Update SPIR-V Headers to 97e96f9e9 and SPIR-V Tools to 3aeaaa088
SPIR-V Headers update:
Changes:
97e96f9e9 SPV_KHR_untyped_pointers final (#536)
de1807b7c Use less confusing name for OpGroupNonUniformBroadcast and OpGroupNonUniformShuffle (#535)
c8ad050fc Add CI reuse check (#525)
7919b00b5 Add MIT license to TOSA extended instruction set grammar (#534)
1de2e410a SPV_QCOM_cooperative_matrix_conversion (#533) (#533)
04b76709b Use original LICENSES/CC-BY-4.0.txt (#524)
9e3836d7d Add SPV_INTEL_function_variants (#532)
2a611a970 Merge pull request #529 from dneto0/tosa-in-spv-headers-bazel
21a60b891 BUILD.bazel: Add the TOSA header to spv_headers
54cec5dc2 Add Bazel definitions for TOSA 001000.1 extended instruction set (#527)
4e209d3d7 Add definitions for TOSA.001000.1 extended instruction set (#526)
e87f5a873 Add text of CC-BY-4.0 to top-level LICENSE file (#523)
50daff941 Add definitions for SPV_ARM_graph (#521)
3b9447dc9 Add missing capability declarations to Float8CooperativeMatrixEXT (#519)
fd9666192 Add definitions for SPV_EXT_float8 (#518)
7168a5ad0 Fix header build (#517)
d6d133089 Add headers for SPV_INTEL_bindless_images (#516)
9a46274d2 Add REUSE (#506)
c9aad99f9 Add definitions for SPV_ARM_tensors (#513)
6d0784e9f Register Goopax SPIV-V generator (#514)
ccf425942 header updates for SPV_INTEL_int4 (#512)
a5b2bd69f Ci legacy asciidoc (#477)
971e66250 Remove asciidoc markup in JSON annotations (#475)
3786ee89d Merge pull request #511 from abrisco/bazel
bab63ff67 Remove reference to EXT_mesh_shader from PerTaskNV decoration (#510)
ffb6c7f93 Add Bazel bzlmod support
aa6cef192 SPV_QCOM_tile_shading (#509)
7c2f5333e Add ImageChannelDataType definitions for cl_ext_image_unsigned_10x6_12x4_14x2 (#507)
95dc1aa44 Add DisplacementMicromapNV to the capabilities enabling OpTypeAccelerationStructureKHR (#508)
8e82b7cfe bump the required CMake version to 3.14 (#505)
8c88e0c4c header updates for SPV_INTEL_ternary_bitwise_function (#504)
72664577f Fix OpFPGARegINTEL grammar (#503)
0e7106779 Fix json capabilities for RayTracingOpacityMicromapEXT (#498)
eceb46dad fixes for SPV_INTEL_arbitrary_precision_floating_point (#495)
0fcd74932 Add grammar entries for SPV_INTEL_task_sequence (#494)
06633cfee Add headers for SPV_INTEL_tensor_float32_conversion extension (#501)
d5ee9ed2b Add SPV_KHR_bfloat16 (#502)
ddd2c099b Update Slang tool entry. (#496)
bf08186d8 ClspvReflection non-sematic: Add WorkgroupVariableSize (#493)
4793aeec2 remove extra arbitrary precision fixed point instructions operands (#491)
54a521dd1 Register tool ID 47 for a new ARM SPIR-V generator. (#486)
6be51b8f7 updates AtomicStorageOps to depend on the AtomicStorage capability (#479)
09913f088 Remove extra space causing rendering issue (#485)
e7294a8eb Add headers for SPV_NV_linear_swept_spheres. (#483)
003bcf4e0 Add headers for SPV_NV_cluster_acceleration_structure. (#484)
43764cc75 updates IntegerFunctions2INTEL to remove Shader capability dependency (#481)
767e901c9 Add SPV_NV_cooperative_vector (#482)
2b2e05e08 grammar and header changes for SPV_INTEL_subgroup_matrix_multiply_accumulate (#471)
0659679d9 Add a source language for Rust (#472)
9ca0e67b5 grammar and header changes for SPV_INTEL_2d_block_io (#470)
a380cd254 Fix OpAsmTargetINTEL operand (#468)
3f17b2af6 [SPIRV] Add generator magic number (#467)
36d5e2dda Add provisional key to grammar (#464)
45b314049 Add NonSemanticShaderDebugInfo100.h to bazel build. (#466)
2ce05a6f7 Remove trailing whitespace (#465)
996c728cf add basic utility code testing for cpp, cpp11, and c (#461)
cb6b2c32d Fix on header generator for c++11, regenerated products (#463)
22c4d1b1e Add SPV_NV_cooperative_matrix2 and SPV_NV_tensor_addressing (#458)
252dc2df0 Add nuvk's spirv emitter. (#454)
50bc4debd VkspReflection non-sematic: remove literals for Ids (#453)
07ddb1c0f Update SPV_AMDX_shader_enqueue (#452)
d92cf88c3 Add "aliases" fields to the grammar and remove duplicated (#447)
a62b03200 Add SPV_EXT_arithmetic_fence (#450)
ec59c77a3 Reserve SPIR-V enums for MediaTek (#451)
0413bc33f Add SPV_EXT_optnone (#449)
2a9b6f951 Add Capability and Execution mode SPV_KHR_compute_shader_derivatives (#446)
efb6b4099 add support for SPV_INTEL_subgroup_buffer_prefetch (#442)
744753a21 Update spirv generator info (#445)
69ab0f32d Add UnormInt2_101010EXT ImageChannelDataType (#444)
1b75a4ae0 Request a vendor id for Kongruent (#443)
f013f08e4 Add missing OpUntypedPrefetchKHR (#441)
a41bc926e VkspReflection non-sematic: add fields to DescriptorSetBuffer (#440)
db5a00f8c Support for SPV_KHR_untyped_pointers (#439)
3c355ec43 Reserve 4 memory operands bits for Arm (#436)
41a8eb27f Update headers with SPIR-V version 1.6, revision 4. (#437)
2acb319af SPV_ARM_cooperative_matrix_layouts (#433)
eb49bb7b1 Add KHR suffix to OpExtInstWithForwardRefsKHR (#435)
fbf240296 Enforce grammar naming conventions for aliases (#432)
ff2afc3af Adds SPV_KHR_relaxed_extended_instruction (#434)
ea77f2a82 SPV_EXT_replicated_composites (#431)
49a1fceb9 Fix SPIR-V reserved ranges (#427)
acfc254a7 Add utility functions to strinfigy value enums (#426)
Commands:
./third_party/update-spirvheaders.sh
SPIR-V Tools update:
Changes:
3aeaaa088 spirv-val: Fix using global static map (#6241)
286c4a66d spirv-val: Fix Mesh Builtin checking for signed int (#6238)
18f08838c Roll external/abseil_cpp/ 840da4a0f..56945519b (3 commits) (#6235)
9b035b701 Roll external/abseil_cpp/ 7ece455c2..55f48665b (2 commits) (#6231)
cef15589a [GH Actions] Run wasm build when kokoro:run is removed. (#6233)
c8fd10183 spirv-val: Fix scalarBlockLayout typo (#6234)
a6e2406b1 Validate that OpDecorateId IDs are well-ordered (#6227)
a983ab19d spirv-val: Fix Mesh Shading not checking EntryPoint (#6228)
ed173ab18 [GH Actions] Trigger when the `kokoro:run` label is removed (#6230)
c0455d40d Extra restrictions for accesses of block arrays (#6226)
73d28b5f3 Roll external/abseil_cpp/ 6ad95e153..7ece455c2 (4 commits) (#6229)
d8c5240c3 build(deps): bump github/codeql-action in the github-actions group (#6225)
17b870490 Roll external/abseil_cpp/ 454205a61..64a9eafe3 (1 commit) (#6224)
04d4deab5 Add support for SPV_INTEL_inline_assembly (#6210)
3abad502d spirv-val: Add Patch Decoration check (#6219)
8cf1bf9bb spirv-val: Check OpTypeCooperativeMatrixKHR for bfloat16/fp8 (#6220)
aaa94856d Initialize output parameter of spvtools::LookupOperand (#6223)
e7d92f71f Roll external/abseil_cpp/ 6cd1763d9..492fccd3b (5 commits) (#6214)
257a227fb Roll external/abseil_cpp/ ea50280ae..6cd1763d9 (6 commits) (#6208)
7806d0a70 spirv-val: Add PrimitiveID check (#6209)
08f1e75fe spir-val: fix OpTensor{Read,Write}ARM for tensors with a spec constant rank (#6206)
54fc95232 Roll external/abseil_cpp/ 2ecc1dd00..ea50280ae (2 commits) (#6207)
edce8bd5e Roll external/googletest/ c67de1173..3983f67e3 (1 commit) (#6205)
cc07e5303 build(deps): bump github/codeql-action in the github-actions group (#6201)
d05052073 Roll external/abseil_cpp/ d4e6b8cdb..d20bae7f9 (2 commits) (#6200)
d6ef579a0 spirv-opt: add support for tensors to type manager (#6202)
e16fcd177 Update README with canonicalize IDs pass (#6204)
44c93ad92 spirv-val: accept NonReadable/NonWritable on tensor variables in UniformConstant (#6184)
bc7c60e96 Fix the wrong location of DebugFunctionDefinition inst (#6198)
f657d2c15 build(deps): bump github/codeql-action in the github-actions group (#6199)
a478b3842 roll deps (#6197)
40eb301f3 spirv-opt: Fix crash if shader uses linkage decoration (#6191)
604c3e75a spirv-as: fix docs: need '-' arg to specify stdin (#6194)
28a883ba4 SPV_INTEL_function_variants: basic asm, dis support (#6195)
37da76351 Update github bots to windows-2025 (#6196)
7fbd5fbb1 Roll external/abseil_cpp/ 212fcb96c..aed3ddd94 (6 commits) (#6190)
33e025681 Prepare release v2025.3 (#6192)
a364c41a7 We want to use extension `SPV_KHR_variable_pointers` with vulkan memory (#6121)
108b19e5c Add --canonicalize-ids pass (#6174)
85607567a Keep instructions used by the DebugBuildIdentifier (#6189)
c837be3e4 opt: Pass DebugDeclare scope to DebugValue (#6178)
7ddec72ea build(deps): bump lukka/get-cmake in the github-actions group (#6182)
c2977ef0a roll deps (#6181)
422150b40 Add mimalloc to improve multithreaded performance (#6188)
da0ec29bb Revert array location validation (#6187)
3f76afcf9 Add minimal as/dis support for TOSA.001000.1 extended instruction set (#6183)
dab29fb16 spirv-val: tidy up validation of type constraints for IDs (#6185)
dec28643e Add validation support for MeshEXT based on the spec update PR https://github.com/KhronosGroup/Vulkan-Docs/pull/2475 (#6171)
e0bad2825 Roll external/abseil_cpp/ daff1b1a9..9c02e2cbe (1 commit) (#6173)
15f61f8ad build(deps): bump github/codeql-action in the github-actions group (#6180)
27dd301f8 spirv-val: Label maintenance9 new VUID (#6176)
e9a8ceedd spirv-val: add positive test for FP8 cooperative matrices (#6175)
90cfb3e96 spirv-val: Give hints when user is forgetting feature bit (#6164)
ec1c9ca71 build(deps): bump github/codeql-action in the github-actions group (#6169)
0d6c8d6f4 Add SPV_NV_linear_swept_spheres to allow list. (#6168)
501960632 Roll external/abseil_cpp/ e1ff6a333..169c953aa (1 commit) (#6165)
6061b7204 Add initial support for SPV_EXT_float8 (#6170)
7dda3c01f Keep DebugBuildIdentifier during dce (#6166)
2e743e96b Improve automatic formatting of SPV extensions allowlists (#6167)
9de1dbb0a --Modfied files so that OpTypeTaskSequenceINTEL is identified as a type instruction (#6084)
9d2218773 build(deps): bump ossf/scorecard-action in the github-actions group (#6162)
c38571fee Add SPV_NV_cluster_acceleration_structure to allow lists (#6163)
5b87767c6 [OPT] prevent private_to_local_pass optimizing double pointer (#6161)
f6e5a5a8f spirv-dis: Set a hard limit on last_instruction_comment_alignment_ (#6149)
066f726eb roll deps (#6160)
0498065e0 [OPT] Use conservative default case for `GetPtr` (#6158)
c3c5427ec [OPT] Set the BB for the debug instruction when moved. (#6153)
a9d7fde99 Roll external/abseil_cpp/ 3006ff8b4..2dd803689 (4 commits) (#6159)
8b2535346 build(deps): bump github/codeql-action in the github-actions group (#6147)
045c1b251 roll deps (#6150)
da48bb20b val: Fix CullPrimitiveEXT array of bool (#6155)
01021466b [spirv-val] Add the validation checks for SPV_QCOM_tile_shading (#6130)
736e415eb Fix operand access in invalid layout checks (#6151)
66fe61094 roll deps (#6146)
9b1a7e7a6 grammar tables: emit good error when missing an operand type (#6145)
eac930caa Add support for SPV_ARM_tensors (#6134)
11df9e83a build(deps): bump the github-actions group across 1 directory with 2 updates (#6133)
0cf1a2bfe roll deps (#6143)
75f2e873a [opt] Move debug instruction when neccessary in copy prop arrays. (#6142)
6039eeff1 [OPT] Remove recursion from redundancy_elimination (#6141)
feba06f44 ggt.py: no need to precondition extension lists (#6139)
9d0f81794 Delete utils/generate_grammar_tables.py (#6138)
058b4b3c7 roll deps (#6129)
2956d8e7e Fix exit in ggt.py (#6137)
f06e0f3d2 Avoid double-lookup for name searches in tables (#6136)
e8864edbe Use compressed tables for extended instructions (#6135)
8ede14d21 use static std::array for grammar tables again (#6132)
54f2f3dc0 Fix gn (#6131)
cc1e6c546 [ROLL] Roll deps (#6127)
9693056da no static initializers (#6128)
f1524d1a2 Roll external/googletest/ cd430b47a..90a415211 (5 commits) (#6114)
eb82f2cad Move enum mappings to compressed tables (#6120)
d50426893 build: Fix BUILD.gn missing headers (#6125)
f026033b6 opt: add SPV_NV_shader_invocation_reorder to allowlist (#6122)
6db659dae Add instruction printingClass value to InstructionDesc (#6118)
c0fa1efc8 python: Use type annotations compatible with python 3.8 (#6119)
3935361d2 Fixes for Dawn gn build. (#6117)
62de1f740 Use compressed grammar tables for core instructions and operands (#6107)
887a1d678 [Kokoro] Add dxc-smoketest (#6113)
f050bb781 spirv-val: allow Float16 in OpenCL environments (#6110)
cb619916b [Kokoro] Use merge-base for format check. (#6112)
20d503166 build(deps): bump github/codeql-action in the github-actions group (#6102)
d101daf8a Replace spirv.hpp with spirv.hpp11 in objdump (#6108)
04ade331e Roll external/abseil_cpp/ 8b2b78bb9..87e8b54fa (4 commits) (#6101)
634a44abf Simplify ext inst table generation (#6095)
2fe7d3dd6 Add spvtools::utils::IndexRange (#6106)
d75157435 fix clang-20 build issue (#6103)
783d70336 Add spvtools::utils::Span (#6105)
8e9165a3d spirv-val: Update 1.4.312 VUID churn (#6082)
b6a83226d Allow copyright line without '(c)' (#6099)
a62abcb40 [OPT] Don't fold n % 1.0 (#6100)
506fee4df generate_grammar_tables.py: remove unused option to emit C enums (#6094)
898ed77be Prepare for 2025.2 release. (#6098)
0aa67e2af Roll external/abseil_cpp/ 8b81b77c5..daa0bfb56 (4 commits) (#6091)
ca63ea568 Fix validation of BFloat16 FP types (#6092)
096bb07f7 Initialize variables (#6093)
255086985 build(deps): bump lukka/get-cmake in the github-actions group (#6089)
7e41c7130 Add Vulkan 1.3 and 1.4 capability checks (#6063)
f53aac84f Roll external/abseil_cpp/ c8d5854f0..12f4be680 (7 commits) (#6086)
3f7cbaf32 format check: Show the list of files to be checked (#6088)
a871fc43e Minimal opt support for SPV_KHR_untyped_pointers (#6087)
2e7ba023c Add SPV_KHR_bfloat16 support (#6057)
e94023922 build(deps): bump the github-actions group across 1 directory with 2 updates (#6083)
fb6206f9a roll deps (#6076)
1a811fd69 spirv-val: Restrict VUID 09557 to Vulkan environments (#6080)
73d6a038e spirv-val: Label new VUID from 312 headers (#6079)
4bd1536ed [OPT] In copy propagate arrays, debug instructions are not stores. (#6078)
6add4e478 Add support for pointer types in vector when using extension SPV_INTEL_masked_gather_scatter (#6041)
056e3ed2c [OPT] Add extension to allow list (#6075)
2e83ad7e6 Roll external/abseil_cpp/ b12a6f75f..bcf4bf315 (3 commits) (#6072)
8a6aaa696 roll deps (#6069)
393d5c7df [OPT] fix loop with recursive types in trim pass (#6070)
a48b47340 opt: Add QuadControlKHR to trim pass and allow lists (#6068)
a4adb9a8a [OPT] Delete decoration for OpPhi when unrolling (#6064)
4b5584e28 Roll external/abseil_cpp/ 3b1bb7337..fd39cfa46 (1 commit) (#6065)
91c4380f7 build(deps): bump github/codeql-action in the github-actions group (#6066)
6a6693d1c Validate version requirement for Vulkan Memory Model (#6042)
a958887ba roll deps (#6060)
d5ca80037 build(deps): bump the github-actions group with 3 updates (#6056)
ada1771a9 Fix calculation of locations for matrices (#6062)
db06346b0 opt: value numbering: preserve loads of image, sampler, sampled image (#6059)
ef1004ec5 format check should say what version of clang-format is used (#6058)
553300374 Fix implicit conversion warning: int32_t to uint32_t (#6052)
e58e469f0 roll deps (#6055)
0c1ca5815 Validation for relaxed control barrier with storage class semantics (#5984)
51aeff761 roll deps (#6049)
a6cb96028 Check that layouts match runtime array requirement (#6048)
2b3df1ec7 split-combined-image-samplers: clone decorations on loads (#6046)
ff4d89082 opt: add resolve-binding-conflicts pass (#6044)
36a3ef46e test fixture: print optimized assembly that fails to validate (#6043)
940c6faa1 split-combined-image-sampler: synthesize names (#6037)
6c757dd9e build(deps): bump github/codeql-action in the github-actions group (#6033)
b45be9b0a Roll external/abseil_cpp/ 35211d98d..bdbaf376e (3 commits) (#6031)
ba1359d20 Update location/component conflict validation (#5993)
48c703b81 opt: add pass to split combined image samplers (#6035)
5986ec106 github workflow bazel: print error logs (#6036)
9f8ff357d spirv-diff: Try to pair functions by their complete type. (#6021)
9e470ef0f Fix explicit layout validation on ptr type (#6029)
ba828b232 Fold 0 <<,>>,/,% n to 0. Fold a / 1 to a. Fold a % 1 to 0. Fold f % 1.0 to 0.0. Fold 0.0 % f to 0.0 (#6020)
bac6ca756 Support optimization of OpCopyLogical (#6016)
7e3efaf1b Support scalar replacement of large structs (#6019)
d3fc6ed18 spirv-val: Validate PhysicalStorageBuffer Stage Interface (#6000)
f6b40e7f1 spirv-val: Add Vulkan Aligned PowerOfTwo check (#6027)
fb803311a folding_rules: generalise RedundantIAdd() to |^>><<+- with 0 on RHS and |^+ with 0 on LHS (#6013)
62a930f4a roll deps (#6030)
bb86786ed Roll external/abseil_cpp/ f1b7d000b..735c86164 (3 commits) (#6025)
6484ea2a0 spirv-as: Add OpUnknown pseudo-instruction (#6024)
b63895481 [opt] Add StorageBuffer16BitAccess to trim pass. (#6026)
a946dba85 roll deps (#6022)
12abd77a6 Fix invalid layout validation version check (#6023)
b1140ad29 Roll external/abseil_cpp/ f004e6c0a..cc70e832b (1 commit) (#5999)
4517f75c6 build(deps): bump actions/cache in the github-actions group (#6018)
d3bfa4b9b build(deps): bump lukka/get-cmake in the github-actions group (#6015)
b095f36a5 Add validation for invalid layout decoration usage (#6012)
f289d047f [OPT] Update DebugDeclare if the var is not an OpVariable (#6014)
132103f44 Prepare release v2025.1 (#6011)
d5b6f2de7 build(deps): bump the github-actions group across 1 directory with 4 updates (#6010)
00170308e kokoro: linux: use cpp-builder instead of radial-build (#6008)
aafd52457 [opt] Fix bug opt::InstructionBuilder::AddVariable (#6007)
f2dac2f3d spirv-val: Add AllowVulkan32BitBitwise option (#6001)
a80d3b5c5 Fix untyped pointer comparison validation (#6004)
2e55f9c69 kokoro: Streamline check-format (#5973)
9fa14b914 roll deps (#5997)
dc1641d16 build(deps): bump github/codeql-action in the github-actions group (#5994)
cd177fa74 roll deps (#5996)
66e57d114 roll deps (#5992)
f95b07a5a diff: Fix crash in OpString matching (#5988)
114920c25 Add missing include headers (#5995)
b3fe11f89 spirv-val: Update VUIDs for 308 header (#5990)
9d7e182da linker: remove LinkOnceODR decorations when linking executables (#5979)
32af271ac roll deps (#5987)
682bcd515 spirv-val: fix env parsing for vk1.1spv1.4 (#5985)
f52c9a1e4 Roll external/abseil_cpp/ 7253ff8f9..69b58f922 (4 commits) (#5983)
9d07794bc build(deps): bump the github-actions group across 1 directory with 2 updates (#5976)
d59325f37 Roll external/abseil_cpp/ fd8b35b9a..5f8d605c0 (1 commit) (#5957)
ce37fd67f Add validation for SPV_NV_linear_swept_spheres. (#5975)
7cf95f1d5 Add validation SPV_NV_cluster_acceleration_structure. (#5974)
04b4a204a Improve the instruction diagnostic for some access chain errors (#5978)
96b46d160 Update physical storage buffer validation to match SPIR-V 1.6.5 (#5977)
3364b9827 Validate SPV_NV_cooperative_vector (#5972)
2e8113719 Fix layout checks with untyped pointers (#5970)
d99e54e37 kokoro: use ndk-r27c (#5969)
bdf077623 kokoro: use clang 13.0.1 on Linux (#5962)
a9f826b65 kokoro: use gcc 13 instead of gcc 9 (#5961)
173fe3c60 spirv-val: Update mislabeled VUIDs (#5964)
e02275ec0 More explicit layout validation (#5958)
4aa537a5c Roll external/abseil_cpp/ a28c4b582..fd8b35b9a (6 commits) (#5955)
01676d8d8 build(deps): bump github/codeql-action in the github-actions group (#5956)
066c3d52c spirv-val: Add VK_KHR_maintenance8 support (#5951)
4be5222ac Roll external/abseil_cpp/ a4e771912..a28c4b582 (7 commits) (#5952)
b9d5ced92 Add SPV_AMDX_shader_enqueue version 2 support (#5838)
c62409034 roll deps (#5949)
321692686 dd missing Vulkan 1.4 in validator help, env testing (#5946)
f942f65e8 add support for SPV_INTEL_subgroup_matrix_multiply_accumulate (#5928)
a6107edd2 Add missing include headers (#5944)
981c462c1 roll deps (#5943)
7ef6bc3ce [OPT] Add SPV_KHR_ray_tracing to allow list (#5941)
173217281 fix: handle LinkOnceODR correctly (#5938)
8b8f8fe95 Roll external/abseil_cpp/ 6effb000c..a1de53ddd (4 commits) (#5942)
fdea64191 Add EXT_mesh_shader validation support (#5640)
6ea395b0e spirv-val: Remove OpenCL ivec3 req (#5940)
b8566d459 Roll external/abseil_cpp/ 3f770c4d9..6effb000c (6 commits) (#5937)
995922d48 build(deps): bump the github-actions group with 2 updates (#5936)
9064fe863 Roll external/abseil_cpp/ f489ceb63..3f770c4d9 (4 commits) (#5935)
31c154a2a kokoro: remove VS 2019 debug (#5934)
a29530db2 Update download links to VS 2022 (#5933)
bc158d936 build(deps): bump the github-actions group across 1 directory with 4 updates (#5932)
e15ac6102 kokoro: Add VS 2022 scripts, remove VS 2017 scripts (#5930)
880612646 Roll external/abseil_cpp/ 4e0956109..65b7da13b (2 commits) (#5929)
e6307f473 Update downloads badges and matrix (#5931)
8b39a8b54 Update effcee (#5927)
4b4e4b993 lsp: Make vim support more explicit, add code completions (#5917)
8fc0830d9 Roll external/abseil_cpp/ 688dd51cc..4e0956109 (11 commits) (#5926)
8f98634c4 spirv-val: Validate zero product workgroup size (#5407)
1a0658f55 Roll external/abseil_cpp/ c7cf999bd..67576965a (3 commits) (#5900)
becf97fdc update cmake_minimum_required to 3.22.1 (#5925)
9295a8b94 Add OpImageSampleFootprintNV to IsAllowedSampledImageOperand (#5914)
a466e9d68 kokoro: windows: use Python 3.12 (#5920)
1a84052a5 opt: keep all OpSource instructions (#5901)
a4084887e build: Add missing include headers (#5915)
7cac4f355 kokoro: Use cmake-3.31.2 on linux and windows (#5918)
13b59bf1d Relax DebugLine validation (#5916)
1229f1ef3 assembler: ensure progress when seeking the version string (#5910)
4d2f0b40b Prepare release (#5905)
3fb52548b Vulkan 1.4 support (#5899)
7d5bc3519 build(deps): bump github/codeql-action in the github-actions group (#5891)
eebdb1575 Roll external/abseil_cpp/ 917bfee46..b67caffec (3 commits) (#5889)
7c58952fa Update path-to-regexp to address CVE-2024-45296 (#5895)
a9d884e58 spirv-as: Assume target from spvasm text (#5893)
f3c4a5053 spirv-val: Add missing NonSemantic.Shader.DebugInfo.100 (#5846)
ea1d8cd98 Roll external/abseil_cpp/ 8f739d18b..917bfee46 (2 commits) (#5887)
16fa89f06 build(deps): bump the github-actions group across 1 directory with 2 updates (#5885)
27433b11e roll deps (#5883)
35e5f1160 spirv-val: Accept valid OpSizeOf instructions (#5879)
692529b94 [NFC] Apply small clang-tidy fixes (#5709)
707da36c7 Correct a spelling error 'diagnostic' (#5878)
df94b2db4 Avoid maintaining a list of all operating systems by hand. (#5881)
1601ec263 ci: Make MacOS builds only run if other things pass (#5872)
671e7ca5e Roll external/abseil_cpp/ a3027054a..27a0c7308 (7 commits) (#5875)
384d527eb spirv-val: Report VUID 08973 only in Vulkan environments (#5873)
9117e042b roll deps (#5871)
02433568a tools: Accept hex representation as binary input (#5870)
d426fc53b build(deps): bump the github-actions group across 1 directory with 3 updates (#5866)
9aaa26014 roll deps (#5850)
e5c1498af Update proto JSON options call. (#5867)
5f1e86cb5 tools: Move io utils to cpp (#5869)
ce9263039 Add validation for SPV_NV_tensor_addressing and SPV_NV_cooperative_matrix2 (#5865)
298055b25 opt: add StorageImageWriteWithoutFormat to trimm pass (#5860)
895bb9ffe opt: add KHR_fragment_shading_rate to allowlist (#5859)
ba37b3b51 opt: Remove InstDebugPrintfPass (#5856)
14388d701 ci: Update MacOS to latest OS (#5855)
a832c1333 Fix switch case construct validation (#5852)
2ea729062 opt: Fix array copy propagation of access chain pointers (#5853)
5b98dea6f build(deps): bump the github-actions group across 1 directory with 5 updates (#5847)
68265e160 Roll external/abseil_cpp/ 03b8d6ea3..8634e35f1 (1 commit) (#5844)
42b315c15 Fix result type check in ValidateImageTexelPointer (#5848)
fcf994a61 Handle aliases field in the grammar (#5799)
4310fd4ed build(deps): bump the github-actions group across 1 directory with 3 updates (#5841)
ada92f849 roll deps (#5833)
522dfead3 opt: Add support for OpExtInst to capability trim pass (#5836)
c173df736 build(deps): bump github/codeql-action in the github-actions group (#5831)
4554c6b7e Roll external/abseil_cpp/ 482ca0b9d..c6b27359c (1 commit) (#5829)
48f9f4a99 opt: Update copy prop arrays to handle InterpolateAt* instructions (#5827)
d9c1aee6a Roll external/abseil_cpp/ ba5fd0979..482ca0b9d (1 commit) (#5828)
b1ad37b17 opt: Mark InterpolateAt* argument as live for DCE (#5824)
5b38abc87 Do not distrubute OpSNegate into OpUDiv (#5823)
5c8442f7f build(deps-dev): bump rollup from 3.23.0 to 3.29.5 in /tools/sva (#5826)
c0e6399df build(deps): bump the github-actions group across 1 directory with 2 updates (#5825)
3656c4bd1 Roll external/abseil_cpp/ c0b9bd08e..ba5fd0979 (2 commits) (#5818)
44936c4a9 Add support for SPV_KHR_compute_shader_derivative (#5817)
362ce7c60 Allow more levels of arrays with component decoration (#5820)
24849751c build(deps): bump github/codeql-action in the github-actions group (#5813)
c405baf8c Roll external/abseil_cpp/ 0df567400..c0b9bd08e (3 commits) (#5812)
7ba72f14f spirv-val: Disallow stores according to VUID 06924 (#5368)
01c8438ee [SPV_KHR_untyped_pointers] Fix verification for OpenCL.std instructions (#5810)
6dcc7e350 Prepare release v2024.4 (#5811)
04bdb6c7c roll deps (#5809)
20788a4c5 add support for SPV_INTEL_global_variable_host_access (#5786)
04ad1e1ce build(deps): bump github/codeql-action in the github-actions group (#5808)
d85446fd7 [OPT] Fix generating debugLocalVariable from debugGlobalVariable (#5803)
a2c9c2387 Roll external/abseil_cpp/ 1d4466e8d..f7c22f52a (3 commits) (#5806)
4c2094ee9 Made libspirv include relative to allow better portability (#5807)
4451f6ab1 Implement to_string(uint32_t) without using the locale (#5805)
7c9210cc1 Roll external/abseil_cpp/ 67d126083..1d4466e8d (2 commits) (#5801)
37d2fcb48 spirv-opt: fix crash in function declarations (#5796)
380275eac Do not check structurally unreachable continue target predecessors (#5800)
d160e170d Roll external/abseil_cpp/ f7f316824..67d126083 (3 commits) (#5787)
6209efd77 Update SPIRV-Headers (#5793)
05be5b246 Fix build.gn build. (#5791)
e9915cea8 Update sampled image validation (#5789)
07f49ce65 spirv-opt: make traversal deterministic (#5790)
f914d9c8a [SPV_KHR_untyped_pointers] Fix verification of vload/vstore OpenCL.std instructions (#5788)
b31baff4e [opt] Add struct-packing pass and unit test. (#5778)
2a67ced43 Roll external/abseil_cpp/ e64dd622d..f7f316824 (2 commits) (#5782)
bc4060ed2 update_build_version.py: support an envvar to force the description (#5758)
61d6952e2 Revert "OpSampledImage extra validation (#5695)" (#5785)
e1782d667 Roll external/abseil_cpp/ fd7713cb9..fd58e18f2 (2 commits) (#5773)
88c25a71d build(deps): bump the github-actions group across 1 directory with 3 updates (#5780)
b21dda0ee Validate presence of Stride operand to OpCooperativeMatrix{Load,Store}KHR (#5777)
edc68950b build(deps): bump github/codeql-action in the github-actions group (#5772)
a85a703e3 roll deps (#5771)
25b4e42ea roll deps (#5754)
0c40b591a [OPT] Add SPV_KHR_ray_tracing_position_fetch to allow lists (#5757)
e8c2fbca1 Remove local attribute from build_version_inc genrule (#5766)
988995c3b build(deps): bump github/codeql-action (#5769)
87fcbaf1b build(deps): bump the github-actions group across 1 directory with 4 updates (#5761)
b64a423b4 Workaround issue in MSVC arm64 compiler returning random upper 32-bits in function spvtools::util::CountSetBits. (#5763)
72c291332 Add OpTypeRuntimeArray to composite types (#5765)
bc2478c92 Use "docker compose" in wasm build (#5764)
246daf246 [OPT] Avoid assert in generatecopy (#5756)
363486479 roll deps (#5748)
e7216170d build(deps): bump braces from 3.0.2 to 3.0.3 in /tools/sva (#5737)
8731673a5 Allow ArrayStride on untyped pointers (#5746)
ffb8d85ea Roll external/googletest/ 9ff2450a5..cee1ba1f2 (1 commit) (#5743)
81a116002 [opt] Fix uses of type manager in fix storage class (#5740)
e99a5c033 spirv-link: allow linking functions with different pointer arguments (#5534)
ca373497f [opt] Fix pointer stores in DCE (#5739)
a0817526b properly handle the load and store cache control operand types (#5664)
d1b35bb17 build(deps): bump the github-actions group with 2 updates (#5744)
626dfbff4 Roll external/abseil_cpp/ eb8522077..3cb498899 (4 commits) (#5741)
2ea400363 opt: split composite from array flattening (#5733)
4c7e1fa5c Roll external/abseil_cpp/ 074a32af6..af4c589ed (1 commit) (#5731)
3ab0d2260 Support SPV_KHR_untyped_pointers (#5736)
6248fda37 Handle coop matrix in fix storage class (#5729)
7c778973e Allow fmt arg to printf to be an array of i8 in non-constant space (#5677)
257cacfb3 build(deps): bump the github-actions group across 1 directory with 4 updates (#5734)
6a5fa5f70 Fix SPRIV -> SPIRV typos (#5735)
9f2ccaef5 kokoro: use Python 3.12 in Linux builds (#5730)
beabd8b7f Roll external/abseil_cpp/ 1278ee9bd..0d9c2fc76 (2 commits) (#5724)
216574bed Allow for empty list of enums for an operand (#5727)
3bc9744d0 Add FPEncoding operand type. (#5726)
973e791a9 Roll external/abseil_cpp/ 16452e141..a7c5f985f (5 commits) (#5722)
c91d9ec15 Roll external/abseil_cpp/ 1315c900e..b4e4b6259 (1 commit) (#5716)
ca004da9f Add knowledge of cooperative matrices (#5720)
64d37e281 [NFC] Fix potential buffer overflow (#5715)
b9d811469 Add re2 dep back to Bazel build (#5721)
0cfe9e721 Prepare release v2024.3 (#5719)
581279ded [OPT] Zero-extend unsigned 16-bit integers when bitcasting (#5714)
80a1aed21 Use bzlmod for effcee (#5707)
7bf2d0275 roll deps (#5685)
6c8b460eb misc: remove encoding parameter (#5710)
7564e142d spirv-dis: Add --nested-indent and --reorder-blocks (#5671)
bc28ac7c1 opt: add OpExtInst forward ref fixup pass (#5708)
65d30c315 opt: fix Subgroup* trimming (#5706)
c3178da8e spirv-dis: add decorations to comments (#5675)
ce46482db Add KHR suffix to OpExtInstWithForwardRef opcode. (#5704)
7b5691084 update tests for disassembly changes (#5694)
e1c0ad23f build(deps): bump the github-actions group across 1 directory with 2 updates (#5702)
9db5b5ec1 Add assert header to val/decoration.h (#5703)
6a2bdeee7 spirv-val, core: add support for OpExtInstWithForwardRefs (#5698)
4a2e0c9b3 Fix comments in liveness.h (#5699)
70ad4dae7 OpSampledImage extra validation (#5695)
fd96922e9 Remove calls to GetId in liveness analysis (#5693)
95681dc42 Remove implicit call to GetId in ConvertToSampledImagePass. (#5692)
148c97f68 Avoid use of type manager in extact->construct folding (#5684)
142bf7de8 spirv-val: Fix indentation of --version output (#5686)
7e1a8cdc5 Basic support for SPV_EXT_replicated_composites (#5690)
3d2408929 spirv-val: Add Duplicate EntryPoint Builtin check (#5678)
77c40bece Roll deps
336b5710a Do not fold mul and adds to generate fmas (#5682)
ee749f505 Add abseil to the autoroller (#5680)
e2646f5e9 spirv-val: Consider target env for OpReadClockKHR scope (#5681)
e4b1a48aa Use raw string to avoid unintended escapes in regex (#5676)
14fe558c0 --- (#5679)
ccf3e3c10 Improve matrix layout validation (#5662)
199038f10 spirv-val: Validate MemoryAccessMask of OpCooperativeMatrixStoreKHR (#5668)
9241a58a8 opt: Remove bindless and buff addr instrumentation passes (#5657)
bfc3a1568 build(deps): bump the github-actions group across 1 directory with 3 updates (#5656)
57a42e6c1 spirv-val: Separate Location check for tess patch (#5654)
Commands:
./third_party/update-spirvtools.sh
Bug: b/123642959
git-subtree-dir: third_party/SPIRV-Headers
git-subtree-split: 97e96f9e9defeb4bba3cfbd034dec516671dd7a3
Change-Id: I8b91f5f47966f93507bb032d8e0b36ca31553557
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/76128
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Shahbaz Youssefi <syoussefi@google.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@google.com>
diff --git a/src/Pipeline/CMakeLists.txt b/src/Pipeline/CMakeLists.txt
index 374d424..fd2e9e3 100644
--- a/src/Pipeline/CMakeLists.txt
+++ b/src/Pipeline/CMakeLists.txt
@@ -72,7 +72,6 @@
endif()
set_target_properties(core_tables PROPERTIES FOLDER "SPIRV-Tools build")
-set_target_properties(enum_string_mapping PROPERTIES FOLDER "SPIRV-Tools build")
set_target_properties(extinst_tables PROPERTIES FOLDER "SPIRV-Tools build")
set_target_properties(vk_pipeline PROPERTIES
diff --git a/third_party/SPIRV-Headers/.github/workflows/presubmit.yml b/third_party/SPIRV-Headers/.github/workflows/presubmit.yml
index d7958ca..841e251 100644
--- a/third_party/SPIRV-Headers/.github/workflows/presubmit.yml
+++ b/third_party/SPIRV-Headers/.github/workflows/presubmit.yml
@@ -38,6 +38,16 @@
./bin/makeHeaders
- name: Check generated headers
run: git diff --exit-code
+ - name: Check for legacy asciidoc in JSON
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ grep \"\'".*"\'\" include/spirv/unified1/*.json >build/bad-asciidoc.txt || true
+ if [ 0 -lt $(cat build/bad-asciidoc.txt | wc -l) ]; then
+ echo "Legacy asciidoc italics detected, like \"'foo'\". Text formating aren't used anymore. Please use \"foo\" instead."
+ head -10 build/bad-asciidoc.txt
+ exit 1
+ fi
+
test_cmake_min_required:
runs-on: ubuntu-latest
@@ -121,3 +131,16 @@
run: |
cmake -S tests/pkg_config -B tests/pkg_config/build/ -D CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/build/install
cmake --build tests/pkg_config/build/
+
+ license-check:
+ name: Verify repository license compliance
+ runs-on: ubuntu-latest
+ # We now refer to the container by its SHA instead of the name, to prevent
+ # caching problems when updating the image.
+ # container: khronosgroup/docker-images:asciidoctor-spec.20240726
+ container: khronosgroup/docker-images@sha256:724f67d8562445523644abf017d5d192b369fafc122de75e9d26792c649821a0
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: REUSE license checker
+ run: reuse lint
\ No newline at end of file
diff --git a/third_party/SPIRV-Headers/.gitignore b/third_party/SPIRV-Headers/.gitignore
index f33592c..f2f2b8c 100644
--- a/third_party/SPIRV-Headers/.gitignore
+++ b/third_party/SPIRV-Headers/.gitignore
@@ -1,3 +1,5 @@
build
out
.DS_Store
+bazel-*
+MODULE.bazel.lock
diff --git a/third_party/SPIRV-Headers/BUILD.bazel b/third_party/SPIRV-Headers/BUILD.bazel
index 25634d9..13ca699 100644
--- a/third_party/SPIRV-Headers/BUILD.bazel
+++ b/third_party/SPIRV-Headers/BUILD.bazel
@@ -1,3 +1,5 @@
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
+
package(
default_visibility = ["//visibility:public"],
)
@@ -121,6 +123,11 @@
srcs = ["include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json"],
)
+filegroup(
+ name = "spirv_ext_inst_tosa_001000_1",
+ srcs = ["include/spirv/unified1/extinst.tosa.001000.1.grammar.json"],
+)
+
cc_library(
name = "spirv_common_headers",
hdrs = [
@@ -133,8 +140,10 @@
"include/spirv/unified1/GLSL.std.450.h",
"include/spirv/unified1/NonSemanticClspvReflection.h",
"include/spirv/unified1/NonSemanticDebugPrintf.h",
+ "include/spirv/unified1/NonSemanticShaderDebugInfo100.h",
"include/spirv/unified1/NonSemanticVkspReflection.h",
"include/spirv/unified1/OpenCL.std.h",
+ "include/spirv/unified1/TOSA.001000.1.h",
],
includes = ["include"],
)
@@ -174,4 +183,3 @@
includes = ["include"],
deps = [":spirv_common_headers"],
)
-
diff --git a/third_party/SPIRV-Headers/BUILD.gn b/third_party/SPIRV-Headers/BUILD.gn
index 34294e0..64abfcd 100644
--- a/third_party/SPIRV-Headers/BUILD.gn
+++ b/third_party/SPIRV-Headers/BUILD.gn
@@ -1,26 +1,10 @@
-# Copyright (c) 2020-2024 Google LLC
+# SPDX-FileCopyrightText: 2020-2024 Google LLC
+# SPDX-License-Identifier: MIT
#
-# 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.
+# 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/
config("spv_headers_public_config") {
include_dirs = [ "include" ]
diff --git a/third_party/SPIRV-Headers/CMakeLists.txt b/third_party/SPIRV-Headers/CMakeLists.txt
index b018b23..c7711c7 100644
--- a/third_party/SPIRV-Headers/CMakeLists.txt
+++ b/third_party/SPIRV-Headers/CMakeLists.txt
@@ -1,30 +1,13 @@
-# Copyright (c) 2015-2024 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.
-#
+# SPDX-FileCopyrightText: 2015-2024 The Khronos Group Inc.
+# SPDX-License-Identifier: MIT
+#
# 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.
+
cmake_minimum_required(VERSION 3.14)
-project(SPIRV-Headers LANGUAGES CXX VERSION 1.5.5)
+project(SPIRV-Headers LANGUAGES C CXX VERSION 1.5.5)
if (CMAKE_VERSION VERSION_LESS "3.21")
# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html
diff --git a/third_party/SPIRV-Headers/LICENSE b/third_party/SPIRV-Headers/LICENSE
index a02ace1..a63e9c6 100644
--- a/third_party/SPIRV-Headers/LICENSE
+++ b/third_party/SPIRV-Headers/LICENSE
@@ -101,3 +101,402 @@
========================================================================
---
+
+Files: **.md, WORKSPACE, .git**
+
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the “Licensor.” The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
+
diff --git a/third_party/SPIRV-Headers/LICENSES/CC-BY-4.0.txt b/third_party/SPIRV-Headers/LICENSES/CC-BY-4.0.txt
new file mode 100644
index 0000000..13ca539
--- /dev/null
+++ b/third_party/SPIRV-Headers/LICENSES/CC-BY-4.0.txt
@@ -0,0 +1,156 @@
+Creative Commons Attribution 4.0 International
+
+ Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
+
+Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
+
+Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
+
+Section 1 – Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
+
+ d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
+
+ g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
+
+ i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
+
+Section 2 – Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+
+ A. reproduce and Share the Licensed Material, in whole or in part; and
+
+ B. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section 6(a).
+
+ 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
+
+ B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
+
+b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this Public License.
+
+ 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
+
+Section 3 – License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified form), You must:
+
+ A. retain the following if it is supplied by the Licensor with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
+
+ B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
+
+ C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
+
+ 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
+
+Section 4 – Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
+For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+
+Section 5 – Disclaimer of Warranties and Limitation of Liability.
+
+ a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
+
+ b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
+
+ c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
+
+Section 6 – Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
+
+ d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
+
+ e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
+
+Section 7 – Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
+
+Section 8 – Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
+
+ c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
+
+Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/third_party/SPIRV-Headers/LICENSES/MIT.txt b/third_party/SPIRV-Headers/LICENSES/MIT.txt
new file mode 100644
index 0000000..fc2cf8e
--- /dev/null
+++ b/third_party/SPIRV-Headers/LICENSES/MIT.txt
@@ -0,0 +1,18 @@
+MIT License
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is 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 Software.
+
+THE SOFTWARE IS 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 SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/third_party/SPIRV-Headers/MODULE.bazel b/third_party/SPIRV-Headers/MODULE.bazel
new file mode 100644
index 0000000..385a902
--- /dev/null
+++ b/third_party/SPIRV-Headers/MODULE.bazel
@@ -0,0 +1,10 @@
+# SPDX-FileCopyrightText: The Khronos Group, Inc.
+# SPDX-License-Identifier: MIT
+"""SPIRV-Headers"""
+
+module(
+ name = "spirv_headers",
+ version = "0.0.0",
+)
+
+bazel_dep(name = "rules_cc", version = "0.1.1")
diff --git a/third_party/SPIRV-Headers/REUSE.toml b/third_party/SPIRV-Headers/REUSE.toml
new file mode 100644
index 0000000..8392272
--- /dev/null
+++ b/third_party/SPIRV-Headers/REUSE.toml
@@ -0,0 +1,49 @@
+version = 1
+SPDX-PackageName = "SPIRV-Headers"
+SPDX-PackageSupplier = "The Khronos Group, Inc."
+SPDX-PackageDownloadLocation = "https://github.com/KhronosGroup/SPIRV-Headers"
+
+[[annotations]]
+path = ["**.md", "WORKSPACE", ".git**"]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "The Khronos Group, Inc."
+SPDX-License-Identifier = "CC-BY-4.0"
+
+[[annotations]]
+path = ["include/**/*.json" ]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "The Khronos Group, Inc."
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = ["include/spirv/1.0/spir*", "include/spirv/1.1/spir*", "include/spirv/1.2/spir*"]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "2014-2018 The Khronos Group, Inc."
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = ["include/spirv/unified1/spir*", "include/spirv/unified1/spv.d"]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "2014-2024 The Khronos Group, Inc."
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = [
+ "BUILD.bazel",
+ "MODULE.bazel",
+ "cmake/SPIRV-Headers.pc.in",
+ "tools/buildHeaders/CMakeLists.txt",
+ "tools/buildHeaders/bin/makeExtinstHeaders.py",
+ "tools/buildHeaders/bin/makeHeaders",
+ "include/spirv/unified1/OpenCLDebugInfo100.h",
+ "include/spirv/unified1/DebugInfo.h"
+]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "The Khronos Group, Inc."
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = "tools/buildHeaders/jsoncpp/**"
+precedence = "aggregate"
+SPDX-FileCopyrightText = "2007-2010 by Baptiste Lepilleur"
+SPDX-License-Identifier = "MIT"
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/GLSL.std.450.h b/third_party/SPIRV-Headers/include/spirv/1.0/GLSL.std.450.h
index 54cc00e..16ae294 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/GLSL.std.450.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/GLSL.std.450.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2016 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2014-2016 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
#ifndef GLSLstd450_H
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/OpenCL.std.h b/third_party/SPIRV-Headers/include/spirv/1.0/OpenCL.std.h
index 19a6688..5f9ea69 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/OpenCL.std.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/OpenCL.std.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2015-2017 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2015-2017 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
namespace OpenCLLIB {
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json
index 3d9f39e..609014f 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/extinst.glsl.std.450.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 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.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json
index 4fe4506..12245e5 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/extinst.opencl.std.100.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 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.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.core.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.core.grammar.json
index f3cfc4c..7bad5a2 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.core.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.core.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 The Khronos Group Inc.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
"magic_number" : "0x07230203",
"major_version" : 1,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.cs b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.cs
index de325cc..941dc9e 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.cs
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.cs
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 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.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
+//
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.h b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.h
index bd5a9b9..5a90568 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2018 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.
+** Copyright: 2014-2018 The Khronos Group Inc.
+** License: MIT
+**
+** 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/
*/
/*
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp
index e98a89c..7e3a6e1 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp11 b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp11
index 8896e81..fc7958c 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp11
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.hpp11
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.json b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.json
index 9b0a8f3..8ec9f8d 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.json
@@ -6,29 +6,13 @@
"Comment":
[
[
- "Copyright (c) 2014-2018 The Khronos Group Inc.",
+ "Copyright: 2014-2018 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
[
"This header is automatically generated by the same tool that creates",
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.lua b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.lua
index 2bd33ba..f5b5310 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.lua
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.lua
@@ -1,26 +1,10 @@
--- Copyright (c) 2014-2018 The Khronos Group Inc.
+-- Copyright: 2014-2018 The Khronos Group Inc.
+-- License: MIT
--
--- 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.
+-- 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/
-- This header is automatically generated by the same tool that creates
-- the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.py b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.py
index 8a200e7..47d0d44 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.0/spirv.py
+++ b/third_party/SPIRV-Headers/include/spirv/1.0/spirv.py
@@ -1,26 +1,10 @@
-# Copyright (c) 2014-2018 The Khronos Group Inc.
+# Copyright: 2014-2018 The Khronos Group Inc.
+# License: MIT
#
-# 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.
+# 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/
# This header is automatically generated by the same tool that creates
# the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/GLSL.std.450.h b/third_party/SPIRV-Headers/include/spirv/1.1/GLSL.std.450.h
index 54cc00e..16ae294 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/GLSL.std.450.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/GLSL.std.450.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2016 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2014-2016 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
#ifndef GLSLstd450_H
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/OpenCL.std.h b/third_party/SPIRV-Headers/include/spirv/1.1/OpenCL.std.h
index 19a6688..5f9ea69 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/OpenCL.std.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/OpenCL.std.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2015-2017 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2015-2017 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
namespace OpenCLLIB {
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json
index 3d9f39e..24792f2 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/extinst.glsl.std.450.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 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.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json
index 4fe4506..f85d41e 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/extinst.opencl.std.100.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 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.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ "HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/",
+ ""
],
"version" : 100,
"revision" : 2,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.core.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.core.grammar.json
index c142e60..b2e2c46 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.core.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.core.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 The Khronos Group Inc.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
"magic_number" : "0x07230203",
"major_version" : 1,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.cs b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.cs
index 99194e5..3cdea8d 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.cs
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.cs
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.h b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.h
index 971c3be..b445137 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2018 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.
+** Copyright: 2014-2018 The Khronos Group Inc.
+** License: MIT
+**
+** 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/
*/
/*
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp
index c26ac1f..0d115fb 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp11 b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp11
index 992d43b..745b5ce 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp11
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.hpp11
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.json b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.json
index 4c18e01..db1acf5 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.json
@@ -6,29 +6,13 @@
"Comment":
[
[
- "Copyright (c) 2014-2018 The Khronos Group Inc.",
+ "Copyright: 2014-2018 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
[
"This header is automatically generated by the same tool that creates",
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.lua b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.lua
index ad34e0a..f369b5e 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.lua
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.lua
@@ -1,26 +1,10 @@
--- Copyright (c) 2014-2018 The Khronos Group Inc.
+-- Copyright: 2014-2018 The Khronos Group Inc.
+-- License: MIT
--
--- 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.
+-- 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/
-- This header is automatically generated by the same tool that creates
-- the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.py b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.py
index 519a597..50fd996 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.1/spirv.py
+++ b/third_party/SPIRV-Headers/include/spirv/1.1/spirv.py
@@ -1,26 +1,10 @@
-# Copyright (c) 2014-2018 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.
+# Copyright: 2014-2018 The Khronos Group Inc.
+# License: MIT
+#
+# 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/
# This header is automatically generated by the same tool that creates
# the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/GLSL.std.450.h b/third_party/SPIRV-Headers/include/spirv/1.2/GLSL.std.450.h
index 54cc00e..16ae294 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/GLSL.std.450.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/GLSL.std.450.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2016 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2014-2016 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
#ifndef GLSLstd450_H
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/OpenCL.std.h b/third_party/SPIRV-Headers/include/spirv/1.2/OpenCL.std.h
index 19a6688..5f9ea69 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/OpenCL.std.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/OpenCL.std.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2015-2017 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2015-2017 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
namespace OpenCLLIB {
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json
index 3d9f39e..24792f2 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/extinst.glsl.std.450.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 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.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json
index 4fe4506..12245e5 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/extinst.opencl.std.100.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 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.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.core.grammar.json b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.core.grammar.json
index 393ee3c..fe1a919 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.core.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.core.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2016 The Khronos Group Inc.",
+ "Copyright: 2014-2016 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
"magic_number" : "0x07230203",
"major_version" : 1,
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.cs b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.cs
index 493303d..4595daf 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.cs
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.cs
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.h b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.h
index 7c6d884..7ddf2f8 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.h
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2018 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.
+** Copyright: 2014-2018 The Khronos Group Inc.
+** License: MIT
+**
+** 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/
*/
/*
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp
index 57bd97a..a53809c 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp11 b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp11
index 7a875fd..23f5e5d 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp11
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.hpp11
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2018 The Khronos Group Inc.
+// Copyright: 2014-2018 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.json b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.json
index 9c0ff0a..ff7ad9b 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.json
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.json
@@ -6,29 +6,13 @@
"Comment":
[
[
- "Copyright (c) 2014-2018 The Khronos Group Inc.",
+ "Copyright: 2014-2018 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
[
"This header is automatically generated by the same tool that creates",
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.lua b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.lua
index 0de507d..db0bae0 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.lua
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.lua
@@ -1,26 +1,10 @@
--- Copyright (c) 2014-2018 The Khronos Group Inc.
+-- Copyright: 2014-2018 The Khronos Group Inc.
+-- License: MIT
--
--- 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.
+-- 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/
-- This header is automatically generated by the same tool that creates
-- the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.py b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.py
index cefee4d..d80b1f5 100644
--- a/third_party/SPIRV-Headers/include/spirv/1.2/spirv.py
+++ b/third_party/SPIRV-Headers/include/spirv/1.2/spirv.py
@@ -1,26 +1,10 @@
-# Copyright (c) 2014-2018 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.
+# Copyright: 2014-2018 The Khronos Group Inc.
+# License: MIT
+#
+# 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/
# This header is automatically generated by the same tool that creates
# the Binary Section of the SPIR-V specification.
diff --git a/third_party/SPIRV-Headers/include/spirv/spir-v.xml b/third_party/SPIRV-Headers/include/spirv/spir-v.xml
index 52de097..b7c7947 100644
--- a/third_party/SPIRV-Headers/include/spirv/spir-v.xml
+++ b/third_party/SPIRV-Headers/include/spirv/spir-v.xml
@@ -1,26 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<registry>
<!--
- Copyright (c) 2015-2024 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.
-
- 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.
+ SPDX-FileCopyrightText: 2015-2024 The Khronos Group Inc.
+ SPDX-License-Identifier: MIT
-->
<!--
This file, spir-v.xml, is the SPIR-V Tool ID, opcode and enumerant registry.
@@ -64,7 +46,7 @@
<id value="11" vendor="Intel" comment="Contact Alexey, alexey.bader@intel.com"/>
<id value="12" vendor="Imagination" comment="Contact Stephen Clarke, stephen.clarke@imgtec.com"/>
<id value="13" vendor="Google" tool="Shaderc over Glslang" comment="Contact David Neto, dneto@google.com"/>
- <id value="14" vendor="Google" tool="spiregg" comment="Contact Lei Zhang, antiagainst@google.com"/>
+ <id value="14" vendor="Google" tool="spiregg" comment="Contact Steven Perron, stevenperron@google.com"/>
<id value="15" vendor="Google" tool="rspirv" comment="Contact Lei Zhang, antiagainst@gmail.com"/>
<id value="16" vendor="X-LEGEND" tool="Mesa-IR/SPIR-V Translator" comment="Contact Metora Wang, github:metora/MesaGLSLCompiler"/>
<id value="17" vendor="Khronos" tool="SPIR-V Tools Linker" comment="Contact David Neto, dneto@google.com"/>
@@ -72,7 +54,7 @@
<id value="19" vendor="Tellusim" tool="Clay Shader Compiler" comment="Contact info@tellusim.com"/>
<id value="20" vendor="W3C WebGPU Group" tool="WHLSL Shader Translator" comment="https://github.com/gpuweb/WHLSL"/>
<id value="21" vendor="Google" tool="Clspv" comment="Contact David Neto, dneto@google.com"/>
- <id value="22" vendor="Google" tool="MLIR SPIR-V Serializer" comment="Contact Lei Zhang, antiagainst@google.com"/>
+ <id value="22" vendor="LLVM" tool="MLIR SPIR-V Serializer" comment="Contact Jakub Kuderski, jakub.kuderski@amd.com, https://mlir.llvm.org/docs/Dialects/SPIR-V/"/>
<id value="23" vendor="Google" tool="Tint Compiler" comment="Contact David Neto, dneto@google.com"/>
<id value="24" vendor="Google" tool="ANGLE Shader Compiler" comment="Contact Shahbaz Youssefi, syoussefi@google.com"/>
<id value="25" vendor="Netease Games" tool="Messiah Shader Compiler" comment="Contact Yuwen Wu, atyuwen@gmail.com"/>
@@ -90,11 +72,16 @@
<id value="37" vendor="heroseh" tool="Hero C Compiler" comment="https://github.com/heroseh/hcc"/>
<id value="38" vendor="Meta" tool="SparkSL" comment="Contact Dunfan Lu, dunfanlu@meta.com, https://sparkar.facebook.com/ar-studio/learn/sparksl/sparksl-overview"/>
<id value="39" vendor="SirLynix" tool="Nazara ShaderLang Compiler" comment="Contact Jérôme Leclercq, https://github.com/NazaraEngine/ShaderLang"/>
- <id value="40" vendor="NVIDIA" tool="Slang Compiler" comment="Contact Theresa Foley, tfoley@nvidia.com, https://github.com/shader-slang/slang/"/>
+ <id value="40" vendor="Khronos" tool="Slang Compiler" comment="https://shader-slang.org"/>
<id value="41" vendor="Zig Software Foundation" tool="Zig Compiler" comment="Contact Robin Voetter, https://github.com/Snektron"/>
<id value="42" vendor="Rendong Liang" tool="spq" comment="Contact Rendong Liang, admin@penguinliong.moe, https://github.com/PENGUINLIONG/spq-rs"/>
<id value="43" vendor="LLVM" tool="LLVM SPIR-V Backend" comment="Contact Michal Paszkowski, michal.paszkowski@intel.com, https://github.com/llvm/llvm-project/tree/main/llvm/lib/Target/SPIRV"/>
- <unused start="44" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
+ <id value="44" vendor="Robert Konrad" tool="Kongruent" comment="Contact Robert Konrad, https://github.com/Kode/Kongruent"/>
+ <id value="45" vendor="Kitsunebi Games" tool="Nuvk SPIR-V Emitter and DLSL compiler" comment="Contact Luna Nielsen, luna@foxgirls.gay, https://github.com/Inochi2D/nuvk"/>
+ <id value="46" vendor="Nintendo" comment="Contact Steve Urquhart, steve.urquhart@ntd.nintendo.com"/>
+ <id value="47" vendor="ARM" comment="Contact Christopher Gautier, christopher.gautier@arm.com"/>
+ <id value="48" vendor="Goopax" comment="Contact Ingo Josopait, josopait@goopax.com"/>
+ <unused start="49" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
</ids>
<!-- SECTION: SPIR-V Opcodes and Enumerants -->
@@ -151,13 +138,14 @@
<ids type="opcode" start="6528" end="6591" vendor="Codeplay" comment="Contact duncan.brawley@codeplay.com"/>
<ids type="opcode" start="6592" end="6655" vendor="Saarland University" comment="Contact devillers@cg.uni-saarland.de"/>
<ids type="opcode" start="6656" end="6719" vendor="Meta" comment="Contact dunfanlu@meta.com"/>
+ <ids type="opcode" start="6720" end="6783" vendor="MediaTek" comment="Contact samuel.huang@mediatek.com"/>
<!-- Opcode enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="opcode" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
- <ids type="opcode" start="6656" end="65535" comment="Opcode range reservable for future use by vendors"/>
+ <ids type="opcode" start="6784" end="65535" comment="Opcode range reservable for future use by vendors"/>
<!-- End reservations of opcodes -->
@@ -184,13 +172,14 @@
<ids type="enumerant" start="6528" end="6591" vendor="Codeplay" comment="Contact duncan.brawley@codeplay.com"/>
<ids type="enumerant" start="6592" end="6655" vendor="Saarland University" comment="Contact devillers@cg.uni-saarland.de"/>
<ids type="enumerant" start="6656" end="6719" vendor="Meta" comment="Contact dunfanlu@meta.com"/>
+ <ids type="enumerant" start="6720" end="6783" vendor="MediaTek" comment="Contact samuel.huang@mediatek.com"/>
<!-- Enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="enumerant" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
- <ids type="enumerant" start="6656" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
+ <ids type="enumerant" start="6784" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
<!-- End reservations of enumerants -->
@@ -272,7 +261,8 @@
<!-- Reserved memory operand bits -->
<ids type="MemoryOperand" start="0" end="15" vendor="Khronos" comment="Reserved MemoryOperand bits, not available to vendors - see the SPIR-V Specification"/>
<ids type="MemoryOperand" start="16" end="18" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
- <ids type="MemoryOperand" start="19" end="30" comment="Unreserved bits reservable for use by vendors"/>
+ <ids type="MemoryOperand" start="19" end="22" vendor="Arm" comment="Contact kevin.petit@arm.com"/>
+ <ids type="MemoryOperand" start="23" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="MemoryOperand" start="31" end="31" vendor="Khronos" comment="Reserved MemoryOperand bit, not available to vendors"/>
<!-- SECTION: SPIR-V Image Operand Bit Reservations -->
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_gcn_shader.h b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_gcn_shader.h
index e626a7a..2c42abf 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_gcn_shader.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_gcn_shader.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_AMD_gcn_shader_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_ballot.h b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_ballot.h
index 563c0b6..7c33421 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_ballot.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_ballot.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_AMD_shader_ballot_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h
index e663330..2e3e573 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_trinary_minmax.h b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_trinary_minmax.h
index dd51c5f..f7acf71 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_trinary_minmax.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/AMD_shader_trinary_minmax.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/DebugInfo.h b/third_party/SPIRV-Headers/include/spirv/unified1/DebugInfo.h
index a3c0af4..81880f1 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/DebugInfo.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/DebugInfo.h
@@ -1,26 +1,10 @@
-// Copyright (c) 2017-2024 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.
+// Copyright: 2017-2024 The Khronos Group Inc.
+// License: MIT
//
// 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.
#ifndef SPIRV_UNIFIED1_DebugInfo_H_
#define SPIRV_UNIFIED1_DebugInfo_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/GLSL.std.450.h b/third_party/SPIRV-Headers/include/spirv/unified1/GLSL.std.450.h
index 0594f90..fb8c01e 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/GLSL.std.450.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/GLSL.std.450.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2024 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2014-2024 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
#ifndef GLSLstd450_H
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticClspvReflection.h b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticClspvReflection.h
index b6c27fa..10eda0e 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticClspvReflection.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticClspvReflection.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_NonSemanticClspvReflection_H_
@@ -33,7 +16,7 @@
#endif
enum {
- NonSemanticClspvReflectionRevision = 6,
+ NonSemanticClspvReflectionRevision = 7,
NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
};
@@ -79,6 +62,7 @@
NonSemanticClspvReflectionPrintfBufferStorageBuffer = 39,
NonSemanticClspvReflectionPrintfBufferPointerPushConstant = 40,
NonSemanticClspvReflectionNormalizedSamplerMaskPushConstant = 41,
+ NonSemanticClspvReflectionWorkgroupVariableSize = 42,
NonSemanticClspvReflectionInstructionsMax = 0x7fffffff
};
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugBreak.h b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugBreak.h
index 8604fe7..62b3333 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugBreak.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugBreak.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_NonSemanticDebugBreak_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugPrintf.h b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugPrintf.h
index bc24683..7a62f05 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugPrintf.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticDebugPrintf.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h
index b276b56..c095e28 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticShaderDebugInfo100.h
@@ -1,26 +1,10 @@
-// Copyright (c) 2018-2024 The Khronos Group Inc.
+// SPDX-FileCopyrightText: 2018-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
-// 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.
+// 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/
#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticVkspReflection.h b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticVkspReflection.h
index 331a3d9..227a9c1 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticVkspReflection.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/NonSemanticVkspReflection.h
@@ -1,28 +1,11 @@
-// Copyright (c) 2020-2024 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.
+// SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
// 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.
//
#ifndef SPIRV_UNIFIED1_NonSemanticVkspReflection_H_
@@ -33,7 +16,7 @@
#endif
enum {
- NonSemanticVkspReflectionRevision = 2,
+ NonSemanticVkspReflectionRevision = 4,
NonSemanticVkspReflectionRevision_BitWidthPadding = 0x7fffffff
};
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/OpenCL.std.h b/third_party/SPIRV-Headers/include/spirv/unified1/OpenCL.std.h
index ed74f20..5382de1 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/OpenCL.std.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/OpenCL.std.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2015-2024 The Khronos Group Inc.
+** SPDX-FileCopyrightText: 2015-2024 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
**
-** 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.
+** 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/
*/
#ifndef OPENCLstd_H
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/OpenCLDebugInfo100.h b/third_party/SPIRV-Headers/include/spirv/unified1/OpenCLDebugInfo100.h
index ffbd16f..39f596f 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/OpenCLDebugInfo100.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/OpenCLDebugInfo100.h
@@ -1,26 +1,10 @@
-// Copyright (c) 2018-2024 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.
+// Copyright: 2018-2024 The Khronos Group Inc.
+// License: MIT
//
// 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.
#ifndef SPIRV_UNIFIED1_OpenCLDebugInfo100_H_
#define SPIRV_UNIFIED1_OpenCLDebugInfo100_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/TOSA.001000.1.h b/third_party/SPIRV-Headers/include/spirv/unified1/TOSA.001000.1.h
new file mode 100644
index 0000000..3da2969
--- /dev/null
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/TOSA.001000.1.h
@@ -0,0 +1,95 @@
+// SPDX-FileCopyrightText: 2022-2025 Arm Ltd.
+// SPDX-License-Identifier: MIT
+
+#ifndef SPIRV_UNIFIED1_TOSA_001000_1_H_
+#define SPIRV_UNIFIED1_TOSA_001000_1_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+ TOSAVersion = 1000000,
+ TOSAVersion_BitWidthPadding = 0x7fffffff
+};
+enum {
+ TOSARevision = 1,
+ TOSARevision_BitWidthPadding = 0x7fffffff
+};
+
+enum TOSAInstructions {
+ TOSAARGMAX = 0,
+ TOSAAVG_POOL2D = 1,
+ TOSACONV2D = 2,
+ TOSACONV3D = 3,
+ TOSADEPTHWISE_CONV2D = 4,
+ TOSAFFT2D = 5,
+ TOSAMATMUL = 6,
+ TOSAMAX_POOL2D = 7,
+ TOSARFFT2D = 8,
+ TOSATRANSPOSE_CONV2D = 9,
+ TOSACLAMP = 10,
+ TOSAERF = 11,
+ TOSASIGMOID = 12,
+ TOSATANH = 13,
+ TOSAADD = 14,
+ TOSAARITHMETIC_RIGHT_SHIFT = 15,
+ TOSABITWISE_AND = 16,
+ TOSABITWISE_OR = 17,
+ TOSABITWISE_XOR = 18,
+ TOSAINTDIV = 19,
+ TOSALOGICAL_AND = 20,
+ TOSALOGICAL_LEFT_SHIFT = 21,
+ TOSALOGICAL_RIGHT_SHIFT = 22,
+ TOSALOGICAL_OR = 23,
+ TOSALOGICAL_XOR = 24,
+ TOSAMAXIMUM = 25,
+ TOSAMINIMUM = 26,
+ TOSAMUL = 27,
+ TOSAPOW = 28,
+ TOSASUB = 29,
+ TOSATABLE = 30,
+ TOSAABS = 31,
+ TOSABITWISE_NOT = 32,
+ TOSACEIL = 33,
+ TOSACLZ = 34,
+ TOSACOS = 35,
+ TOSAEXP = 36,
+ TOSAFLOOR = 37,
+ TOSALOG = 38,
+ TOSALOGICAL_NOT = 39,
+ TOSANEGATE = 40,
+ TOSARECIPROCAL = 41,
+ TOSARSQRT = 42,
+ TOSASIN = 43,
+ TOSASELECT = 44,
+ TOSAEQUAL = 45,
+ TOSAGREATER = 46,
+ TOSAGREATER_EQUAL = 47,
+ TOSAREDUCE_ALL = 48,
+ TOSAREDUCE_ANY = 49,
+ TOSAREDUCE_MAX = 50,
+ TOSAREDUCE_MIN = 51,
+ TOSAREDUCE_PRODUCT = 52,
+ TOSAREDUCE_SUM = 53,
+ TOSACONCAT = 54,
+ TOSAPAD = 55,
+ TOSARESHAPE = 56,
+ TOSAREVERSE = 57,
+ TOSASLICE = 58,
+ TOSATILE = 59,
+ TOSATRANSPOSE = 60,
+ TOSAGATHER = 61,
+ TOSASCATTER = 62,
+ TOSARESIZE = 63,
+ TOSACAST = 64,
+ TOSARESCALE = 65,
+ TOSAInstructionsMax = 0x7fffffff
+};
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SPIRV_UNIFIED1_TOSA_001000_1_H_
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.debuginfo.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.debuginfo.grammar.json
index 918a9e5..d723d61 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.debuginfo.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.debuginfo.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2017-2024 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.",
+ "Copyright: 2017-2024 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 1,
@@ -35,253 +19,253 @@
"opname" : "DebugCompilationUnit",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Version'" },
- { "kind" : "LiteralInteger", "name" : "'DWARF Version'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Version" },
+ { "kind" : "LiteralInteger", "name" : "DWARF Version" }
]
},
{
"opname" : "DebugTypeBasic",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "Encoding" }
]
},
{
"opname" : "DebugTypePointer",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "StorageClass", "name" : "'Storage Class'" },
- { "kind" : "DebugInfoFlags", "name" : "'Literal Flags'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "StorageClass", "name" : "Storage Class" },
+ { "kind" : "DebugInfoFlags", "name" : "Literal Flags" }
]
},
{
"opname" : "DebugTypeQualifier",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "DebugTypeQualifier", "name" : "Type Qualifier" }
]
},
{
"opname" : "DebugTypeArray",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Component Counts", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeVector",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "LiteralInteger", "name" : "'Component Count'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "LiteralInteger", "name" : "Component Count" }
]
},
{
"opname" : "DebugTypedef",
"opcode" : 7,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugTypeFunction",
"opcode" : 8,
"operands" : [
- { "kind" : "IdRef", "name" : "'Return Type'" },
- { "kind" : "IdRef", "name" : "'Paramter Types'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Return Type" },
+ { "kind" : "IdRef", "name" : "Paramter Types", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeEnum",
"opcode" : 9,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Underlying Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Underlying Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "PairIdRefIdRef", "name" : "Value, Name, Value, Name, ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeComposite",
"opcode" : 10,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "DebugCompositeType", "name" : "'Tag'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "DebugCompositeType", "name" : "Tag" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Members", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeMember",
"opcode" : 11,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Value", "quantifier" : "?" }
]
},
{
"opname" : "DebugTypeInheritance",
"opcode" : 12,
"operands" : [
- { "kind" : "IdRef", "name" : "'Child'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Child" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" }
]
},
{
"opname" : "DebugTypePtrToMember",
"opcode" : 13,
"operands" : [
- { "kind" : "IdRef", "name" : "'Member Type'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Member Type" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugTypeTemplate",
"opcode" : 14,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Parameters", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeTemplateParameter",
"opcode" : 15,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Actual Type'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Actual Type" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" }
]
},
{
"opname" : "DebugTypeTemplateTemplateParameter",
"opcode" : 16,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Template Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Template Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" }
]
},
{
"opname" : "DebugTypeTemplateParameterPack",
"opcode" : 17,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Template Parameters", "quantifier" : "*" }
]
},
{
"opname" : "DebugGlobalVariable",
"opcode" : 18,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Static Member Declaration", "quantifier" : "?" }
]
},
{
"opname" : "DebugFunctionDeclaration",
"opcode" : 19,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" }
]
},
{
"opname" : "DebugFunction",
"opcode" : 20,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "LiteralInteger", "name" : "'Scope Line'" },
- { "kind" : "IdRef", "name" : "'Function'" },
- { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "LiteralInteger", "name" : "Scope Line" },
+ { "kind" : "IdRef", "name" : "Function" },
+ { "kind" : "IdRef", "name" : "Declaration", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlock",
"opcode" : 21,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Name", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlockDiscriminator",
"opcode" : 22,
"operands" : [
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "LiteralInteger", "name" : "'Discriminator'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "LiteralInteger", "name" : "Discriminator" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugScope",
"opcode" : 23,
"operands" : [
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Inlined At", "quantifier" : "?" }
]
},
{
@@ -292,82 +276,82 @@
"opname" : "DebugInlinedAt",
"opcode" : 25,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" }
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Inlined", "quantifier" : "?" }
]
},
{
"opname" : "DebugLocalVariable",
"opcode" : 26,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "LiteralInteger", "name" : "Arg Number", "quantifier" : "?" }
]
},
{
"opname" : "DebugInlinedVariable",
"opcode" : 27,
"operands" : [
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Inlined'" }
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Inlined" }
]
},
{
"opname" : "DebugDeclare",
"opcode" : 28,
"operands" : [
- { "kind" : "IdRef", "name" : "'Local Variable'" },
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Expression'" }
+ { "kind" : "IdRef", "name" : "Local Variable" },
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Expression" }
]
},
{
"opname" : "DebugValue",
"opcode" : 29,
"operands" : [
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Expression'" },
- { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Expression" },
+ { "kind" : "IdRef", "name" : "Indexes", "quantifier" : "*" }
]
},
{
"opname" : "DebugOperation",
"opcode" : 30,
"operands" : [
- { "kind" : "DebugOperation", "name" : "'OpCode'" },
- { "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" }
+ { "kind" : "DebugOperation", "name" : "OpCode" },
+ { "kind" : "LiteralInteger", "name" : "Operands ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugExpression",
"opcode" : 31,
"operands" : [
- { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Operands ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugMacroDef",
"opcode" : 32,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Value", "quantifier" : "?" }
]
},
{
"opname" : "DebugMacroUndef",
"opcode" : 33,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Macro'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Macro" }
]
}
],
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json
index ac8fc6d..89338c9 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.glsl.std.450.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
"Copyright (c) 2014-2024 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.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
@@ -31,439 +15,439 @@
"opname" : "Round",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "RoundEven",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Trunc",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "FAbs",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "SAbs",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "FSign",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "SSign",
"opcode" : 7,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Floor",
"opcode" : 8,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Ceil",
"opcode" : 9,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Fract",
"opcode" : 10,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Radians",
"opcode" : 11,
"operands" : [
- { "kind" : "IdRef", "name" : "'degrees'" }
+ { "kind" : "IdRef", "name" : "degrees" }
]
},
{
"opname" : "Degrees",
"opcode" : 12,
"operands" : [
- { "kind" : "IdRef", "name" : "'radians'" }
+ { "kind" : "IdRef", "name" : "radians" }
]
},
{
"opname" : "Sin",
"opcode" : 13,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Cos",
"opcode" : 14,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Tan",
"opcode" : 15,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Asin",
"opcode" : 16,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Acos",
"opcode" : 17,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Atan",
"opcode" : 18,
"operands" : [
- { "kind" : "IdRef", "name" : "'y_over_x'" }
+ { "kind" : "IdRef", "name" : "y_over_x" }
]
},
{
"opname" : "Sinh",
"opcode" : 19,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Cosh",
"opcode" : 20,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Tanh",
"opcode" : 21,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Asinh",
"opcode" : 22,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Acosh",
"opcode" : 23,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Atanh",
"opcode" : 24,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Atan2",
"opcode" : 25,
"operands" : [
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Pow",
"opcode" : 26,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "Exp",
"opcode" : 27,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Log",
"opcode" : 28,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Exp2",
"opcode" : 29,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Log2",
"opcode" : 30,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Sqrt",
"opcode" : 31,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "InverseSqrt",
"opcode" : 32,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Determinant",
"opcode" : 33,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "MatrixInverse",
"opcode" : 34,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Modf",
"opcode" : 35,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'i'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "i" }
]
},
{
"opname" : "ModfStruct",
"opcode" : 36,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "FMin",
"opcode" : 37,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "UMin",
"opcode" : 38,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "SMin",
"opcode" : 39,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "FMax",
"opcode" : 40,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "UMax",
"opcode" : 41,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "SMax",
"opcode" : 42,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "FClamp",
"opcode" : 43,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minVal'" },
- { "kind" : "IdRef", "name" : "'maxVal'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minVal" },
+ { "kind" : "IdRef", "name" : "maxVal" }
]
},
{
"opname" : "UClamp",
"opcode" : 44,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minVal'" },
- { "kind" : "IdRef", "name" : "'maxVal'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minVal" },
+ { "kind" : "IdRef", "name" : "maxVal" }
]
},
{
"opname" : "SClamp",
"opcode" : 45,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minVal'" },
- { "kind" : "IdRef", "name" : "'maxVal'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minVal" },
+ { "kind" : "IdRef", "name" : "maxVal" }
]
},
{
"opname" : "FMix",
"opcode" : 46,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'a'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "a" }
]
},
{
"opname" : "IMix",
"opcode" : 47,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'a'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "a" }
]
},
{
"opname" : "Step",
"opcode" : 48,
"operands" : [
- { "kind" : "IdRef", "name" : "'edge'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "edge" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "SmoothStep",
"opcode" : 49,
"operands" : [
- { "kind" : "IdRef", "name" : "'edge0'" },
- { "kind" : "IdRef", "name" : "'edge1'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "edge0" },
+ { "kind" : "IdRef", "name" : "edge1" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Fma",
"opcode" : 50,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "Frexp",
"opcode" : 51,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'exp'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "exp" }
]
},
{
"opname" : "FrexpStruct",
"opcode" : 52,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Ldexp",
"opcode" : 53,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'exp'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "exp" }
]
},
{
"opname" : "PackSnorm4x8",
"opcode" : 54,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
]
},
{
"opname" : "PackUnorm4x8",
"opcode" : 55,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
]
},
{
"opname" : "PackSnorm2x16",
"opcode" : 56,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
]
},
{
"opname" : "PackUnorm2x16",
"opcode" : 57,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
]
},
{
"opname" : "PackHalf2x16",
"opcode" : 58,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
]
},
{
"opname" : "PackDouble2x32",
"opcode" : 59,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
],
"capabilities" : [ "Float64" ]
},
@@ -471,42 +455,42 @@
"opname" : "UnpackSnorm2x16",
"opcode" : 60,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "UnpackUnorm2x16",
"opcode" : 61,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "UnpackHalf2x16",
"opcode" : 62,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
]
},
{
"opname" : "UnpackSnorm4x8",
"opcode" : 63,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "UnpackUnorm4x8",
"opcode" : 64,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "UnpackDouble2x32",
"opcode" : 65,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" }
+ { "kind" : "IdRef", "name" : "v" }
],
"capabilities" : [ "Float64" ]
},
@@ -514,84 +498,84 @@
"opname" : "Length",
"opcode" : 66,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "Distance",
"opcode" : 67,
"operands" : [
- { "kind" : "IdRef", "name" : "'p0'" },
- { "kind" : "IdRef", "name" : "'p1'" }
+ { "kind" : "IdRef", "name" : "p0" },
+ { "kind" : "IdRef", "name" : "p1" }
]
},
{
"opname" : "Cross",
"opcode" : 68,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "Normalize",
"opcode" : 69,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "FaceForward",
"opcode" : 70,
"operands" : [
- { "kind" : "IdRef", "name" : "'N'" },
- { "kind" : "IdRef", "name" : "'I'" },
- { "kind" : "IdRef", "name" : "'Nref'" }
+ { "kind" : "IdRef", "name" : "N" },
+ { "kind" : "IdRef", "name" : "I" },
+ { "kind" : "IdRef", "name" : "Nref" }
]
},
{
"opname" : "Reflect",
"opcode" : 71,
"operands" : [
- { "kind" : "IdRef", "name" : "'I'" },
- { "kind" : "IdRef", "name" : "'N'" }
+ { "kind" : "IdRef", "name" : "I" },
+ { "kind" : "IdRef", "name" : "N" }
]
},
{
"opname" : "Refract",
"opcode" : 72,
"operands" : [
- { "kind" : "IdRef", "name" : "'I'" },
- { "kind" : "IdRef", "name" : "'N'" },
- { "kind" : "IdRef", "name" : "'eta'" }
+ { "kind" : "IdRef", "name" : "I" },
+ { "kind" : "IdRef", "name" : "N" },
+ { "kind" : "IdRef", "name" : "eta" }
]
},
{
"opname" : "FindILsb",
"opcode" : 73,
"operands" : [
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
]
},
{
"opname" : "FindSMsb",
"opcode" : 74,
"operands" : [
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
]
},
{
"opname" : "FindUMsb",
"opcode" : 75,
"operands" : [
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
]
},
{
"opname" : "InterpolateAtCentroid",
"opcode" : 76,
"operands" : [
- { "kind" : "IdRef", "name" : "'interpolant'" }
+ { "kind" : "IdRef", "name" : "interpolant" }
],
"capabilities" : [ "InterpolationFunction" ]
},
@@ -599,8 +583,8 @@
"opname" : "InterpolateAtSample",
"opcode" : 77,
"operands" : [
- { "kind" : "IdRef", "name" : "'interpolant'" },
- { "kind" : "IdRef", "name" : "'sample'" }
+ { "kind" : "IdRef", "name" : "interpolant" },
+ { "kind" : "IdRef", "name" : "sample" }
],
"capabilities" : [ "InterpolationFunction" ]
},
@@ -608,8 +592,8 @@
"opname" : "InterpolateAtOffset",
"opcode" : 78,
"operands" : [
- { "kind" : "IdRef", "name" : "'interpolant'" },
- { "kind" : "IdRef", "name" : "'offset'" }
+ { "kind" : "IdRef", "name" : "interpolant" },
+ { "kind" : "IdRef", "name" : "offset" }
],
"capabilities" : [ "InterpolationFunction" ]
},
@@ -617,25 +601,25 @@
"opname" : "NMin",
"opcode" : 79,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "NMax",
"opcode" : 80,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "NClamp",
"opcode" : 81,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minVal'" },
- { "kind" : "IdRef", "name" : "'maxVal'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minVal" },
+ { "kind" : "IdRef", "name" : "maxVal" }
]
}
]
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
index cfccc80..bd8dfd1 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
@@ -1,5 +1,5 @@
{
- "revision" : 6,
+ "revision" : 7,
"instructions" : [
{
"opname" : "Kernel",
@@ -405,6 +405,14 @@
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
+ },
+ {
+ "opname" : "WorkgroupVariableSize",
+ "opcode" : 42,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
}
],
"operand_kinds" : [
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json
index 71fa711..710214c 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json
@@ -5,7 +5,7 @@
"opname" : "DebugPrintf",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'Format'" },
+ { "kind" : "IdRef", "name" : "Format" },
{ "kind" : "IdRef", "quantifier" : "*" }
]
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json
index 1eb2859..effbdd3 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2018-2024 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.",
+ "Copyright: 2018-2024 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 6,
@@ -35,254 +19,254 @@
"opname" : "DebugCompilationUnit",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'Version'" },
- { "kind" : "IdRef", "name" : "'DWARF Version'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Language'" }
+ { "kind" : "IdRef", "name" : "Version" },
+ { "kind" : "IdRef", "name" : "DWARF Version" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Language" }
]
},
{
"opname" : "DebugTypeBasic",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "IdRef", "name" : "'Encoding'" },
- { "kind" : "IdRef", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "Encoding" },
+ { "kind" : "IdRef", "name" : "Flags" }
]
},
{
"opname" : "DebugTypePointer",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Storage Class'" },
- { "kind" : "IdRef", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Storage Class" },
+ { "kind" : "IdRef", "name" : "Flags" }
]
},
{
"opname" : "DebugTypeQualifier",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Type Qualifier'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Type Qualifier" }
]
},
{
"opname" : "DebugTypeArray",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Component Counts", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeVector",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Component Count'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Component Count" }
]
},
{
"opname" : "DebugTypedef",
"opcode" : 7,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugTypeFunction",
"opcode" : 8,
"operands" : [
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Return Type'" },
- { "kind" : "IdRef", "name" : "'Parameter Types'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Return Type" },
+ { "kind" : "IdRef", "name" : "Parameter Types", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeEnum",
"opcode" : 9,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Underlying Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Underlying Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "PairIdRefIdRef", "name" : "Value, Name, Value, Name, ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeComposite",
"opcode" : 10,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Tag'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Tag" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Members", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeMember",
"opcode" : 11,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Value", "quantifier" : "?" }
]
},
{
"opname" : "DebugTypeInheritance",
"opcode" : 12,
"operands" : [
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "IdRef", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "Flags" }
]
},
{
"opname" : "DebugTypePtrToMember",
"opcode" : 13,
"operands" : [
- { "kind" : "IdRef", "name" : "'Member Type'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Member Type" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugTypeTemplate",
"opcode" : 14,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Parameters", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeTemplateParameter",
"opcode" : 15,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Actual Type'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Actual Type" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" }
]
},
{
"opname" : "DebugTypeTemplateTemplateParameter",
"opcode" : 16,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Template Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Template Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" }
]
},
{
"opname" : "DebugTypeTemplateParameterPack",
"opcode" : 17,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Template Parameters", "quantifier" : "*" }
]
},
{
"opname" : "DebugGlobalVariable",
"opcode" : 18,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Static Member Declaration", "quantifier" : "?" }
]
},
{
"opname" : "DebugFunctionDeclaration",
"opcode" : 19,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Flags" }
]
},
{
"opname" : "DebugFunction",
"opcode" : 20,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Scope Line'" },
- { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Scope Line" },
+ { "kind" : "IdRef", "name" : "Declaration", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlock",
"opcode" : 21,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Name", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlockDiscriminator",
"opcode" : 22,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Discriminator'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Discriminator" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugScope",
"opcode" : 23,
"operands" : [
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Inlined At", "quantifier" : "?" }
]
},
{
@@ -293,132 +277,132 @@
"opname" : "DebugInlinedAt",
"opcode" : 25,
"operands" : [
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Inlined", "quantifier" : "?" }
]
},
{
"opname" : "DebugLocalVariable",
"opcode" : 26,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Arg Number'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Arg Number", "quantifier" : "?" }
]
},
{
"opname" : "DebugInlinedVariable",
"opcode" : 27,
"operands" : [
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Inlined'" }
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Inlined" }
]
},
{
"opname" : "DebugDeclare",
"opcode" : 28,
"operands" : [
- { "kind" : "IdRef", "name" : "'Local Variable'" },
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Expression'" },
- { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Local Variable" },
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Expression" },
+ { "kind" : "IdRef", "name" : "Indexes", "quantifier" : "*" }
]
},
{
"opname" : "DebugValue",
"opcode" : 29,
"operands" : [
- { "kind" : "IdRef", "name" : "'Local Variable'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Expression'" },
- { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Local Variable" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Expression" },
+ { "kind" : "IdRef", "name" : "Indexes", "quantifier" : "*" }
]
},
{
"opname" : "DebugOperation",
"opcode" : 30,
"operands" : [
- { "kind" : "IdRef", "name" : "'OpCode'" },
- { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "OpCode" },
+ { "kind" : "IdRef", "name" : "Operands ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugExpression",
"opcode" : 31,
"operands" : [
- { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Operands ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugMacroDef",
"opcode" : 32,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Value", "quantifier" : "?" }
]
},
{
"opname" : "DebugMacroUndef",
"opcode" : 33,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Macro'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Macro" }
]
},
{
"opname" : "DebugImportedEntity",
"opcode" : 34,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Tag'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Entity'" },
- { "kind" : "IdRef", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Tag" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Entity" },
+ { "kind" : "IdRef", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugSource",
"opcode" : 35,
"operands" : [
- { "kind" : "IdRef", "name" : "'File'" },
- { "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "File" },
+ { "kind" : "IdRef", "name" : "Text", "quantifier" : "?" }
]
},
{
"opname" : "DebugFunctionDefinition",
"opcode" : 101,
"operands" : [
- { "kind" : "IdRef", "name" : "'Function'" },
- { "kind" : "IdRef", "name" : "'Definition'" }
+ { "kind" : "IdRef", "name" : "Function" },
+ { "kind" : "IdRef", "name" : "Definition" }
]
},
{
"opname" : "DebugSourceContinued",
"opcode" : 102,
"operands" : [
- { "kind" : "IdRef", "name" : "'Text'" }
+ { "kind" : "IdRef", "name" : "Text" }
]
},
{
"opname" : "DebugLine",
"opcode" : 103,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Line Start'" },
- { "kind" : "IdRef", "name" : "'Line End'" },
- { "kind" : "IdRef", "name" : "'Column Start'" },
- { "kind" : "IdRef", "name" : "'Column End'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Line Start" },
+ { "kind" : "IdRef", "name" : "Line End" },
+ { "kind" : "IdRef", "name" : "Column Start" },
+ { "kind" : "IdRef", "name" : "Column End" }
]
},
{
@@ -429,34 +413,34 @@
"opname" : "DebugBuildIdentifier",
"opcode" : 105,
"operands" : [
- { "kind" : "IdRef", "name" : "'Identifier'" },
- { "kind" : "IdRef", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Identifier" },
+ { "kind" : "IdRef", "name" : "Flags" }
]
},
{
"opname" : "DebugStoragePath",
"opcode" : 106,
"operands" : [
- { "kind" : "IdRef", "name" : "'Path'" }
+ { "kind" : "IdRef", "name" : "Path" }
]
},
{
"opname" : "DebugEntryPoint",
"opcode" : 107,
"operands" : [
- { "kind" : "IdRef", "name" : "'Entry Point'" },
- { "kind" : "IdRef", "name" : "'Compilation Unit'" },
- { "kind" : "IdRef", "name" : "'Compiler Signature'" },
- { "kind" : "IdRef", "name" : "'Command-line Arguments'" }
+ { "kind" : "IdRef", "name" : "Entry Point" },
+ { "kind" : "IdRef", "name" : "Compilation Unit" },
+ { "kind" : "IdRef", "name" : "Compiler Signature" },
+ { "kind" : "IdRef", "name" : "Command-line Arguments" }
]
},
{
"opname" : "DebugTypeMatrix",
"opcode" : 108,
"operands" : [
- { "kind" : "IdRef", "name" : "'Vector Type'" },
- { "kind" : "IdRef", "name" : "'Vector Count'" },
- { "kind" : "IdRef", "name" : "'Column Major'" }
+ { "kind" : "IdRef", "name" : "Vector Type" },
+ { "kind" : "IdRef", "name" : "Vector Count" },
+ { "kind" : "IdRef", "name" : "Column Major" }
]
}
],
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json
index 379457b..0bc12d6 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json
@@ -1,26 +1,26 @@
{
- "revision" : 2,
+ "revision" : 4,
"instructions" : [
{
"opname" : "Configuration",
"opcode" : 1,
"operands" : [
- {"kind" : "LiteralString", "name" : "enabledExtensionNames" },
- {"kind" : "LiteralInteger", "name" : "specializationInfoDataSize" },
- {"kind" : "LiteralString", "name" : "specializationInfoData" },
- {"kind" : "LiteralString", "name" : "shaderName" },
- {"kind" : "LiteralString", "name" : "EntryPoint" },
- {"kind" : "LiteralInteger", "name" : "groupCountX" },
- {"kind" : "LiteralInteger", "name" : "groupCountY" },
- {"kind" : "LiteralInteger", "name" : "groupCountZ" },
- {"kind" : "LiteralInteger", "name" : "dispatchId" }
+ {"kind" : "IdRef", "name" : "enabledExtensionNames" },
+ {"kind" : "IdRef", "name" : "specializationInfoDataSize" },
+ {"kind" : "IdRef", "name" : "specializationInfoData" },
+ {"kind" : "IdRef", "name" : "shaderName" },
+ {"kind" : "IdRef", "name" : "EntryPoint" },
+ {"kind" : "IdRef", "name" : "groupCountX" },
+ {"kind" : "IdRef", "name" : "groupCountY" },
+ {"kind" : "IdRef", "name" : "groupCountZ" },
+ {"kind" : "IdRef", "name" : "dispatchId" }
]
},
{
"opname" : "StartCounter",
"opcode" : 2,
"operands" : [
- {"kind" : "LiteralString", "name" : "name" }
+ {"kind" : "IdRef", "name" : "name" }
]
},
{
@@ -34,102 +34,104 @@
"opname" : "PushConstants",
"opcode" : 4,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "offset" },
- { "kind" : "LiteralInteger", "name" : "size" },
- { "kind" : "LiteralString", "name" : "pValues" },
- { "kind" : "LiteralInteger", "name" : "stageFlags" }
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "size" },
+ { "kind" : "IdRef", "name" : "pValues" },
+ { "kind" : "IdRef", "name" : "stageFlags" }
]
},
{
"opname" : "SpecializationMapEntry",
"opcode" : 5,
"operands" : [
- {"kind" : "LiteralInteger", "name" : "constantID" },
- {"kind" : "LiteralInteger", "name" : "offset" },
- {"kind" : "LiteralInteger", "name" : "size" }
+ {"kind" : "IdRef", "name" : "constantID" },
+ {"kind" : "IdRef", "name" : "offset" },
+ {"kind" : "IdRef", "name" : "size" }
]
},
{
"opname" : "DescriptorSetBuffer",
"opcode" : 6,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "ds" },
- { "kind" : "LiteralInteger", "name" : "binding" },
- { "kind" : "LiteralInteger", "name" : "type" },
- { "kind" : "LiteralInteger", "name" : "flags" },
- { "kind" : "LiteralInteger", "name" : "queueFamilyIndexCount" },
- { "kind" : "LiteralInteger", "name" : "sharingMode" },
- { "kind" : "LiteralInteger", "name" : "size" },
- { "kind" : "LiteralInteger", "name" : "usage" },
- { "kind" : "LiteralInteger", "name" : "range" },
- { "kind" : "LiteralInteger", "name" : "offset" },
- { "kind" : "LiteralInteger", "name" : "memorySize" },
- { "kind" : "LiteralInteger", "name" : "memoryType" },
- { "kind" : "LiteralInteger", "name" : "bindOffset" }
+ { "kind" : "IdRef", "name" : "ds" },
+ { "kind" : "IdRef", "name" : "binding" },
+ { "kind" : "IdRef", "name" : "type" },
+ { "kind" : "IdRef", "name" : "flags" },
+ { "kind" : "IdRef", "name" : "queueFamilyIndexCount" },
+ { "kind" : "IdRef", "name" : "sharingMode" },
+ { "kind" : "IdRef", "name" : "size" },
+ { "kind" : "IdRef", "name" : "usage" },
+ { "kind" : "IdRef", "name" : "range" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "memorySize" },
+ { "kind" : "IdRef", "name" : "memoryType" },
+ { "kind" : "IdRef", "name" : "bindOffset" },
+ { "kind" : "IdRef", "name" : "viewFlags" },
+ { "kind" : "IdRef", "name" : "viewFormat" }
]
},
{
"opname" : "DescriptorSetImage",
"opcode" : 7,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "ds" },
- { "kind" : "LiteralInteger", "name" : "binding" },
- { "kind" : "LiteralInteger", "name" : "type" },
- { "kind" : "LiteralInteger", "name" : "imageLayout"},
- { "kind" : "LiteralInteger", "name" : "imageFlags"},
- { "kind" : "LiteralInteger", "name" : "imageType"},
- { "kind" : "LiteralInteger", "name" : "imageformat"},
- { "kind" : "LiteralInteger", "name" : "width"},
- { "kind" : "LiteralInteger", "name" : "height"},
- { "kind" : "LiteralInteger", "name" : "depth"},
- { "kind" : "LiteralInteger", "name" : "mipLevels"},
- { "kind" : "LiteralInteger", "name" : "arrayLayers"},
- { "kind" : "LiteralInteger", "name" : "samples"},
- { "kind" : "LiteralInteger", "name" : "tiling"},
- { "kind" : "LiteralInteger", "name" : "usage"},
- { "kind" : "LiteralInteger", "name" : "sharingMode"},
- { "kind" : "LiteralInteger", "name" : "queueFamilyIndexCount"},
- { "kind" : "LiteralInteger", "name" : "initialLayout"},
- { "kind" : "LiteralInteger", "name" : "aspectMask"},
- { "kind" : "LiteralInteger", "name" : "baseMipLevel"},
- { "kind" : "LiteralInteger", "name" : "levelCount"},
- { "kind" : "LiteralInteger", "name" : "baseArrayLayer"},
- { "kind" : "LiteralInteger", "name" : "layerCount"},
- { "kind" : "LiteralInteger", "name" : "viewFlags"},
- { "kind" : "LiteralInteger", "name" : "viewType"},
- { "kind" : "LiteralInteger", "name" : "viewFormat"},
- { "kind" : "LiteralInteger", "name" : "component_a"},
- { "kind" : "LiteralInteger", "name" : "component_b"},
- { "kind" : "LiteralInteger", "name" : "component_g"},
- { "kind" : "LiteralInteger", "name" : "component_r"},
- { "kind" : "LiteralInteger", "name" : "memorySize" },
- { "kind" : "LiteralInteger", "name" : "memoryType" },
- { "kind" : "LiteralInteger", "name" : "bindOffset"}
+ { "kind" : "IdRef", "name" : "ds" },
+ { "kind" : "IdRef", "name" : "binding" },
+ { "kind" : "IdRef", "name" : "type" },
+ { "kind" : "IdRef", "name" : "imageLayout"},
+ { "kind" : "IdRef", "name" : "imageFlags"},
+ { "kind" : "IdRef", "name" : "imageType"},
+ { "kind" : "IdRef", "name" : "imageformat"},
+ { "kind" : "IdRef", "name" : "width"},
+ { "kind" : "IdRef", "name" : "height"},
+ { "kind" : "IdRef", "name" : "depth"},
+ { "kind" : "IdRef", "name" : "mipLevels"},
+ { "kind" : "IdRef", "name" : "arrayLayers"},
+ { "kind" : "IdRef", "name" : "samples"},
+ { "kind" : "IdRef", "name" : "tiling"},
+ { "kind" : "IdRef", "name" : "usage"},
+ { "kind" : "IdRef", "name" : "sharingMode"},
+ { "kind" : "IdRef", "name" : "queueFamilyIndexCount"},
+ { "kind" : "IdRef", "name" : "initialLayout"},
+ { "kind" : "IdRef", "name" : "aspectMask"},
+ { "kind" : "IdRef", "name" : "baseMipLevel"},
+ { "kind" : "IdRef", "name" : "levelCount"},
+ { "kind" : "IdRef", "name" : "baseArrayLayer"},
+ { "kind" : "IdRef", "name" : "layerCount"},
+ { "kind" : "IdRef", "name" : "viewFlags"},
+ { "kind" : "IdRef", "name" : "viewType"},
+ { "kind" : "IdRef", "name" : "viewFormat"},
+ { "kind" : "IdRef", "name" : "component_a"},
+ { "kind" : "IdRef", "name" : "component_b"},
+ { "kind" : "IdRef", "name" : "component_g"},
+ { "kind" : "IdRef", "name" : "component_r"},
+ { "kind" : "IdRef", "name" : "memorySize" },
+ { "kind" : "IdRef", "name" : "memoryType" },
+ { "kind" : "IdRef", "name" : "bindOffset"}
]
},
{
"opname" : "DescriptorSetSampler",
"opcode" : 8,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "ds" },
- { "kind" : "LiteralInteger", "name" : "binding" },
- { "kind" : "LiteralInteger", "name" : "type" },
- { "kind" : "LiteralInteger", "name" : "flags"},
- { "kind" : "LiteralInteger", "name" : "magFilter"},
- { "kind" : "LiteralInteger", "name" : "minFilter"},
- { "kind" : "LiteralInteger", "name" : "mipmapMode"},
- { "kind" : "LiteralInteger", "name" : "addressModeU"},
- { "kind" : "LiteralInteger", "name" : "addressModeV"},
- { "kind" : "LiteralInteger", "name" : "addressModeW"},
- { "kind" : "LiteralFloat", "name" : "mipLodBias"},
- { "kind" : "LiteralInteger", "name" : "anisotropyEnable"},
- { "kind" : "LiteralFloat", "name" : "maxAnisotropy"},
- { "kind" : "LiteralInteger", "name" : "compareEnable"},
- { "kind" : "LiteralInteger", "name" : "compareOp"},
- { "kind" : "LiteralFloat", "name" : "minLod"},
- { "kind" : "LiteralFloat", "name" : "maxLod"},
- { "kind" : "LiteralInteger", "name" : "borderColor"},
- { "kind" : "LiteralInteger", "name" : "unnormalizedCoordinates"}
+ { "kind" : "IdRef", "name" : "ds" },
+ { "kind" : "IdRef", "name" : "binding" },
+ { "kind" : "IdRef", "name" : "type" },
+ { "kind" : "IdRef", "name" : "flags"},
+ { "kind" : "IdRef", "name" : "magFilter"},
+ { "kind" : "IdRef", "name" : "minFilter"},
+ { "kind" : "IdRef", "name" : "mipmapMode"},
+ { "kind" : "IdRef", "name" : "addressModeU"},
+ { "kind" : "IdRef", "name" : "addressModeV"},
+ { "kind" : "IdRef", "name" : "addressModeW"},
+ { "kind" : "IdRef", "name" : "mipLodBias"},
+ { "kind" : "IdRef", "name" : "anisotropyEnable"},
+ { "kind" : "IdRef", "name" : "maxAnisotropy"},
+ { "kind" : "IdRef", "name" : "compareEnable"},
+ { "kind" : "IdRef", "name" : "compareOp"},
+ { "kind" : "IdRef", "name" : "minLod"},
+ { "kind" : "IdRef", "name" : "maxLod"},
+ { "kind" : "IdRef", "name" : "borderColor"},
+ { "kind" : "IdRef", "name" : "unnormalizedCoordinates"}
]
}
]
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
index 53b001c..6d4d6e3 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2018-2024 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.",
+ "Copyright: 2018-2024 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 200,
"revision" : 2,
@@ -35,256 +19,256 @@
"opname" : "DebugCompilationUnit",
"opcode" : 1,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "'Version'" },
- { "kind" : "LiteralInteger", "name" : "'DWARF Version'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "SourceLanguage", "name" : "'Language'" }
+ { "kind" : "LiteralInteger", "name" : "Version" },
+ { "kind" : "LiteralInteger", "name" : "DWARF Version" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "SourceLanguage", "name" : "Language" }
]
},
{
"opname" : "DebugTypeBasic",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugBaseTypeAttributeEncoding", "name" : "Encoding" }
]
},
{
"opname" : "DebugTypePointer",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "StorageClass", "name" : "'Storage Class'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "StorageClass", "name" : "Storage Class" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" }
]
},
{
"opname" : "DebugTypeQualifier",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "DebugTypeQualifier", "name" : "Type Qualifier" }
]
},
{
"opname" : "DebugTypeArray",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Component Counts", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeVector",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "LiteralInteger", "name" : "'Component Count'" }
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "LiteralInteger", "name" : "Component Count" }
]
},
{
"opname" : "DebugTypedef",
"opcode" : 7,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Base Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugTypeFunction",
"opcode" : 8,
"operands" : [
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Return Type'" },
- { "kind" : "IdRef", "name" : "'Parameter Types'", "quantifier" : "*" }
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Return Type" },
+ { "kind" : "IdRef", "name" : "Parameter Types", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeEnum",
"opcode" : 9,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Underlying Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Underlying Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "PairIdRefIdRef", "name" : "Value, Name, Value, Name, ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeComposite",
"opcode" : 10,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "DebugCompositeType", "name" : "'Tag'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "DebugCompositeType", "name" : "Tag" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Members", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeMember",
"opcode" : 11,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Value", "quantifier" : "?" }
]
},
{
"opname" : "DebugTypeInheritance",
"opcode" : 12,
"operands" : [
- { "kind" : "IdRef", "name" : "'Child'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Size'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Child" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" }
]
},
{
"opname" : "DebugTypePtrToMember",
"opcode" : 13,
"operands" : [
- { "kind" : "IdRef", "name" : "'Member Type'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Member Type" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugTypeTemplate",
"opcode" : 14,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Parameters", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeTemplateParameter",
"opcode" : 15,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Actual Type'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Actual Type" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" }
]
},
{
"opname" : "DebugTypeTemplateTemplateParameter",
"opcode" : 16,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Template Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Template Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" }
]
},
{
"opname" : "DebugTypeTemplateParameterPack",
"opcode" : 17,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Template Parameters", "quantifier" : "*" }
]
},
{
"opname" : "DebugGlobalVariable",
"opcode" : 18,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "Static Member Declaration", "quantifier" : "?" }
]
},
{
"opname" : "DebugFunctionDeclaration",
"opcode" : 19,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" }
]
},
{
"opname" : "DebugFunction",
"opcode" : 20,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Linkage Name'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "LiteralInteger", "name" : "'Scope Line'" },
- { "kind" : "IdRef", "name" : "'Function'" },
- { "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Linkage Name" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "LiteralInteger", "name" : "Scope Line" },
+ { "kind" : "IdRef", "name" : "Function" },
+ { "kind" : "IdRef", "name" : "Declaration", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlock",
"opcode" : 21,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "IdRef", "name" : "Name", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlockDiscriminator",
"opcode" : 22,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Discriminator'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Discriminator" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugScope",
"opcode" : 23,
"operands" : [
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Inlined At", "quantifier" : "?" }
]
},
{
@@ -295,119 +279,119 @@
"opname" : "DebugInlinedAt",
"opcode" : 25,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" }
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Inlined", "quantifier" : "?" }
]
},
{
"opname" : "DebugLocalVariable",
"opcode" : 26,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "DebugInfoFlags", "name" : "'Flags'" },
- { "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "DebugInfoFlags", "name" : "Flags" },
+ { "kind" : "LiteralInteger", "name" : "Arg Number", "quantifier" : "?" }
]
},
{
"opname" : "DebugInlinedVariable",
"opcode" : 27,
"operands" : [
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Inlined'" }
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Inlined" }
]
},
{
"opname" : "DebugDeclare",
"opcode" : 28,
"operands" : [
- { "kind" : "IdRef", "name" : "'Local Variable'" },
- { "kind" : "IdRef", "name" : "'Variable'" },
- { "kind" : "IdRef", "name" : "'Expression'" }
+ { "kind" : "IdRef", "name" : "Local Variable" },
+ { "kind" : "IdRef", "name" : "Variable" },
+ { "kind" : "IdRef", "name" : "Expression" }
]
},
{
"opname" : "DebugValue",
"opcode" : 29,
"operands" : [
- { "kind" : "IdRef", "name" : "'Local Variable'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Expression'" },
- { "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Local Variable" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Expression" },
+ { "kind" : "IdRef", "name" : "Indexes", "quantifier" : "*" }
]
},
{
"opname" : "DebugOperation",
"opcode" : 30,
"operands" : [
- { "kind" : "DebugOperation", "name" : "'OpCode'" },
- { "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" }
+ { "kind" : "DebugOperation", "name" : "OpCode" },
+ { "kind" : "LiteralInteger", "name" : "Operands ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugExpression",
"opcode" : 31,
"operands" : [
- { "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "Operands ...", "quantifier" : "*" }
]
},
{
"opname" : "DebugMacroDef",
"opcode" : 32,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Value", "quantifier" : "?" }
]
},
{
"opname" : "DebugMacroUndef",
"opcode" : 33,
"operands" : [
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'Macro'" }
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "Macro" }
]
},
{
"opname" : "DebugImportedEntity",
"opcode" : 34,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "DebugImportedEntity", "name" : "'Tag'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Entity'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" },
- { "kind" : "IdRef", "name" : "'Parent'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "DebugImportedEntity", "name" : "Tag" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Entity" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" },
+ { "kind" : "IdRef", "name" : "Parent" }
]
},
{
"opname" : "DebugSource",
"opcode" : 35,
"operands" : [
- { "kind" : "IdRef", "name" : "'File'" },
- { "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "File" },
+ { "kind" : "IdRef", "name" : "Text", "quantifier" : "?" }
]
},
{
"opname" : "DebugModuleINTEL",
"opcode" : 36,
"operands" : [
- { "kind" : "IdRef", "name" : "'Name'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Parent'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "IdRef", "name" : "'ConfigurationMacros'" },
- { "kind" : "IdRef", "name" : "'IncludePath'" },
- { "kind" : "IdRef", "name" : "'APINotesFile'" },
- { "kind" : "LiteralInteger", "name" : "'IsDeclaration'" }
+ { "kind" : "IdRef", "name" : "Name" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Parent" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "IdRef", "name" : "ConfigurationMacros" },
+ { "kind" : "IdRef", "name" : "IncludePath" },
+ { "kind" : "IdRef", "name" : "APINotesFile" },
+ { "kind" : "LiteralInteger", "name" : "IsDeclaration" }
],
"capability" : "DebugInfoModuleINTEL"
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json
index 21b7876..79394dd 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.opencl.std.100.grammar.json
@@ -1,28 +1,12 @@
{
"copyright" : [
- "Copyright (c) 2014-2024 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.",
+ "Copyright: 2014-2024 The Khronos Group Inc.",
+ "License: MIT",
"",
"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."
+ ""
],
"version" : 100,
"revision" : 2,
@@ -31,1248 +15,1248 @@
"opname" : "acos",
"opcode" : 0,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "acosh",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "acospi",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "asin",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "asinh",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "asinpi",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "atan",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "atan2",
"opcode" : 7,
"operands" : [
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "atanh",
"opcode" : 8,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "atanpi",
"opcode" : 9,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "atan2pi",
"opcode" : 10,
"operands" : [
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "cbrt",
"opcode" : 11,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "ceil",
"opcode" : 12,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "copysign",
"opcode" : 13,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "cos",
"opcode" : 14,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "cosh",
"opcode" : 15,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "cospi",
"opcode" : 16,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "erfc",
"opcode" : 17,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "erf",
"opcode" : 18,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "exp",
"opcode" : 19,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "exp2",
"opcode" : 20,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "exp10",
"opcode" : 21,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "expm1",
"opcode" : 22,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "fabs",
"opcode" : 23,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "fdim",
"opcode" : 24,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "floor",
"opcode" : 25,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "fma",
"opcode" : 26,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "fmax",
"opcode" : 27,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "fmin",
"opcode" : 28,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "fmod",
"opcode" : 29,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "fract",
"opcode" : 30,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'ptr'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "ptr" }
]
},
{
"opname" : "frexp",
"opcode" : 31,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'exp'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "exp" }
]
},
{
"opname" : "hypot",
"opcode" : 32,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "ilogb",
"opcode" : 33,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "ldexp",
"opcode" : 34,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'k'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "k" }
]
},
{
"opname" : "lgamma",
"opcode" : 35,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "lgamma_r",
"opcode" : 36,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'signp'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "signp" }
]
},
{
"opname" : "log",
"opcode" : 37,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "log2",
"opcode" : 38,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "log10",
"opcode" : 39,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "log1p",
"opcode" : 40,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "logb",
"opcode" : 41,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "mad",
"opcode" : 42,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "maxmag",
"opcode" : 43,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "minmag",
"opcode" : 44,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "modf",
"opcode" : 45,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'iptr'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "iptr" }
]
},
{
"opname" : "nan",
"opcode" : 46,
"operands" : [
- { "kind" : "IdRef", "name" : "'nancode'" }
+ { "kind" : "IdRef", "name" : "nancode" }
]
},
{
"opname" : "nextafter",
"opcode" : 47,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "pow",
"opcode" : 48,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "pown",
"opcode" : 49,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "powr",
"opcode" : 50,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "remainder",
"opcode" : 51,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "remquo",
"opcode" : 52,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'quo'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "quo" }
]
},
{
"opname" : "rint",
"opcode" : 53,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "rootn",
"opcode" : 54,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "round",
"opcode" : 55,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "rsqrt",
"opcode" : 56,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "sin",
"opcode" : 57,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "sincos",
"opcode" : 58,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'cosval'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "cosval" }
]
},
{
"opname" : "sinh",
"opcode" : 59,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "sinpi",
"opcode" : 60,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "sqrt",
"opcode" : 61,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "tan",
"opcode" : 62,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "tanh",
"opcode" : 63,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "tanpi",
"opcode" : 64,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "tgamma",
"opcode" : 65,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "trunc",
"opcode" : 66,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_cos",
"opcode" : 67,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_divide",
"opcode" : 68,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "half_exp",
"opcode" : 69,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_exp2",
"opcode" : 70,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_exp10",
"opcode" : 71,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_log",
"opcode" : 72,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_log2",
"opcode" : 73,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_log10",
"opcode" : 74,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_powr",
"opcode" : 75,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "half_recip",
"opcode" : 76,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_rsqrt",
"opcode" : 77,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_sin",
"opcode" : 78,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_sqrt",
"opcode" : 79,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "half_tan",
"opcode" : 80,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_cos",
"opcode" : 81,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_divide",
"opcode" : 82,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "native_exp",
"opcode" : 83,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_exp2",
"opcode" : 84,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_exp10",
"opcode" : 85,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_log",
"opcode" : 86,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_log2",
"opcode" : 87,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_log10",
"opcode" : 88,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_powr",
"opcode" : 89,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "native_recip",
"opcode" : 90,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_rsqrt",
"opcode" : 91,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_sin",
"opcode" : 92,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_sqrt",
"opcode" : 93,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "native_tan",
"opcode" : 94,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "s_abs",
"opcode" : 141,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "s_abs_diff",
"opcode" : 142,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "s_add_sat",
"opcode" : 143,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_add_sat",
"opcode" : 144,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "s_hadd",
"opcode" : 145,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_hadd",
"opcode" : 146,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "s_rhadd",
"opcode" : 147,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_rhadd",
"opcode" : 148,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "s_clamp",
"opcode" : 149,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minval'" },
- { "kind" : "IdRef", "name" : "'maxval'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minval" },
+ { "kind" : "IdRef", "name" : "maxval" }
]
},
{
"opname" : "u_clamp",
"opcode" : 150,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minval'" },
- { "kind" : "IdRef", "name" : "'maxval'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minval" },
+ { "kind" : "IdRef", "name" : "maxval" }
]
},
{
"opname" : "clz",
"opcode" : 151,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "ctz",
"opcode" : 152,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "s_mad_hi",
"opcode" : 153,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "u_mad_sat",
"opcode" : 154,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
]
},
{
"opname" : "s_mad_sat",
"opcode" : 155,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
]
},
{
"opname" : "s_max",
"opcode" : 156,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_max",
"opcode" : 157,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "s_min",
"opcode" : 158,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_min",
"opcode" : 159,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "s_mul_hi",
"opcode" : 160,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "rotate",
"opcode" : 161,
"operands" : [
- { "kind" : "IdRef", "name" : "'v'" },
- { "kind" : "IdRef", "name" : "'i'" }
+ { "kind" : "IdRef", "name" : "v" },
+ { "kind" : "IdRef", "name" : "i" }
]
},
{
"opname" : "s_sub_sat",
"opcode" : 162,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_sub_sat",
"opcode" : 163,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_upsample",
"opcode" : 164,
"operands" : [
- { "kind" : "IdRef", "name" : "'hi'" },
- { "kind" : "IdRef", "name" : "'lo'" }
+ { "kind" : "IdRef", "name" : "hi" },
+ { "kind" : "IdRef", "name" : "lo" }
]
},
{
"opname" : "s_upsample",
"opcode" : 165,
"operands" : [
- { "kind" : "IdRef", "name" : "'hi'" },
- { "kind" : "IdRef", "name" : "'lo'" }
+ { "kind" : "IdRef", "name" : "hi" },
+ { "kind" : "IdRef", "name" : "lo" }
]
},
{
"opname" : "popcount",
"opcode" : 166,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "s_mad24",
"opcode" : 167,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
]
},
{
"opname" : "u_mad24",
"opcode" : 168,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
]
},
{
"opname" : "s_mul24",
"opcode" : 169,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_mul24",
"opcode" : 170,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_abs",
"opcode" : 201,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "u_abs_diff",
"opcode" : 202,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_mul_hi",
"opcode" : 203,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "u_mad_hi",
"opcode" : 204,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "fclamp",
"opcode" : 95,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'minval'" },
- { "kind" : "IdRef", "name" : "'maxval'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "minval" },
+ { "kind" : "IdRef", "name" : "maxval" }
]
},
{
"opname" : "degrees",
"opcode" :96,
"operands" : [
- { "kind" : "IdRef", "name" : "'radians'" }
+ { "kind" : "IdRef", "name" : "radians" }
]
},
{
"opname" : "fmax_common",
"opcode" : 97,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "fmin_common",
"opcode" : 98,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
]
},
{
"opname" : "mix",
"opcode" : 99,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'a'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "a" }
]
},
{
"opname" : "radians",
"opcode" : 100,
"operands" : [
- { "kind" : "IdRef", "name" : "'degrees'" }
+ { "kind" : "IdRef", "name" : "degrees" }
]
},
{
"opname" : "step",
"opcode" : 101,
"operands" : [
- { "kind" : "IdRef", "name" : "'edge'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "edge" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "smoothstep",
"opcode" : 102,
"operands" : [
- { "kind" : "IdRef", "name" : "'edge0'" },
- { "kind" : "IdRef", "name" : "'edge1'" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "edge0" },
+ { "kind" : "IdRef", "name" : "edge1" },
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "sign",
"opcode" : 103,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
]
},
{
"opname" : "cross",
"opcode" : 104,
"operands" : [
- { "kind" : "IdRef", "name" : "'p0'" },
- { "kind" : "IdRef", "name" : "'p1'" }
+ { "kind" : "IdRef", "name" : "p0" },
+ { "kind" : "IdRef", "name" : "p1" }
]
},
{
"opname" : "distance",
"opcode" : 105,
"operands" : [
- { "kind" : "IdRef", "name" : "'p0'" },
- { "kind" : "IdRef", "name" : "'p1'" }
+ { "kind" : "IdRef", "name" : "p0" },
+ { "kind" : "IdRef", "name" : "p1" }
]
},
{
"opname" : "length",
"opcode" : 106,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "normalize",
"opcode" : 107,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "fast_distance",
"opcode" : 108,
"operands" : [
- { "kind" : "IdRef", "name" : "'p0'" },
- { "kind" : "IdRef", "name" : "'p1'" }
+ { "kind" : "IdRef", "name" : "p0" },
+ { "kind" : "IdRef", "name" : "p1" }
]
},
{
"opname" : "fast_length",
"opcode" : 109,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "fast_normalize",
"opcode" : 110,
"operands" : [
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "bitselect",
"opcode" : 186,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "select",
"opcode" : 187,
"operands" : [
- { "kind" : "IdRef", "name" : "'a'" },
- { "kind" : "IdRef", "name" : "'b'" },
- { "kind" : "IdRef", "name" : "'c'" }
+ { "kind" : "IdRef", "name" : "a" },
+ { "kind" : "IdRef", "name" : "b" },
+ { "kind" : "IdRef", "name" : "c" }
]
},
{
"opname" : "vloadn",
"opcode" : 171,
"operands" : [
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" },
- { "kind" : "LiteralInteger", "name" : "'n'" }
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" },
+ { "kind" : "LiteralInteger", "name" : "n" }
]
},
{
"opname" : "vstoren",
"opcode" : 172,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "vload_half",
"opcode" : 173,
"operands" : [
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "vload_halfn",
"opcode" : 174,
"operands" : [
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" },
- { "kind" : "LiteralInteger", "name" : "'n'" }
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" },
+ { "kind" : "LiteralInteger", "name" : "n" }
]
},
{
"opname" : "vstore_half",
"opcode" : 175,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "vstore_half_r",
"opcode" : 176,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" },
- { "kind" : "FPRoundingMode", "name" : "'mode'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" },
+ { "kind" : "FPRoundingMode", "name" : "mode" }
]
},
{
"opname" : "vstore_halfn",
"opcode" : 177,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "vstore_halfn_r",
"opcode" : 178,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" },
- { "kind" : "FPRoundingMode", "name" : "'mode'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" },
+ { "kind" : "FPRoundingMode", "name" : "mode" }
]
},
{
"opname" : "vloada_halfn",
"opcode" : 179,
"operands" : [
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" },
- { "kind" : "LiteralInteger", "name" : "'n'" }
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" },
+ { "kind" : "LiteralInteger", "name" : "n" }
]
},
{
"opname" : "vstorea_halfn",
"opcode" : 180,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" }
]
},
{
"opname" : "vstorea_halfn_r",
"opcode" : 181,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" },
- { "kind" : "IdRef", "name" : "'p'" },
- { "kind" : "FPRoundingMode", "name" : "'mode'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" },
+ { "kind" : "IdRef", "name" : "p" },
+ { "kind" : "FPRoundingMode", "name" : "mode" }
]
},
{
"opname" : "shuffle",
"opcode" : 182,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'shuffle mask'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "shuffle mask" }
]
},
{
"opname" : "shuffle2",
"opcode" : 183,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'shuffle mask'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "shuffle mask" }
]
},
{
"opname" : "printf",
"opcode" : 184,
"operands" : [
- { "kind" : "IdRef", "name" : "'format'" },
- { "kind" : "IdRef", "name" : "'additional arguments'", "quantifier" : "*" }
+ { "kind" : "IdRef", "name" : "format" },
+ { "kind" : "IdRef", "name" : "additional arguments", "quantifier" : "*" }
]
},
{
"opname" : "prefetch",
"opcode" : 185,
"operands" : [
- { "kind" : "IdRef", "name" : "'ptr'" },
- { "kind" : "IdRef", "name" : "'num elements'" }
+ { "kind" : "IdRef", "name" : "ptr" },
+ { "kind" : "IdRef", "name" : "num elements" }
]
}
]
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json
index e18251b..ed43f95 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json
@@ -5,7 +5,7 @@
"opname" : "CubeFaceIndexAMD",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"extensions" : [ "SPV_AMD_gcn_shader" ]
},
@@ -13,7 +13,7 @@
"opname" : "CubeFaceCoordAMD",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"extensions" : [ "SPV_AMD_gcn_shader" ]
},
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json
index 62a470e..936fd4e 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json
@@ -5,8 +5,8 @@
"opname" : "SwizzleInvocationsAMD",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'offset'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "offset" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
},
@@ -14,8 +14,8 @@
"opname" : "SwizzleInvocationsMaskedAMD",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'data'" },
- { "kind" : "IdRef", "name" : "'mask'" }
+ { "kind" : "IdRef", "name" : "data" },
+ { "kind" : "IdRef", "name" : "mask" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
},
@@ -23,9 +23,9 @@
"opname" : "WriteInvocationAMD",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'inputValue'" },
- { "kind" : "IdRef", "name" : "'writeValue'" },
- { "kind" : "IdRef", "name" : "'invocationIndex'" }
+ { "kind" : "IdRef", "name" : "inputValue" },
+ { "kind" : "IdRef", "name" : "writeValue" },
+ { "kind" : "IdRef", "name" : "invocationIndex" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
},
@@ -33,7 +33,7 @@
"opname" : "MbcntAMD",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'mask'" }
+ { "kind" : "IdRef", "name" : "mask" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json
index e156b1b..e5a8a01 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json
@@ -5,8 +5,8 @@
"opname" : "InterpolateAtVertexAMD",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'interpolant'" },
- { "kind" : "IdRef", "name" : "'vertexIdx'" }
+ { "kind" : "IdRef", "name" : "interpolant" },
+ { "kind" : "IdRef", "name" : "vertexIdx" }
],
"extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ]
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json
index c681976..0c7bf7d 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json
@@ -5,9 +5,9 @@
"opname" : "FMin3AMD",
"opcode" : 1,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -15,9 +15,9 @@
"opname" : "UMin3AMD",
"opcode" : 2,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -25,9 +25,9 @@
"opname" : "SMin3AMD",
"opcode" : 3,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -35,9 +35,9 @@
"opname" : "FMax3AMD",
"opcode" : 4,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -45,9 +45,9 @@
"opname" : "UMax3AMD",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -55,9 +55,9 @@
"opname" : "SMax3AMD",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -65,9 +65,9 @@
"opname" : "FMid3AMD",
"opcode" : 7,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -75,9 +75,9 @@
"opname" : "UMid3AMD",
"opcode" : 8,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
@@ -85,9 +85,9 @@
"opname" : "SMid3AMD",
"opcode" : 9,
"operands" : [
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" },
- { "kind" : "IdRef", "name" : "'z'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" },
+ { "kind" : "IdRef", "name" : "z" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/extinst.tosa.001000.1.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.tosa.001000.1.grammar.json
new file mode 100644
index 0000000..cabab82
--- /dev/null
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/extinst.tosa.001000.1.grammar.json
@@ -0,0 +1,1144 @@
+{
+ "copyright": [
+ "SPDX-FileCopyrightText: 2022-2025 Arm Ltd.",
+ "SPDX-License-Identifier: MIT"
+ ],
+ "version": 1000000,
+ "revision": 1,
+ "instructions": [
+ {
+ "opname": "ARGMAX",
+ "opcode": 0,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "AVG_POOL2D",
+ "opcode": 1,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "kernel"
+ },
+ {
+ "kind": "IdRef",
+ "name": "stride"
+ },
+ {
+ "kind": "IdRef",
+ "name": "pad"
+ },
+ {
+ "kind": "IdRef",
+ "name": "acc_type"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "output_zp"
+ }
+ ]
+ },
+ {
+ "opname": "CONV2D",
+ "opcode": 2,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "pad"
+ },
+ {
+ "kind": "IdRef",
+ "name": "stride"
+ },
+ {
+ "kind": "IdRef",
+ "name": "dilation"
+ },
+ {
+ "kind": "IdRef",
+ "name": "acc_type"
+ },
+ {
+ "kind": "IdRef",
+ "name": "local_bound"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight"
+ },
+ {
+ "kind": "IdRef",
+ "name": "bias"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight_zp"
+ }
+ ]
+ },
+ {
+ "opname": "CONV3D",
+ "opcode": 3,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "pad"
+ },
+ {
+ "kind": "IdRef",
+ "name": "stride"
+ },
+ {
+ "kind": "IdRef",
+ "name": "dilation"
+ },
+ {
+ "kind": "IdRef",
+ "name": "acc_type"
+ },
+ {
+ "kind": "IdRef",
+ "name": "local_bound"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight"
+ },
+ {
+ "kind": "IdRef",
+ "name": "bias"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight_zp"
+ }
+ ]
+ },
+ {
+ "opname": "DEPTHWISE_CONV2D",
+ "opcode": 4,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "pad"
+ },
+ {
+ "kind": "IdRef",
+ "name": "stride"
+ },
+ {
+ "kind": "IdRef",
+ "name": "dilation"
+ },
+ {
+ "kind": "IdRef",
+ "name": "acc_type"
+ },
+ {
+ "kind": "IdRef",
+ "name": "local_bound"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight"
+ },
+ {
+ "kind": "IdRef",
+ "name": "bias"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight_zp"
+ }
+ ]
+ },
+ {
+ "opname": "FFT2D",
+ "opcode": 5,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "inverse"
+ },
+ {
+ "kind": "IdRef",
+ "name": "local_bound"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_real"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_imag"
+ }
+ ]
+ },
+ {
+ "opname": "MATMUL",
+ "opcode": 6,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "A"
+ },
+ {
+ "kind": "IdRef",
+ "name": "B"
+ },
+ {
+ "kind": "IdRef",
+ "name": "A_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "B_zp"
+ }
+ ]
+ },
+ {
+ "opname": "MAX_POOL2D",
+ "opcode": 7,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "kernel"
+ },
+ {
+ "kind": "IdRef",
+ "name": "stride"
+ },
+ {
+ "kind": "IdRef",
+ "name": "pad"
+ },
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "RFFT2D",
+ "opcode": 8,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "local_bound"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_real"
+ }
+ ]
+ },
+ {
+ "opname": "TRANSPOSE_CONV2D",
+ "opcode": 9,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "out_pad"
+ },
+ {
+ "kind": "IdRef",
+ "name": "stride"
+ },
+ {
+ "kind": "IdRef",
+ "name": "acc_type"
+ },
+ {
+ "kind": "IdRef",
+ "name": "local_bound"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight"
+ },
+ {
+ "kind": "IdRef",
+ "name": "bias"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "weight_zp"
+ }
+ ]
+ },
+ {
+ "opname": "CLAMP",
+ "opcode": 10,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "min_val"
+ },
+ {
+ "kind": "IdRef",
+ "name": "max_val"
+ },
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "ERF",
+ "opcode": 11,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "SIGMOID",
+ "opcode": 12,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "TANH",
+ "opcode": 13,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "ADD",
+ "opcode": 14,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "ARITHMETIC_RIGHT_SHIFT",
+ "opcode": 15,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "round"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "BITWISE_AND",
+ "opcode": 16,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "BITWISE_OR",
+ "opcode": 17,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "BITWISE_XOR",
+ "opcode": 18,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "INTDIV",
+ "opcode": 19,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "LOGICAL_AND",
+ "opcode": 20,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "LOGICAL_LEFT_SHIFT",
+ "opcode": 21,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "LOGICAL_RIGHT_SHIFT",
+ "opcode": 22,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "LOGICAL_OR",
+ "opcode": 23,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "LOGICAL_XOR",
+ "opcode": 24,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "MAXIMUM",
+ "opcode": 25,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "MINIMUM",
+ "opcode": 26,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "MUL",
+ "opcode": 27,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ },
+ {
+ "kind": "IdRef",
+ "name": "shift"
+ }
+ ]
+ },
+ {
+ "opname": "POW",
+ "opcode": 28,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "SUB",
+ "opcode": 29,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "TABLE",
+ "opcode": 30,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "table"
+ }
+ ]
+ },
+ {
+ "opname": "ABS",
+ "opcode": 31,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "BITWISE_NOT",
+ "opcode": 32,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "CEIL",
+ "opcode": 33,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "CLZ",
+ "opcode": 34,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "COS",
+ "opcode": 35,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "EXP",
+ "opcode": 36,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "FLOOR",
+ "opcode": 37,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "LOG",
+ "opcode": 38,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "LOGICAL_NOT",
+ "opcode": 39,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "NEGATE",
+ "opcode": 40,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "output_zp"
+ }
+ ]
+ },
+ {
+ "opname": "RECIPROCAL",
+ "opcode": 41,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "RSQRT",
+ "opcode": 42,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "SIN",
+ "opcode": 43,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "SELECT",
+ "opcode": 44,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input3"
+ }
+ ]
+ },
+ {
+ "opname": "EQUAL",
+ "opcode": 45,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "GREATER",
+ "opcode": 46,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "GREATER_EQUAL",
+ "opcode": 47,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input2"
+ }
+ ]
+ },
+ {
+ "opname": "REDUCE_ALL",
+ "opcode": 48,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "REDUCE_ANY",
+ "opcode": 49,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "REDUCE_MAX",
+ "opcode": 50,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "REDUCE_MIN",
+ "opcode": 51,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "nan_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "REDUCE_PRODUCT",
+ "opcode": 52,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "REDUCE_SUM",
+ "opcode": 53,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "CONCAT",
+ "opcode": 54,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1",
+ "quantifier": "*"
+ }
+ ]
+ },
+ {
+ "opname": "PAD",
+ "opcode": 55,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "padding"
+ },
+ {
+ "kind": "IdRef",
+ "name": "pad_const"
+ }
+ ]
+ },
+ {
+ "opname": "RESHAPE",
+ "opcode": 56,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "shape"
+ }
+ ]
+ },
+ {
+ "opname": "REVERSE",
+ "opcode": 57,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "axis"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "SLICE",
+ "opcode": 58,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "start"
+ },
+ {
+ "kind": "IdRef",
+ "name": "size"
+ }
+ ]
+ },
+ {
+ "opname": "TILE",
+ "opcode": 59,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ },
+ {
+ "kind": "IdRef",
+ "name": "multiples"
+ }
+ ]
+ },
+ {
+ "opname": "TRANSPOSE",
+ "opcode": 60,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "perms"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input1"
+ }
+ ]
+ },
+ {
+ "opname": "GATHER",
+ "opcode": 61,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "values"
+ },
+ {
+ "kind": "IdRef",
+ "name": "indices"
+ }
+ ]
+ },
+ {
+ "opname": "SCATTER",
+ "opcode": 62,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "values_in"
+ },
+ {
+ "kind": "IdRef",
+ "name": "indices"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "RESIZE",
+ "opcode": 63,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "scale"
+ },
+ {
+ "kind": "IdRef",
+ "name": "offset"
+ },
+ {
+ "kind": "IdRef",
+ "name": "border"
+ }
+ ]
+ },
+ {
+ "opname": "CAST",
+ "opcode": 64,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "input"
+ }
+ ]
+ },
+ {
+ "opname": "RESCALE",
+ "opcode": 65,
+ "operands": [
+ {
+ "kind": "IdRef",
+ "name": "scale32"
+ },
+ {
+ "kind": "IdRef",
+ "name": "rounding_mode"
+ },
+ {
+ "kind": "IdRef",
+ "name": "per_channel"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_unsigned"
+ },
+ {
+ "kind": "IdRef",
+ "name": "output_unsigned"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input"
+ },
+ {
+ "kind": "IdRef",
+ "name": "multiplier"
+ },
+ {
+ "kind": "IdRef",
+ "name": "shift"
+ },
+ {
+ "kind": "IdRef",
+ "name": "input_zp"
+ },
+ {
+ "kind": "IdRef",
+ "name": "output_zp"
+ }
+ ]
+ }
+ ],
+ "operand_kinds": []
+}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.bf b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.bf
index 92b95c8..0b153d4 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.bf
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.bf
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 The Khronos Group Inc.
+// Copyright: 2014-2024 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
@@ -71,6 +55,8 @@
WGSL = 10,
Slang = 11,
Zig = 12,
+ Rust = 13,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ExecutionModel
@@ -98,6 +84,7 @@
CallableNV = 5318,
TaskEXT = 5364,
MeshEXT = 5365,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum AddressingModel
@@ -107,6 +94,7 @@
Physical64 = 2,
PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum MemoryModel
@@ -116,6 +104,7 @@
OpenCL = 2,
Vulkan = 3,
VulkanKHR = 3,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ExecutionMode
@@ -168,9 +157,12 @@
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ NonCoherentTileAttachmentReadQCOM = 4489,
+ TileShadingRateQCOM = 4490,
EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
CoalescingAMDX = 5069,
+ IsApiEntryAMDX = 5070,
MaxNodeRecursionAMDX = 5071,
StaticNumWorkgroupsAMDX = 5072,
ShaderIndexAMDX = 5073,
@@ -183,11 +175,14 @@
StencilRefLessBackAMD = 5084,
QuadDerivativesKHR = 5088,
RequireFullQuadsKHR = 5089,
+ SharesInputWithAMDX = 5102,
OutputLinesEXT = 5269,
OutputLinesNV = 5269,
OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
+ DerivativeGroupQuadsKHR = 5289,
DerivativeGroupQuadsNV = 5289,
+ DerivativeGroupLinearKHR = 5290,
DerivativeGroupLinearNV = 5290,
OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
@@ -215,6 +210,7 @@
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum StorageClass
@@ -233,8 +229,8 @@
Image = 11,
StorageBuffer = 12,
TileImageEXT = 4172,
+ TileAttachmentQCOM = 4491,
NodePayloadAMDX = 5068,
- NodeOutputPayloadAMDX = 5076,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
@@ -254,6 +250,7 @@
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum Dim
@@ -266,6 +263,7 @@
Buffer = 5,
SubpassData = 6,
TileImageDataEXT = 4173,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum SamplerAddressingMode
@@ -275,12 +273,14 @@
Clamp = 2,
Repeat = 3,
RepeatMirrored = 4,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum SamplerFilterMode
{
Nearest = 0,
Linear = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ImageFormat
@@ -327,6 +327,7 @@
R8ui = 39,
R64ui = 40,
R64i = 41,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ImageChannelOrder
@@ -351,6 +352,7 @@
sRGBA = 17,
sBGRA = 18,
ABGR = 19,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ImageChannelDataType
@@ -372,8 +374,16 @@
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
+ UnormInt10X6EXT = 17,
UnsignedIntRaw10EXT = 19,
UnsignedIntRaw12EXT = 20,
+ UnormInt2_101010EXT = 21,
+ UnsignedInt10X6EXT = 22,
+ UnsignedInt12X4EXT = 23,
+ UnsignedInt14X2EXT = 24,
+ UnormInt12X4EXT = 25,
+ UnormInt14X2EXT = 26,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ImageOperandsShift
@@ -398,6 +408,7 @@
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum ImageOperandsMask
@@ -437,6 +448,7 @@
AllowReassoc = 17,
AllowReassocINTEL = 17,
AllowTransform = 18,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum FPFastMathModeMask
@@ -460,6 +472,7 @@
RTZ = 1,
RTP = 2,
RTN = 3,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum LinkageType
@@ -467,6 +480,7 @@
Export = 0,
Import = 1,
LinkOnceODR = 2,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum AccessQualifier
@@ -474,6 +488,7 @@
ReadOnly = 0,
WriteOnly = 1,
ReadWrite = 2,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum FunctionParameterAttribute
@@ -487,6 +502,7 @@
NoWrite = 6,
NoReadWrite = 7,
RuntimeAlignedINTEL = 5940,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum Decoration
@@ -538,6 +554,7 @@
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
+ SaturatedToLargestFloat8NormalConversionEXT = 4216,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
WeightTextureQCOM = 4487,
@@ -548,6 +565,10 @@
NodeMaxPayloadsAMDX = 5020,
TrackFinishWritingAMDX = 5078,
PayloadNodeNameAMDX = 5091,
+ PayloadNodeBaseIndexAMDX = 5098,
+ PayloadNodeSparseArrayAMDX = 5099,
+ PayloadNodeArraySizeAMDX = 5100,
+ PayloadDispatchIndirectAMDX = 5105,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
@@ -634,8 +655,10 @@
HostAccessINTEL = 6188,
InitModeINTEL = 6190,
ImplementInRegisterMapINTEL = 6191,
+ ConditionalINTEL = 6247,
CacheControlLoadINTEL = 6442,
CacheControlStoreINTEL = 6443,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum BuiltIn
@@ -703,6 +726,9 @@
DeviceIndex = 4438,
ViewIndex = 4440,
ShadingRateKHR = 4444,
+ TileOffsetQCOM = 4492,
+ TileDimensionQCOM = 4493,
+ TileApronSizeQCOM = 4494,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
@@ -711,7 +737,7 @@
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
- CoalescedInputCountAMDX = 5021,
+ RemainingRecursionLevelsAMDX = 5021,
ShaderIndexAMDX = 5073,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
@@ -771,19 +797,28 @@
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
+ HitIsSphereNV = 5359,
+ HitIsLSSNV = 5360,
+ HitSpherePositionNV = 5361,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
+ HitLSSPositionsNV = 5396,
HitKindFrontFacingMicroTriangleNV = 5405,
HitKindBackFacingMicroTriangleNV = 5406,
+ HitSphereRadiusNV = 5420,
+ HitLSSRadiiNV = 5421,
+ ClusterIDNV = 5436,
CullMaskKHR = 6021,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum SelectionControlShift
{
Flatten = 0,
DontFlatten = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum SelectionControlMask
@@ -814,6 +849,7 @@
NoFusionINTEL = 23,
LoopCountINTEL = 24,
MaxReinvocationDelayINTEL = 25,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum LoopControlMask
@@ -846,7 +882,9 @@
DontInline = 1,
Pure = 2,
Const = 3,
+ OptNoneEXT = 16,
OptNoneINTEL = 16,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum FunctionControlMask
@@ -856,6 +894,7 @@
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
+ OptNoneEXT = 0x00010000,
OptNoneINTEL = 0x00010000,
}
@@ -878,6 +917,7 @@
MakeVisible = 14,
MakeVisibleKHR = 14,
Volatile = 15,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum MemorySemanticsMask
@@ -915,6 +955,7 @@
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum MemoryAccessMask
@@ -943,6 +984,7 @@
QueueFamily = 5,
QueueFamilyKHR = 5,
ShaderCallKHR = 6,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum GroupOperation
@@ -954,6 +996,7 @@
PartitionedReduceNV = 6,
PartitionedInclusiveScanNV = 7,
PartitionedExclusiveScanNV = 8,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum KernelEnqueueFlags
@@ -961,11 +1004,13 @@
NoWait = 0,
WaitKernel = 1,
WaitWorkGroup = 2,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum KernelProfilingInfoShift
{
CmdExecTime = 0,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum KernelProfilingInfoMask
@@ -1050,6 +1095,13 @@
TileImageColorReadAccessEXT = 4166,
TileImageDepthReadAccessEXT = 4167,
TileImageStencilReadAccessEXT = 4168,
+ TensorsARM = 4174,
+ StorageTensorArrayDynamicIndexingARM = 4175,
+ StorageTensorArrayNonUniformIndexingARM = 4176,
+ GraphARM = 4191,
+ CooperativeMatrixLayoutsARM = 4201,
+ Float8EXT = 4212,
+ Float8CooperativeMatrixEXT = 4213,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -1079,11 +1131,14 @@
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayQueryKHR = 4472,
+ UntypedPointersKHR = 4473,
RayTraversalPrimitiveCullingKHR = 4478,
RayTracingKHR = 4479,
TextureSampleWeightedQCOM = 4484,
TextureBoxFilterQCOM = 4485,
TextureBlockMatchQCOM = 4486,
+ TileShadingQCOM = 4495,
+ CooperativeMatrixConversionQCOM = 4496,
TextureBlockMatch2QCOM = 4498,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
@@ -1094,6 +1149,11 @@
ShaderClockKHR = 5055,
ShaderEnqueueAMDX = 5067,
QuadControlKHR = 5087,
+ Int4TypeINTEL = 5112,
+ Int4CooperativeMatrixINTEL = 5114,
+ BFloat16TypeKHR = 5116,
+ BFloat16DotProductKHR = 5117,
+ BFloat16CooperativeMatrixKHR = 5118,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
@@ -1107,6 +1167,7 @@
MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
+ ComputeDerivativeGroupQuadsKHR = 5288,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
@@ -1144,6 +1205,7 @@
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
+ ComputeDerivativeGroupLinearKHR = 5350,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
@@ -1158,9 +1220,20 @@
ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
RayQueryPositionFetchKHR = 5391,
+ CooperativeVectorNV = 5394,
AtomicFloat16VectorNV = 5404,
RayTracingDisplacementMicromapNV = 5409,
RawAccessChainsNV = 5414,
+ RayTracingSpheresGeometryNV = 5418,
+ RayTracingLinearSweptSpheresGeometryNV = 5419,
+ CooperativeMatrixReductionsNV = 5430,
+ CooperativeMatrixConversionsNV = 5431,
+ CooperativeMatrixPerElementOperationsNV = 5432,
+ CooperativeMatrixTensorAddressingNV = 5433,
+ CooperativeMatrixBlockLoadsNV = 5434,
+ CooperativeVectorTrainingNV = 5435,
+ RayTracingClusterAccelerationStructureNV = 5437,
+ TensorAddressingNV = 5439,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
@@ -1213,28 +1286,43 @@
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
CooperativeMatrixKHR = 6022,
+ ReplicatedCompositesEXT = 6024,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
FloatControls2 = 6029,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongCompositesINTEL = 6089,
+ OptNoneEXT = 6094,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
BFloat16ConversionINTEL = 6115,
SplitBarrierINTEL = 6141,
+ ArithmeticFenceEXT = 6144,
FPGAClusterAttributesV2INTEL = 6150,
FPGAKernelAttributesv2INTEL = 6161,
+ TaskSequenceINTEL = 6162,
FPMaxErrorINTEL = 6169,
FPGALatencyControlINTEL = 6171,
FPGAArgumentInterfacesINTEL = 6174,
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
+ SubgroupBufferPrefetchINTEL = 6220,
+ Subgroup2DBlockIOINTEL = 6228,
+ Subgroup2DBlockTransformINTEL = 6229,
+ Subgroup2DBlockTransposeINTEL = 6230,
+ SubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ TernaryBitwiseFunctionINTEL = 6241,
+ SpecConditionalINTEL = 6245,
+ FunctionVariantsINTEL = 6246,
GroupUniformArithmeticKHR = 6400,
+ TensorFloat32RoundingINTEL = 6425,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
+ BindlessImagesINTEL = 6528,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum RayFlagsShift
@@ -1247,9 +1335,11 @@
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
+ SkipBuiltinPrimitivesNV = 8,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
ForceOpacityMicromap2StateEXT = 10,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum RayFlagsMask
@@ -1263,6 +1353,7 @@
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
+ SkipBuiltinPrimitivesNV = 0x00000100,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
ForceOpacityMicromap2StateEXT = 0x00000400,
@@ -1272,6 +1363,7 @@
{
RayQueryCandidateIntersectionKHR = 0,
RayQueryCommittedIntersectionKHR = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum RayQueryCommittedIntersectionType
@@ -1279,12 +1371,14 @@
RayQueryCommittedIntersectionNoneKHR = 0,
RayQueryCommittedIntersectionTriangleKHR = 1,
RayQueryCommittedIntersectionGeneratedKHR = 2,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum RayQueryCandidateIntersectionType
{
RayQueryCandidateIntersectionTriangleKHR = 0,
RayQueryCandidateIntersectionAABBKHR = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum FragmentShadingRateShift
@@ -1293,6 +1387,7 @@
Vertical4Pixels = 1,
Horizontal2Pixels = 2,
Horizontal4Pixels = 3,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum FragmentShadingRateMask
@@ -1308,12 +1403,14 @@
{
Preserve = 0,
FlushToZero = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum FPOperationMode
{
IEEE = 0,
ALT = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum QuantizationModes
@@ -1326,6 +1423,7 @@
RND_MIN_INF = 5,
RND_CONV = 6,
RND_CONV_ODD = 7,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum OverflowModes
@@ -1334,12 +1432,14 @@
SAT = 1,
SAT_ZERO = 2,
SAT_SYM = 3,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum PackedVectorFormat
{
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum CooperativeMatrixOperandsShift
@@ -1349,6 +1449,7 @@
MatrixCSignedComponentsKHR = 2,
MatrixResultSignedComponentsKHR = 3,
SaturatingAccumulationKHR = 4,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum CooperativeMatrixOperandsMask
@@ -1365,6 +1466,9 @@
{
RowMajorKHR = 0,
ColumnMajorKHR = 1,
+ RowBlockedInterleavedARM = 4202,
+ ColumnBlockedInterleavedARM = 4203,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum CooperativeMatrixUse
@@ -1372,12 +1476,74 @@
MatrixAKHR = 0,
MatrixBKHR = 1,
MatrixAccumulatorKHR = 2,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum CooperativeMatrixReduceShift
+ {
+ Row = 0,
+ Column = 1,
+ CooperativeMatrixReduce2x2 = 2,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum CooperativeMatrixReduceMask
+ {
+ MaskNone = 0,
+ Row = 0x00000001,
+ Column = 0x00000002,
+ CooperativeMatrixReduce2x2 = 0x00000004,
+ }
+
+ [AllowDuplicates, CRepr] public enum TensorClampMode
+ {
+ Undefined = 0,
+ Constant = 1,
+ ClampToEdge = 2,
+ Repeat = 3,
+ RepeatMirrored = 4,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum TensorAddressingOperandsShift
+ {
+ TensorView = 0,
+ DecodeFunc = 1,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum TensorAddressingOperandsMask
+ {
+ MaskNone = 0,
+ TensorView = 0x00000001,
+ DecodeFunc = 0x00000002,
+ }
+
+ [AllowDuplicates, CRepr] public enum TensorOperandsShift
+ {
+ NontemporalARM = 0,
+ OutOfBoundsValueARM = 1,
+ MakeElementAvailableARM = 2,
+ MakeElementVisibleARM = 3,
+ NonPrivateElementARM = 4,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum TensorOperandsMask
+ {
+ MaskNone = 0,
+ NontemporalARM = 0x00000001,
+ OutOfBoundsValueARM = 0x00000002,
+ MakeElementAvailableARM = 0x00000004,
+ MakeElementVisibleARM = 0x00000008,
+ NonPrivateElementARM = 0x00000010,
}
[AllowDuplicates, CRepr] public enum InitializationModeQualifier
{
InitOnDeviceReprogramINTEL = 0,
InitOnDeviceResetINTEL = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum HostAccessQualifier
@@ -1386,6 +1552,7 @@
ReadINTEL = 1,
WriteINTEL = 2,
ReadWriteINTEL = 3,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum LoadCacheControl
@@ -1395,6 +1562,7 @@
StreamingINTEL = 2,
InvalidateAfterReadINTEL = 3,
ConstCachedINTEL = 4,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum StoreCacheControl
@@ -1403,17 +1571,58 @@
WriteThroughINTEL = 1,
WriteBackINTEL = 2,
StreamingINTEL = 3,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum NamedMaximumNumberOfRegisters
{
AutoINTEL = 0,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum MatrixMultiplyAccumulateOperandsShift
+ {
+ MatrixASignedComponentsINTEL = 0,
+ MatrixBSignedComponentsINTEL = 1,
+ MatrixCBFloat16INTEL = 2,
+ MatrixResultBFloat16INTEL = 3,
+ MatrixAPackedInt8INTEL = 4,
+ MatrixBPackedInt8INTEL = 5,
+ MatrixAPackedInt4INTEL = 6,
+ MatrixBPackedInt4INTEL = 7,
+ MatrixATF32INTEL = 8,
+ MatrixBTF32INTEL = 9,
+ MatrixAPackedFloat16INTEL = 10,
+ MatrixBPackedFloat16INTEL = 11,
+ MatrixAPackedBFloat16INTEL = 12,
+ MatrixBPackedBFloat16INTEL = 13,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum MatrixMultiplyAccumulateOperandsMask
+ {
+ MaskNone = 0,
+ MatrixASignedComponentsINTEL = 0x00000001,
+ MatrixBSignedComponentsINTEL = 0x00000002,
+ MatrixCBFloat16INTEL = 0x00000004,
+ MatrixResultBFloat16INTEL = 0x00000008,
+ MatrixAPackedInt8INTEL = 0x00000010,
+ MatrixBPackedInt8INTEL = 0x00000020,
+ MatrixAPackedInt4INTEL = 0x00000040,
+ MatrixBPackedInt4INTEL = 0x00000080,
+ MatrixATF32INTEL = 0x00000100,
+ MatrixBTF32INTEL = 0x00000200,
+ MatrixAPackedFloat16INTEL = 0x00000400,
+ MatrixBPackedFloat16INTEL = 0x00000800,
+ MatrixAPackedBFloat16INTEL = 0x00001000,
+ MatrixBPackedBFloat16INTEL = 0x00002000,
}
[AllowDuplicates, CRepr] public enum RawAccessChainOperandsShift
{
RobustnessPerComponentNV = 0,
RobustnessPerElementNV = 1,
+ Max = 0x7fffffff,
}
[AllowDuplicates, CRepr] public enum RawAccessChainOperandsMask
@@ -1423,6 +1632,43 @@
RobustnessPerElementNV = 0x00000002,
}
+ [AllowDuplicates, CRepr] public enum FPEncoding
+ {
+ BFloat16KHR = 0,
+ Float8E4M3EXT = 4214,
+ Float8E5M2EXT = 4215,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum CooperativeVectorMatrixLayout
+ {
+ RowMajorNV = 0,
+ ColumnMajorNV = 1,
+ InferencingOptimalNV = 2,
+ TrainingOptimalNV = 3,
+ Max = 0x7fffffff,
+ }
+
+ [AllowDuplicates, CRepr] public enum ComponentType
+ {
+ Float16NV = 0,
+ Float32NV = 1,
+ Float64NV = 2,
+ SignedInt8NV = 3,
+ SignedInt16NV = 4,
+ SignedInt32NV = 5,
+ SignedInt64NV = 6,
+ UnsignedInt8NV = 7,
+ UnsignedInt16NV = 8,
+ UnsignedInt32NV = 9,
+ UnsignedInt64NV = 10,
+ SignedInt8PackedNV = 1000491000,
+ UnsignedInt8PackedNV = 1000491001,
+ FloatE4M3NV = 1000491002,
+ FloatE5M2NV = 1000491003,
+ Max = 0x7fffffff,
+ }
+
[AllowDuplicates, CRepr] public enum Op
{
OpNop = 0,
@@ -1772,14 +2018,35 @@
OpColorAttachmentReadEXT = 4160,
OpDepthAttachmentReadEXT = 4161,
OpStencilAttachmentReadEXT = 4162,
+ OpTypeTensorARM = 4163,
+ OpTensorReadARM = 4164,
+ OpTensorWriteARM = 4165,
+ OpTensorQuerySizeARM = 4166,
+ OpGraphConstantARM = 4181,
+ OpGraphEntryPointARM = 4182,
+ OpGraphARM = 4183,
+ OpGraphInputARM = 4184,
+ OpGraphSetOutputARM = 4185,
+ OpGraphEndARM = 4186,
+ OpTypeGraphARM = 4190,
OpTerminateInvocation = 4416,
+ OpTypeUntypedPointerKHR = 4417,
+ OpUntypedVariableKHR = 4418,
+ OpUntypedAccessChainKHR = 4419,
+ OpUntypedInBoundsAccessChainKHR = 4420,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
+ OpUntypedPtrAccessChainKHR = 4423,
+ OpUntypedInBoundsPtrAccessChainKHR = 4424,
+ OpUntypedArrayLengthKHR = 4425,
+ OpUntypedPrefetchKHR = 4426,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
+ OpExtInstWithForwardRefsKHR = 4433,
+ OpUntypedGroupAsyncCopyKHR = 4434,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
@@ -1802,6 +2069,9 @@
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
+ OpConstantCompositeReplicateEXT = 4461,
+ OpSpecConstantCompositeReplicateEXT = 4462,
+ OpCompositeConstructReplicateEXT = 4463,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@@ -1813,10 +2083,14 @@
OpImageBoxFilterQCOM = 4481,
OpImageBlockMatchSSDQCOM = 4482,
OpImageBlockMatchSADQCOM = 4483,
+ OpBitCastArrayQCOM = 4497,
OpImageBlockMatchWindowSSDQCOM = 4500,
OpImageBlockMatchWindowSADQCOM = 4501,
OpImageBlockMatchGatherSSDQCOM = 4502,
OpImageBlockMatchGatherSADQCOM = 4503,
+ OpCompositeConstructCoopMatQCOM = 4540,
+ OpCompositeExtractCoopMatQCOM = 4541,
+ OpExtractSubArrayQCOM = 4542,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@@ -1828,9 +2102,14 @@
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
- OpFinalizeNodePayloadsAMDX = 5075,
+ OpAllocateNodePayloadsAMDX = 5074,
+ OpEnqueueNodePayloadsAMDX = 5075,
+ OpTypeNodePayloadArrayAMDX = 5076,
OpFinishWritingNodePayloadAMDX = 5078,
- OpInitializeNodePayloadsAMDX = 5090,
+ OpNodePayloadArrayLengthAMDX = 5090,
+ OpIsNodePayloadValidAMDX = 5101,
+ OpConstantStringAMDX = 5103,
+ OpSpecConstantStringAMDX = 5104,
OpGroupNonUniformQuadAllKHR = 5110,
OpGroupNonUniformQuadAnyKHR = 5111,
OpHitObjectRecordHitMotionNV = 5249,
@@ -1867,12 +2146,20 @@
OpReorderThreadWithHintNV = 5280,
OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpTypeCooperativeVectorNV = 5288,
+ OpCooperativeVectorMatrixMulNV = 5289,
+ OpCooperativeVectorOuterProductAccumulateNV = 5290,
+ OpCooperativeVectorReduceSumAccumulateNV = 5291,
+ OpCooperativeVectorMatrixMulAddNV = 5292,
+ OpCooperativeMatrixConvertNV = 5293,
OpEmitMeshTasksEXT = 5294,
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
+ OpCooperativeVectorLoadNV = 5302,
+ OpCooperativeVectorStoreNV = 5303,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
@@ -1884,6 +2171,8 @@
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
+ OpRayQueryGetClusterIdNV = 5345,
+ OpHitObjectGetClusterIdNV = 5346,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
@@ -1891,9 +2180,26 @@
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
+ OpCooperativeMatrixReduceNV = 5366,
+ OpCooperativeMatrixLoadTensorNV = 5367,
+ OpCooperativeMatrixStoreTensorNV = 5368,
+ OpCooperativeMatrixPerElementOpNV = 5369,
+ OpTypeTensorLayoutNV = 5370,
+ OpTypeTensorViewNV = 5371,
+ OpCreateTensorLayoutNV = 5372,
+ OpTensorLayoutSetDimensionNV = 5373,
+ OpTensorLayoutSetStrideNV = 5374,
+ OpTensorLayoutSliceNV = 5375,
+ OpTensorLayoutSetClampValueNV = 5376,
+ OpCreateTensorViewNV = 5377,
+ OpTensorViewSetDimensionNV = 5378,
+ OpTensorViewSetStrideNV = 5379,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
+ OpTensorViewSetClipNV = 5382,
+ OpTensorLayoutSetBlockSizeNV = 5384,
+ OpCooperativeMatrixTransposeNV = 5390,
OpConvertUToImageNV = 5391,
OpConvertUToSamplerNV = 5392,
OpConvertImageToUNV = 5393,
@@ -1902,6 +2208,19 @@
OpConvertSampledImageToUNV = 5396,
OpSamplerImageAddressingModeNV = 5397,
OpRawAccessChainNV = 5398,
+ OpRayQueryGetIntersectionSpherePositionNV = 5427,
+ OpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ OpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ OpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ OpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ OpHitObjectGetSpherePositionNV = 5432,
+ OpHitObjectGetSphereRadiusNV = 5433,
+ OpHitObjectGetLSSPositionsNV = 5434,
+ OpHitObjectGetLSSRadiiNV = 5435,
+ OpHitObjectIsSphereHitNV = 5436,
+ OpHitObjectIsLSSHitNV = 5437,
+ OpRayQueryIsSphereHitNV = 5438,
+ OpRayQueryIsLSSHitNV = 5439,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -2148,6 +2467,27 @@
OpConvertBF16ToFINTEL = 6117,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
+ OpArithmeticFenceEXT = 6145,
+ OpTaskSequenceCreateINTEL = 6163,
+ OpTaskSequenceAsyncINTEL = 6164,
+ OpTaskSequenceGetINTEL = 6165,
+ OpTaskSequenceReleaseINTEL = 6166,
+ OpTypeTaskSequenceINTEL = 6199,
+ OpSubgroupBlockPrefetchINTEL = 6221,
+ OpSubgroup2DBlockLoadINTEL = 6231,
+ OpSubgroup2DBlockLoadTransformINTEL = 6232,
+ OpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ OpSubgroup2DBlockPrefetchINTEL = 6234,
+ OpSubgroup2DBlockStoreINTEL = 6235,
+ OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ OpBitwiseFunctionINTEL = 6242,
+ OpConditionalExtensionINTEL = 6248,
+ OpConditionalEntryPointINTEL = 6249,
+ OpConditionalCapabilityINTEL = 6250,
+ OpSpecConstantTargetINTEL = 6251,
+ OpSpecConstantArchitectureINTEL = 6252,
+ OpSpecConstantCapabilitiesINTEL = 6253,
+ OpConditionalCopyObjectINTEL = 6254,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
@@ -2156,8 +2496,13 @@
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
+ OpRoundFToTF32INTEL = 6426,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
+ OpConvertHandleToImageINTEL = 6529,
+ OpConvertHandleToSamplerINTEL = 6530,
+ OpConvertHandleToSampledImageINTEL = 6531,
+ Max = 0x7fffffff,
}
}
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.core.grammar.json b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.core.grammar.json
index 5d904ca..f4f768e 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.core.grammar.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.core.grammar.json
@@ -1,33 +1,17 @@
{
"copyright" : [
- "Copyright (c) 2014-2024 The Khronos Group Inc.",
+ "Copyright: 2014-2024 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
"magic_number" : "0x07230203",
"major_version" : 1,
"minor_version" : 6,
- "revision" : 1,
+ "revision" : 4,
"instruction_printing_class" : [
{
"tag" : "@exclude"
@@ -129,6 +113,14 @@
"heading" : "Non-Uniform Instructions"
},
{
+ "tag" : "Tensor",
+ "heading" : "Tensor Instructions"
+ },
+ {
+ "tag" : "Graph",
+ "heading" : "Graph Instructions"
+ },
+ {
"tag" : "Reserved",
"heading" : "Reserved Instructions"
}
@@ -155,7 +147,7 @@
"class" : "Debug",
"opcode" : 2,
"operands" : [
- { "kind" : "LiteralString", "name" : "'Continued Source'" }
+ { "kind" : "LiteralString", "name" : "Continued Source" }
],
"version": "1.0"
},
@@ -165,9 +157,9 @@
"opcode" : 3,
"operands" : [
{ "kind" : "SourceLanguage" },
- { "kind" : "LiteralInteger", "name" : "'Version'" },
- { "kind" : "IdRef", "quantifier" : "?", "name" : "'File'" },
- { "kind" : "LiteralString", "quantifier" : "?", "name" : "'Source'" }
+ { "kind" : "LiteralInteger", "name" : "Version" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "File" },
+ { "kind" : "LiteralString", "quantifier" : "?", "name" : "Source" }
],
"version": "1.0"
},
@@ -176,7 +168,7 @@
"class" : "Debug",
"opcode" : 4,
"operands" : [
- { "kind" : "LiteralString", "name" : "'Extension'" }
+ { "kind" : "LiteralString", "name" : "Extension" }
],
"version": "1.0"
},
@@ -185,8 +177,8 @@
"class" : "Debug",
"opcode" : 5,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "LiteralString", "name" : "'Name'" }
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "LiteralString", "name" : "Name" }
],
"version": "1.0"
},
@@ -195,9 +187,9 @@
"class" : "Debug",
"opcode" : 6,
"operands" : [
- { "kind" : "IdRef", "name" : "'Type'" },
- { "kind" : "LiteralInteger", "name" : "'Member'" },
- { "kind" : "LiteralString", "name" : "'Name'" }
+ { "kind" : "IdRef", "name" : "Type" },
+ { "kind" : "LiteralInteger", "name" : "Member" },
+ { "kind" : "LiteralString", "name" : "Name" }
],
"version": "1.0"
},
@@ -207,7 +199,7 @@
"opcode" : 7,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "LiteralString", "name" : "'String'" }
+ { "kind" : "LiteralString", "name" : "String" }
],
"version": "1.0"
},
@@ -216,9 +208,9 @@
"class" : "Debug",
"opcode" : 8,
"operands" : [
- { "kind" : "IdRef", "name" : "'File'" },
- { "kind" : "LiteralInteger", "name" : "'Line'" },
- { "kind" : "LiteralInteger", "name" : "'Column'" }
+ { "kind" : "IdRef", "name" : "File" },
+ { "kind" : "LiteralInteger", "name" : "Line" },
+ { "kind" : "LiteralInteger", "name" : "Column" }
],
"version": "1.0"
},
@@ -227,7 +219,7 @@
"class" : "Extension",
"opcode" : 10,
"operands" : [
- { "kind" : "LiteralString", "name" : "'Name'" }
+ { "kind" : "LiteralString", "name" : "Name" }
],
"version": "1.0"
},
@@ -237,7 +229,7 @@
"opcode" : 11,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "LiteralString", "name" : "'Name'" }
+ { "kind" : "LiteralString", "name" : "Name" }
],
"version": "1.0"
},
@@ -248,9 +240,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Set'" },
- { "kind" : "LiteralExtInstInteger", "name" : "'Instruction'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1', +\n'Operand 2', +\n..." }
+ { "kind" : "IdRef", "name" : "Set" },
+ { "kind" : "LiteralExtInstInteger", "name" : "Instruction" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Operand 1, Operand 2, ..." }
],
"version": "1.0"
},
@@ -270,9 +262,9 @@
"opcode" : 15,
"operands" : [
{ "kind" : "ExecutionModel" },
- { "kind" : "IdRef", "name" : "'Entry Point'" },
- { "kind" : "LiteralString", "name" : "'Name'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Interface'" }
+ { "kind" : "IdRef", "name" : "Entry Point" },
+ { "kind" : "LiteralString", "name" : "Name" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Interface" }
],
"version": "1.0"
},
@@ -281,8 +273,8 @@
"class" : "Mode-Setting",
"opcode" : 16,
"operands" : [
- { "kind" : "IdRef", "name" : "'Entry Point'" },
- { "kind" : "ExecutionMode", "name" : "'Mode'" }
+ { "kind" : "IdRef", "name" : "Entry Point" },
+ { "kind" : "ExecutionMode", "name" : "Mode" }
],
"version": "1.0"
},
@@ -291,7 +283,7 @@
"class" : "Mode-Setting",
"opcode" : 17,
"operands" : [
- { "kind" : "Capability", "name" : "'Capability'" }
+ { "kind" : "Capability", "name" : "Capability" }
],
"version": "1.0"
},
@@ -319,8 +311,8 @@
"opcode" : 21,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "LiteralInteger", "name" : "'Width'" },
- { "kind" : "LiteralInteger", "name" : "'Signedness'" }
+ { "kind" : "LiteralInteger", "name" : "Width" },
+ { "kind" : "LiteralInteger", "name" : "Signedness" }
],
"version": "1.0"
},
@@ -330,7 +322,8 @@
"opcode" : 22,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "LiteralInteger", "name" : "'Width'" }
+ { "kind" : "LiteralInteger", "name" : "Width" },
+ { "kind" : "FPEncoding", "quantifier" : "?", "name" : "Floating Point Encoding" }
],
"version": "1.0"
},
@@ -340,8 +333,8 @@
"opcode" : 23,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Component Type'" },
- { "kind" : "LiteralInteger", "name" : "'Component Count'" }
+ { "kind" : "IdRef", "name" : "Component Type" },
+ { "kind" : "LiteralInteger", "name" : "Component Count" }
],
"version": "1.0"
},
@@ -351,8 +344,8 @@
"opcode" : 24,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Column Type'" },
- { "kind" : "LiteralInteger", "name" : "'Column Count'" }
+ { "kind" : "IdRef", "name" : "Column Type" },
+ { "kind" : "LiteralInteger", "name" : "Column Count" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -363,12 +356,12 @@
"opcode" : 25,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Type'" },
+ { "kind" : "IdRef", "name" : "Sampled Type" },
{ "kind" : "Dim" },
- { "kind" : "LiteralInteger", "name" : "'Depth'" },
- { "kind" : "LiteralInteger", "name" : "'Arrayed'" },
- { "kind" : "LiteralInteger", "name" : "'MS'" },
- { "kind" : "LiteralInteger", "name" : "'Sampled'" },
+ { "kind" : "LiteralInteger", "name" : "Depth" },
+ { "kind" : "LiteralInteger", "name" : "Arrayed" },
+ { "kind" : "LiteralInteger", "name" : "MS" },
+ { "kind" : "LiteralInteger", "name" : "Sampled" },
{ "kind" : "ImageFormat" },
{ "kind" : "AccessQualifier", "quantifier" : "?" }
],
@@ -389,7 +382,7 @@
"opcode" : 27,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image Type'" }
+ { "kind" : "IdRef", "name" : "Image Type" }
],
"version": "1.0"
},
@@ -399,8 +392,8 @@
"opcode" : 28,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Element Type'" },
- { "kind" : "IdRef", "name" : "'Length'" }
+ { "kind" : "IdRef", "name" : "Element Type" },
+ { "kind" : "IdRef", "name" : "Length" }
],
"version": "1.0"
},
@@ -410,7 +403,7 @@
"opcode" : 29,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Element Type'" }
+ { "kind" : "IdRef", "name" : "Element Type" }
],
"capabilities" : [ "Shader" ],
"version": "1.0"
@@ -421,7 +414,7 @@
"opcode" : 30,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Member 0 type, member 1 type, ..." }
],
"version": "1.0"
},
@@ -443,7 +436,7 @@
"operands" : [
{ "kind" : "IdResult" },
{ "kind" : "StorageClass" },
- { "kind" : "IdRef", "name" : "'Type'" }
+ { "kind" : "IdRef", "name" : "Type" }
],
"version": "1.0"
},
@@ -453,8 +446,8 @@
"opcode" : 33,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Return Type'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Parameter 0 Type', +\n'Parameter 1 Type', +\n..." }
+ { "kind" : "IdRef", "name" : "Return Type" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Parameter 0 Type, Parameter 1 Type, ..." }
],
"version": "1.0"
},
@@ -504,7 +497,7 @@
"opcode" : 38,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "AccessQualifier", "name" : "'Qualifier'" }
+ { "kind" : "AccessQualifier", "name" : "Qualifier" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -514,7 +507,7 @@
"class" : "Type-Declaration",
"opcode" : 39,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer Type'" },
+ { "kind" : "IdRef", "name" : "Pointer Type" },
{ "kind" : "StorageClass" }
],
"capabilities" : [
@@ -550,7 +543,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" }
+ { "kind" : "LiteralContextDependentNumber", "name" : "Value" }
],
"version": "1.0"
},
@@ -561,7 +554,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Constituents" }
],
"version": "1.0"
},
@@ -573,7 +566,7 @@
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "SamplerAddressingMode" },
- { "kind" : "LiteralInteger", "name" : "'Param'" },
+ { "kind" : "LiteralInteger", "name" : "Param" },
{ "kind" : "SamplerFilterMode" }
],
"capabilities" : [ "LiteralSampler" ],
@@ -616,7 +609,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "LiteralContextDependentNumber", "name" : "'Value'" }
+ { "kind" : "LiteralContextDependentNumber", "name" : "Value" }
],
"version": "1.0"
},
@@ -627,7 +620,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Constituents" }
],
"version": "1.0"
},
@@ -638,7 +631,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "LiteralSpecConstantOpInteger", "name" : "'Opcode'" }
+ { "kind" : "LiteralSpecConstantOpInteger", "name" : "Opcode" }
],
"version": "1.0"
},
@@ -650,7 +643,7 @@
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "FunctionControl" },
- { "kind" : "IdRef", "name" : "'Function Type'" }
+ { "kind" : "IdRef", "name" : "Function Type" }
],
"version": "1.0"
},
@@ -677,8 +670,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Function'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0', +\n'Argument 1', +\n..." }
+ { "kind" : "IdRef", "name" : "Function" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Argument 0, Argument 1, ..."}
],
"version": "1.0"
},
@@ -690,7 +683,7 @@
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "StorageClass" },
- { "kind" : "IdRef", "quantifier" : "?", "name" : "'Initializer'" }
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Initializer" }
],
"version": "1.0"
},
@@ -701,9 +694,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Sample'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Sample" }
],
"version": "1.0"
},
@@ -714,7 +707,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
+ { "kind" : "IdRef", "name" : "Pointer" },
{ "kind" : "MemoryAccess", "quantifier" : "?" }
],
"version": "1.0"
@@ -724,8 +717,8 @@
"class" : "Memory",
"opcode" : 62,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Object'" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Object" },
{ "kind" : "MemoryAccess", "quantifier" : "?" }
],
"version": "1.0"
@@ -735,8 +728,8 @@
"class" : "Memory",
"opcode" : 63,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Source'" },
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Source" },
{ "kind" : "MemoryAccess", "quantifier" : "?" },
{ "kind" : "MemoryAccess", "quantifier" : "?" }
],
@@ -747,13 +740,16 @@
"class" : "Memory",
"opcode" : 64,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Size'" },
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Size" },
{ "kind" : "MemoryAccess", "quantifier" : "?" },
{ "kind" : "MemoryAccess", "quantifier" : "?" }
],
- "capabilities" : [ "Addresses" ],
+ "capabilities" : [
+ "Addresses",
+ "UntypedPointersKHR"
+ ],
"version": "1.0"
},
{
@@ -763,8 +759,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
],
"version": "1.0"
},
@@ -775,8 +771,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
],
"version": "1.0"
},
@@ -787,9 +783,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Element'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Element" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
],
"capabilities" : [
"Addresses",
@@ -806,8 +802,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Structure'" },
- { "kind" : "LiteralInteger", "name" : "'Array member'" }
+ { "kind" : "IdRef", "name" : "Structure" },
+ { "kind" : "LiteralInteger", "name" : "Array member" }
],
"capabilities" : [ "Shader" ],
"version": "1.0"
@@ -819,7 +815,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -831,9 +827,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Element'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Indexes'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Element" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
],
"capabilities" : [ "Addresses" ],
"version": "1.0"
@@ -843,7 +839,7 @@
"class" : "Annotation",
"opcode" : 71,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
+ { "kind" : "IdRef", "name" : "Target" },
{ "kind" : "Decoration" }
],
"version": "1.0"
@@ -853,8 +849,8 @@
"class" : "Annotation",
"opcode" : 72,
"operands" : [
- { "kind" : "IdRef", "name" : "'Structure Type'" },
- { "kind" : "LiteralInteger", "name" : "'Member'" },
+ { "kind" : "IdRef", "name" : "Structure Type" },
+ { "kind" : "LiteralInteger", "name" : "Member" },
{ "kind" : "Decoration" }
],
"version": "1.0"
@@ -873,8 +869,8 @@
"class" : "Annotation",
"opcode" : 74,
"operands" : [
- { "kind" : "IdRef", "name" : "'Decoration Group'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Targets'" }
+ { "kind" : "IdRef", "name" : "Decoration Group" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Targets" }
],
"version": "1.0"
},
@@ -883,8 +879,8 @@
"class" : "Annotation",
"opcode" : 75,
"operands" : [
- { "kind" : "IdRef", "name" : "'Decoration Group'" },
- { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "'Targets'" }
+ { "kind" : "IdRef", "name" : "Decoration Group" },
+ { "kind" : "PairIdRefLiteralInteger", "quantifier" : "*", "name" : "Targets" }
],
"version": "1.0"
},
@@ -895,8 +891,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector'" },
- { "kind" : "IdRef", "name" : "'Index'" }
+ { "kind" : "IdRef", "name" : "Vector" },
+ { "kind" : "IdRef", "name" : "Index" }
],
"version": "1.0"
},
@@ -907,9 +903,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector'" },
- { "kind" : "IdRef", "name" : "'Component'" },
- { "kind" : "IdRef", "name" : "'Index'" }
+ { "kind" : "IdRef", "name" : "Vector" },
+ { "kind" : "IdRef", "name" : "Component" },
+ { "kind" : "IdRef", "name" : "Index" }
],
"version": "1.0"
},
@@ -920,9 +916,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Components'" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Components" }
],
"version": "1.0"
},
@@ -933,7 +929,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Constituents" }
],
"version": "1.0"
},
@@ -944,8 +940,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Composite'" },
- { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" }
+ { "kind" : "IdRef", "name" : "Composite" },
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Indexes" }
],
"version": "1.0"
},
@@ -956,9 +952,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Object'" },
- { "kind" : "IdRef", "name" : "'Composite'" },
- { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Indexes'" }
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "IdRef", "name" : "Composite" },
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Indexes" }
],
"version": "1.0"
},
@@ -969,7 +965,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version": "1.0"
},
@@ -980,7 +976,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Matrix'" }
+ { "kind" : "IdRef", "name" : "Matrix" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -992,8 +988,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Sampler'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Sampler" }
],
"version": "1.0"
},
@@ -1004,8 +1000,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "Shader" ],
@@ -1018,8 +1014,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands" }
],
"version": "1.0"
@@ -1031,9 +1027,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "Shader" ],
@@ -1046,9 +1042,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "Shader" ],
@@ -1061,8 +1057,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "Shader" ],
@@ -1075,8 +1071,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "Shader" ],
@@ -1089,9 +1085,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "Shader" ],
@@ -1104,9 +1100,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "Shader" ],
@@ -1119,8 +1115,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"version": "1.0"
@@ -1132,9 +1128,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Component'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Component" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "Shader" ],
@@ -1147,9 +1143,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "Shader" ],
@@ -1162,8 +1158,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"version": "1.0"
@@ -1173,9 +1169,9 @@
"class" : "Image",
"opcode" : 99,
"operands" : [
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Texel'" },
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Texel" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"version": "1.0"
@@ -1187,7 +1183,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" }
+ { "kind" : "IdRef", "name" : "Sampled Image" }
],
"version": "1.0"
},
@@ -1198,7 +1194,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" }
+ { "kind" : "IdRef", "name" : "Image" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1210,7 +1206,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" }
+ { "kind" : "IdRef", "name" : "Image" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1222,8 +1218,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Level of Detail'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Level of Detail" }
],
"capabilities" : [ "Kernel", "ImageQuery" ],
"version": "1.0"
@@ -1235,7 +1231,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" }
+ { "kind" : "IdRef", "name" : "Image" }
],
"capabilities" : [ "Kernel", "ImageQuery" ],
"version": "1.0"
@@ -1247,8 +1243,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" }
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" }
],
"capabilities" : [ "ImageQuery" ],
"version": "1.0"
@@ -1260,7 +1256,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" }
+ { "kind" : "IdRef", "name" : "Image" }
],
"capabilities" : [ "Kernel", "ImageQuery" ],
"version": "1.0"
@@ -1272,7 +1268,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" }
+ { "kind" : "IdRef", "name" : "Image" }
],
"capabilities" : [ "Kernel", "ImageQuery" ],
"version": "1.0"
@@ -1284,7 +1280,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Float Value'" }
+ { "kind" : "IdRef", "name" : "Float Value" }
],
"version": "1.0"
},
@@ -1295,7 +1291,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Float Value'" }
+ { "kind" : "IdRef", "name" : "Float Value" }
],
"version": "1.0"
},
@@ -1306,7 +1302,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Signed Value'" }
+ { "kind" : "IdRef", "name" : "Signed Value" }
],
"version": "1.0"
},
@@ -1317,7 +1313,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Unsigned Value'" }
+ { "kind" : "IdRef", "name" : "Unsigned Value" }
],
"version": "1.0"
},
@@ -1328,7 +1324,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Unsigned Value'" }
+ { "kind" : "IdRef", "name" : "Unsigned Value" }
],
"version": "1.0"
},
@@ -1339,7 +1335,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Signed Value'" }
+ { "kind" : "IdRef", "name" : "Signed Value" }
],
"version": "1.0"
},
@@ -1350,7 +1346,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Float Value'" }
+ { "kind" : "IdRef", "name" : "Float Value" }
],
"version": "1.0"
},
@@ -1361,7 +1357,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -1372,7 +1368,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [
"Addresses",
@@ -1387,7 +1383,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Signed Value'" }
+ { "kind" : "IdRef", "name" : "Signed Value" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1399,7 +1395,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Unsigned Value'" }
+ { "kind" : "IdRef", "name" : "Unsigned Value" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1411,7 +1407,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Integer Value'" }
+ { "kind" : "IdRef", "name" : "Integer Value" }
],
"capabilities" : [
"Addresses",
@@ -1426,7 +1422,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1438,7 +1434,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1450,8 +1446,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "StorageClass", "name" : "'Storage'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "StorageClass", "name" : "Storage" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1463,7 +1459,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version": "1.0"
},
@@ -1474,7 +1470,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version": "1.0"
},
@@ -1485,7 +1481,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version": "1.0"
},
@@ -1496,8 +1492,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1508,8 +1504,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1520,8 +1516,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1532,8 +1528,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1544,8 +1540,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1556,8 +1552,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1568,8 +1564,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1580,8 +1576,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1592,8 +1588,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1604,8 +1600,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1616,8 +1612,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1628,8 +1624,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1640,8 +1636,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1652,8 +1648,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1664,8 +1660,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector'" },
- { "kind" : "IdRef", "name" : "'Scalar'" }
+ { "kind" : "IdRef", "name" : "Vector" },
+ { "kind" : "IdRef", "name" : "Scalar" }
],
"version": "1.0"
},
@@ -1676,8 +1672,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Matrix'" },
- { "kind" : "IdRef", "name" : "'Scalar'" }
+ { "kind" : "IdRef", "name" : "Matrix" },
+ { "kind" : "IdRef", "name" : "Scalar" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -1689,8 +1685,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector'" },
- { "kind" : "IdRef", "name" : "'Matrix'" }
+ { "kind" : "IdRef", "name" : "Vector" },
+ { "kind" : "IdRef", "name" : "Matrix" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -1702,8 +1698,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Matrix'" },
- { "kind" : "IdRef", "name" : "'Vector'" }
+ { "kind" : "IdRef", "name" : "Matrix" },
+ { "kind" : "IdRef", "name" : "Vector" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -1715,8 +1711,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'LeftMatrix'" },
- { "kind" : "IdRef", "name" : "'RightMatrix'" }
+ { "kind" : "IdRef", "name" : "LeftMatrix" },
+ { "kind" : "IdRef", "name" : "RightMatrix" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -1728,8 +1724,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" }
],
"capabilities" : [ "Matrix" ],
"version": "1.0"
@@ -1741,8 +1737,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" }
],
"version": "1.0"
},
@@ -1753,8 +1749,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1765,8 +1761,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1777,8 +1773,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1789,8 +1785,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1801,7 +1797,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector'" }
+ { "kind" : "IdRef", "name" : "Vector" }
],
"version": "1.0"
},
@@ -1812,7 +1808,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector'" }
+ { "kind" : "IdRef", "name" : "Vector" }
],
"version": "1.0"
},
@@ -1823,7 +1819,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
],
"version": "1.0"
},
@@ -1834,7 +1830,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
],
"version": "1.0"
},
@@ -1845,7 +1841,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1857,7 +1853,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1869,7 +1865,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" }
+ { "kind" : "IdRef", "name" : "x" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1881,8 +1877,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
],
"capabilities" : [ "Kernel" ],
"version" : "1.0",
@@ -1895,8 +1891,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1908,8 +1904,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'x'" },
- { "kind" : "IdRef", "name" : "'y'" }
+ { "kind" : "IdRef", "name" : "x" },
+ { "kind" : "IdRef", "name" : "y" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -1921,8 +1917,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1933,8 +1929,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1945,8 +1941,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -1957,8 +1953,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version" : "1.0"
},
@@ -1969,7 +1965,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version": "1.0"
},
@@ -1980,9 +1976,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Condition'" },
- { "kind" : "IdRef", "name" : "'Object 1'" },
- { "kind" : "IdRef", "name" : "'Object 2'" }
+ { "kind" : "IdRef", "name" : "Condition" },
+ { "kind" : "IdRef", "name" : "Object 1" },
+ { "kind" : "IdRef", "name" : "Object 2" }
],
"version": "1.0"
},
@@ -1993,8 +1989,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2005,8 +2001,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2017,8 +2013,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2029,8 +2025,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2041,8 +2037,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2053,8 +2049,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2065,8 +2061,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2077,8 +2073,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2089,8 +2085,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2101,8 +2097,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2113,8 +2109,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2125,8 +2121,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2137,8 +2133,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2149,8 +2145,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2161,8 +2157,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2173,8 +2169,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2185,8 +2181,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2197,8 +2193,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2209,8 +2205,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2221,8 +2217,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2233,8 +2229,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2245,8 +2241,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2257,8 +2253,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Shift'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Shift" }
],
"version": "1.0"
},
@@ -2269,8 +2265,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Shift'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Shift" }
],
"version": "1.0"
},
@@ -2281,8 +2277,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Shift'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Shift" }
],
"version": "1.0"
},
@@ -2293,8 +2289,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2305,8 +2301,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2317,8 +2313,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version": "1.0"
},
@@ -2329,7 +2325,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version": "1.0"
},
@@ -2340,10 +2336,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Insert'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Count'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Insert" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Count" }
],
"capabilities" : [ "Shader", "BitInstructions" ],
"version": "1.0"
@@ -2355,9 +2351,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Count'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Count" }
],
"capabilities" : [ "Shader", "BitInstructions" ],
"version": "1.0"
@@ -2369,9 +2365,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Offset'" },
- { "kind" : "IdRef", "name" : "'Count'" }
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Count" }
],
"capabilities" : [ "Shader", "BitInstructions" ],
"version": "1.0"
@@ -2383,7 +2379,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" }
+ { "kind" : "IdRef", "name" : "Base" }
],
"capabilities" : [ "Shader", "BitInstructions" ],
"version": "1.0"
@@ -2395,7 +2391,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" }
+ { "kind" : "IdRef", "name" : "Base" }
],
"version": "1.0"
},
@@ -2406,7 +2402,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "Shader" ],
"version": "1.0"
@@ -2418,7 +2414,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "Shader" ],
"version": "1.0"
@@ -2430,7 +2426,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "Shader" ],
"version": "1.0"
@@ -2442,7 +2438,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "DerivativeControl" ],
"version": "1.0"
@@ -2454,7 +2450,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "DerivativeControl" ],
"version": "1.0"
@@ -2466,7 +2462,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "DerivativeControl" ],
"version": "1.0"
@@ -2478,7 +2474,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "DerivativeControl" ],
"version": "1.0"
@@ -2490,7 +2486,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "DerivativeControl" ],
"version": "1.0"
@@ -2502,7 +2498,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'P'" }
+ { "kind" : "IdRef", "name" : "P" }
],
"capabilities" : [ "DerivativeControl" ],
"version": "1.0"
@@ -2526,7 +2522,7 @@
"class" : "Primitive",
"opcode" : 220,
"operands" : [
- { "kind" : "IdRef", "name" : "'Stream'" }
+ { "kind" : "IdRef", "name" : "Stream" }
],
"capabilities" : [ "GeometryStreams" ],
"version": "1.0"
@@ -2536,7 +2532,7 @@
"class" : "Primitive",
"opcode" : 221,
"operands" : [
- { "kind" : "IdRef", "name" : "'Stream'" }
+ { "kind" : "IdRef", "name" : "Stream" }
],
"capabilities" : [ "GeometryStreams" ],
"version": "1.0"
@@ -2546,9 +2542,9 @@
"class" : "Barrier",
"opcode" : 224,
"operands" : [
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"version": "1.0"
},
@@ -2557,8 +2553,8 @@
"class" : "Barrier",
"opcode" : 225,
"operands" : [
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"version": "1.0"
},
@@ -2569,9 +2565,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"version": "1.0"
},
@@ -2580,10 +2576,10 @@
"class" : "Atomic",
"opcode" : 228,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2594,10 +2590,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2608,12 +2604,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Equal'" },
- { "kind" : "IdMemorySemantics", "name" : "'Unequal'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Comparator'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Equal" },
+ { "kind" : "IdMemorySemantics", "name" : "Unequal" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Comparator" }
],
"version": "1.0"
},
@@ -2624,12 +2620,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Equal'" },
- { "kind" : "IdMemorySemantics", "name" : "'Unequal'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Comparator'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Equal" },
+ { "kind" : "IdMemorySemantics", "name" : "Unequal" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Comparator" }
],
"capabilities" : [ "Kernel" ],
"version" : "1.0",
@@ -2642,9 +2638,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"version": "1.0"
},
@@ -2655,9 +2651,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"version": "1.0"
},
@@ -2668,10 +2664,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2682,10 +2678,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2696,10 +2692,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2710,10 +2706,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2724,10 +2720,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2738,10 +2734,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2752,10 +2748,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2766,10 +2762,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2780,10 +2776,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2794,7 +2790,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "'Variable, Parent, ...'" }
+ { "kind" : "PairIdRefIdRef", "quantifier" : "*", "name" : "Variable, Parent, ..." }
],
"version": "1.0"
},
@@ -2803,8 +2799,8 @@
"class" : "Control-Flow",
"opcode" : 246,
"operands" : [
- { "kind" : "IdRef", "name" : "'Merge Block'" },
- { "kind" : "IdRef", "name" : "'Continue Target'" },
+ { "kind" : "IdRef", "name" : "Merge Block" },
+ { "kind" : "IdRef", "name" : "Continue Target" },
{ "kind" : "LoopControl" }
],
"version": "1.0"
@@ -2814,7 +2810,7 @@
"class" : "Control-Flow",
"opcode" : 247,
"operands" : [
- { "kind" : "IdRef", "name" : "'Merge Block'" },
+ { "kind" : "IdRef", "name" : "Merge Block" },
{ "kind" : "SelectionControl" }
],
"version": "1.0"
@@ -2833,7 +2829,7 @@
"class" : "Control-Flow",
"opcode" : 249,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target Label'" }
+ { "kind" : "IdRef", "name" : "Target Label" }
],
"version": "1.0"
},
@@ -2842,10 +2838,10 @@
"class" : "Control-Flow",
"opcode" : 250,
"operands" : [
- { "kind" : "IdRef", "name" : "'Condition'" },
- { "kind" : "IdRef", "name" : "'True Label'" },
- { "kind" : "IdRef", "name" : "'False Label'" },
- { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Branch weights'" }
+ { "kind" : "IdRef", "name" : "Condition" },
+ { "kind" : "IdRef", "name" : "True Label" },
+ { "kind" : "IdRef", "name" : "False Label" },
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Branch weights" }
],
"version": "1.0"
},
@@ -2854,9 +2850,9 @@
"class" : "Control-Flow",
"opcode" : 251,
"operands" : [
- { "kind" : "IdRef", "name" : "'Selector'" },
- { "kind" : "IdRef", "name" : "'Default'" },
- { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "'Target'" }
+ { "kind" : "IdRef", "name" : "Selector" },
+ { "kind" : "IdRef", "name" : "Default" },
+ { "kind" : "PairLiteralIntegerIdRef", "quantifier" : "*", "name" : "Target" }
],
"version": "1.0"
},
@@ -2878,7 +2874,7 @@
"class" : "Control-Flow",
"opcode" : 254,
"operands" : [
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
],
"version": "1.0"
},
@@ -2893,8 +2889,8 @@
"class" : "Control-Flow",
"opcode" : 256,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "LiteralInteger", "name" : "'Size'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "LiteralInteger", "name" : "Size" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -2904,8 +2900,8 @@
"class" : "Control-Flow",
"opcode" : 257,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "LiteralInteger", "name" : "'Size'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "LiteralInteger", "name" : "Size" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -2917,12 +2913,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Destination'" },
- { "kind" : "IdRef", "name" : "'Source'" },
- { "kind" : "IdRef", "name" : "'Num Elements'" },
- { "kind" : "IdRef", "name" : "'Stride'" },
- { "kind" : "IdRef", "name" : "'Event'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Destination" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Num Elements" },
+ { "kind" : "IdRef", "name" : "Stride" },
+ { "kind" : "IdRef", "name" : "Event" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -2932,9 +2928,9 @@
"class" : "Group",
"opcode" : 260,
"operands" : [
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Num Events'" },
- { "kind" : "IdRef", "name" : "'Events List'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Num Events" },
+ { "kind" : "IdRef", "name" : "Events List" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -2946,8 +2942,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -2959,8 +2955,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -2972,9 +2968,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'LocalId'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "LocalId" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -2986,9 +2982,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3000,9 +2996,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3014,9 +3010,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3028,9 +3024,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3042,9 +3038,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3056,9 +3052,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3070,9 +3066,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3084,9 +3080,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"version": "1.0"
@@ -3098,10 +3094,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3113,10 +3109,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3128,12 +3124,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" },
- { "kind" : "IdRef", "name" : "'Index'" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Reserve Id" },
+ { "kind" : "IdRef", "name" : "Index" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3145,12 +3141,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" },
- { "kind" : "IdRef", "name" : "'Index'" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Reserve Id" },
+ { "kind" : "IdRef", "name" : "Index" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3162,10 +3158,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Num Packets'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Num Packets" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3177,10 +3173,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Num Packets'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Num Packets" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3190,10 +3186,10 @@
"class" : "Pipe",
"opcode" : 280,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Reserve Id" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3203,10 +3199,10 @@
"class" : "Pipe",
"opcode" : 281,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Reserve Id" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3218,7 +3214,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" }
+ { "kind" : "IdRef", "name" : "Reserve Id" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3230,9 +3226,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3244,9 +3240,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3258,11 +3254,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Num Packets'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Num Packets" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3274,11 +3270,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Num Packets'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Num Packets" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3288,11 +3284,11 @@
"class" : "Pipe",
"opcode" : 287,
"operands" : [
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Reserve Id" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3302,11 +3298,11 @@
"class" : "Pipe",
"opcode" : 288,
"operands" : [
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Pipe'" },
- { "kind" : "IdRef", "name" : "'Reserve Id'" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Pipe" },
+ { "kind" : "IdRef", "name" : "Reserve Id" },
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "Pipes" ],
"version": "1.0"
@@ -3318,10 +3314,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Queue'" },
- { "kind" : "IdRef", "name" : "'Num Events'" },
- { "kind" : "IdRef", "name" : "'Wait Events'" },
- { "kind" : "IdRef", "name" : "'Ret Event'" }
+ { "kind" : "IdRef", "name" : "Queue" },
+ { "kind" : "IdRef", "name" : "Num Events" },
+ { "kind" : "IdRef", "name" : "Wait Events" },
+ { "kind" : "IdRef", "name" : "Ret Event" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3333,17 +3329,17 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Queue'" },
- { "kind" : "IdRef", "name" : "'Flags'" },
- { "kind" : "IdRef", "name" : "'ND Range'" },
- { "kind" : "IdRef", "name" : "'Num Events'" },
- { "kind" : "IdRef", "name" : "'Wait Events'" },
- { "kind" : "IdRef", "name" : "'Ret Event'" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Local Size'" }
+ { "kind" : "IdRef", "name" : "Queue" },
+ { "kind" : "IdRef", "name" : "Flags" },
+ { "kind" : "IdRef", "name" : "ND Range" },
+ { "kind" : "IdRef", "name" : "Num Events" },
+ { "kind" : "IdRef", "name" : "Wait Events" },
+ { "kind" : "IdRef", "name" : "Ret Event" },
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Local Size" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3355,11 +3351,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'ND Range'" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" }
+ { "kind" : "IdRef", "name" : "ND Range" },
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3371,11 +3367,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'ND Range'" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" }
+ { "kind" : "IdRef", "name" : "ND Range" },
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3387,10 +3383,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" }
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3402,10 +3398,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" }
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3415,7 +3411,7 @@
"class" : "Device-Side_Enqueue",
"opcode" : 297,
"operands" : [
- { "kind" : "IdRef", "name" : "'Event'" }
+ { "kind" : "IdRef", "name" : "Event" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3425,7 +3421,7 @@
"class" : "Device-Side_Enqueue",
"opcode" : 298,
"operands" : [
- { "kind" : "IdRef", "name" : "'Event'" }
+ { "kind" : "IdRef", "name" : "Event" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3448,7 +3444,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Event'" }
+ { "kind" : "IdRef", "name" : "Event" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3458,8 +3454,8 @@
"class" : "Device-Side_Enqueue",
"opcode" : 301,
"operands" : [
- { "kind" : "IdRef", "name" : "'Event'" },
- { "kind" : "IdRef", "name" : "'Status'" }
+ { "kind" : "IdRef", "name" : "Event" },
+ { "kind" : "IdRef", "name" : "Status" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3469,9 +3465,9 @@
"class" : "Device-Side_Enqueue",
"opcode" : 302,
"operands" : [
- { "kind" : "IdRef", "name" : "'Event'" },
- { "kind" : "IdRef", "name" : "'Profiling Info'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Event" },
+ { "kind" : "IdRef", "name" : "Profiling Info" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3494,9 +3490,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'GlobalWorkSize'" },
- { "kind" : "IdRef", "name" : "'LocalWorkSize'" },
- { "kind" : "IdRef", "name" : "'GlobalWorkOffset'" }
+ { "kind" : "IdRef", "name" : "GlobalWorkSize" },
+ { "kind" : "IdRef", "name" : "LocalWorkSize" },
+ { "kind" : "IdRef", "name" : "GlobalWorkOffset" }
],
"capabilities" : [ "DeviceEnqueue" ],
"version": "1.0"
@@ -3508,8 +3504,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3522,8 +3518,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3536,9 +3532,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3551,9 +3547,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3566,8 +3562,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3580,8 +3576,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3594,9 +3590,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3609,9 +3605,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3624,8 +3620,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3638,9 +3634,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Component'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Component" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3653,9 +3649,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'D~ref~'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "D~ref~" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3668,7 +3664,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Resident Code'" }
+ { "kind" : "IdRef", "name" : "Resident Code" }
],
"capabilities" : [ "SparseResidency" ],
"version": "1.0"
@@ -3686,9 +3682,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -3698,9 +3694,9 @@
"class" : "Atomic",
"opcode" : 319,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"capabilities" : [ "Kernel" ],
"version": "1.0"
@@ -3712,8 +3708,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "SparseResidency" ],
@@ -3726,7 +3722,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [ "Addresses" ],
"version" : "1.1"
@@ -3748,9 +3744,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "LiteralInteger", "name" : "'Packet Size'" },
- { "kind" : "LiteralInteger", "name" : "'Packet Alignment'" },
- { "kind" : "LiteralInteger", "name" : "'Capacity'" }
+ { "kind" : "LiteralInteger", "name" : "Packet Size" },
+ { "kind" : "LiteralInteger", "name" : "Packet Alignment" },
+ { "kind" : "LiteralInteger", "name" : "Capacity" }
],
"capabilities" : [ "PipeStorage" ],
"version" : "1.1"
@@ -3762,7 +3758,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pipe Storage'" }
+ { "kind" : "IdRef", "name" : "Pipe Storage" }
],
"capabilities" : [ "PipeStorage" ],
"version" : "1.1"
@@ -3774,11 +3770,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Subgroup Count'" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" }
+ { "kind" : "IdRef", "name" : "Subgroup Count" },
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" }
],
"capabilities" : [ "SubgroupDispatch" ],
"version" : "1.1"
@@ -3790,10 +3786,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Invoke'" },
- { "kind" : "IdRef", "name" : "'Param'" },
- { "kind" : "IdRef", "name" : "'Param Size'" },
- { "kind" : "IdRef", "name" : "'Param Align'" }
+ { "kind" : "IdRef", "name" : "Invoke" },
+ { "kind" : "IdRef", "name" : "Param" },
+ { "kind" : "IdRef", "name" : "Param Size" },
+ { "kind" : "IdRef", "name" : "Param Align" }
],
"capabilities" : [ "SubgroupDispatch" ],
"version" : "1.1"
@@ -3815,7 +3811,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Subgroup Count'" }
+ { "kind" : "IdRef", "name" : "Subgroup Count" }
],
"capabilities" : [ "NamedBarrier" ],
"version" : "1.1"
@@ -3825,9 +3821,9 @@
"class" : "Barrier",
"opcode" : 329,
"operands" : [
- { "kind" : "IdRef", "name" : "'Named Barrier'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdRef", "name" : "Named Barrier" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"capabilities" : [ "NamedBarrier" ],
"version" : "1.1"
@@ -3837,7 +3833,7 @@
"class" : "Debug",
"opcode" : 330,
"operands" : [
- { "kind" : "LiteralString", "name" : "'Process'" }
+ { "kind" : "LiteralString", "name" : "Process" }
],
"version" : "1.1"
},
@@ -3846,8 +3842,8 @@
"class" : "Mode-Setting",
"opcode" : 331,
"operands" : [
- { "kind" : "IdRef", "name" : "'Entry Point'" },
- { "kind" : "ExecutionMode", "name" : "'Mode'" }
+ { "kind" : "IdRef", "name" : "Entry Point" },
+ { "kind" : "ExecutionMode", "name" : "Mode" }
],
"version" : "1.2"
},
@@ -3856,7 +3852,7 @@
"class" : "Annotation",
"opcode" : 332,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
+ { "kind" : "IdRef", "name" : "Target" },
{ "kind" : "Decoration" }
],
"extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ],
@@ -3869,7 +3865,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" }
+ { "kind" : "IdScope", "name" : "Execution" }
],
"capabilities" : [ "GroupNonUniform" ],
"version" : "1.3"
@@ -3881,8 +3877,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "GroupNonUniformVote" ],
"version" : "1.3"
@@ -3894,8 +3890,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "GroupNonUniformVote" ],
"version" : "1.3"
@@ -3907,8 +3903,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformVote" ],
"version" : "1.3"
@@ -3920,9 +3916,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Id'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Invocation Id" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -3934,8 +3930,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -3947,8 +3943,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -3960,8 +3956,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -3973,9 +3969,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Index'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Index" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -3987,9 +3983,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -4001,8 +3997,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -4014,8 +4010,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformBallot" ],
"version" : "1.3"
@@ -4027,9 +4023,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Id'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Invocation Id" }
],
"capabilities" : [ "GroupNonUniformShuffle" ],
"version" : "1.3"
@@ -4041,9 +4037,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Mask'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Mask" }
],
"capabilities" : [ "GroupNonUniformShuffle" ],
"version" : "1.3"
@@ -4055,9 +4051,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Delta'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Delta" }
],
"capabilities" : [ "GroupNonUniformShuffleRelative" ],
"version" : "1.3"
@@ -4069,9 +4065,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Delta'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Delta" }
],
"capabilities" : [ "GroupNonUniformShuffleRelative" ],
"version" : "1.3"
@@ -4083,10 +4079,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4098,10 +4094,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4113,10 +4109,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4128,10 +4124,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4143,10 +4139,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4158,10 +4154,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4173,10 +4169,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4188,10 +4184,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4203,10 +4199,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4218,10 +4214,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4233,10 +4229,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4248,10 +4244,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4263,10 +4259,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4278,10 +4274,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4293,10 +4289,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4308,10 +4304,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformArithmetic", "GroupNonUniformClustered", "GroupNonUniformPartitionedNV" ],
"version" : "1.3"
@@ -4323,9 +4319,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Index'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Index" }
],
"capabilities" : [ "GroupNonUniformQuad" ],
"version" : "1.3"
@@ -4337,9 +4333,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Direction'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Direction" }
],
"capabilities" : [ "GroupNonUniformQuad" ],
"version" : "1.3"
@@ -4351,7 +4347,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"version" : "1.4"
},
@@ -4362,8 +4358,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version" : "1.4"
},
@@ -4374,8 +4370,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"version" : "1.4"
},
@@ -4386,8 +4382,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "Addresses", "VariablePointers", "VariablePointersStorageBuffer" ],
"version" : "1.4"
@@ -4399,8 +4395,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Attachment'" },
- { "kind" : "IdRef", "name" : "'Sample'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Attachment" },
+ { "kind" : "IdRef", "name" : "Sample", "quantifier" : "?" }
],
"capabilities": [ "TileImageColorReadAccessEXT" ],
"version" : "None"
@@ -4412,7 +4408,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sample'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Sample", "quantifier" : "?" }
],
"capabilities" : [ "TileImageDepthReadAccessEXT" ],
"version" : "None"
@@ -4424,12 +4420,144 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sample'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Sample", "quantifier" : "?" }
],
"capabilities" : [ "TileImageStencilReadAccessEXT" ],
"version" : "None"
},
{
+ "opname" : "OpTypeTensorARM",
+ "class" : "Type-Declaration",
+ "opcode" : 4163,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Element Type" },
+ { "kind" : "IdRef", "name" : "Rank", "quantifier" : "?" },
+ { "kind" : "IdRef", "name" : "Shape", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorReadARM",
+ "class" : "Tensor",
+ "opcode" : 4164,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Tensor" },
+ { "kind" : "IdRef", "name" : "Coordinates" },
+ { "kind" : "TensorOperands", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorWriteARM",
+ "class" : "Tensor",
+ "opcode" : 4165,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Tensor" },
+ { "kind" : "IdRef", "name" : "Coordinates" },
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "TensorOperands", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorQuerySizeARM",
+ "class" : "Tensor",
+ "opcode" : 4166,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Tensor" },
+ { "kind" : "IdRef", "name" : "Dimension" }
+ ],
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGraphConstantARM",
+ "class" : "Graph",
+ "opcode" : 4181,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "LiteralInteger", "name" : "GraphConstantID" }
+ ],
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGraphEntryPointARM",
+ "class" : "Graph",
+ "opcode" : 4182,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Graph" },
+ { "kind" : "LiteralString", "name" : "Name" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Interface" }
+ ],
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGraphARM",
+ "class" : "Graph",
+ "opcode" : 4183,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" }
+ ],
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGraphInputARM",
+ "class" : "Graph",
+ "opcode" : 4184,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "InputIndex" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "ElementIndex" }
+ ],
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGraphSetOutputARM",
+ "class" : "Graph",
+ "opcode" : 4185,
+ "operands" : [
+ { "kind" : "IdRef", "name": "Value" },
+ { "kind" : "IdRef", "name" : "OutputIndex" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "ElementIndex" }
+ ],
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGraphEndARM",
+ "class" : "Graph",
+ "opcode" : 4186,
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTypeGraphARM",
+ "class" : "Type-Declaration",
+ "opcode" : 4190,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "LiteralInteger", "name" : "NumInputs" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "InOutTypes" }
+ ],
+ "capabilities" : [ "GraphARM" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpTerminateInvocation",
"class" : "Control-Flow",
"opcode" : 4416,
@@ -4440,13 +4568,68 @@
"version" : "1.6"
},
{
+ "opname" : "OpTypeUntypedPointerKHR",
+ "class" : "Type-Declaration",
+ "opcode" : 4417,
+ "capabilities" : [
+ "UntypedPointersKHR"
+ ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "StorageClass" }
+ ]
+ },
+ {
+ "opname" : "OpUntypedVariableKHR",
+ "class" : "Memory",
+ "opcode" : 4418,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "StorageClass" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Data Type" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Initializer" }
+ ]
+ },
+ {
+ "opname" : "OpUntypedAccessChainKHR",
+ "class" : "Memory",
+ "opcode" : 4419,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
+ ]
+ },
+ {
+ "opname" : "OpUntypedInBoundsAccessChainKHR",
+ "class" : "Memory",
+ "opcode" : 4420,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
+ ]
+ },
+ {
"opname" : "OpSubgroupBallotKHR",
"class" : "Group",
"opcode" : 4421,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "SubgroupBallotKHR" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
@@ -4459,20 +4642,78 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "SubgroupBallotKHR" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
"version" : "None"
},
{
+ "opname" : "OpUntypedPtrAccessChainKHR",
+ "class" : "Memory",
+ "opcode" : 4423,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Element" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
+ ]
+ },
+ {
+ "opname" : "OpUntypedInBoundsPtrAccessChainKHR",
+ "class" : "Memory",
+ "opcode" : 4424,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Base Type" },
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Element" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Indexes" }
+ ]
+ },
+ {
+ "opname" : "OpUntypedArrayLengthKHR",
+ "class" : "Memory",
+ "opcode" : 4425,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Structure" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "LiteralInteger", "name" : "Array member" }
+ ]
+ },
+ {
+ "opname" : "OpUntypedPrefetchKHR",
+ "class" : "Memory",
+ "opcode" : 4426,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Pointer Type" },
+ { "kind" : "IdRef", "name" : "Num Bytes" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "RW" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Locality" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Cache Type" }
+ ]
+ },
+ {
"opname" : "OpSubgroupAllKHR",
"class" : "Group",
"opcode" : 4428,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"extensions" : [
"SPV_KHR_subgroup_vote"
@@ -4487,7 +4728,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"extensions" : [
"SPV_KHR_subgroup_vote"
@@ -4502,7 +4743,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"extensions" : [
"SPV_KHR_subgroup_vote"
@@ -4517,10 +4758,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Delta'" },
- { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Delta" },
+ { "kind" : "IdRef", "name" : "ClusterSize", "quantifier" : "?" }
],
"capabilities" : [ "GroupNonUniformRotateKHR" ],
"version" : "None"
@@ -4532,30 +4773,64 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'Index'" }
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "Index" }
],
"capabilities" : [ "SubgroupBallotKHR" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
"version" : "None"
},
{
+ "opname" : "OpExtInstWithForwardRefsKHR",
+ "class" : "Extension",
+ "opcode" : 4433,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Set" },
+ { "kind" : "LiteralExtInstInteger", "name" : "Instruction" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Operand 1, Operand 2, ..." }
+ ],
+ "extensions" : [ "SPV_KHR_relaxed_extended_instruction" ],
+ "version": "None"
+ },
+ {
+ "opname" : "OpUntypedGroupAsyncCopyKHR",
+ "class" : "Group",
+ "opcode" : 4434,
+ "capabilities" : [ "UntypedPointersKHR" ],
+ "version" : "None",
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Destination" },
+ { "kind" : "IdRef", "name" : "Source" },
+ { "kind" : "IdRef", "name" : "Element Num Bytes" },
+ { "kind" : "IdRef", "name" : "Num Elements" },
+ { "kind" : "IdRef", "name" : "Stride" },
+ { "kind" : "IdRef", "name" : "Event" },
+ { "kind" : "MemoryAccess", "quantifier" : "?", "name" : "Destination Memory Operands" },
+ { "kind" : "MemoryAccess", "quantifier" : "?", "name" : "Source Memory Operands" }
+ ]
+ },
+ {
"opname" : "OpTraceRayKHR",
"class" : "Reserved",
"opcode" : 4445,
"operands" : [
- { "kind" : "IdRef", "name" : "'Accel'" },
- { "kind" : "IdRef", "name" : "'Ray Flags'" },
- { "kind" : "IdRef", "name" : "'Cull Mask'" },
- { "kind" : "IdRef", "name" : "'SBT Offset'" },
- { "kind" : "IdRef", "name" : "'SBT Stride'" },
- { "kind" : "IdRef", "name" : "'Miss Index'" },
- { "kind" : "IdRef", "name" : "'Ray Origin'" },
- { "kind" : "IdRef", "name" : "'Ray Tmin'" },
- { "kind" : "IdRef", "name" : "'Ray Direction'" },
- { "kind" : "IdRef", "name" : "'Ray Tmax'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Accel" },
+ { "kind" : "IdRef", "name" : "Ray Flags" },
+ { "kind" : "IdRef", "name" : "Cull Mask" },
+ { "kind" : "IdRef", "name" : "SBT Offset" },
+ { "kind" : "IdRef", "name" : "SBT Stride" },
+ { "kind" : "IdRef", "name" : "Miss Index" },
+ { "kind" : "IdRef", "name" : "Ray Origin" },
+ { "kind" : "IdRef", "name" : "Ray Tmin" },
+ { "kind" : "IdRef", "name" : "Ray Direction" },
+ { "kind" : "IdRef", "name" : "Ray Tmax" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "RayTracingKHR" ],
"extensions" : [ "SPV_KHR_ray_tracing" ],
@@ -4567,8 +4842,8 @@
"opcode" : 4446,
"operands" : [
- { "kind" : "IdRef", "name" : "'SBT Index'" },
- { "kind" : "IdRef", "name" : "'Callable Data'" }
+ { "kind" : "IdRef", "name" : "SBT Index" },
+ { "kind" : "IdRef", "name" : "Callable Data" }
],
"capabilities" : [ "RayTracingKHR" ],
"extensions" : [ "SPV_KHR_ray_tracing" ],
@@ -4581,7 +4856,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Accel'" }
+ { "kind" : "IdRef", "name" : "Accel" }
],
"capabilities" : [ "RayTracingKHR", "RayQueryKHR" ],
"extensions" : [ "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ],
@@ -4606,180 +4881,99 @@
{
"opname" : "OpSDot",
"class" : "Arithmetic",
+ "aliases" : ["OpSDotKHR"],
"opcode" : 4450,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "PackedVectorFormat", "name" : "Packed Vector Format", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
- "version" : "1.6"
- },
- {
- "opname" : "OpSDotKHR",
- "class" : "Arithmetic",
- "opcode" : 4450,
- "operands" : [
- { "kind" : "IdResultType" },
- { "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
- ],
- "capabilities" : [ "DotProductKHR" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpUDot",
"class" : "Arithmetic",
+ "aliases" : ["OpUDotKHR"],
"opcode" : 4451,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "PackedVectorFormat", "name" : "Packed Vector Format", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
- "version" : "1.6"
- },
- {
- "opname" : "OpUDotKHR",
- "class" : "Arithmetic",
- "opcode" : 4451,
- "operands" : [
- { "kind" : "IdResultType" },
- { "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
- ],
- "capabilities" : [ "DotProductKHR" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpSUDot",
"class" : "Arithmetic",
+ "aliases" : ["OpSUDotKHR"],
"opcode" : 4452,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "PackedVectorFormat", "name" : "Packed Vector Format", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
- "version" : "1.6"
- },
- {
- "opname" : "OpSUDotKHR",
- "class" : "Arithmetic",
- "opcode" : 4452,
- "operands" : [
- { "kind" : "IdResultType" },
- { "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
- ],
- "capabilities" : [ "DotProductKHR" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpSDotAccSat",
"class" : "Arithmetic",
+ "aliases" : ["OpSDotAccSatKHR"],
"opcode" : 4453,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "IdRef", "name" : "'Accumulator'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "IdRef", "name" : "Accumulator" },
+ { "kind" : "PackedVectorFormat", "name" : "Packed Vector Format", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
- "version" : "1.6"
- },
- {
- "opname" : "OpSDotAccSatKHR",
- "class" : "Arithmetic",
- "opcode" : 4453,
- "operands" : [
- { "kind" : "IdResultType" },
- { "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "IdRef", "name" : "'Accumulator'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
- ],
- "capabilities" : [ "DotProductKHR" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpUDotAccSat",
"class" : "Arithmetic",
+ "aliases" : ["OpUDotAccSatKHR"],
"opcode" : 4454,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "IdRef", "name" : "'Accumulator'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "IdRef", "name" : "Accumulator" },
+ { "kind" : "PackedVectorFormat", "name" : "Packed Vector Format", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
- "version" : "1.6"
- },
- {
- "opname" : "OpUDotAccSatKHR",
- "class" : "Arithmetic",
- "opcode" : 4454,
- "operands" : [
- { "kind" : "IdResultType" },
- { "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "IdRef", "name" : "'Accumulator'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
- ],
- "capabilities" : [ "DotProductKHR" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"opname" : "OpSUDotAccSat",
"class" : "Arithmetic",
+ "aliases" : ["OpSUDotAccSatKHR"],
"opcode" : 4455,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "IdRef", "name" : "'Accumulator'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Vector 1" },
+ { "kind" : "IdRef", "name" : "Vector 2" },
+ { "kind" : "IdRef", "name" : "Accumulator" },
+ { "kind" : "PackedVectorFormat", "name" : "Packed Vector Format", "quantifier" : "?" }
],
"capabilities" : [ "DotProduct" ],
- "version" : "1.6"
- },
- {
- "opname" : "OpSUDotAccSatKHR",
- "class" : "Arithmetic",
- "opcode" : 4455,
- "operands" : [
- { "kind" : "IdResultType" },
- { "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Vector 1'" },
- { "kind" : "IdRef", "name" : "'Vector 2'" },
- { "kind" : "IdRef", "name" : "'Accumulator'" },
- { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
- ],
- "capabilities" : [ "DotProductKHR" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
@@ -4789,11 +4983,11 @@
"opcode" : 4456,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Component Type'" },
- { "kind" : "IdScope", "name" : "'Scope'" },
- { "kind" : "IdRef", "name" : "'Rows'" },
- { "kind" : "IdRef", "name" : "'Columns'" },
- { "kind" : "IdRef", "name" : "'Use'" }
+ { "kind" : "IdRef", "name" : "Component Type" },
+ { "kind" : "IdScope", "name" : "Scope" },
+ { "kind" : "IdRef", "name" : "Rows" },
+ { "kind" : "IdRef", "name" : "Columns" },
+ { "kind" : "IdRef", "name" : "Use" }
],
"capabilities" : [ "CooperativeMatrixKHR" ],
"version" : "None"
@@ -4805,10 +4999,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'MemoryLayout'" },
- { "kind" : "IdRef", "name" : "'Stride'", "quantifier": "?" },
- { "kind" : "MemoryAccess", "name" : "'Memory Operand'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "MemoryLayout" },
+ { "kind" : "IdRef", "name" : "Stride", "quantifier": "?" },
+ { "kind" : "MemoryAccess", "name" : "Memory Operand", "quantifier" : "?" }
],
"capabilities" : [ "CooperativeMatrixKHR" ],
"version" : "None"
@@ -4818,11 +5012,11 @@
"class" : "Memory",
"opcode" : 4458,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Object'" },
- { "kind" : "IdRef", "name" : "'MemoryLayout'" },
- { "kind" : "IdRef", "name" : "'Stride'", "quantifier": "?" },
- { "kind" : "MemoryAccess", "name" : "'Memory Operand'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "IdRef", "name" : "MemoryLayout" },
+ { "kind" : "IdRef", "name" : "Stride", "quantifier": "?" },
+ { "kind" : "MemoryAccess", "name" : "Memory Operand", "quantifier" : "?" }
],
"capabilities" : [ "CooperativeMatrixKHR" ],
"version" : "None"
@@ -4834,10 +5028,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "IdRef", "name" : "'C'" },
- { "kind" : "CooperativeMatrixOperands", "name" : "'Cooperative Matrix Operands'", "quantifier" : "?" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "IdRef", "name" : "C" },
+ { "kind" : "CooperativeMatrixOperands", "name" : "Cooperative Matrix Operands", "quantifier" : "?" }
],
"capabilities" : [ "CooperativeMatrixKHR" ],
"version" : "None"
@@ -4849,12 +5043,48 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Type'" }
+ { "kind" : "IdRef", "name" : "Type" }
],
"capabilities" : [ "CooperativeMatrixKHR" ],
"version" : "None"
},
{
+ "opname" : "OpConstantCompositeReplicateEXT",
+ "class" : "Constant-Creation",
+ "opcode" : 4461,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Value" }
+ ],
+ "capabilities" : [ "ReplicatedCompositesEXT" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSpecConstantCompositeReplicateEXT",
+ "class" : "Constant-Creation",
+ "opcode" : 4462,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Value" }
+ ],
+ "capabilities" : [ "ReplicatedCompositesEXT" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCompositeConstructReplicateEXT",
+ "class" : "Composite",
+ "opcode" : 4463,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Value" }
+ ],
+ "capabilities" : [ "ReplicatedCompositesEXT" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpTypeRayQueryKHR",
"class" : "Type-Declaration",
"opcode" : 4472,
@@ -4872,35 +5102,35 @@
"operands" : [
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Accel'"
+ "name" : "Accel"
},
{
"kind" : "IdRef",
- "name" : "'RayFlags'"
+ "name" : "RayFlags"
},
{
"kind" : "IdRef",
- "name" : "'CullMask'"
+ "name" : "CullMask"
},
{
"kind" : "IdRef",
- "name" : "'RayOrigin'"
+ "name" : "RayOrigin"
},
{
"kind" : "IdRef",
- "name" : "'RayTMin'"
+ "name" : "RayTMin"
},
{
"kind" : "IdRef",
- "name" : "'RayDirection'"
+ "name" : "RayDirection"
},
{
"kind" : "IdRef",
- "name" : "'RayTMax'"
+ "name" : "RayTMax"
}
],
@@ -4915,7 +5145,7 @@
"operands" : [
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -4929,11 +5159,11 @@
"operands" : [
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'HitT'"
+ "name" : "HitT"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -4947,7 +5177,7 @@
"operands" : [
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -4963,7 +5193,7 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -4979,11 +5209,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -4997,9 +5227,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Texture'" },
- { "kind" : "IdRef", "name" : "'Coordinates'" },
- { "kind" : "IdRef", "name" : "'Weights'" }
+ { "kind" : "IdRef", "name" : "Texture" },
+ { "kind" : "IdRef", "name" : "Coordinates" },
+ { "kind" : "IdRef", "name" : "Weights" }
],
"capabilities" : [ "TextureSampleWeightedQCOM" ],
"version" : "None"
@@ -5011,9 +5241,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Texture'" },
- { "kind" : "IdRef", "name" : "'Coordinates'" },
- { "kind" : "IdRef", "name" : "'Box Size'" }
+ { "kind" : "IdRef", "name" : "Texture" },
+ { "kind" : "IdRef", "name" : "Coordinates" },
+ { "kind" : "IdRef", "name" : "Box Size" }
],
"capabilities" : [ "TextureBoxFilterQCOM" ],
"version" : "None"
@@ -5025,11 +5255,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Target Coordinates'" },
- { "kind" : "IdRef", "name" : "'Reference'" },
- { "kind" : "IdRef", "name" : "'Reference Coordinates'" },
- { "kind" : "IdRef", "name" : "'Block Size'" }
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Target Coordinates" },
+ { "kind" : "IdRef", "name" : "Reference" },
+ { "kind" : "IdRef", "name" : "Reference Coordinates" },
+ { "kind" : "IdRef", "name" : "Block Size" }
],
"capabilities" : [ "TextureBlockMatchQCOM" ],
"version" : "None"
@@ -5041,27 +5271,39 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "IdRef", "name" : "'Target Coordinates'" },
- { "kind" : "IdRef", "name" : "'Reference'" },
- { "kind" : "IdRef", "name" : "'Reference Coordinates'" },
- { "kind" : "IdRef", "name" : "'Block Size'" }
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "IdRef", "name" : "Target Coordinates" },
+ { "kind" : "IdRef", "name" : "Reference" },
+ { "kind" : "IdRef", "name" : "Reference Coordinates" },
+ { "kind" : "IdRef", "name" : "Block Size" }
],
"capabilities" : [ "TextureBlockMatchQCOM" ],
"version" : "None"
},
{
+ "opname" : "OpBitCastArrayQCOM",
+ "class" : "Conversion",
+ "opcode" : 4497,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Source Array" }
+ ],
+ "capabilities" : [ "CooperativeMatrixConversionQCOM" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpImageBlockMatchWindowSSDQCOM",
"class" : "Image",
"opcode" : 4500,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Target Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Target Coordinates'" },
- { "kind" : "IdRef", "name" : "'Reference Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Reference Coordinates'" },
- { "kind" : "IdRef", "name" : "'Block Size'" }
+ { "kind" : "IdRef", "name" : "Target Sampled Image" },
+ { "kind" : "IdRef", "name" : "Target Coordinates" },
+ { "kind" : "IdRef", "name" : "Reference Sampled Image" },
+ { "kind" : "IdRef", "name" : "Reference Coordinates" },
+ { "kind" : "IdRef", "name" : "Block Size" }
],
"capabilities" : [ "TextureBlockMatch2QCOM" ],
"version" : "None"
@@ -5073,11 +5315,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Target Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Target Coordinates'" },
- { "kind" : "IdRef", "name" : "'Reference Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Reference Coordinates'" },
- { "kind" : "IdRef", "name" : "'Block Size'" }
+ { "kind" : "IdRef", "name" : "Target Sampled Image" },
+ { "kind" : "IdRef", "name" : "Target Coordinates" },
+ { "kind" : "IdRef", "name" : "Reference Sampled Image" },
+ { "kind" : "IdRef", "name" : "Reference Coordinates" },
+ { "kind" : "IdRef", "name" : "Block Size" }
],
"capabilities" : [ "TextureBlockMatch2QCOM" ],
"version" : "None"
@@ -5089,11 +5331,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Target Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Target Coordinates'" },
- { "kind" : "IdRef", "name" : "'Reference Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Reference Coordinates'" },
- { "kind" : "IdRef", "name" : "'Block Size'" }
+ { "kind" : "IdRef", "name" : "Target Sampled Image" },
+ { "kind" : "IdRef", "name" : "Target Coordinates" },
+ { "kind" : "IdRef", "name" : "Reference Sampled Image" },
+ { "kind" : "IdRef", "name" : "Reference Coordinates" },
+ { "kind" : "IdRef", "name" : "Block Size" }
],
"capabilities" : [ "TextureBlockMatch2QCOM" ],
"version" : "None"
@@ -5105,25 +5347,62 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Target Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Target Coordinates'" },
- { "kind" : "IdRef", "name" : "'Reference Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Reference Coordinates'" },
- { "kind" : "IdRef", "name" : "'Block Size'" }
+ { "kind" : "IdRef", "name" : "Target Sampled Image" },
+ { "kind" : "IdRef", "name" : "Target Coordinates" },
+ { "kind" : "IdRef", "name" : "Reference Sampled Image" },
+ { "kind" : "IdRef", "name" : "Reference Coordinates" },
+ { "kind" : "IdRef", "name" : "Block Size" }
],
"capabilities" : [ "TextureBlockMatch2QCOM" ],
"version" : "None"
},
{
+ "opname" : "OpCompositeConstructCoopMatQCOM",
+ "class" : "Composite",
+ "opcode" : 4540,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Source Array" }
+ ],
+ "capabilities" : [ "CooperativeMatrixConversionQCOM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCompositeExtractCoopMatQCOM",
+ "class" : "Composite",
+ "opcode" : 4541,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Source Cooperative Matrix" }
+ ],
+ "capabilities" : [ "CooperativeMatrixConversionQCOM" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpExtractSubArrayQCOM",
+ "class" : "Composite",
+ "opcode" : 4542,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Source Array" },
+ { "kind" : "IdRef", "name" : "index" }
+ ],
+ "capabilities" : [ "CooperativeMatrixConversionQCOM" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpGroupIAddNonUniformAMD",
"class" : "Group",
"opcode" : 5000,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5136,9 +5415,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5151,9 +5430,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5166,9 +5445,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5181,9 +5460,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5196,9 +5475,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5211,9 +5490,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5226,9 +5505,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "Groups" ],
"extensions" : [ "SPV_AMD_shader_ballot" ],
@@ -5241,8 +5520,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" }
],
"capabilities" : [ "FragmentMaskAMD" ],
"extensions" : [ "SPV_AMD_shader_fragment_mask" ],
@@ -5255,9 +5534,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Fragment Index'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Fragment Index" }
],
"capabilities" : [ "FragmentMaskAMD" ],
"extensions" : [ "SPV_AMD_shader_fragment_mask" ],
@@ -5270,19 +5549,47 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Scope'" }
+ { "kind" : "IdScope", "name" : "Scope" }
],
"capabilities" : [ "ShaderClockKHR" ],
"version" : "None"
},
{
- "opname" : "OpFinalizeNodePayloadsAMDX",
+ "opname" : "OpAllocateNodePayloadsAMDX",
+ "class" : "Reserved",
+ "opcode" : 5074,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "Visibility" },
+ { "kind" : "IdRef", "name": "Payload Count" },
+ { "kind" : "IdRef", "name": "Node Index" }
+ ],
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpEnqueueNodePayloadsAMDX",
"class" : "Reserved",
"opcode" : 5075,
"operands" : [
- { "kind" : "IdRef", "name": "'Payload Array'" }
+ { "kind" : "IdRef", "name": "Payload Array" }
],
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTypeNodePayloadArrayAMDX",
+ "class" : "Reserved",
+ "opcode" : 5076,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name": "Payload Type" }
+ ],
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
@@ -5292,32 +5599,71 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name": "'Payload'" }
+ { "kind" : "IdRef", "name": "Payload" }
],
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
- "opname" : "OpInitializeNodePayloadsAMDX",
+ "opname" : "OpNodePayloadArrayLengthAMDX",
"class" : "Reserved",
"opcode" : 5090,
"operands" : [
- { "kind" : "IdRef", "name": "'Payload Array'" },
- { "kind" : "IdScope", "name": "'Visibility'" },
- { "kind" : "IdRef", "name": "'Payload Count'" },
- { "kind" : "IdRef", "name": "'Node Index'" }
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name": "Payload Array" }
],
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
+ "opname" : "OpIsNodePayloadValidAMDX",
+ "class" : "Reserved",
+ "opcode" : 5101,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name": "Payload Type" },
+ { "kind" : "IdRef", "name": "Node Index" }
+ ],
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
+ "opname" : "OpConstantStringAMDX",
+ "class" : "Reserved",
+ "opcode" : 5103,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "LiteralString", "name": "Literal String" }
+ ],
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
+ "opname" : "OpSpecConstantStringAMDX",
+ "class" : "Reserved",
+ "opcode" : 5104,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "LiteralString", "name": "Literal String" }
+ ],
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
"opname" : "OpGroupNonUniformQuadAllKHR",
"class" : "Non-Uniform",
"opcode" : 5110,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "QuadControlKHR" ],
"version" : "None"
@@ -5329,7 +5675,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Predicate'" }
+ { "kind" : "IdRef", "name" : "Predicate" }
],
"capabilities" : [ "QuadControlKHR" ],
"version" : "None"
@@ -5339,20 +5685,20 @@
"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'" }
+ { "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"
@@ -5362,19 +5708,19 @@
"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'" }
+ { "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"
@@ -5384,13 +5730,13 @@
"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'" }
+ { "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"
@@ -5402,7 +5748,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5414,7 +5760,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5426,7 +5772,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5438,7 +5784,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5448,19 +5794,19 @@
"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'"}
+ { "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"
@@ -5472,7 +5818,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5484,7 +5830,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5494,7 +5840,7 @@
"class" : "Reserved",
"opcode" : 5259,
"operands" : [
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5504,18 +5850,18 @@
"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'"}
+ { "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"
@@ -5525,19 +5871,19 @@
"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'" }
+ { "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"
@@ -5547,18 +5893,18 @@
"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'" }
+ { "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"
@@ -5568,12 +5914,12 @@
"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'" }
+ { "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"
@@ -5583,8 +5929,8 @@
"class" : "Reserved",
"opcode" : 5264,
"operands" : [
- { "kind" : "IdRef", "name" : "'Hit Object'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Hit Object" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5596,7 +5942,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5606,8 +5952,8 @@
"class" : "Reserved",
"opcode" : 5266,
"operands" : [
- { "kind" : "IdRef", "name" : "'Hit Object'" },
- { "kind" : "IdRef", "name" : "'Hit Object Attribute'" }
+ { "kind" : "IdRef", "name" : "Hit Object" },
+ { "kind" : "IdRef", "name" : "Hit Object Attribute" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5619,7 +5965,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5631,7 +5977,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5643,7 +5989,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5655,7 +6001,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5667,7 +6013,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5679,7 +6025,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5691,7 +6037,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5703,7 +6049,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5715,7 +6061,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5727,7 +6073,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5739,7 +6085,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5751,7 +6097,7 @@
"operands" : [
{ "kind" : "IdResultType"},
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Hit Object'" }
+ { "kind" : "IdRef", "name" : "Hit Object" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5761,9 +6107,9 @@
"class" : "Reserved",
"opcode" : 5279,
"operands" : [
- { "kind" : "IdRef", "name" : "'Hit Object'" },
- { "kind" : "IdRef", "quantifier" : "?", "name" : "'Hint'" },
- { "kind" : "IdRef", "quantifier" : "?", "name" : "'Bits'" }
+ { "kind" : "IdRef", "name" : "Hit Object" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Hint" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Bits" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5773,8 +6119,8 @@
"class" : "Reserved",
"opcode" : 5280,
"operands" : [
- { "kind" : "IdRef", "name" : "'Hint'" },
- { "kind" : "IdRef", "name" : "'Bits'" }
+ { "kind" : "IdRef", "name" : "Hint" },
+ { "kind" : "IdRef", "name" : "Bits" }
],
"capabilities" : [ "ShaderInvocationReorderNV" ],
"version" : "None"
@@ -5796,10 +6142,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Sampled Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Granularity'" },
- { "kind" : "IdRef", "name" : "'Coarse'" },
+ { "kind" : "IdRef", "name" : "Sampled Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Granularity" },
+ { "kind" : "IdRef", "name" : "Coarse" },
{ "kind" : "ImageOperands", "quantifier" : "?" }
],
"capabilities" : [ "ImageFootprintNV" ],
@@ -5807,14 +6153,113 @@
"version" : "None"
},
{
+ "opname" : "OpTypeCooperativeVectorNV",
+ "class" : "Type-Declaration",
+ "opcode" : 5288,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Component Type" },
+ { "kind" : "IdRef", "name" : "Component Count" }
+ ],
+ "capabilities" : [ "CooperativeVectorNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeVectorMatrixMulNV",
+ "class" : "Reserved",
+ "opcode" : 5289,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "IdRef", "name" : "InputInterpretation" },
+ { "kind" : "IdRef", "name" : "Matrix" },
+ { "kind" : "IdRef", "name" : "MatrixOffset" },
+ { "kind" : "IdRef", "name" : "MatrixInterpretation" },
+ { "kind" : "IdRef", "name" : "M" },
+ { "kind" : "IdRef", "name" : "K" },
+ { "kind" : "IdRef", "name" : "MemoryLayout" },
+ { "kind" : "IdRef", "name" : "Transpose" },
+ { "kind" : "IdRef", "name" : "MatrixStride", "quantifier": "?" },
+ { "kind" : "CooperativeMatrixOperands", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "CooperativeVectorNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeVectorOuterProductAccumulateNV",
+ "class" : "Reserved",
+ "opcode" : 5290,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "IdRef", "name" : "MemoryLayout" },
+ { "kind" : "IdRef", "name" : "MatrixInterpretation" },
+ { "kind" : "IdRef", "name" : "MatrixStride", "quantifier": "?" }
+ ],
+ "capabilities" : [ "CooperativeVectorTrainingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeVectorReduceSumAccumulateNV",
+ "class" : "Reserved",
+ "opcode" : 5291,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "V" }
+ ],
+ "capabilities" : [ "CooperativeVectorTrainingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeVectorMatrixMulAddNV",
+ "class" : "Reserved",
+ "opcode" : 5292,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "IdRef", "name" : "InputInterpretation" },
+ { "kind" : "IdRef", "name" : "Matrix" },
+ { "kind" : "IdRef", "name" : "MatrixOffset" },
+ { "kind" : "IdRef", "name" : "MatrixInterpretation" },
+ { "kind" : "IdRef", "name" : "Bias" },
+ { "kind" : "IdRef", "name" : "BiasOffset" },
+ { "kind" : "IdRef", "name" : "BiasInterpretation" },
+ { "kind" : "IdRef", "name" : "M" },
+ { "kind" : "IdRef", "name" : "K" },
+ { "kind" : "IdRef", "name" : "MemoryLayout" },
+ { "kind" : "IdRef", "name" : "Transpose" },
+ { "kind" : "IdRef", "name" : "MatrixStride", "quantifier": "?" },
+ { "kind" : "CooperativeMatrixOperands", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "CooperativeVectorNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeMatrixConvertNV",
+ "class" : "Conversion",
+ "opcode" : 5293,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Matrix" }
+ ],
+ "capabilities" : [ "CooperativeMatrixConversionsNV" ],
+ "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'" }
+ { "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"
@@ -5824,8 +6269,8 @@
"class" : "Reserved",
"opcode" : 5295,
"operands" : [
- { "kind" : "IdRef", "name" : "'Vertex Count'" },
- { "kind" : "IdRef", "name" : "'Primitive Count'" }
+ { "kind" : "IdRef", "name" : "Vertex Count" },
+ { "kind" : "IdRef", "name" : "Primitive Count" }
],
"capabilities" : [ "MeshShadingEXT" ],
"version" : "None"
@@ -5837,7 +6282,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "GroupNonUniformPartitionedNV" ],
"extensions" : [ "SPV_NV_shader_subgroup_partitioned" ],
@@ -5848,8 +6293,8 @@
"class" : "Reserved",
"opcode" : 5299,
"operands" : [
- { "kind" : "IdRef", "name" : "'Index Offset'" },
- { "kind" : "IdRef", "name" : "'Packed Indices'" }
+ { "kind" : "IdRef", "name" : "Index Offset" },
+ { "kind" : "IdRef", "name" : "Packed Indices" }
],
"capabilities" : [ "MeshShadingNV" ],
"extensions" : [ "SPV_NV_mesh_shader" ],
@@ -5862,11 +6307,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Accel'" },
- { "kind" : "IdRef", "name" : "'Instance Id'" },
- { "kind" : "IdRef", "name" : "'Geometry Index'" },
- { "kind" : "IdRef", "name" : "'Primitive Index'" },
- { "kind" : "IdRef", "name" : "'Barycentric'" }
+ { "kind" : "IdRef", "name" : "Accel" },
+ { "kind" : "IdRef", "name" : "Instance Id" },
+ { "kind" : "IdRef", "name" : "Geometry Index" },
+ { "kind" : "IdRef", "name" : "Primitive Index" },
+ { "kind" : "IdRef", "name" : "Barycentric" }
],
"capabilities" : [ "DisplacementMicromapNV" ],
"version" : "None"
@@ -5878,38 +6323,52 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Accel'" },
- { "kind" : "IdRef", "name" : "'Instance Id'" },
- { "kind" : "IdRef", "name" : "'Geometry Index'" },
- { "kind" : "IdRef", "name" : "'Primitive Index'" },
- { "kind" : "IdRef", "name" : "'Barycentric'" }
+ { "kind" : "IdRef", "name" : "Accel" },
+ { "kind" : "IdRef", "name" : "Instance Id" },
+ { "kind" : "IdRef", "name" : "Geometry Index" },
+ { "kind" : "IdRef", "name" : "Primitive Index" },
+ { "kind" : "IdRef", "name" : "Barycentric" }
],
"capabilities" : [ "DisplacementMicromapNV" ],
"version" : "None"
},
{
- "opname" : "OpReportIntersectionNV",
- "class" : "Reserved",
- "opcode" : 5334,
+ "opname" : "OpCooperativeVectorLoadNV",
+ "class" : "Memory",
+ "opcode" : 5302,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Hit'" },
- { "kind" : "IdRef", "name" : "'HitKind'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "MemoryAccess", "quantifier" : "?" }
],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
+ "capabilities" : [ "CooperativeVectorNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeVectorStoreNV",
+ "class" : "Memory",
+ "opcode" : 5303,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "MemoryAccess", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "CooperativeVectorNV" ],
"version" : "None"
},
{
"opname" : "OpReportIntersectionKHR",
"class" : "Reserved",
+ "aliases" : ["OpReportIntersectionNV"],
"opcode" : 5334,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Hit'" },
- { "kind" : "IdRef", "name" : "'HitKind'" }
+ { "kind" : "IdRef", "name" : "Hit" },
+ { "kind" : "IdRef", "name" : "HitKind" }
],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
@@ -5937,17 +6396,17 @@
"opcode" : 5337,
"operands" : [
- { "kind" : "IdRef", "name" : "'Accel'" },
- { "kind" : "IdRef", "name" : "'Ray Flags'" },
- { "kind" : "IdRef", "name" : "'Cull Mask'" },
- { "kind" : "IdRef", "name" : "'SBT Offset'" },
- { "kind" : "IdRef", "name" : "'SBT Stride'" },
- { "kind" : "IdRef", "name" : "'Miss Index'" },
- { "kind" : "IdRef", "name" : "'Ray Origin'" },
- { "kind" : "IdRef", "name" : "'Ray Tmin'" },
- { "kind" : "IdRef", "name" : "'Ray Direction'" },
- { "kind" : "IdRef", "name" : "'Ray Tmax'" },
- { "kind" : "IdRef", "name" : "'PayloadId'" }
+ { "kind" : "IdRef", "name" : "Accel" },
+ { "kind" : "IdRef", "name" : "Ray Flags" },
+ { "kind" : "IdRef", "name" : "Cull Mask" },
+ { "kind" : "IdRef", "name" : "SBT Offset" },
+ { "kind" : "IdRef", "name" : "SBT Stride" },
+ { "kind" : "IdRef", "name" : "Miss Index" },
+ { "kind" : "IdRef", "name" : "Ray Origin" },
+ { "kind" : "IdRef", "name" : "Ray Tmin" },
+ { "kind" : "IdRef", "name" : "Ray Direction" },
+ { "kind" : "IdRef", "name" : "Ray Tmax" },
+ { "kind" : "IdRef", "name" : "PayloadId" }
],
"capabilities" : [ "RayTracingNV" ],
"extensions" : [ "SPV_NV_ray_tracing" ],
@@ -5959,18 +6418,18 @@
"opcode" : 5338,
"operands" : [
- { "kind" : "IdRef", "name" : "'Accel'" },
- { "kind" : "IdRef", "name" : "'Ray Flags'" },
- { "kind" : "IdRef", "name" : "'Cull Mask'" },
- { "kind" : "IdRef", "name" : "'SBT Offset'" },
- { "kind" : "IdRef", "name" : "'SBT Stride'" },
- { "kind" : "IdRef", "name" : "'Miss Index'" },
- { "kind" : "IdRef", "name" : "'Ray Origin'" },
- { "kind" : "IdRef", "name" : "'Ray Tmin'" },
- { "kind" : "IdRef", "name" : "'Ray Direction'" },
- { "kind" : "IdRef", "name" : "'Ray Tmax'" },
- { "kind" : "IdRef", "name" : "'Time'" },
- { "kind" : "IdRef", "name" : "'PayloadId'" }
+ { "kind" : "IdRef", "name" : "Accel" },
+ { "kind" : "IdRef", "name" : "Ray Flags" },
+ { "kind" : "IdRef", "name" : "Cull Mask" },
+ { "kind" : "IdRef", "name" : "SBT Offset" },
+ { "kind" : "IdRef", "name" : "SBT Stride" },
+ { "kind" : "IdRef", "name" : "Miss Index" },
+ { "kind" : "IdRef", "name" : "Ray Origin" },
+ { "kind" : "IdRef", "name" : "Ray Tmin" },
+ { "kind" : "IdRef", "name" : "Ray Direction" },
+ { "kind" : "IdRef", "name" : "Ray Tmax" },
+ { "kind" : "IdRef", "name" : "Time" },
+ { "kind" : "IdRef", "name" : "PayloadId" }
],
"capabilities" : [ "RayTracingMotionBlurNV" ],
"extensions" : [ "SPV_NV_ray_tracing_motion_blur" ],
@@ -5982,18 +6441,18 @@
"opcode" : 5339,
"operands" : [
- { "kind" : "IdRef", "name" : "'Accel'" },
- { "kind" : "IdRef", "name" : "'Ray Flags'" },
- { "kind" : "IdRef", "name" : "'Cull Mask'" },
- { "kind" : "IdRef", "name" : "'SBT Offset'" },
- { "kind" : "IdRef", "name" : "'SBT Stride'" },
- { "kind" : "IdRef", "name" : "'Miss Index'" },
- { "kind" : "IdRef", "name" : "'Ray Origin'" },
- { "kind" : "IdRef", "name" : "'Ray Tmin'" },
- { "kind" : "IdRef", "name" : "'Ray Direction'" },
- { "kind" : "IdRef", "name" : "'Ray Tmax'" },
- { "kind" : "IdRef", "name" : "'Time'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Accel" },
+ { "kind" : "IdRef", "name" : "Ray Flags" },
+ { "kind" : "IdRef", "name" : "Cull Mask" },
+ { "kind" : "IdRef", "name" : "SBT Offset" },
+ { "kind" : "IdRef", "name" : "SBT Stride" },
+ { "kind" : "IdRef", "name" : "Miss Index" },
+ { "kind" : "IdRef", "name" : "Ray Origin" },
+ { "kind" : "IdRef", "name" : "Ray Tmin" },
+ { "kind" : "IdRef", "name" : "Ray Direction" },
+ { "kind" : "IdRef", "name" : "Ray Tmax" },
+ { "kind" : "IdRef", "name" : "Time" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "RayTracingMotionBlurNV" ],
"extensions" : [ "SPV_NV_ray_tracing_motion_blur" ],
@@ -6008,36 +6467,26 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryPositionFetchKHR" ],
"version" : "None"
},
{
- "opname" : "OpTypeAccelerationStructureNV",
- "class" : "Type-Declaration",
- "opcode" : 5341,
- "operands" : [
- { "kind" : "IdResult" }
- ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR", "RayQueryKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ],
- "version" : "None"
- },
- {
"opname" : "OpTypeAccelerationStructureKHR",
"class" : "Type-Declaration",
+ "aliases" : ["OpTypeAccelerationStructureNV"],
"opcode" : 5341,
"operands" : [
{ "kind" : "IdResult" }
],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR", "RayQueryKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing", "SPV_KHR_ray_query" ],
+ "capabilities" : [ "RayTracingNV" , "RayTracingKHR", "RayQueryKHR", "DisplacementMicromapNV" ],
+ "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing", "SPV_KHR_ray_query", "SPV_NV_displacement_micromap" ],
"version" : "None"
},
{
@@ -6046,23 +6495,54 @@
"opcode" : 5344,
"operands" : [
- { "kind" : "IdRef", "name" : "'SBT Index'" },
- { "kind" : "IdRef", "name" : "'Callable DataId'" }
+ { "kind" : "IdRef", "name" : "SBT Index" },
+ { "kind" : "IdRef", "name" : "Callable DataId" }
],
"capabilities" : [ "RayTracingNV" ],
"extensions" : [ "SPV_NV_ray_tracing" ],
"version" : "None"
},
{
+ "opname" : "OpRayQueryGetClusterIdNV",
+ "class" : "Reserved",
+ "opcode" : 5345,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingClusterAccelerationStructureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetClusterIdNV",
+ "class" : "Reserved",
+ "opcode" : 5346,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingClusterAccelerationStructureNV" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpTypeCooperativeMatrixNV",
"class" : "Type-Declaration",
"opcode" : 5358,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Component Type'" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdRef", "name" : "'Rows'" },
- { "kind" : "IdRef", "name" : "'Columns'" }
+ { "kind" : "IdRef", "name" : "Component Type" },
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdRef", "name" : "Rows" },
+ { "kind" : "IdRef", "name" : "Columns" }
],
"capabilities" : [ "CooperativeMatrixNV" ],
"extensions" : [ "SPV_NV_cooperative_matrix" ],
@@ -6075,9 +6555,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Stride'" },
- { "kind" : "IdRef", "name" : "'Column Major'" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Stride" },
+ { "kind" : "IdRef", "name" : "Column Major" },
{ "kind" : "MemoryAccess", "quantifier" : "?" }
],
"capabilities" : [ "CooperativeMatrixNV" ],
@@ -6089,10 +6569,10 @@
"class" : "Reserved",
"opcode" : 5360,
"operands" : [
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdRef", "name" : "'Object'" },
- { "kind" : "IdRef", "name" : "'Stride'" },
- { "kind" : "IdRef", "name" : "'Column Major'" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "IdRef", "name" : "Stride" },
+ { "kind" : "IdRef", "name" : "Column Major" },
{ "kind" : "MemoryAccess", "quantifier" : "?" }
],
"capabilities" : [ "CooperativeMatrixNV" ],
@@ -6106,9 +6586,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "IdRef", "name" : "'C'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "IdRef", "name" : "C" }
],
"capabilities" : [ "CooperativeMatrixNV" ],
"extensions" : [ "SPV_NV_cooperative_matrix" ],
@@ -6121,7 +6601,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Type'" }
+ { "kind" : "IdRef", "name" : "Type" }
],
"capabilities" : [ "CooperativeMatrixNV" ],
"extensions" : [ "SPV_NV_cooperative_matrix" ],
@@ -6144,17 +6624,200 @@
"version" : "None"
},
{
- "opname" : "OpDemoteToHelperInvocation",
- "class" : "Control-Flow",
- "opcode" : 5380,
- "capabilities" : [ "DemoteToHelperInvocation" ],
- "version" : "1.6"
+ "opname" : "OpCooperativeMatrixReduceNV",
+ "class" : "Arithmetic",
+ "opcode" : 5366,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Matrix" },
+ { "kind" : "CooperativeMatrixReduce", "name" : "Reduce" },
+ { "kind" : "IdRef", "name" : "CombineFunc" }
+ ],
+ "capabilities" : [ "CooperativeMatrixReductionsNV" ],
+ "version" : "None"
},
{
- "opname" : "OpDemoteToHelperInvocationEXT",
+ "opname" : "OpCooperativeMatrixLoadTensorNV",
+ "class" : "Memory",
+ "opcode" : 5367,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "MemoryAccess", "name" : "Memory Operand"},
+ { "kind" : "TensorAddressingOperands", "name" : "Tensor Addressing Operands"}
+ ],
+ "capabilities" : [ "CooperativeMatrixTensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeMatrixStoreTensorNV",
+ "class" : "Memory",
+ "opcode" : 5368,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdRef", "name" : "Object" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "MemoryAccess", "name" : "Memory Operand"},
+ { "kind" : "TensorAddressingOperands", "name" : "Tensor Addressing Operands"}
+ ],
+ "capabilities" : [ "CooperativeMatrixTensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeMatrixPerElementOpNV",
+ "class" : "Function",
+ "opcode" : 5369,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Matrix" },
+ { "kind" : "IdRef", "name" : "Func" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Operands" }
+ ],
+ "capabilities" : [ "CooperativeMatrixPerElementOperationsNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTypeTensorLayoutNV",
+ "class" : "Type-Declaration",
+ "opcode" : 5370,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Dim" },
+ { "kind" : "IdRef", "name" : "ClampMode" }
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTypeTensorViewNV",
+ "class" : "Type-Declaration",
+ "opcode" : 5371,
+ "operands" : [
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Dim" },
+ { "kind" : "IdRef", "name" : "HasDimensions" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "p" }
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCreateTensorLayoutNV",
+ "class" : "Reserved",
+ "opcode" : 5372,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" }
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorLayoutSetDimensionNV",
+ "class" : "Reserved",
+ "opcode" : 5373,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Dim" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorLayoutSetStrideNV",
+ "class" : "Reserved",
+ "opcode" : 5374,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Stride" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorLayoutSliceNV",
+ "class" : "Reserved",
+ "opcode" : 5375,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Operands" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorLayoutSetClampValueNV",
+ "class" : "Reserved",
+ "opcode" : 5376,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "IdRef", "name" : "Value" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCreateTensorViewNV",
+ "class" : "Reserved",
+ "opcode" : 5377,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" }
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorViewSetDimensionNV",
+ "class" : "Reserved",
+ "opcode" : 5378,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorView" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Dim" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorViewSetStrideNV",
+ "class" : "Reserved",
+ "opcode" : 5379,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorView" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Stride" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpDemoteToHelperInvocation",
"class" : "Control-Flow",
+ "aliases" : ["OpDemoteToHelperInvocationEXT"],
"opcode" : 5380,
- "capabilities" : [ "DemoteToHelperInvocationEXT" ],
+ "capabilities" : [ "DemoteToHelperInvocation" ],
"version" : "1.6"
},
{
@@ -6165,18 +6828,60 @@
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" }
],
- "capabilities" : [ "DemoteToHelperInvocationEXT" ],
+ "capabilities" : [ "DemoteToHelperInvocation" ],
"extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
"version" : "None"
},
{
+ "opname" : "OpTensorViewSetClipNV",
+ "class" : "Reserved",
+ "opcode" : 5382,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorView" },
+ { "kind" : "IdRef", "name" : "ClipRowOffset" },
+ { "kind" : "IdRef", "name" : "ClipRowSpan" },
+ { "kind" : "IdRef", "name" : "ClipColOffset" },
+ { "kind" : "IdRef", "name" : "ClipColSpan" }
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTensorLayoutSetBlockSizeNV",
+ "class" : "Reserved",
+ "opcode" : 5384,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "TensorLayout" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "BlockSize" }
+
+ ],
+ "capabilities" : [ "TensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpCooperativeMatrixTransposeNV",
+ "class" : "Conversion",
+ "opcode" : 5390,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Matrix" }
+ ],
+ "capabilities" : [ "CooperativeMatrixConversionsNV" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpConvertUToImageNV",
"class" : "Reserved",
"opcode" : 5391,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6188,7 +6893,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6200,7 +6905,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6212,7 +6917,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6224,7 +6929,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6236,7 +6941,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6246,7 +6951,7 @@
"class" : "Reserved",
"opcode" : 5397,
"operands" : [
- { "kind" : "LiteralInteger", "name" : "'Bit Width'" }
+ { "kind" : "LiteralInteger", "name" : "Bit Width" }
],
"capabilities" : [ "BindlessTextureNV" ],
"version" : "None"
@@ -6258,10 +6963,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Base'" },
- { "kind" : "IdRef", "name" : "'Byte stride'" },
- { "kind" : "IdRef", "name" : "'Element index'" },
- { "kind" : "IdRef", "name" : "'Byte offset'" },
+ { "kind" : "IdRef", "name" : "Base" },
+ { "kind" : "IdRef", "name" : "Byte stride" },
+ { "kind" : "IdRef", "name" : "Element index" },
+ { "kind" : "IdRef", "name" : "Byte offset" },
{ "kind" : "RawAccessChainOperands", "quantifier" : "?" }
],
"capabilities" : [
@@ -6270,14 +6975,219 @@
"version" : "None"
},
{
+ "opname" : "OpRayQueryGetIntersectionSpherePositionNV",
+ "class" : "Reserved",
+ "opcode" : 5427,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpRayQueryGetIntersectionSphereRadiusNV",
+ "class" : "Reserved",
+ "opcode" : 5428,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpRayQueryGetIntersectionLSSPositionsNV",
+ "class" : "Reserved",
+ "opcode" : 5429,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpRayQueryGetIntersectionLSSRadiiNV",
+ "class" : "Reserved",
+ "opcode" : 5430,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV"],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpRayQueryGetIntersectionLSSHitValueNV",
+ "class" : "Reserved",
+ "opcode" : 5431,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetSpherePositionNV",
+ "class" : "Reserved",
+ "opcode" : 5432,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetSphereRadiusNV",
+ "class" : "Reserved",
+ "opcode" : 5433,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetLSSPositionsNV",
+ "class" : "Reserved",
+ "opcode" : 5434,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetLSSRadiiNV",
+ "class" : "Reserved",
+ "opcode" : 5435,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectIsSphereHitNV",
+ "class" : "Reserved",
+ "opcode" : 5436,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectIsLSSHitNV",
+ "class" : "Reserved",
+ "opcode" : 5437,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "Hit Object" }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpRayQueryIsSphereHitNV",
+ "class" : "Reserved",
+ "opcode" : 5438,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpRayQueryIsLSSHitNV",
+ "class" : "Reserved",
+ "opcode" : 5439,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ {
+ "kind" : "IdRef",
+ "name" : "RayQuery"
+ },
+ {
+ "kind" : "IdRef",
+ "name" : "Intersection"
+ }
+ ],
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpSubgroupShuffleINTEL",
"class" : "Group",
"opcode" : 5571,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Data'" },
- { "kind" : "IdRef", "name" : "'InvocationId'" }
+ { "kind" : "IdRef", "name" : "Data" },
+ { "kind" : "IdRef", "name" : "InvocationId" }
],
"capabilities" : [ "SubgroupShuffleINTEL" ],
"version" : "None"
@@ -6289,9 +7199,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Current'" },
- { "kind" : "IdRef", "name" : "'Next'" },
- { "kind" : "IdRef", "name" : "'Delta'" }
+ { "kind" : "IdRef", "name" : "Current" },
+ { "kind" : "IdRef", "name" : "Next" },
+ { "kind" : "IdRef", "name" : "Delta" }
],
"capabilities" : [ "SubgroupShuffleINTEL" ],
"version" : "None"
@@ -6303,9 +7213,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Previous'" },
- { "kind" : "IdRef", "name" : "'Current'" },
- { "kind" : "IdRef", "name" : "'Delta'" }
+ { "kind" : "IdRef", "name" : "Previous" },
+ { "kind" : "IdRef", "name" : "Current" },
+ { "kind" : "IdRef", "name" : "Delta" }
],
"capabilities" : [ "SubgroupShuffleINTEL" ],
"version" : "None"
@@ -6317,8 +7227,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Data'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Data" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "SubgroupShuffleINTEL" ],
"version" : "None"
@@ -6330,7 +7240,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Ptr'" }
+ { "kind" : "IdRef", "name" : "Ptr" }
],
"capabilities" : [ "SubgroupBufferBlockIOINTEL" ],
"version" : "None"
@@ -6340,8 +7250,8 @@
"class" : "Group",
"opcode" : 5576,
"operands" : [
- { "kind" : "IdRef", "name" : "'Ptr'" },
- { "kind" : "IdRef", "name" : "'Data'" }
+ { "kind" : "IdRef", "name" : "Ptr" },
+ { "kind" : "IdRef", "name" : "Data" }
],
"capabilities" : [ "SubgroupBufferBlockIOINTEL" ],
"version" : "None"
@@ -6353,8 +7263,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" }
],
"capabilities" : [ "SubgroupImageBlockIOINTEL" ],
"version" : "None"
@@ -6364,9 +7274,9 @@
"class" : "Group",
"opcode" : 5578,
"operands" : [
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Data'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Data" }
],
"capabilities" : [ "SubgroupImageBlockIOINTEL" ],
"version" : "None"
@@ -6378,10 +7288,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Width'" },
- { "kind" : "IdRef", "name" : "'Height'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Width" },
+ { "kind" : "IdRef", "name" : "Height" }
],
"capabilities" : [ "SubgroupImageMediaBlockIOINTEL" ],
"version" : "None"
@@ -6391,11 +7301,11 @@
"class" : "Group",
"opcode" : 5581,
"operands" : [
- { "kind" : "IdRef", "name" : "'Image'" },
- { "kind" : "IdRef", "name" : "'Coordinate'" },
- { "kind" : "IdRef", "name" : "'Width'" },
- { "kind" : "IdRef", "name" : "'Height'" },
- { "kind" : "IdRef", "name" : "'Data'" }
+ { "kind" : "IdRef", "name" : "Image" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Width" },
+ { "kind" : "IdRef", "name" : "Height" },
+ { "kind" : "IdRef", "name" : "Data" }
],
"capabilities" : [ "SubgroupImageMediaBlockIOINTEL" ],
"version" : "None"
@@ -6407,7 +7317,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6419,7 +7329,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand'" }
+ { "kind" : "IdRef", "name" : "Operand" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6431,8 +7341,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6444,8 +7354,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6457,8 +7367,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6470,8 +7380,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6483,8 +7393,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6496,8 +7406,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6509,8 +7419,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6522,8 +7432,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6535,8 +7445,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6548,8 +7458,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6561,8 +7471,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6574,8 +7484,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Operand 1'" },
- { "kind" : "IdRef", "name" : "'Operand 2'" }
+ { "kind" : "IdRef", "name" : "Operand 1" },
+ { "kind" : "IdRef", "name" : "Operand 2" }
],
"capabilities" : [ "IntegerFunctions2INTEL" ],
"version" : "None"
@@ -6587,7 +7497,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Function'" }
+ { "kind" : "IdRef", "name" : "Function" }
],
"capabilities" : [ "FunctionPointersINTEL" ],
"extensions" : [ "SPV_INTEL_function_pointers" ],
@@ -6600,7 +7510,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Operand 1'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Operand 1" }
],
"capabilities" : [ "FunctionPointersINTEL" ],
"extensions" : [ "SPV_INTEL_function_pointers" ],
@@ -6611,9 +7521,8 @@
"class" : "@exclude",
"opcode" : 5609,
"operands" : [
- { "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "LiteralString", "name" : "'Asm target'" }
+ { "kind" : "LiteralString", "name" : "Asm target" }
],
"capabilities" : [ "AsmINTEL" ],
"version" : "None"
@@ -6625,10 +7534,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Asm type'" },
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "LiteralString", "name" : "'Asm instructions'" },
- { "kind" : "LiteralString", "name" : "'Constraints'" }
+ { "kind" : "IdRef", "name" : "Asm type" },
+ { "kind" : "IdRef", "name" : "Target" },
+ { "kind" : "LiteralString", "name" : "Asm instructions" },
+ { "kind" : "LiteralString", "name" : "Constraints" }
],
"capabilities" : [ "AsmINTEL" ],
"version" : "None"
@@ -6640,8 +7549,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Asm'" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Argument 0'" }
+ { "kind" : "IdRef", "name" : "Asm" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Argument" }
],
"capabilities" : [ "AsmINTEL" ],
"version" : "None"
@@ -6653,10 +7562,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT", "AtomicFloat16VectorNV" ],
"version" : "None"
@@ -6668,10 +7577,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "AtomicFloat16MinMaxEXT", "AtomicFloat32MinMaxEXT", "AtomicFloat64MinMaxEXT", "AtomicFloat16VectorNV" ],
"version" : "None"
@@ -6681,7 +7590,7 @@
"class" : "Miscellaneous",
"opcode" : 5630,
"operands" : [
- { "kind" : "IdRef", "name" : "'Condition'" }
+ { "kind" : "IdRef", "name" : "Condition" }
],
"capabilities" : [ "ExpectAssumeKHR" ],
"extensions" : [ "SPV_KHR_expect_assume" ],
@@ -6694,8 +7603,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Value'" },
- { "kind" : "IdRef", "name" : "'ExpectedValue'" }
+ { "kind" : "IdRef", "name" : "Value" },
+ { "kind" : "IdRef", "name" : "ExpectedValue" }
],
"capabilities" : [ "ExpectAssumeKHR" ],
"extensions" : [ "SPV_KHR_expect_assume" ],
@@ -6704,20 +7613,10 @@
{
"opname" : "OpDecorateString",
"class" : "Annotation",
+ "aliases" : ["OpDecorateStringGOOGLE"],
"opcode" : 5632,
"operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
- { "kind" : "Decoration" }
- ],
- "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ],
- "version" : "1.4"
- },
- {
- "opname" : "OpDecorateStringGOOGLE",
- "class" : "Annotation",
- "opcode" : 5632,
- "operands" : [
- { "kind" : "IdRef", "name" : "'Target'" },
+ { "kind" : "IdRef", "name" : "Target" },
{ "kind" : "Decoration" }
],
"extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ],
@@ -6726,22 +7625,11 @@
{
"opname" : "OpMemberDecorateString",
"class" : "Annotation",
+ "aliases" : ["OpMemberDecorateStringGOOGLE"],
"opcode" : 5633,
"operands" : [
- { "kind" : "IdRef", "name" : "'Struct Type'" },
- { "kind" : "LiteralInteger", "name" : "'Member'" },
- { "kind" : "Decoration" }
- ],
- "extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ],
- "version" : "1.4"
- },
- {
- "opname" : "OpMemberDecorateStringGOOGLE",
- "class" : "Annotation",
- "opcode" : 5633,
- "operands" : [
- { "kind" : "IdRef", "name" : "'Struct Type'" },
- { "kind" : "LiteralInteger", "name" : "'Member'" },
+ { "kind" : "IdRef", "name" : "Struct Type" },
+ { "kind" : "LiteralInteger", "name" : "Member" },
{ "kind" : "Decoration" }
],
"extensions" : [ "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1" ],
@@ -6754,8 +7642,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image Type'" },
- { "kind" : "IdRef", "name" : "'Sampler'" }
+ { "kind" : "IdRef", "name" : "Image Type" },
+ { "kind" : "IdRef", "name" : "Sampler" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6766,7 +7654,7 @@
"opcode" : 5700,
"operands" : [
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image Type'" }
+ { "kind" : "IdRef", "name" : "Image Type" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6898,8 +7786,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Slice Type'" },
- { "kind" : "IdRef", "name" : "'Qp'" }
+ { "kind" : "IdRef", "name" : "Slice Type" },
+ { "kind" : "IdRef", "name" : "Qp" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6911,8 +7799,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Reference Base Penalty'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Reference Base Penalty" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6924,8 +7812,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Slice Type'" },
- { "kind" : "IdRef", "name" : "'Qp'" }
+ { "kind" : "IdRef", "name" : "Slice Type" },
+ { "kind" : "IdRef", "name" : "Qp" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6937,8 +7825,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packed Shape Penalty'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Packed Shape Penalty" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6950,8 +7838,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Slice Type'" },
- { "kind" : "IdRef", "name" : "'Qp'" }
+ { "kind" : "IdRef", "name" : "Slice Type" },
+ { "kind" : "IdRef", "name" : "Qp" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6963,8 +7851,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Direction Cost'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Direction Cost" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -6976,8 +7864,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Slice Type'" },
- { "kind" : "IdRef", "name" : "'Qp'" }
+ { "kind" : "IdRef", "name" : "Slice Type" },
+ { "kind" : "IdRef", "name" : "Qp" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -6989,8 +7877,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Slice Type'" },
- { "kind" : "IdRef", "name" : "'Qp'" }
+ { "kind" : "IdRef", "name" : "Slice Type" },
+ { "kind" : "IdRef", "name" : "Qp" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7035,10 +7923,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packed Cost Center Delta'" },
- { "kind" : "IdRef", "name" : "'Packed Cost Table'" },
- { "kind" : "IdRef", "name" : "'Cost Precision'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Packed Cost Center Delta" },
+ { "kind" : "IdRef", "name" : "Packed Cost Table" },
+ { "kind" : "IdRef", "name" : "Cost Precision" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7050,8 +7938,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Slice Type'" },
- { "kind" : "IdRef", "name" : "'Qp'" }
+ { "kind" : "IdRef", "name" : "Slice Type" },
+ { "kind" : "IdRef", "name" : "Qp" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -7085,7 +7973,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7097,8 +7985,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Source Field Polarity'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Source Field Polarity" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7110,8 +7998,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Reference Field Polarity'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Reference Field Polarity" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7123,9 +8011,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Forward Reference Field Polarity'" },
- { "kind" : "IdRef", "name" : "'Backward Reference Field Polarity'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Forward Reference Field Polarity" },
+ { "kind" : "IdRef", "name" : "Backward Reference Field Polarity" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7137,7 +8025,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7149,7 +8037,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7161,7 +8049,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7173,7 +8061,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7185,7 +8073,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7197,7 +8085,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7209,7 +8097,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7221,7 +8109,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7233,7 +8121,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7245,7 +8133,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7257,7 +8145,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7269,7 +8157,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7281,7 +8169,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7293,7 +8181,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7305,9 +8193,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packed Reference Ids'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Parameter Field Polarities'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Packed Reference Ids" },
+ { "kind" : "IdRef", "name" : "Packed Reference Parameter Field Polarities" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7319,9 +8207,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Coord'" },
- { "kind" : "IdRef", "name" : "'Partition Mask'" },
- { "kind" : "IdRef", "name" : "'SAD Adjustment'" }
+ { "kind" : "IdRef", "name" : "Src Coord" },
+ { "kind" : "IdRef", "name" : "Partition Mask" },
+ { "kind" : "IdRef", "name" : "SAD Adjustment" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7333,9 +8221,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Ref Offset'" },
- { "kind" : "IdRef", "name" : "'Search Window Config'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Ref Offset" },
+ { "kind" : "IdRef", "name" : "Search Window Config" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7347,10 +8235,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Offset'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Offset'" },
- { "kind" : "IdRef", "name" : "'id> Search Window Config'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Fwd Ref Offset" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Offset" },
+ { "kind" : "IdRef", "name" : "id> Search Window Config" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7362,8 +8250,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Search Window Config'" },
- { "kind" : "IdRef", "name" : "'Dual Ref'" }
+ { "kind" : "IdRef", "name" : "Search Window Config" },
+ { "kind" : "IdRef", "name" : "Dual Ref" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7375,10 +8263,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Ref Offset'" },
- { "kind" : "IdRef", "name" : "'Src Coord'" },
- { "kind" : "IdRef", "name" : "'Ref Window Size'" },
- { "kind" : "IdRef", "name" : "'Image Size'" }
+ { "kind" : "IdRef", "name" : "Ref Offset" },
+ { "kind" : "IdRef", "name" : "Src Coord" },
+ { "kind" : "IdRef", "name" : "Ref Window Size" },
+ { "kind" : "IdRef", "name" : "Image Size" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7390,7 +8278,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7402,8 +8290,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Max Motion Vector Count'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Max Motion Vector Count" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7415,7 +8303,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7427,8 +8315,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Threshold'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Threshold" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7440,8 +8328,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packed Sad Weights'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Packed Sad Weights" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7453,9 +8341,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7467,10 +8355,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Fwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7482,10 +8370,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Streamin Components'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Streamin Components" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7497,11 +8385,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Streamin Components'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Fwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Streamin Components" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7513,9 +8401,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7527,10 +8415,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Fwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7542,10 +8430,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Streamin Components'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Streamin Components" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7557,11 +8445,11 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Streamin Components'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Fwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Streamin Components" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7573,7 +8461,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7585,7 +8473,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7597,7 +8485,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7609,7 +8497,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7621,7 +8509,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7633,8 +8521,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Major Shape'" }
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Major Shape" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7646,8 +8534,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Major Shape'" }
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Major Shape" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7659,8 +8547,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Major Shape'" }
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Major Shape" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7672,9 +8560,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Major Shape'" },
- { "kind" : "IdRef", "name" : "'Direction'" }
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Major Shape" },
+ { "kind" : "IdRef", "name" : "Direction" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7686,9 +8574,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Major Shape'" },
- { "kind" : "IdRef", "name" : "'Direction'" }
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Major Shape" },
+ { "kind" : "IdRef", "name" : "Direction" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7700,9 +8588,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" },
- { "kind" : "IdRef", "name" : "'Major Shape'" },
- { "kind" : "IdRef", "name" : "'Direction'" }
+ { "kind" : "IdRef", "name" : "Payload" },
+ { "kind" : "IdRef", "name" : "Major Shape" },
+ { "kind" : "IdRef", "name" : "Direction" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7714,8 +8602,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Image Select'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Image Select" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7727,7 +8615,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7739,7 +8627,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7751,7 +8639,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7763,7 +8651,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7775,13 +8663,13 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Coord'" },
- { "kind" : "IdRef", "name" : "'Motion Vectors'" },
- { "kind" : "IdRef", "name" : "'Major Shapes'" },
- { "kind" : "IdRef", "name" : "'Minor Shapes'" },
- { "kind" : "IdRef", "name" : "'Direction'" },
- { "kind" : "IdRef", "name" : "'Pixel Resolution'" },
- { "kind" : "IdRef", "name" : "'Sad Adjustment'" }
+ { "kind" : "IdRef", "name" : "Src Coord" },
+ { "kind" : "IdRef", "name" : "Motion Vectors" },
+ { "kind" : "IdRef", "name" : "Major Shapes" },
+ { "kind" : "IdRef", "name" : "Minor Shapes" },
+ { "kind" : "IdRef", "name" : "Direction" },
+ { "kind" : "IdRef", "name" : "Pixel Resolution" },
+ { "kind" : "IdRef", "name" : "Sad Adjustment" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7793,14 +8681,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Coord'" },
- { "kind" : "IdRef", "name" : "'Motion Vectors'" },
- { "kind" : "IdRef", "name" : "'Major Shapes'" },
- { "kind" : "IdRef", "name" : "'Minor Shapes'" },
- { "kind" : "IdRef", "name" : "'Direction'" },
- { "kind" : "IdRef", "name" : "'Pixel Resolution'" },
- { "kind" : "IdRef", "name" : "'Bidirectional Weight'" },
- { "kind" : "IdRef", "name" : "'Sad Adjustment'" }
+ { "kind" : "IdRef", "name" : "Src Coord" },
+ { "kind" : "IdRef", "name" : "Motion Vectors" },
+ { "kind" : "IdRef", "name" : "Major Shapes" },
+ { "kind" : "IdRef", "name" : "Minor Shapes" },
+ { "kind" : "IdRef", "name" : "Direction" },
+ { "kind" : "IdRef", "name" : "Pixel Resolution" },
+ { "kind" : "IdRef", "name" : "Bidirectional Weight" },
+ { "kind" : "IdRef", "name" : "Sad Adjustment" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7812,7 +8700,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7824,7 +8712,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7836,7 +8724,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7848,9 +8736,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7862,10 +8750,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Fwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7877,9 +8765,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Ids'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Packed Reference Ids" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7891,10 +8779,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Ids'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Field Polarities'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Packed Reference Ids" },
+ { "kind" : "IdRef", "name" : "Packed Reference Field Polarities" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7906,7 +8794,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7918,7 +8806,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Coord'" }
+ { "kind" : "IdRef", "name" : "Src Coord" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7930,12 +8818,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Skip Block Partition Type'" },
- { "kind" : "IdRef", "name" : "'Skip Motion Vector Mask'" },
- { "kind" : "IdRef", "name" : "'Motion Vectors'" },
- { "kind" : "IdRef", "name" : "'Bidirectional Weight'" },
- { "kind" : "IdRef", "name" : "'Sad Adjustment'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Skip Block Partition Type" },
+ { "kind" : "IdRef", "name" : "Skip Motion Vector Mask" },
+ { "kind" : "IdRef", "name" : "Motion Vectors" },
+ { "kind" : "IdRef", "name" : "Bidirectional Weight" },
+ { "kind" : "IdRef", "name" : "Sad Adjustment" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -7947,14 +8835,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Luma Intra Partition Mask'" },
- { "kind" : "IdRef", "name" : "'Intra Neighbour Availabilty'" },
- { "kind" : "IdRef", "name" : "'Left Edge Luma Pixels'" },
- { "kind" : "IdRef", "name" : "'Upper Left Corner Luma Pixel'" },
- { "kind" : "IdRef", "name" : "'Upper Edge Luma Pixels'" },
- { "kind" : "IdRef", "name" : "'Upper Right Edge Luma Pixels'" },
- { "kind" : "IdRef", "name" : "'Sad Adjustment'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Luma Intra Partition Mask" },
+ { "kind" : "IdRef", "name" : "Intra Neighbour Availabilty" },
+ { "kind" : "IdRef", "name" : "Left Edge Luma Pixels" },
+ { "kind" : "IdRef", "name" : "Upper Left Corner Luma Pixel" },
+ { "kind" : "IdRef", "name" : "Upper Edge Luma Pixels" },
+ { "kind" : "IdRef", "name" : "Upper Right Edge Luma Pixels" },
+ { "kind" : "IdRef", "name" : "Sad Adjustment" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -7966,17 +8854,17 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Luma Intra Partition Mask'" },
- { "kind" : "IdRef", "name" : "'Intra Neighbour Availabilty'" },
- { "kind" : "IdRef", "name" : "'Left Edge Luma Pixels'" },
- { "kind" : "IdRef", "name" : "'Upper Left Corner Luma Pixel'" },
- { "kind" : "IdRef", "name" : "'Upper Edge Luma Pixels'" },
- { "kind" : "IdRef", "name" : "'Upper Right Edge Luma Pixels'" },
- { "kind" : "IdRef", "name" : "'Left Edge Chroma Pixels'" },
- { "kind" : "IdRef", "name" : "'Upper Left Corner Chroma Pixel'" },
- { "kind" : "IdRef", "name" : "'Upper Edge Chroma Pixels'" },
- { "kind" : "IdRef", "name" : "'Sad Adjustment'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Luma Intra Partition Mask" },
+ { "kind" : "IdRef", "name" : "Intra Neighbour Availabilty" },
+ { "kind" : "IdRef", "name" : "Left Edge Luma Pixels" },
+ { "kind" : "IdRef", "name" : "Upper Left Corner Luma Pixel" },
+ { "kind" : "IdRef", "name" : "Upper Edge Luma Pixels" },
+ { "kind" : "IdRef", "name" : "Upper Right Edge Luma Pixels" },
+ { "kind" : "IdRef", "name" : "Left Edge Chroma Pixels" },
+ { "kind" : "IdRef", "name" : "Upper Left Corner Chroma Pixel" },
+ { "kind" : "IdRef", "name" : "Upper Edge Chroma Pixels" },
+ { "kind" : "IdRef", "name" : "Sad Adjustment" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ],
"version" : "None"
@@ -7988,8 +8876,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Skip Block Partition Type'" },
- { "kind" : "IdRef", "name" : "'Direction'" }
+ { "kind" : "IdRef", "name" : "Skip Block Partition Type" },
+ { "kind" : "IdRef", "name" : "Direction" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8001,7 +8889,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8013,8 +8901,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packed Shape Penalty'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Packed Shape Penalty" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8026,10 +8914,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Luma Mode Penalty'" },
- { "kind" : "IdRef", "name" : "'Luma Packed Neighbor Modes'" },
- { "kind" : "IdRef", "name" : "'Luma Packed Non Dc Penalty'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Luma Mode Penalty" },
+ { "kind" : "IdRef", "name" : "Luma Packed Neighbor Modes" },
+ { "kind" : "IdRef", "name" : "Luma Packed Non Dc Penalty" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8041,8 +8929,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Chroma Mode Base Penalty'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Chroma Mode Base Penalty" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ],
"version" : "None"
@@ -8054,7 +8942,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8066,8 +8954,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packed Sad Coefficients'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Packed Sad Coefficients" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8079,8 +8967,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Block Based Skip Type'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Block Based Skip Type" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8092,8 +8980,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8105,9 +8993,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8119,10 +9007,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Fwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Bwd Ref Image'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Fwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Bwd Ref Image" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8134,9 +9022,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Ids'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Packed Reference Ids" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8148,10 +9036,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Src Image'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Ids'" },
- { "kind" : "IdRef", "name" : "'Packed Reference Field Polarities'" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Src Image" },
+ { "kind" : "IdRef", "name" : "Packed Reference Ids" },
+ { "kind" : "IdRef", "name" : "Packed Reference Field Polarities" },
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8163,7 +9051,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8175,7 +9063,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8187,7 +9075,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8199,7 +9087,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8211,7 +9099,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8223,7 +9111,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationChromaINTEL" ],
"version" : "None"
@@ -8235,7 +9123,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8247,7 +9135,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL", "SubgroupAvcMotionEstimationIntraINTEL" ],
"version" : "None"
@@ -8259,7 +9147,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Payload'" }
+ { "kind" : "IdRef", "name" : "Payload" }
],
"capabilities" : [ "SubgroupAvcMotionEstimationINTEL" ],
"version" : "None"
@@ -8271,7 +9159,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Lenght'" }
+ { "kind" : "IdRef", "name" : "Lenght" }
],
"capabilities" : [ "VariableLengthArrayINTEL" ],
"version" : "None"
@@ -8292,7 +9180,7 @@
"class" : "@exclude",
"opcode" : 5820,
"operands" : [
- { "kind" : "IdRef", "name" : "'Ptr'" }
+ { "kind" : "IdRef", "name" : "Ptr" }
],
"capabilities" : [ "VariableLengthArrayINTEL" ],
"version" : "None"
@@ -8304,13 +9192,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'FromSign'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "MResult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "RoundingAccuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8322,12 +9209,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8339,12 +9226,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'FromSign'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "FromSign" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8356,11 +9243,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "ToSign" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8372,14 +9260,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "MResult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8391,14 +9279,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8410,14 +9298,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8429,14 +9317,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8448,10 +9336,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8463,10 +9351,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8478,10 +9366,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8493,10 +9381,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8508,10 +9396,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8523,12 +9411,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8540,12 +9428,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8557,12 +9445,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8574,14 +9462,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8593,12 +9481,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8610,12 +9498,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8627,12 +9515,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8644,12 +9532,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8661,12 +9549,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8678,12 +9566,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8695,12 +9583,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8712,12 +9600,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8729,12 +9617,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8746,12 +9634,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8763,12 +9651,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8780,12 +9668,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8797,12 +9685,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8814,12 +9702,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8831,12 +9719,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8848,12 +9736,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8865,12 +9753,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "M1" },
+ { "kind" : "LiteralInteger", "name" : "Mout" },
+ { "kind" : "LiteralInteger", "name" : "EnableSubnormals" },
+ { "kind" : "LiteralInteger", "name" : "RoundingMode" },
+ { "kind" : "LiteralInteger", "name" : "RoundingAccuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8882,12 +9770,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8899,12 +9787,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8916,12 +9804,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8933,14 +9821,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8952,14 +9840,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8971,14 +9859,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'M2'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "Mb" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -8990,13 +9878,14 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'A'" },
- { "kind" : "LiteralInteger", "name" : "'M1'" },
- { "kind" : "IdRef", "name" : "'B'" },
- { "kind" : "LiteralInteger", "name" : "'Mout'" },
- { "kind" : "LiteralInteger", "name" : "'EnableSubnormals'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingMode'" },
- { "kind" : "LiteralInteger", "name" : "'RoundingAccuracy'" }
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "LiteralInteger", "name" : "Ma" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "LiteralInteger", "name" : "SignOfB" },
+ { "kind" : "LiteralInteger", "name" : "Mresult" },
+ { "kind" : "LiteralInteger", "name" : "Subnormal" },
+ { "kind" : "LiteralInteger", "name" : "Rounding" },
+ { "kind" : "LiteralInteger", "name" : "Accuracy" }
],
"capabilities" : [ "ArbitraryPrecisionFloatingPointINTEL" ],
"version" : "None"
@@ -9006,7 +9895,7 @@
"class" : "Reserved",
"opcode" : 5887,
"operands" : [
- { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Loop Control Parameters'" }
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Loop Control Parameters" }
],
"capabilities" : [ "UnstructuredLoopControlsINTEL" ],
"extensions" : [ "SPV_INTEL_unstructured_loop_controls" ],
@@ -9018,7 +9907,7 @@
"opcode" : 5911,
"operands" : [
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "quantifier" : "?", "name" : "'Name'" }
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Name" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
@@ -9030,8 +9919,8 @@
"opcode" : 5912,
"operands" : [
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "name" : "'Alias Domain'"},
- { "kind" : "IdRef", "quantifier" : "?", "name" : "'Name'" }
+ { "kind" : "IdRef", "name" : "Alias Domain"},
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "Name" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
@@ -9043,7 +9932,7 @@
"opcode" : 5913,
"operands" : [
{ "kind" : "IdResult"},
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'AliasScope1, AliasScope2, ...'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "AliasScope 1, AliasScope 2, ..." }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
@@ -9056,13 +9945,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9074,13 +9962,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9092,13 +9979,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9110,13 +9996,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9128,13 +10013,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9146,13 +10030,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9164,13 +10047,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9182,13 +10064,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9200,13 +10081,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9218,13 +10098,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9236,13 +10115,12 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Input Type'" },
- { "kind" : "IdRef", "name" : "'Input'" },
- { "kind" : "LiteralInteger", "name" : "'S'" },
- { "kind" : "LiteralInteger", "name" : "'I'" },
- { "kind" : "LiteralInteger", "name" : "'rI'" },
- { "kind" : "LiteralInteger", "name" : "'Q'" },
- { "kind" : "LiteralInteger", "name" : "'O'" }
+ { "kind" : "IdRef", "name" : "Input" },
+ { "kind" : "LiteralInteger", "name" : "S" },
+ { "kind" : "LiteralInteger", "name" : "I" },
+ { "kind" : "LiteralInteger", "name" : "rI" },
+ { "kind" : "LiteralInteger", "name" : "Q" },
+ { "kind" : "LiteralInteger", "name" : "O" }
],
"capabilities" : [ "ArbitraryPrecisionFixedPointINTEL" ],
"version" : "None"
@@ -9254,7 +10132,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [ "USMStorageClassesINTEL" ],
"version" : "None"
@@ -9266,7 +10144,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" }
+ { "kind" : "IdRef", "name" : "Pointer" }
],
"capabilities" : [ "USMStorageClassesINTEL" ],
"version" : "None"
@@ -9278,8 +10156,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "BlockingPipesINTEL" ],
"extensions" : [ "SPV_INTEL_blocking_pipes" ],
@@ -9292,8 +10170,8 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Packet Size'" },
- { "kind" : "IdRef", "name" : "'Packet Alignment'" }
+ { "kind" : "IdRef", "name" : "Packet Size" },
+ { "kind" : "IdRef", "name" : "Packet Alignment" }
],
"capabilities" : [ "BlockingPipesINTEL" ],
"extensions" : [ "SPV_INTEL_blocking_pipes" ],
@@ -9306,8 +10184,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Result'" },
- { "kind" : "IdRef", "name" : "'Input'" }
+ { "kind" : "IdRef", "name" : "Input" }
],
"capabilities" : [ "FPGARegINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_reg" ],
@@ -9322,7 +10199,7 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9338,7 +10215,7 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9354,11 +10231,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9374,11 +10251,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9394,11 +10271,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9414,11 +10291,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9434,11 +10311,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9454,11 +10331,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9474,11 +10351,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9494,11 +10371,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9514,7 +10391,7 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9530,11 +10407,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9550,11 +10427,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9570,7 +10447,7 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9586,7 +10463,7 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9602,11 +10479,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9622,11 +10499,11 @@
{ "kind" : "IdResult" },
{
"kind" : "IdRef",
- "name" : "'RayQuery'"
+ "name" : "RayQuery"
},
{
"kind" : "IdRef",
- "name" : "'Intersection'"
+ "name" : "Intersection"
}
],
"capabilities" : [ "RayQueryKHR" ],
@@ -9640,10 +10517,10 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Pointer'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" },
- { "kind" : "IdRef", "name" : "'Value'" }
+ { "kind" : "IdRef", "name" : "Pointer" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" },
+ { "kind" : "IdRef", "name" : "Value" }
],
"capabilities" : [ "AtomicFloat16AddEXT", "AtomicFloat32AddEXT", "AtomicFloat64AddEXT", "AtomicFloat16VectorNV" ],
"extensions" : [ "SPV_EXT_shader_atomic_float_add" ],
@@ -9657,7 +10534,7 @@
{ "kind" : "IdResult" },
{
"kind" : "AccessQualifier",
- "name" : "'AccessQualifier'"
+ "name" : "AccessQualifier"
}
],
"capabilities" : [ "VectorComputeINTEL" ],
@@ -9668,7 +10545,7 @@
"class" : "Type-Declaration",
"opcode" : 6090,
"operands" : [
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Member 0 type', +\n'member 1 type', +\n..." }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Member 0 type, member 1 type, ..." }
],
"capabilities" : [ "LongCompositesINTEL" ],
"version" : "None"
@@ -9678,7 +10555,7 @@
"class" : "Constant-Creation",
"opcode" : 6091,
"operands" : [
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Constituents" }
],
"capabilities" : [ "LongCompositesINTEL" ],
"version" : "None"
@@ -9688,7 +10565,7 @@
"class" : "Constant-Creation",
"opcode" : 6092,
"operands" : [
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Constituents" }
],
"capabilities" : [ "LongCompositesINTEL" ],
"version" : "None"
@@ -9700,7 +10577,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "quantifier" : "*", "name" : "'Constituents'" }
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Constituents" }
],
"capabilities" : [ "LongCompositesINTEL" ],
"version": "None"
@@ -9712,7 +10589,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'Float Value'" }
+ { "kind" : "IdRef", "name" : "Float Value" }
],
"capabilities" : [ "BFloat16ConversionINTEL" ],
"version" : "None"
@@ -9724,7 +10601,7 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'BFloat16 Value'" }
+ { "kind" : "IdRef", "name" : "BFloat16 Value" }
],
"capabilities" : [ "BFloat16ConversionINTEL" ],
"version" : "None"
@@ -9734,9 +10611,9 @@
"class" : "Barrier",
"opcode" : 6142,
"operands" : [
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"capabilities" : [ "SplitBarrierINTEL" ],
"version" : "None"
@@ -9746,23 +10623,326 @@
"class" : "Barrier",
"opcode" : 6143,
"operands" : [
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "IdScope", "name" : "'Memory'" },
- { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "IdScope", "name" : "Memory" },
+ { "kind" : "IdMemorySemantics", "name" : "Semantics" }
],
"capabilities" : [ "SplitBarrierINTEL" ],
"version" : "None"
},
{
+ "opname" : "OpArithmeticFenceEXT",
+ "class" : "Miscellaneous",
+ "opcode" : 6145,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Target" }
+ ],
+ "capabilities" : [ "ArithmeticFenceEXT" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTaskSequenceCreateINTEL",
+ "class" : "Reserved",
+ "opcode" : 6163,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Function" },
+ { "kind" : "LiteralInteger", "name" : "Pipelined" },
+ { "kind" : "LiteralInteger", "name" : "UseStallEnableClusters" },
+ { "kind" : "LiteralInteger", "name" : "GetCapacity" },
+ { "kind" : "LiteralInteger", "name" : "AsyncCapacity" }
+ ],
+ "capabilities" : [ "TaskSequenceINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTaskSequenceAsyncINTEL",
+ "class" : "Reserved",
+ "opcode" : 6164,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Sequence" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Arguments" }
+ ],
+ "capabilities" : [ "TaskSequenceINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTaskSequenceGetINTEL",
+ "class" : "Reserved",
+ "opcode" : 6165,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Sequence" }
+ ],
+ "capabilities" : [ "TaskSequenceINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTaskSequenceReleaseINTEL",
+ "class" : "Reserved",
+ "opcode" : 6166,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Sequence" }
+ ],
+ "capabilities" : [ "TaskSequenceINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTypeTaskSequenceINTEL",
+ "class" : "Type-Declaration",
+ "opcode" : 6199,
+ "operands" : [
+ { "kind" : "IdResult" }
+ ],
+ "capabilities" : [ "TaskSequenceINTEL" ],
+ "version": "None"
+ },
+ {
+ "opname" : "OpSubgroupBlockPrefetchINTEL",
+ "class" : "Group",
+ "opcode" : 6221,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Ptr" },
+ { "kind" : "IdRef", "name" : "NumBytes" },
+ { "kind" : "MemoryAccess", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "SubgroupBufferPrefetchINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSubgroup2DBlockLoadINTEL",
+ "class" : "Group",
+ "opcode" : 6231,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Element Size" },
+ { "kind" : "IdRef", "name" : "Block Width" },
+ { "kind" : "IdRef", "name" : "Block Height" },
+ { "kind" : "IdRef", "name" : "Block Count" },
+ { "kind" : "IdRef", "name" : "Src Base Pointer" },
+ { "kind" : "IdRef", "name" : "Memory Width" },
+ { "kind" : "IdRef", "name" : "Memory Height" },
+ { "kind" : "IdRef", "name" : "Memory Pitch" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Dst Pointer" }
+ ],
+ "capabilities" : [ "Subgroup2DBlockIOINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSubgroup2DBlockLoadTransformINTEL",
+ "class" : "Group",
+ "opcode" : 6232,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Element Size" },
+ { "kind" : "IdRef", "name" : "Block Width" },
+ { "kind" : "IdRef", "name" : "Block Height" },
+ { "kind" : "IdRef", "name" : "Block Count" },
+ { "kind" : "IdRef", "name" : "Src Base Pointer" },
+ { "kind" : "IdRef", "name" : "Memory Width" },
+ { "kind" : "IdRef", "name" : "Memory Height" },
+ { "kind" : "IdRef", "name" : "Memory Pitch" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Dst Pointer" }
+ ],
+ "capabilities" : [ "Subgroup2DBlockTransformINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSubgroup2DBlockLoadTransposeINTEL",
+ "class" : "Group",
+ "opcode" : 6233,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Element Size" },
+ { "kind" : "IdRef", "name" : "Block Width" },
+ { "kind" : "IdRef", "name" : "Block Height" },
+ { "kind" : "IdRef", "name" : "Block Count" },
+ { "kind" : "IdRef", "name" : "Src Base Pointer" },
+ { "kind" : "IdRef", "name" : "Memory Width" },
+ { "kind" : "IdRef", "name" : "Memory Height" },
+ { "kind" : "IdRef", "name" : "Memory Pitch" },
+ { "kind" : "IdRef", "name" : "Coordinate" },
+ { "kind" : "IdRef", "name" : "Dst Pointer" }
+ ],
+ "capabilities" : [ "Subgroup2DBlockTransposeINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSubgroup2DBlockPrefetchINTEL",
+ "class" : "Group",
+ "opcode" : 6234,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Element Size" },
+ { "kind" : "IdRef", "name" : "Block Width" },
+ { "kind" : "IdRef", "name" : "Block Height" },
+ { "kind" : "IdRef", "name" : "Block Count" },
+ { "kind" : "IdRef", "name" : "Src Base Pointer" },
+ { "kind" : "IdRef", "name" : "Memory Width" },
+ { "kind" : "IdRef", "name" : "Memory Height" },
+ { "kind" : "IdRef", "name" : "Memory Pitch" },
+ { "kind" : "IdRef", "name" : "Coordinate" }
+ ],
+ "capabilities" : [ "Subgroup2DBlockIOINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSubgroup2DBlockStoreINTEL",
+ "class" : "Group",
+ "opcode" : 6235,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Element Size" },
+ { "kind" : "IdRef", "name" : "Block Width" },
+ { "kind" : "IdRef", "name" : "Block Height" },
+ { "kind" : "IdRef", "name" : "Block Count" },
+ { "kind" : "IdRef", "name" : "Src Pointer" },
+ { "kind" : "IdRef", "name" : "Dst Base Pointer" },
+ { "kind" : "IdRef", "name" : "Memory Width" },
+ { "kind" : "IdRef", "name" : "Memory Height" },
+ { "kind" : "IdRef", "name" : "Memory Pitch" },
+ { "kind" : "IdRef", "name" : "Coordinate" }
+ ],
+ "capabilities" : [ "Subgroup2DBlockIOINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSubgroupMatrixMultiplyAccumulateINTEL",
+ "class" : "Group",
+ "opcode" : 6237,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "K Dim" },
+ { "kind" : "IdRef", "name" : "Matrix A" },
+ { "kind" : "IdRef", "name" : "Matrix B" },
+ { "kind" : "IdRef", "name" : "Matrix C" },
+ { "kind" : "MatrixMultiplyAccumulateOperands", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "SubgroupMatrixMultiplyAccumulateINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpBitwiseFunctionINTEL",
+ "class" : "Bit",
+ "opcode" : 6242,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "A" },
+ { "kind" : "IdRef", "name" : "B" },
+ { "kind" : "IdRef", "name" : "C" },
+ { "kind" : "IdRef", "name" : "LUTIndex" }
+ ],
+ "capabilities" : [ "TernaryBitwiseFunctionINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConditionalExtensionINTEL",
+ "class" : "Extension",
+ "opcode" : 6248,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Condition" },
+ { "kind" : "LiteralString", "name" : "Name" }
+ ],
+ "capabilities" : [ "SpecConditionalINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConditionalEntryPointINTEL",
+ "class" : "Mode-Setting",
+ "opcode" : 6249,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Condition" },
+ { "kind" : "ExecutionModel" },
+ { "kind" : "IdRef", "name" : "Entry Point" },
+ { "kind" : "LiteralString", "name" : "Name" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Interface" }
+ ],
+ "capabilities" : [ "SpecConditionalINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConditionalCapabilityINTEL",
+ "class" : "Mode-Setting",
+ "opcode" : 6250,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Condition" },
+ { "kind" : "Capability", "name" : "Capability" }
+ ],
+ "capabilities" : [ "SpecConditionalINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSpecConstantTargetINTEL",
+ "class" : "Constant-Creation",
+ "opcode" : 6251,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "LiteralInteger", "name" : "Target" },
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Features" }
+ ],
+ "capabilities" : [ "FunctionVariantsINTEL" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
+ "opname" : "OpSpecConstantArchitectureINTEL",
+ "class" : "Constant-Creation",
+ "opcode" : 6252,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "LiteralInteger", "name" : "Category" },
+ { "kind" : "LiteralInteger", "name" : "Family" },
+ { "kind" : "LiteralInteger", "name" : "Opcode" },
+ { "kind" : "LiteralInteger", "name" : "Architecture" }
+ ],
+ "capabilities" : [ "FunctionVariantsINTEL" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
+ "opname" : "OpSpecConstantCapabilitiesINTEL",
+ "class" : "Constant-Creation",
+ "opcode" : 6253,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "Capability", "quantifier" : "*", "name" : "Capabilities" }
+ ],
+ "capabilities" : [ "FunctionVariantsINTEL" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
+ "opname" : "OpConditionalCopyObjectINTEL",
+ "class" : "Composite",
+ "opcode" : 6254,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "Condition 0, Operand 0, +\nCondition 1, Operand 1, +\n..." }
+ ],
+ "capabilities" : [ "SpecConditionalINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
"opname" : "OpGroupIMulKHR",
"class" : "Group",
"opcode" : 6401,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9774,9 +10954,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9788,9 +10968,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9802,9 +10982,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9816,9 +10996,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9830,9 +11010,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9844,9 +11024,9 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
@@ -9858,24 +11038,36 @@
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdScope", "name" : "'Execution'" },
- { "kind" : "GroupOperation", "name" : "'Operation'" },
- { "kind" : "IdRef", "name" : "'X'" }
+ { "kind" : "IdScope", "name" : "Execution" },
+ { "kind" : "GroupOperation", "name" : "Operation" },
+ { "kind" : "IdRef", "name" : "X" }
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
+ "opname" : "OpRoundFToTF32INTEL",
+ "class" : "Conversion",
+ "opcode" : 6426,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Float Value" }
+ ],
+ "capabilities" : [ "TensorFloat32RoundingINTEL" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpMaskedGatherINTEL",
"class" : "Memory",
"opcode" : 6428,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
- { "kind" : "IdRef", "name" : "'PtrVector'" },
- { "kind" : "LiteralInteger", "name" : "'Alignment'" },
- { "kind" : "IdRef", "name" : "'Mask'" },
- { "kind" : "IdRef", "name" : "'FillEmpty'" }
+ { "kind" : "IdRef", "name" : "PtrVector" },
+ { "kind" : "LiteralInteger", "name" : "Alignment" },
+ { "kind" : "IdRef", "name" : "Mask" },
+ { "kind" : "IdRef", "name" : "FillEmpty" }
],
"capabilities" : [ "MaskedGatherScatterINTEL" ],
"version" : "None"
@@ -9885,13 +11077,52 @@
"class" : "Memory",
"opcode" : 6429,
"operands" : [
- { "kind" : "IdRef", "name" : "'InputVector'" },
- { "kind" : "IdRef", "name" : "'PtrVector'" },
- { "kind" : "LiteralInteger", "name" : "'Alignment'" },
- { "kind" : "IdRef", "name" : "'Mask'" }
+ { "kind" : "IdRef", "name" : "InputVector" },
+ { "kind" : "IdRef", "name" : "PtrVector" },
+ { "kind" : "LiteralInteger", "name" : "Alignment" },
+ { "kind" : "IdRef", "name" : "Mask" }
],
"capabilities" : [ "MaskedGatherScatterINTEL" ],
"version" : "None"
+ },
+ {
+ "opname" : "OpConvertHandleToImageINTEL",
+ "class" : "Image",
+ "opcode" : 6529,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Operand" }
+ ],
+ "capabilities" : [ "BindlessImagesINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertHandleToSamplerINTEL",
+ "class" : "Image",
+ "opcode" : 6530,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Operand" }
+ ],
+ "capabilities" : [ "BindlessImagesINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertHandleToSampledImageINTEL",
+ "class" : "Image",
+ "opcode" : 6531,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "Operand" }
+ ],
+ "capabilities" : [ "BindlessImagesINTEL" ],
+ "provisional" : true,
+ "version" : "None"
}
],
"operand_kinds" : [
@@ -9974,15 +11205,7 @@
},
{
"enumerant" : "MakeTexelAvailable",
- "value" : "0x0100",
- "capabilities" : [ "VulkanMemoryModel" ],
- "parameters" : [
- { "kind" : "IdScope" }
- ],
- "version" : "1.5"
- },
- {
- "enumerant" : "MakeTexelAvailableKHR",
+ "aliases" : [ "MakeTexelAvailableKHR" ],
"value" : "0x0100",
"capabilities" : [ "VulkanMemoryModel" ],
"parameters" : [
@@ -9993,15 +11216,7 @@
},
{
"enumerant" : "MakeTexelVisible",
- "value" : "0x0200",
- "capabilities" : [ "VulkanMemoryModel" ],
- "parameters" : [
- { "kind" : "IdScope" }
- ],
- "version" : "1.5"
- },
- {
- "enumerant" : "MakeTexelVisibleKHR",
+ "aliases" : [ "MakeTexelVisibleKHR" ],
"value" : "0x0200",
"capabilities" : [ "VulkanMemoryModel" ],
"parameters" : [
@@ -10012,12 +11227,7 @@
},
{
"enumerant" : "NonPrivateTexel",
- "value" : "0x0400",
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "NonPrivateTexelKHR",
+ "aliases" : [ "NonPrivateTexelKHR" ],
"value" : "0x0400",
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -10025,12 +11235,7 @@
},
{
"enumerant" : "VolatileTexel",
- "value" : "0x0800",
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "VolatileTexelKHR",
+ "aliases" : [ "VolatileTexelKHR" ],
"value" : "0x0800",
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -10097,24 +11302,14 @@
},
{
"enumerant" : "AllowContract",
- "value" : "0x10000",
- "capabilities" : [ "FloatControls2", "FPFastMathModeINTEL" ],
- "version" : "None"
- },
- {
- "enumerant" : "AllowContractFastINTEL",
+ "aliases" : ["AllowContractFastINTEL"],
"value" : "0x10000",
"capabilities" : [ "FloatControls2", "FPFastMathModeINTEL" ],
"version" : "None"
},
{
"enumerant" : "AllowReassoc",
- "value" : "0x20000",
- "capabilities" : [ "FloatControls2", "FPFastMathModeINTEL" ],
- "version" : "None"
- },
- {
- "enumerant" : "AllowReassocINTEL",
+ "aliases" : ["AllowReassocINTEL"],
"value" : "0x20000",
"capabilities" : [ "FloatControls2", "FPFastMathModeINTEL" ],
"version" : "None"
@@ -10339,9 +11534,10 @@
"version" : "1.0"
},
{
- "enumerant" : "OptNoneINTEL",
+ "enumerant" : "OptNoneEXT",
+ "aliases" : ["OptNoneINTEL"],
"value" : "0x10000",
- "capabilities" : [ "OptNoneINTEL" ],
+ "capabilities" : [ "OptNoneEXT" ],
"version" : "None"
}
]
@@ -10352,11 +11548,7 @@
"enumerants" : [
{
"enumerant" : "Relaxed",
- "value" : "0x0000",
- "version" : "1.0"
- },
- {
- "enumerant" : "None",
+ "aliases" : ["None"],
"value" : "0x0000",
"version" : "1.0"
},
@@ -10414,12 +11606,7 @@
},
{
"enumerant" : "OutputMemory",
- "value" : "0x1000",
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "OutputMemoryKHR",
+ "aliases" : ["OutputMemoryKHR"],
"value" : "0x1000",
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -10427,12 +11614,7 @@
},
{
"enumerant" : "MakeAvailable",
- "value" : "0x2000",
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "MakeAvailableKHR",
+ "aliases" : ["MakeAvailableKHR"],
"value" : "0x2000",
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -10440,12 +11622,7 @@
},
{
"enumerant" : "MakeVisible",
- "value" : "0x4000",
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "MakeVisibleKHR",
+ "aliases" : ["MakeVisibleKHR"],
"value" : "0x4000",
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -10489,15 +11666,7 @@
},
{
"enumerant" : "MakePointerAvailable",
- "value" : "0x0008",
- "parameters" : [
- { "kind" : "IdScope" }
- ],
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "MakePointerAvailableKHR",
+ "aliases" : ["MakePointerAvailableKHR"],
"value" : "0x0008",
"parameters" : [
{ "kind" : "IdScope" }
@@ -10508,15 +11677,7 @@
},
{
"enumerant" : "MakePointerVisible",
- "value" : "0x0010",
- "parameters" : [
- { "kind" : "IdScope" }
- ],
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "MakePointerVisibleKHR",
+ "aliases" : ["MakePointerVisibleKHR"],
"value" : "0x0010",
"parameters" : [
{ "kind" : "IdScope" }
@@ -10527,12 +11688,7 @@
},
{
"enumerant" : "NonPrivatePointer",
- "value" : "0x0020",
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "NonPrivatePointerKHR",
+ "aliases" : ["NonPrivatePointerKHR"],
"value" : "0x0020",
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -10637,6 +11793,7 @@
},
{
"enumerant" : "SkipTrianglesKHR",
+ "aliases" : ["SkipBuiltinPrimitivesNV"],
"value" : "0x0100",
"capabilities" : [ "RayTraversalPrimitiveCullingKHR" ],
"version" : "None"
@@ -10775,6 +11932,11 @@
"enumerant" : "Zig",
"value" : 12,
"version" : "1.0"
+ },
+ {
+ "enumerant" : "Rust",
+ "value" : 13,
+ "version" : "1.0"
}
]
},
@@ -10837,73 +11999,43 @@
"version" : "None"
},
{
- "enumerant" : "RayGenerationNV",
- "value" : 5313,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "RayGenerationKHR",
+ "aliases" : ["RayGenerationNV"],
"value" : 5313,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "IntersectionNV",
- "value" : 5314,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "IntersectionKHR",
+ "aliases" : ["IntersectionNV"],
"value" : 5314,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "AnyHitNV",
- "value" : 5315,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "AnyHitKHR",
+ "aliases" : ["AnyHitNV"],
"value" : 5315,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "ClosestHitNV",
- "value" : 5316,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "ClosestHitKHR",
+ "aliases" : ["ClosestHitNV"],
"value" : 5316,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "MissNV",
- "value" : 5317,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "MissKHR",
+ "aliases" : ["MissNV"],
"value" : 5317,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "CallableNV",
- "value" : 5318,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "CallableKHR",
+ "aliases" : ["CallableNV"],
"value" : 5318,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
@@ -10945,17 +12077,11 @@
},
{
"enumerant" : "PhysicalStorageBuffer64",
+ "aliases" : ["PhysicalStorageBuffer64EXT"],
"value" : 5348,
"extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ],
"capabilities" : [ "PhysicalStorageBufferAddresses" ],
"version" : "1.5"
- },
- {
- "enumerant" : "PhysicalStorageBuffer64EXT",
- "value" : 5348,
- "extensions" : [ "SPV_EXT_physical_storage_buffer" ],
- "capabilities" : [ "PhysicalStorageBufferAddresses" ],
- "version" : "1.5"
}
]
},
@@ -10983,12 +12109,7 @@
},
{
"enumerant" : "Vulkan",
- "value" : 3,
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "VulkanKHR",
+ "aliases" : ["VulkanKHR"],
"value" : 3,
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
@@ -11005,7 +12126,7 @@
"value" : 0,
"capabilities" : [ "Geometry" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Number of <<Invocation,invocations>>'" }
+ { "kind" : "LiteralInteger", "name" : "Number of <<Invocation,invocations>>" }
],
"version": "1.0"
},
@@ -11103,9 +12224,9 @@
"enumerant" : "LocalSize",
"value" : 17,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'x size'" },
- { "kind" : "LiteralInteger", "name" : "'y size'" },
- { "kind" : "LiteralInteger", "name" : "'z size'" }
+ { "kind" : "LiteralInteger", "name" : "x size" },
+ { "kind" : "LiteralInteger", "name" : "y size" },
+ { "kind" : "LiteralInteger", "name" : "z size" }
],
"version": "1.0"
},
@@ -11114,9 +12235,9 @@
"value" : 18,
"capabilities" : [ "Kernel" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'x size'" },
- { "kind" : "LiteralInteger", "name" : "'y size'" },
- { "kind" : "LiteralInteger", "name" : "'z size'" }
+ { "kind" : "LiteralInteger", "name" : "x size" },
+ { "kind" : "LiteralInteger", "name" : "y size" },
+ { "kind" : "LiteralInteger", "name" : "z size" }
],
"version": "1.0"
},
@@ -11167,7 +12288,7 @@
"value" : 26,
"capabilities" : [ "Geometry", "Tessellation", "MeshShadingNV", "MeshShadingEXT" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Vertex count'" }
+ { "kind" : "LiteralInteger", "name" : "Vertex count" }
],
"version": "1.0"
},
@@ -11194,7 +12315,7 @@
"value" : 30,
"capabilities" : [ "Kernel" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Vector type'" }
+ { "kind" : "LiteralInteger", "name" : "Vector type" }
],
"version": "1.0"
},
@@ -11221,7 +12342,7 @@
"value" : 35,
"capabilities" : [ "SubgroupDispatch" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Subgroup Size'" }
+ { "kind" : "LiteralInteger", "name" : "Subgroup Size" }
],
"version" : "1.1"
},
@@ -11230,7 +12351,7 @@
"value" : 36,
"capabilities" : [ "SubgroupDispatch" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Subgroups Per Workgroup'" }
+ { "kind" : "LiteralInteger", "name" : "Subgroups Per Workgroup" }
],
"version" : "1.1"
},
@@ -11239,7 +12360,7 @@
"value" : 37,
"capabilities" : [ "SubgroupDispatch" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Subgroups Per Workgroup'" }
+ { "kind" : "IdRef", "name" : "Subgroups Per Workgroup" }
],
"version" : "1.2"
},
@@ -11247,9 +12368,9 @@
"enumerant" : "LocalSizeId",
"value" : 38,
"parameters" : [
- { "kind" : "IdRef", "name" : "'x size'" },
- { "kind" : "IdRef", "name" : "'y size'" },
- { "kind" : "IdRef", "name" : "'z size'" }
+ { "kind" : "IdRef", "name" : "x size" },
+ { "kind" : "IdRef", "name" : "y size" },
+ { "kind" : "IdRef", "name" : "z size" }
],
"version" : "1.2"
},
@@ -11258,9 +12379,9 @@
"value" : 39,
"capabilities" : [ "Kernel" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'x size hint'" },
- { "kind" : "IdRef", "name" : "'y size hint'" },
- { "kind" : "IdRef", "name" : "'z size hint'" }
+ { "kind" : "IdRef", "name" : "x size hint" },
+ { "kind" : "IdRef", "name" : "y size hint" },
+ { "kind" : "IdRef", "name" : "z size hint" }
],
"version" : "1.2"
},
@@ -11302,7 +12423,7 @@
"capabilities" : [ "DenormPreserve" ],
"extensions" : [ "SPV_KHR_float_controls" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"version" : "1.4"
},
@@ -11312,7 +12433,7 @@
"capabilities" : [ "DenormFlushToZero" ],
"extensions" : [ "SPV_KHR_float_controls" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"version" : "1.4"
},
@@ -11322,7 +12443,7 @@
"capabilities" : [ "SignedZeroInfNanPreserve" ],
"extensions" : [ "SPV_KHR_float_controls" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"version" : "1.4"
},
@@ -11332,7 +12453,7 @@
"capabilities" : [ "RoundingModeRTE" ],
"extensions" : [ "SPV_KHR_float_controls" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"version" : "1.4"
},
@@ -11342,11 +12463,28 @@
"capabilities" : [ "RoundingModeRTZ" ],
"extensions" : [ "SPV_KHR_float_controls" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"version" : "1.4"
},
{
+ "enumerant" : "NonCoherentTileAttachmentReadQCOM",
+ "value" : 4489,
+ "capabilities" : [ "TileShadingQCOM" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TileShadingRateQCOM",
+ "value" : 4490,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "x rate" },
+ { "kind" : "LiteralInteger", "name" : "y rate" },
+ { "kind" : "LiteralInteger", "name" : "z rate" }
+ ],
+ "capabilities" : [ "TileShadingQCOM" ],
+ "version": "None"
+ },
+ {
"enumerant": "EarlyAndLateFragmentTestsAMD",
"value": 5017,
"capabilities": [ "Shader" ],
@@ -11364,6 +12502,17 @@
"enumerant" : "CoalescingAMDX",
"value" : 5069,
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "IsApiEntryAMDX",
+ "value" : 5070,
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "parameters" : [
+ { "kind" : "IdRef", "name" : "Is Entry" }
+ ],
+ "provisional" : true,
"version" : "None"
},
{
@@ -11371,8 +12520,9 @@
"value" : 5071,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Number of recursions'" }
+ { "kind" : "IdRef", "name" : "Number of recursions" }
],
+ "provisional" : true,
"version" : "None"
},
{
@@ -11380,10 +12530,11 @@
"value" : 5072,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'x size'" },
- { "kind" : "IdRef", "name" : "'y size'" },
- { "kind" : "IdRef", "name" : "'z size'" }
+ { "kind" : "IdRef", "name" : "x size" },
+ { "kind" : "IdRef", "name" : "y size" },
+ { "kind" : "IdRef", "name" : "z size" }
],
+ "provisional" : true,
"version" : "None"
},
{
@@ -11391,8 +12542,9 @@
"value" : 5073,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Shader Index'" }
+ { "kind" : "IdRef", "name" : "Shader Index" }
],
+ "provisional" : true,
"version" : "None"
},
{
@@ -11400,10 +12552,11 @@
"value" : 5077,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'x size'" },
- { "kind" : "IdRef", "name" : "'y size'" },
- { "kind" : "IdRef", "name" : "'z size'" }
+ { "kind" : "IdRef", "name" : "x size" },
+ { "kind" : "IdRef", "name" : "y size" },
+ { "kind" : "IdRef", "name" : "z size" }
],
+ "provisional" : true,
"version" : "None"
},
{
@@ -11461,62 +12614,54 @@
"version" : "None"
},
{
- "enumerant" : "OutputLinesNV",
- "value" : 5269,
- "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
- "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "enumerant" : "SharesInputWithAMDX",
+ "value" : 5102,
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "parameters" : [
+ { "kind" : "IdRef", "name" : "Node Name" },
+ { "kind" : "IdRef", "name" : "Shader Index" }
+ ],
+ "provisional" : true,
"version" : "None"
},
{
"enumerant" : "OutputLinesEXT",
+ "aliases" : ["OutputLinesNV"],
"value" : 5269,
"capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
"extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
- "enumerant" : "OutputPrimitivesNV",
- "value" : 5270,
- "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
- "parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Primitive count'" }
- ],
- "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
- "version" : "None"
- },
- {
"enumerant" : "OutputPrimitivesEXT",
+ "aliases" : ["OutputPrimitivesNV"],
"value" : 5270,
"capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Primitive count'" }
+ { "kind" : "LiteralInteger", "name" : "Primitive count" }
],
"extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
- "enumerant" : "DerivativeGroupQuadsNV",
+ "enumerant" : "DerivativeGroupQuadsKHR",
+ "aliases" : ["DerivativeGroupQuadsNV"],
"value" : 5289,
- "capabilities" : [ "ComputeDerivativeGroupQuadsNV" ],
- "extensions" : [ "SPV_NV_compute_shader_derivatives" ],
+ "capabilities" : [ "ComputeDerivativeGroupQuadsNV", "ComputeDerivativeGroupQuadsKHR" ],
+ "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ],
"version" : "None"
},
{
- "enumerant" : "DerivativeGroupLinearNV",
+ "enumerant" : "DerivativeGroupLinearKHR",
+ "aliases" : ["DerivativeGroupLinearNV"],
"value" : 5290,
- "capabilities" : [ "ComputeDerivativeGroupLinearNV" ],
- "extensions" : [ "SPV_NV_compute_shader_derivatives" ],
- "version" : "None"
- },
- {
- "enumerant" : "OutputTrianglesNV",
- "value" : 5298,
- "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
- "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "capabilities" : [ "ComputeDerivativeGroupLinearNV", "ComputeDerivativeGroupLinearKHR" ],
+ "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ],
"version" : "None"
},
{
"enumerant" : "OutputTrianglesEXT",
+ "aliases" : ["OutputTrianglesNV"],
"value" : 5298,
"capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
"extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
@@ -11568,7 +12713,7 @@
"enumerant" : "SharedLocalMemorySizeINTEL",
"value" : 5618,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Size'" }
+ { "kind" : "LiteralInteger", "name" : "Size" }
],
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
@@ -11577,7 +12722,7 @@
"enumerant" : "RoundingModeRTPINTEL",
"value" : 5620,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"capabilities" : [ "RoundToInfinityINTEL" ],
"version" : "None"
@@ -11586,7 +12731,7 @@
"enumerant" : "RoundingModeRTNINTEL",
"value" : 5621,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"capabilities" : [ "RoundToInfinityINTEL" ],
"version" : "None"
@@ -11595,7 +12740,7 @@
"enumerant" : "FloatingPointModeALTINTEL",
"value" : 5622,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"capabilities" : [ "RoundToInfinityINTEL" ],
"version" : "None"
@@ -11604,7 +12749,7 @@
"enumerant" : "FloatingPointModeIEEEINTEL",
"value" : 5623,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" }
],
"capabilities" : [ "RoundToInfinityINTEL" ],
"version" : "None"
@@ -11613,9 +12758,9 @@
"enumerant" : "MaxWorkgroupSizeINTEL",
"value" : 5893,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'max_x_size'" },
- { "kind" : "LiteralInteger", "name" : "'max_y_size'" },
- { "kind" : "LiteralInteger", "name" : "'max_z_size'" }
+ { "kind" : "LiteralInteger", "name" : "max_x_size" },
+ { "kind" : "LiteralInteger", "name" : "max_y_size" },
+ { "kind" : "LiteralInteger", "name" : "max_z_size" }
],
"capabilities" : [ "KernelAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_kernel_attributes" ],
@@ -11625,7 +12770,7 @@
"enumerant" : "MaxWorkDimINTEL",
"value" : 5894,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'max_dimensions'" }
+ { "kind" : "LiteralInteger", "name" : "max_dimensions" }
],
"capabilities" : [ "KernelAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_kernel_attributes" ],
@@ -11642,7 +12787,7 @@
"enumerant" : "NumSIMDWorkitemsINTEL",
"value" : 5896,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'vector_width'" }
+ { "kind" : "LiteralInteger", "name" : "vector_width" }
],
"capabilities" : [ "FPGAKernelAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_kernel_attributes" ],
@@ -11652,7 +12797,7 @@
"enumerant" : "SchedulerTargetFmaxMhzINTEL",
"value" : 5903,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'target_fmax'" }
+ { "kind" : "LiteralInteger", "name" : "target_fmax" }
],
"capabilities" : [ "FPGAKernelAttributesINTEL" ],
"version" : "None"
@@ -11663,22 +12808,22 @@
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_KHR_maximal_reconvergence" ],
"version" : "None"
- },
- {
+ },
+ {
"enumerant" : "FPFastMathDefault",
"value" : 6028,
"parameters" : [
- { "kind" : "IdRef", "name" : "'Target Type'" },
- { "kind" : "IdRef", "name" : "'Fast-Math Mode'" }
- ],
+ { "kind" : "IdRef", "name" : "Target Type" },
+ { "kind" : "IdRef", "name" : "Fast-Math Mode" }
+ ],
"capabilities" : [ "FloatControls2" ],
"version" : "None"
- },
- {
+ },
+ {
"enumerant" : "StreamingInterfaceINTEL",
"value" : 6154,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'StallFreeReturn'" }
+ { "kind" : "LiteralInteger", "name" : "StallFreeReturn" }
],
"capabilities" : [ "FPGAKernelAttributesINTEL" ],
"version" : "None"
@@ -11687,7 +12832,7 @@
"enumerant" : "RegisterMapInterfaceINTEL",
"value" : 6160,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'WaitForDoneWrite'" }
+ { "kind" : "LiteralInteger", "name" : "WaitForDoneWrite" }
],
"capabilities" : [ "FPGAKernelAttributesv2INTEL" ],
"version" : "None"
@@ -11696,7 +12841,7 @@
"enumerant" : "NamedBarrierCountINTEL",
"value" : 6417,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Barrier Count'" }
+ { "kind" : "LiteralInteger", "name" : "Barrier Count" }
],
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
@@ -11705,7 +12850,7 @@
"enumerant" : "MaximumRegistersINTEL",
"value" : 6461,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Number of Registers'" }
+ { "kind" : "LiteralInteger", "name" : "Number of Registers" }
],
"capabilities" : [ "RegisterLimitsINTEL" ],
"version" : "None"
@@ -11714,7 +12859,7 @@
"enumerant" : "MaximumRegistersIdINTEL",
"value" : 6462,
"parameters" : [
- { "kind" : "IdRef", "name" : "'Number of Registers'" }
+ { "kind" : "IdRef", "name" : "Number of Registers" }
],
"capabilities" : [ "RegisterLimitsINTEL" ],
"version" : "None"
@@ -11723,7 +12868,7 @@
"enumerant" : "NamedMaximumRegistersINTEL",
"value" : 6463,
"parameters" : [
- { "kind" : "NamedMaximumNumberOfRegisters", "name" : "'Named Maximum Number of Registers'" }
+ { "kind" : "NamedMaximumNumberOfRegisters", "name" : "Named Maximum Number of Registers" }
],
"capabilities" : [ "RegisterLimitsINTEL" ],
"version" : "None"
@@ -11817,96 +12962,61 @@
"version" : "None"
},
{
+ "enumerant" : "TileAttachmentQCOM",
+ "value" : 4491,
+ "capabilities" : [ "TileShadingQCOM" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "NodePayloadAMDX",
"value" : 5068,
"capabilities" : [ "ShaderEnqueueAMDX" ],
- "version" : "None"
- },
- {
- "enumerant" : "NodeOutputPayloadAMDX",
- "value" : 5076,
- "capabilities" : [ "ShaderEnqueueAMDX" ],
- "version" : "None"
- },
- {
- "enumerant" : "CallableDataNV",
- "value" : 5328,
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
+ "provisional" : true,
"version" : "None"
},
{
"enumerant" : "CallableDataKHR",
+ "aliases" : ["CallableDataNV"],
"value" : 5328,
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "IncomingCallableDataNV",
- "value" : 5329,
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "IncomingCallableDataKHR",
+ "aliases" : ["IncomingCallableDataNV"],
"value" : 5329,
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "RayPayloadNV",
- "value" : 5338,
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "RayPayloadKHR",
+ "aliases" : ["RayPayloadNV"],
"value" : 5338,
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "HitAttributeNV",
- "value" : 5339,
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "HitAttributeKHR",
+ "aliases" : ["HitAttributeNV"],
"value" : 5339,
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "IncomingRayPayloadNV",
- "value" : 5342,
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "IncomingRayPayloadKHR",
+ "aliases" : ["IncomingRayPayloadNV"],
"value" : 5342,
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
},
{
- "enumerant" : "ShaderRecordBufferNV",
- "value" : 5343,
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "version" : "None"
- },
- {
"enumerant" : "ShaderRecordBufferKHR",
+ "aliases" : ["ShaderRecordBufferNV"],
"value" : 5343,
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
@@ -11914,19 +13024,13 @@
},
{
"enumerant" : "PhysicalStorageBuffer",
+ "aliases" : ["PhysicalStorageBufferEXT"],
"value" : 5349,
"extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ],
"capabilities" : [ "PhysicalStorageBufferAddresses" ],
"version" : "1.5"
},
{
- "enumerant" : "PhysicalStorageBufferEXT",
- "value" : 5349,
- "extensions" : [ "SPV_EXT_physical_storage_buffer" ],
- "capabilities" : [ "PhysicalStorageBufferAddresses" ],
- "version" : "1.5"
- },
- {
"enumerant" : "HitObjectAttributeNV",
"value" : 5385,
"capabilities" : [ "ShaderInvocationReorderNV" ],
@@ -12518,6 +13622,11 @@
"version": "1.0"
},
{
+ "enumerant" : "UnormInt10X6EXT",
+ "value" : 17,
+ "version": "1.0"
+ },
+ {
"enumerant" : "UnsignedIntRaw10EXT",
"value" : 19,
"version": "1.0"
@@ -12526,6 +13635,36 @@
"enumerant" : "UnsignedIntRaw12EXT",
"value" : 20,
"version": "1.0"
+ },
+ {
+ "enumerant" : "UnormInt2_101010EXT",
+ "value" : 21,
+ "version": "1.0"
+ },
+ {
+ "enumerant" : "UnsignedInt10X6EXT",
+ "value" : 22,
+ "version": "1.0"
+ },
+ {
+ "enumerant" : "UnsignedInt12X4EXT",
+ "value" : 23,
+ "version": "1.0"
+ },
+ {
+ "enumerant" : "UnsignedInt14X2EXT",
+ "value" : 24,
+ "version": "1.0"
+ },
+ {
+ "enumerant" : "UnormInt12X4EXT",
+ "value" : 25,
+ "version": "1.0"
+ },
+ {
+ "enumerant" : "UnormInt14X2EXT",
+ "value" : 26,
+ "version": "1.0"
}
]
},
@@ -12829,7 +13968,7 @@
"value" : 1,
"capabilities" : [ "Shader", "Kernel" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Specialization Constant ID'" }
+ { "kind" : "LiteralInteger", "name" : "Specialization Constant ID" }
],
"version": "1.0"
},
@@ -12863,7 +14002,7 @@
"value" : 6,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Array Stride'" }
+ { "kind" : "LiteralInteger", "name" : "Array Stride" }
],
"version": "1.0"
},
@@ -12872,7 +14011,7 @@
"value" : 7,
"capabilities" : [ "Matrix" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Matrix Stride'" }
+ { "kind" : "LiteralInteger", "name" : "Matrix Stride" }
],
"version": "1.0"
},
@@ -12985,7 +14124,7 @@
"value" : 27,
"capabilities" : [ "Shader", "UniformDecoration" ],
"parameters" : [
- { "kind" : "IdScope", "name" : "'Execution'" }
+ { "kind" : "IdScope", "name" : "Execution" }
],
"version" : "1.4"
},
@@ -13000,7 +14139,7 @@
"value" : 29,
"capabilities" : [ "GeometryStreams" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Stream Number'" }
+ { "kind" : "LiteralInteger", "name" : "Stream Number" }
],
"version": "1.0"
},
@@ -13009,7 +14148,7 @@
"value" : 30,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Location'" }
+ { "kind" : "LiteralInteger", "name" : "Location" }
],
"version": "1.0"
},
@@ -13018,7 +14157,7 @@
"value" : 31,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Component'" }
+ { "kind" : "LiteralInteger", "name" : "Component" }
],
"version": "1.0"
},
@@ -13027,7 +14166,7 @@
"value" : 32,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Index'" }
+ { "kind" : "LiteralInteger", "name" : "Index" }
],
"version": "1.0"
},
@@ -13036,7 +14175,7 @@
"value" : 33,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Binding Point'" }
+ { "kind" : "LiteralInteger", "name" : "Binding Point" }
],
"version": "1.0"
},
@@ -13045,7 +14184,7 @@
"value" : 34,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Descriptor Set'" }
+ { "kind" : "LiteralInteger", "name" : "Descriptor Set" }
],
"version": "1.0"
},
@@ -13054,7 +14193,7 @@
"value" : 35,
"capabilities" : [ "Shader" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Byte Offset'" }
+ { "kind" : "LiteralInteger", "name" : "Byte Offset" }
],
"version": "1.0"
},
@@ -13063,7 +14202,7 @@
"value" : 36,
"capabilities" : [ "TransformFeedback" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'XFB Buffer Number'" }
+ { "kind" : "LiteralInteger", "name" : "XFB Buffer Number" }
],
"version": "1.0"
},
@@ -13072,7 +14211,7 @@
"value" : 37,
"capabilities" : [ "TransformFeedback" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'XFB Stride'" }
+ { "kind" : "LiteralInteger", "name" : "XFB Stride" }
],
"version": "1.0"
},
@@ -13081,7 +14220,7 @@
"value" : 38,
"capabilities" : [ "Kernel" ],
"parameters" : [
- { "kind" : "FunctionParameterAttribute", "name" : "'Function Parameter Attribute'" }
+ { "kind" : "FunctionParameterAttribute", "name" : "Function Parameter Attribute" }
],
"version": "1.0"
},
@@ -13089,7 +14228,7 @@
"enumerant" : "FPRoundingMode",
"value" : 39,
"parameters" : [
- { "kind" : "FPRoundingMode", "name" : "'Floating-Point Rounding Mode'" }
+ { "kind" : "FPRoundingMode", "name" : "Floating-Point Rounding Mode" }
],
"version": "1.0"
},
@@ -13098,7 +14237,7 @@
"value" : 40,
"capabilities" : [ "Kernel", "FloatControls2" ],
"parameters" : [
- { "kind" : "FPFastMathMode", "name" : "'Fast-Math Mode'" }
+ { "kind" : "FPFastMathMode", "name" : "Fast-Math Mode" }
],
"version": "1.0"
},
@@ -13107,8 +14246,8 @@
"value" : 41,
"capabilities" : [ "Linkage" ],
"parameters" : [
- { "kind" : "LiteralString", "name" : "'Name'" },
- { "kind" : "LinkageType", "name" : "'Linkage Type'" }
+ { "kind" : "LiteralString", "name" : "Name" },
+ { "kind" : "LinkageType", "name" : "Linkage Type" }
],
"version": "1.0"
},
@@ -13123,7 +14262,7 @@
"value" : 43,
"capabilities" : [ "InputAttachment" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Attachment Index'" }
+ { "kind" : "LiteralInteger", "name" : "Attachment Index" }
],
"version": "1.0"
},
@@ -13132,7 +14271,7 @@
"value" : 44,
"capabilities" : [ "Kernel" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Alignment'" }
+ { "kind" : "LiteralInteger", "name" : "Alignment" }
],
"version": "1.0"
},
@@ -13141,7 +14280,7 @@
"value" : 45,
"capabilities" : [ "Addresses" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Max Byte Offset'" }
+ { "kind" : "LiteralInteger", "name" : "Max Byte Offset" }
],
"version" : "1.1"
},
@@ -13150,7 +14289,7 @@
"value" : 46,
"capabilities" : [ "Kernel" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Alignment'" }
+ { "kind" : "IdRef", "name" : "Alignment" }
],
"version" : "1.2"
},
@@ -13159,11 +14298,17 @@
"value" : 47,
"capabilities" : [ "Addresses" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Max Byte Offset'" }
+ { "kind" : "IdRef", "name" : "Max Byte Offset" }
],
"version" : "1.2"
},
{
+ "enumerant" : "SaturatedToLargestFloat8NormalConversionEXT",
+ "value" : 4216,
+ "capabilities" : [ "Float8EXT" ],
+ "version": "None"
+ },
+ {
"enumerant" : "NoSignedWrap",
"value" : 4469,
"extensions" : [ "SPV_KHR_no_integer_wrap_decoration" ],
@@ -13204,8 +14349,9 @@
"value" : 5019,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Payload Array'" }
+ { "kind" : "IdRef", "name" : "Payload Type" }
],
+ "provisional" : true,
"version" : "None"
},
{
@@ -13213,14 +14359,16 @@
"value" : 5020,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "IdRef", "name" : "'Max number of payloads'" }
+ { "kind" : "IdRef", "name" : "Max number of payloads" }
],
+ "provisional" : true,
"version" : "None"
},
{
"enumerant" : "TrackFinishWritingAMDX",
"value" : 5078,
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
@@ -13228,8 +14376,43 @@
"value" : 5091,
"capabilities" : [ "ShaderEnqueueAMDX" ],
"parameters" : [
- { "kind" : "LiteralString", "name" : "'Node Name'" }
+ { "kind" : "IdRef", "name" : "Node Name" }
],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PayloadNodeBaseIndexAMDX",
+ "value" : 5098,
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "parameters" : [
+ { "kind" : "IdRef", "name" : "Base Index" }
+ ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PayloadNodeSparseArrayAMDX",
+ "value" : 5099,
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PayloadNodeArraySizeAMDX",
+ "value" : 5100,
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "parameters" : [
+ { "kind" : "IdRef", "name" : "Array Size" }
+ ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PayloadDispatchIndirectAMDX",
+ "value" : 5105,
+ "capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
@@ -13259,18 +14442,12 @@
"extensions" : [ "SPV_NV_stereo_view_rendering" ],
"version" : "None",
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Offset'" }
+ { "kind" : "LiteralInteger", "name" : "Offset" }
]
},
{
- "enumerant" : "PerPrimitiveNV",
- "value" : 5271,
- "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
- "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
- "version" : "None"
- },
- {
"enumerant" : "PerPrimitiveEXT",
+ "aliases" : ["PerPrimitiveNV"],
"value" : 5271,
"capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
"extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
@@ -13286,32 +14463,21 @@
{
"enumerant" : "PerTaskNV",
"value" : 5273,
- "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
- "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV" ],
+ "extensions" : [ "SPV_NV_mesh_shader" ],
"version" : "None"
},
{
"enumerant" : "PerVertexKHR",
+ "aliases" : ["PerVertexNV"],
"value" : 5285,
- "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
- "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
- "version" : "None"
- },
- {
- "enumerant" : "PerVertexNV",
- "value" : 5285,
- "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "capabilities" : [ "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "NonUniform",
- "value" : 5300,
- "capabilities" : [ "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "NonUniformEXT",
+ "aliases" : ["NonUniformEXT"],
"value" : 5300,
"capabilities" : [ "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -13319,33 +14485,21 @@
},
{
"enumerant" : "RestrictPointer",
+ "aliases" : ["RestrictPointerEXT"],
"value" : 5355,
"capabilities" : [ "PhysicalStorageBufferAddresses" ],
"extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ],
"version" : "1.5"
},
{
- "enumerant" : "RestrictPointerEXT",
- "value" : 5355,
- "capabilities" : [ "PhysicalStorageBufferAddresses" ],
- "extensions" : [ "SPV_EXT_physical_storage_buffer" ],
- "version" : "1.5"
- },
- {
"enumerant" : "AliasedPointer",
+ "aliases" : ["AliasedPointerEXT"],
"value" : 5356,
"capabilities" : [ "PhysicalStorageBufferAddresses" ],
"extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ],
"version" : "1.5"
},
{
- "enumerant" : "AliasedPointerEXT",
- "value" : 5356,
- "capabilities" : [ "PhysicalStorageBufferAddresses" ],
- "extensions" : [ "SPV_EXT_physical_storage_buffer" ],
- "version" : "1.5"
- },
- {
"enumerant" : "HitObjectShaderRecordBufferNV",
"value" : 5386,
"capabilities" : [ "ShaderInvocationReorderNV" ],
@@ -13379,7 +14533,7 @@
"enumerant" : "SIMTCallINTEL",
"value" : 5599,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'N'" }
+ { "kind" : "LiteralInteger", "name" : "N" }
],
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
@@ -13395,7 +14549,7 @@
"enumerant" : "ClobberINTEL",
"value" : 5607,
"parameters" : [
- { "kind" : "LiteralString", "name" : "'Register'" }
+ { "kind" : "LiteralString", "name" : "Register" }
],
"capabilities" : [ "AsmINTEL" ],
"version" : "None"
@@ -13416,7 +14570,7 @@
"enumerant" : "FuncParamIOKindINTEL",
"value" : 5625,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Kind'" }
+ { "kind" : "LiteralInteger", "name" : "Kind" }
],
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
@@ -13437,50 +14591,36 @@
"enumerant" : "GlobalVariableOffsetINTEL",
"value" : 5628,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Offset'" }
+ { "kind" : "LiteralInteger", "name" : "Offset" }
],
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
},
{
"enumerant" : "CounterBuffer",
+ "aliases" : ["HlslCounterBufferGOOGLE"],
"value" : 5634,
"parameters" : [
- { "kind" : "IdRef", "name" : "'Counter Buffer'" }
- ],
- "version" : "1.4"
- },
- {
- "enumerant" : "HlslCounterBufferGOOGLE",
- "value" : 5634,
- "parameters" : [
- { "kind" : "IdRef", "name" : "'Counter Buffer'" }
+ { "kind" : "IdRef", "name" : "Counter Buffer" }
],
"extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ],
- "version" : "None"
+ "version" : "1.4"
},
{
"enumerant" : "UserSemantic",
+ "aliases" : ["HlslSemanticGOOGLE"],
"value" : 5635,
"parameters" : [
- { "kind" : "LiteralString", "name" : "'Semantic'" }
- ],
- "version" : "1.4"
- },
- {
- "enumerant" : "HlslSemanticGOOGLE",
- "value" : 5635,
- "parameters" : [
- { "kind" : "LiteralString", "name" : "'Semantic'" }
+ { "kind" : "LiteralString", "name" : "Semantic" }
],
"extensions" : [ "SPV_GOOGLE_hlsl_functionality1" ],
- "version" : "None"
+ "version" : "1.4"
},
{
"enumerant" : "UserTypeGOOGLE",
"value" : 5636,
"parameters" : [
- { "kind" : "LiteralString", "name" : "'User Type'" }
+ { "kind" : "LiteralString", "name" : "User Type" }
],
"extensions" : [ "SPV_GOOGLE_user_type" ],
"version" : "None"
@@ -13489,8 +14629,8 @@
"enumerant" : "FunctionRoundingModeINTEL",
"value" : 5822,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" },
- { "kind" : "FPRoundingMode", "name" : "'FP Rounding Mode'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" },
+ { "kind" : "FPRoundingMode", "name" : "FP Rounding Mode" }
],
"capabilities" : [ "FunctionFloatControlINTEL" ],
"version" : "None"
@@ -13499,8 +14639,8 @@
"enumerant" : "FunctionDenormModeINTEL",
"value" : 5823,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" },
- { "kind" : "FPDenormMode", "name" : "'FP Denorm Mode'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" },
+ { "kind" : "FPDenormMode", "name" : "FP Denorm Mode" }
],
"capabilities" : [ "FunctionFloatControlINTEL" ],
"version" : "None"
@@ -13516,7 +14656,7 @@
"enumerant" : "MemoryINTEL",
"value" : 5826,
"parameters" : [
- { "kind" : "LiteralString", "name" : "'Memory Type'" }
+ { "kind" : "LiteralString", "name" : "Memory Type" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13526,7 +14666,7 @@
"enumerant" : "NumbanksINTEL",
"value" : 5827,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Banks'" }
+ { "kind" : "LiteralInteger", "name" : "Banks" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13536,7 +14676,7 @@
"enumerant" : "BankwidthINTEL",
"value" : 5828,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Bank Width'" }
+ { "kind" : "LiteralInteger", "name" : "Bank Width" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13546,7 +14686,7 @@
"enumerant" : "MaxPrivateCopiesINTEL",
"value" : 5829,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Maximum Copies'" }
+ { "kind" : "LiteralInteger", "name" : "Maximum Copies" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13570,7 +14710,7 @@
"enumerant" : "MaxReplicatesINTEL",
"value" : 5832,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Maximum Replicates'" }
+ { "kind" : "LiteralInteger", "name" : "Maximum Replicates" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13587,8 +14727,8 @@
"enumerant" : "MergeINTEL",
"value" : 5834,
"parameters" : [
- { "kind" : "LiteralString", "name" : "'Merge Key'" },
- { "kind" : "LiteralString", "name" : "'Merge Type'" }
+ { "kind" : "LiteralString", "name" : "Merge Key" },
+ { "kind" : "LiteralString", "name" : "Merge Type" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13598,7 +14738,7 @@
"enumerant" : "BankBitsINTEL",
"value" : 5835,
"parameters" : [
- { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "'Bank Bits'" }
+ { "kind" : "LiteralInteger", "quantifier" : "*", "name" : "Bank Bits" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13608,7 +14748,7 @@
"enumerant" : "ForcePow2DepthINTEL",
"value" : 5836,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Force Key'" }
+ { "kind" : "LiteralInteger", "name" : "Force Key" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"extensions" : [ "SPV_INTEL_fpga_memory_attributes" ],
@@ -13618,7 +14758,7 @@
"enumerant" : "StridesizeINTEL",
"value" : 5883,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Stride Size'" }
+ { "kind" : "LiteralInteger", "name" : "Stride Size" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"version" : "None"
@@ -13627,7 +14767,7 @@
"enumerant" : "WordsizeINTEL",
"value" : 5884,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Word Size'" }
+ { "kind" : "LiteralInteger", "name" : "Word Size" }
],
"capabilities" : [ "FPGAMemoryAttributesINTEL" ],
"version" : "None"
@@ -13648,7 +14788,7 @@
"enumerant" : "CacheSizeINTEL",
"value" : 5900,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Cache Size in bytes'" }
+ { "kind" : "LiteralInteger", "name" : "Cache Size in bytes" }
],
"capabilities" : [ "FPGAMemoryAccessesINTEL" ],
"version" : "None"
@@ -13663,7 +14803,7 @@
"enumerant" : "PrefetchINTEL",
"value" : 5902,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Prefetcher Size in bytes'" }
+ { "kind" : "LiteralInteger", "name" : "Prefetcher Size in bytes" }
],
"capabilities" : [ "FPGAMemoryAccessesINTEL" ],
"version" : "None"
@@ -13684,8 +14824,8 @@
"enumerant" : "MathOpDSPModeINTEL",
"value" : 5909,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Mode'" },
- { "kind" : "LiteralInteger", "name" : "'Propagate'" }
+ { "kind" : "LiteralInteger", "name" : "Mode" },
+ { "kind" : "LiteralInteger", "name" : "Propagate" }
],
"capabilities" : [ "FPGADSPControlINTEL" ],
"version" : "None"
@@ -13694,7 +14834,7 @@
"enumerant" : "AliasScopeINTEL",
"value" : 5914,
"parameters" : [
- { "kind" : "IdRef", "name" : "'Aliasing Scopes List'" }
+ { "kind" : "IdRef", "name" : "Aliasing Scopes List" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"version" : "None"
@@ -13703,7 +14843,7 @@
"enumerant" : "NoAliasINTEL",
"value" : 5915,
"parameters" : [
- { "kind" : "IdRef", "name" : "'Aliasing Scopes List'" }
+ { "kind" : "IdRef", "name" : "Aliasing Scopes List" }
],
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"version" : "None"
@@ -13712,7 +14852,7 @@
"enumerant" : "InitiationIntervalINTEL",
"value" : 5917,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Cycles'" }
+ { "kind" : "LiteralInteger", "name" : "Cycles" }
],
"capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ],
"version" : "None"
@@ -13721,7 +14861,7 @@
"enumerant" : "MaxConcurrencyINTEL",
"value" : 5918,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Invocations'" }
+ { "kind" : "LiteralInteger", "name" : "Invocations" }
],
"capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ],
"version" : "None"
@@ -13730,7 +14870,7 @@
"enumerant" : "PipelineEnableINTEL",
"value" : 5919,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Enable'" }
+ { "kind" : "LiteralInteger", "name" : "Enable" }
],
"capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ],
"version" : "None"
@@ -13739,7 +14879,7 @@
"enumerant" : "BufferLocationINTEL",
"value" : 5921,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Buffer Location ID'" }
+ { "kind" : "LiteralInteger", "name" : "Buffer Location ID" }
],
"capabilities" : [ "FPGABufferLocationINTEL" ],
"version" : "None"
@@ -13748,7 +14888,7 @@
"enumerant" : "IOPipeStorageINTEL",
"value" : 5944,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'IO Pipe ID'" }
+ { "kind" : "LiteralInteger", "name" : "IO Pipe ID" }
],
"capabilities" : [ "IOPipesINTEL" ],
"version" : "None"
@@ -13757,8 +14897,8 @@
"enumerant" : "FunctionFloatingPointModeINTEL",
"value" : 6080,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Target Width'" },
- { "kind" : "FPOperationMode", "name" : "'FP Operation Mode'" }
+ { "kind" : "LiteralInteger", "name" : "Target Width" },
+ { "kind" : "FPOperationMode", "name" : "FP Operation Mode" }
],
"capabilities" : [ "FunctionFloatControlINTEL" ],
"version" : "None"
@@ -13791,7 +14931,7 @@
"enumerant" : "FPMaxErrorDecorationINTEL",
"value" : 6170,
"parameters" : [
- { "kind" : "LiteralFloat", "name" : "'Max Error'" }
+ { "kind" : "LiteralFloat", "name" : "Max Error" }
],
"capabilities" : [ "FPMaxErrorINTEL" ],
"version" : "None"
@@ -13800,7 +14940,7 @@
"enumerant" : "LatencyControlLabelINTEL",
"value" : 6172,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Latency Label'" }
+ { "kind" : "LiteralInteger", "name" : "Latency Label" }
],
"capabilities" : [ "FPGALatencyControlINTEL" ],
"version" : "None"
@@ -13809,9 +14949,9 @@
"enumerant" : "LatencyControlConstraintINTEL",
"value" : 6173,
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Relative To'" },
- { "kind" : "LiteralInteger", "name" : "'Control Type'" },
- { "kind" : "LiteralInteger", "name" : "'Relative Cycle'" }
+ { "kind" : "LiteralInteger", "name" : "Relative To" },
+ { "kind" : "LiteralInteger", "name" : "Control Type" },
+ { "kind" : "LiteralInteger", "name" : "Relative Cycle" }
],
"capabilities" : [ "FPGALatencyControlINTEL" ],
"version" : "None"
@@ -13833,7 +14973,7 @@
"value" : 6177,
"capabilities" : [ "FPGAArgumentInterfacesINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'AddressWidth'" }
+ { "kind" : "LiteralInteger", "name" : "AddressWidth" }
],
"version" : "None"
},
@@ -13842,7 +14982,7 @@
"value" : 6178,
"capabilities" : [ "FPGAArgumentInterfacesINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'DataWidth'" }
+ { "kind" : "LiteralInteger", "name" : "DataWidth" }
],
"version" : "None"
},
@@ -13851,7 +14991,7 @@
"value" : 6179,
"capabilities" : [ "FPGAArgumentInterfacesINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Latency'" }
+ { "kind" : "LiteralInteger", "name" : "Latency" }
],
"version" : "None"
},
@@ -13860,7 +15000,7 @@
"value" : 6180,
"capabilities" : [ "FPGAArgumentInterfacesINTEL" ],
"parameters" : [
- { "kind" : "AccessQualifier", "name" : "'ReadWriteMode'" }
+ { "kind" : "AccessQualifier", "name" : "ReadWriteMode" }
],
"version" : "None"
},
@@ -13869,7 +15009,7 @@
"value" : 6181,
"capabilities" : [ "FPGAArgumentInterfacesINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'MaxBurstCount'" }
+ { "kind" : "LiteralInteger", "name" : "MaxBurstCount" }
],
"version" : "None"
},
@@ -13878,7 +15018,7 @@
"value" : 6182,
"capabilities" : [ "FPGAArgumentInterfacesINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Waitrequest'" }
+ { "kind" : "LiteralInteger", "name" : "Waitrequest" }
],
"version" : "None"
},
@@ -13892,8 +15032,8 @@
"enumerant" : "HostAccessINTEL",
"value" : 6188,
"parameters": [
- { "kind" : "HostAccessQualifier", "name" : "'Access'" },
- { "kind" : "LiteralString", "name" : "'Name'" }
+ { "kind" : "HostAccessQualifier", "name" : "Access" },
+ { "kind" : "LiteralString", "name" : "Name" }
],
"capabilities" : [ "GlobalVariableHostAccessINTEL" ],
"version" : "None"
@@ -13902,7 +15042,7 @@
"enumerant" : "InitModeINTEL",
"value" : 6190,
"parameters": [
- { "kind" : "InitializationModeQualifier", "name" : "'Trigger'" }
+ { "kind" : "InitializationModeQualifier", "name" : "Trigger" }
],
"capabilities" : [ "GlobalVariableFPGADecorationsINTEL" ],
"version" : "None"
@@ -13917,12 +15057,22 @@
"version" : "None"
},
{
+ "enumerant" : "ConditionalINTEL",
+ "value" : 6247,
+ "parameters": [
+ { "kind" : "IdRef", "name" : "Condition" }
+ ],
+ "capabilities" : [ "SpecConditionalINTEL" ],
+ "provisional" : true,
+ "version" : "None"
+ },
+ {
"enumerant" : "CacheControlLoadINTEL",
"value" : 6442,
"capabilities" : [ "CacheControlsINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Cache Level'" },
- { "kind" : "LoadCacheControl", "name" : "'Cache Control'" }
+ { "kind" : "LiteralInteger", "name" : "Cache Level" },
+ { "kind" : "LoadCacheControl", "name" : "Cache Control" }
],
"version" : "None"
},
@@ -13931,8 +15081,8 @@
"value" : 6443,
"capabilities" : [ "CacheControlsINTEL" ],
"parameters" : [
- { "kind" : "LiteralInteger", "name" : "'Cache Level'" },
- { "kind" : "StoreCacheControl", "name" : "'Cache Control'" }
+ { "kind" : "LiteralInteger", "name" : "Cache Level" },
+ { "kind" : "StoreCacheControl", "name" : "Cache Control" }
],
"version" : "None"
}
@@ -14214,12 +15364,7 @@
},
{
"enumerant" : "SubgroupEqMask",
- "value" : 4416,
- "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "SubgroupEqMaskKHR",
+ "aliases" : ["SubgroupEqMaskKHR"],
"value" : 4416,
"capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
@@ -14227,12 +15372,7 @@
},
{
"enumerant" : "SubgroupGeMask",
- "value" : 4417,
- "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "SubgroupGeMaskKHR",
+ "aliases" : ["SubgroupGeMaskKHR"],
"value" : 4417,
"capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
@@ -14240,12 +15380,7 @@
},
{
"enumerant" : "SubgroupGtMask",
- "value" : 4418,
- "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "SubgroupGtMaskKHR",
+ "aliases" : ["SubgroupGtMaskKHR"],
"value" : 4418,
"capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
@@ -14253,12 +15388,7 @@
},
{
"enumerant" : "SubgroupLeMask",
- "value" : 4419,
- "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "SubgroupLeMaskKHR",
+ "aliases" : ["SubgroupLeMaskKHR"],
"value" : 4419,
"capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
@@ -14266,12 +15396,7 @@
},
{
"enumerant" : "SubgroupLtMask",
- "value" : 4420,
- "capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "SubgroupLtMaskKHR",
+ "aliases" : ["SubgroupLtMaskKHR"],
"value" : 4420,
"capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
"extensions" : [ "SPV_KHR_shader_ballot" ],
@@ -14327,6 +15452,24 @@
"version" : "None"
},
{
+ "enumerant" : "TileOffsetQCOM",
+ "value" : 4492,
+ "capabilities" : [ "TileShadingQCOM" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TileDimensionQCOM",
+ "value" : 4493,
+ "capabilities" : [ "TileShadingQCOM" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TileApronSizeQCOM",
+ "value" : 4494,
+ "capabilities" : [ "TileShadingQCOM" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "BaryCoordNoPerspAMD",
"value" : 4992,
"extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ],
@@ -14376,15 +15519,17 @@
"version" : "None"
},
{
- "enumerant" : "CoalescedInputCountAMDX",
+ "enumerant" : "RemainingRecursionLevelsAMDX",
"value" : 5021,
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
"enumerant" : "ShaderIndexAMDX",
"value" : 5073,
"capabilities" : [ "ShaderEnqueueAMDX" ],
+ "provisional" : true,
"version" : "None"
},
{
@@ -14487,61 +15632,37 @@
},
{
"enumerant" : "BaryCoordKHR",
+ "aliases" : ["BaryCoordNV"],
"value" : 5286,
- "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
- "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
- "version" : "None"
- },
- {
- "enumerant" : "BaryCoordNV",
- "value" : 5286,
- "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "capabilities" : [ "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "BaryCoordNoPerspKHR",
+ "aliases" : ["BaryCoordNoPerspNV"],
"value" : 5287,
- "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
- "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
- "version" : "None"
- },
- {
- "enumerant" : "BaryCoordNoPerspNV",
- "value" : 5287,
- "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "capabilities" : [ "FragmentBarycentricKHR" ],
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "FragSizeEXT",
+ "aliases" : ["FragmentSizeNV"],
"value" : 5292 ,
- "capabilities" : [ "FragmentDensityEXT", "ShadingRateNV" ],
+ "capabilities" : [ "FragmentDensityEXT" ],
"extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ],
"version" : "None"
},
{
- "enumerant" : "FragmentSizeNV",
- "value" : 5292 ,
- "capabilities" : [ "ShadingRateNV", "FragmentDensityEXT" ],
- "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ],
- "version" : "None"
- },
- {
"enumerant" : "FragInvocationCountEXT",
+ "aliases" : ["InvocationsPerPixelNV"],
"value" : 5293,
- "capabilities" : [ "FragmentDensityEXT", "ShadingRateNV" ],
+ "capabilities" : [ "FragmentDensityEXT" ],
"extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ],
"version" : "None"
},
{
- "enumerant" : "InvocationsPerPixelNV",
- "value" : 5293,
- "capabilities" : [ "ShadingRateNV", "FragmentDensityEXT" ],
- "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ],
- "version" : "None"
- },
- {
"enumerant" : "PrimitivePointIndicesEXT",
"value" : 5294,
"capabilities" : [ "MeshShadingEXT" ],
@@ -14570,154 +15691,88 @@
"version" : "None"
},
{
- "enumerant" : "LaunchIdNV",
- "value" : 5319,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "LaunchIdKHR",
+ "aliases" : ["LaunchIdNV"],
"value" : 5319,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "LaunchSizeNV",
- "value" : 5320,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "LaunchSizeKHR",
+ "aliases" : ["LaunchSizeNV"],
"value" : 5320,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "WorldRayOriginNV",
- "value" : 5321,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "WorldRayOriginKHR",
+ "aliases" : ["WorldRayOriginNV"],
"value" : 5321,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "WorldRayDirectionNV",
- "value" : 5322,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "WorldRayDirectionKHR",
+ "aliases" : ["WorldRayDirectionNV"],
"value" : 5322,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "ObjectRayOriginNV",
- "value" : 5323,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "ObjectRayOriginKHR",
+ "aliases" : ["ObjectRayOriginNV"],
"value" : 5323,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "ObjectRayDirectionNV",
- "value" : 5324,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "ObjectRayDirectionKHR",
+ "aliases" : ["ObjectRayDirectionNV"],
"value" : 5324,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "RayTminNV",
- "value" : 5325,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "RayTminKHR",
+ "aliases" : ["RayTminNV"],
"value" : 5325,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "RayTmaxNV",
- "value" : 5326,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "RayTmaxKHR",
+ "aliases" : ["RayTmaxNV"],
"value" : 5326,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "InstanceCustomIndexNV",
- "value" : 5327,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "InstanceCustomIndexKHR",
+ "aliases" : ["InstanceCustomIndexNV"],
"value" : 5327,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "ObjectToWorldNV",
- "value" : 5330,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "ObjectToWorldKHR",
+ "aliases" : ["ObjectToWorldNV"],
"value" : 5330,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
"version" : "None"
},
{
- "enumerant" : "WorldToObjectNV",
- "value" : 5331,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "WorldToObjectKHR",
+ "aliases" : ["WorldToObjectNV"],
"value" : 5331,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
@@ -14731,14 +15786,8 @@
"version" : "None"
},
{
- "enumerant" : "HitKindNV",
- "value" : 5333,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "HitKindKHR",
+ "aliases" : ["HitKindNV"],
"value" : 5333,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
@@ -14770,14 +15819,8 @@
"version" : "None"
},
{
- "enumerant" : "IncomingRayFlagsNV",
- "value" : 5351,
- "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
- "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
- "version" : "None"
- },
- {
"enumerant" : "IncomingRayFlagsKHR",
+ "aliases" : ["IncomingRayFlagsNV"],
"value" : 5351,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
@@ -14791,6 +15834,27 @@
"version" : "None"
},
{
+ "enumerant" : "HitIsSphereNV",
+ "value" : 5359,
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "HitIsLSSNV",
+ "value" : 5360,
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "HitSpherePositionNV",
+ "value" : 5361,
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "WarpsPerSMNV",
"value" : 5374,
"capabilities" : [ "ShaderSMBuiltinsNV" ],
@@ -14819,6 +15883,13 @@
"version" : "None"
},
{
+ "enumerant" : "HitLSSPositionsNV",
+ "value" : 5396,
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "HitKindFrontFacingMicroTriangleNV",
"value" : 5405,
"capabilities" : [ "RayTracingDisplacementMicromapNV" ],
@@ -14831,6 +15902,27 @@
"version" : "None"
},
{
+ "enumerant" : "HitSphereRadiusNV",
+ "value" : 5420,
+ "capabilities" : [ "RayTracingSpheresGeometryNV" ],
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "HitLSSRadiiNV",
+ "value" : 5421,
+ "capabilities" : [ "RayTracingLinearSweptSpheresGeometryNV" ],
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "ClusterIDNV",
+ "value" : 5436,
+ "capabilities" : [ "RayTracingClusterAccelerationStructureNV" ],
+ "extensions" : [ "SPV_NV_cluster_acceleration_structure" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "CullMaskKHR",
"value" : 6021,
"capabilities" : [ "RayCullMaskKHR" ],
@@ -14870,12 +15962,7 @@
},
{
"enumerant" : "QueueFamily",
- "value" : 5,
- "capabilities" : [ "VulkanMemoryModel" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "QueueFamilyKHR",
+ "aliases" : ["QueueFamilyKHR"],
"value" : 5,
"capabilities" : [ "VulkanMemoryModel" ],
"version" : "1.5"
@@ -15397,6 +16484,49 @@
"version" : "None"
},
{
+ "enumerant" : "TensorsARM",
+ "value" : 4174,
+ "extensions" : [ "SPV_ARM_tensors"],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "StorageTensorArrayDynamicIndexingARM",
+ "value" : 4175,
+ "extensions" : [ "SPV_ARM_tensors"],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "StorageTensorArrayNonUniformIndexingARM",
+ "value" : 4176,
+ "extensions" : [ "SPV_ARM_tensors"],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "GraphARM",
+ "value" : 4191,
+ "extensions" : [ "SPV_ARM_graph"],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixLayoutsARM",
+ "value" : 4201,
+ "extensions" : [ "SPV_ARM_cooperative_matrix_layouts" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Float8EXT",
+ "value" : 4212,
+ "extensions" : [ "SPV_EXT_float8"],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Float8CooperativeMatrixEXT",
+ "value" : 4213,
+ "capabilities" : [ "Float8EXT", "CooperativeMatrixKHR" ],
+ "extensions" : [ "SPV_EXT_float8"],
+ "version" : "None"
+ },
+ {
"enumerant" : "FragmentShadingRateKHR",
"value" : 4422,
"capabilities" : [ "Shader" ],
@@ -15445,33 +16575,16 @@
},
{
"enumerant" : "StorageBuffer16BitAccess",
- "value" : 4433,
- "extensions" : [ "SPV_KHR_16bit_storage" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "StorageUniformBufferBlock16",
+ "aliases" : ["StorageUniformBufferBlock16"],
"value" : 4433,
"extensions" : [ "SPV_KHR_16bit_storage" ],
"version" : "1.3"
},
{
"enumerant" : "UniformAndStorageBuffer16BitAccess",
+ "aliases" : ["StorageUniform16"],
"value" : 4434,
- "capabilities" : [
- "StorageBuffer16BitAccess",
- "StorageUniformBufferBlock16"
- ],
- "extensions" : [ "SPV_KHR_16bit_storage" ],
- "version" : "1.3"
- },
- {
- "enumerant" : "StorageUniform16",
- "value" : 4434,
- "capabilities" : [
- "StorageBuffer16BitAccess",
- "StorageUniformBufferBlock16"
- ],
+ "capabilities" : [ "StorageBuffer16BitAccess" ],
"extensions" : [ "SPV_KHR_16bit_storage" ],
"version" : "1.3"
},
@@ -15517,6 +16630,7 @@
{
"enumerant" : "AtomicStorageOps",
"value" : 4445,
+ "capabilities" : [ "AtomicStorage" ],
"extensions" : [ "SPV_KHR_shader_atomic_counter_ops" ],
"version" : "None"
},
@@ -15590,6 +16704,12 @@
"version" : "None"
},
{
+ "enumerant" : "UntypedPointersKHR",
+ "value" : 4473,
+ "extensions" : [ "SPV_KHR_untyped_pointers" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "RayTraversalPrimitiveCullingKHR",
"value" : 4478,
"capabilities" : [ "RayQueryKHR","RayTracingKHR" ],
@@ -15622,6 +16742,20 @@
"version" : "None"
},
{
+ "enumerant" : "TileShadingQCOM",
+ "value" : 4495,
+ "capabilities" : [ "Shader" ],
+ "extensions" : [ "SPV_QCOM_tile_shading" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixConversionQCOM",
+ "value" : 4496,
+ "capabilities" : [ "CooperativeMatrixKHR" ],
+ "extensions" : [ "SPV_QCOM_cooperative_matrix_conversion" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "TextureBlockMatch2QCOM",
"value" : 4498,
"extensions" : [ "SPV_QCOM_image_processing2" ],
@@ -15680,6 +16814,7 @@
"value" : 5067,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_AMDX_shader_enqueue" ],
+ "provisional" : true,
"version" : "None"
},
{
@@ -15687,7 +16822,40 @@
"value" : 5087,
"extensions" : [ "SPV_KHR_quad_control" ],
"version" : "None"
- },
+ },
+ {
+ "enumerant" : "Int4TypeINTEL",
+ "value" : 5112,
+ "extensions" : [ "SPV_INTEL_int4" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Int4CooperativeMatrixINTEL",
+ "value" : 5114,
+ "capabilities" : [ "Int4TypeINTEL", "CooperativeMatrixKHR" ],
+ "extensions" : [ "SPV_INTEL_int4" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BFloat16TypeKHR",
+ "value" : 5116,
+ "extensions" : [ "SPV_KHR_bfloat16" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BFloat16DotProductKHR",
+ "value" : 5117,
+ "capabilities" : [ "BFloat16TypeKHR" ],
+ "extensions" : [ "SPV_KHR_bfloat16" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BFloat16CooperativeMatrixKHR",
+ "value" : 5118,
+ "capabilities" : [ "BFloat16TypeKHR", "CooperativeMatrixKHR" ],
+ "extensions" : [ "SPV_KHR_bfloat16" ],
+ "version" : "None"
+ },
{
"enumerant" : "SampleMaskOverrideCoverageNV",
"value" : 5249,
@@ -15704,22 +16872,16 @@
},
{
"enumerant" : "ShaderViewportIndexLayerEXT",
+ "aliases" : ["ShaderViewportIndexLayerNV"],
"value" : 5254,
"capabilities" : [ "MultiViewport" ],
- "extensions" : [ "SPV_EXT_shader_viewport_index_layer" ],
- "version" : "None"
- },
- {
- "enumerant" : "ShaderViewportIndexLayerNV",
- "value" : 5254,
- "capabilities" : [ "MultiViewport" ],
- "extensions" : [ "SPV_NV_viewport_array2" ],
+ "extensions" : [ "SPV_EXT_shader_viewport_index_layer", "SPV_NV_viewport_array2" ],
"version" : "None"
},
{
"enumerant" : "ShaderViewportMaskNV",
"value" : 5255,
- "capabilities" : [ "ShaderViewportIndexLayerNV" ],
+ "capabilities" : [ "ShaderViewportIndexLayerEXT" ],
"extensions" : [ "SPV_NV_viewport_array2" ],
"version" : "None"
},
@@ -15766,37 +16928,28 @@
},
{
"enumerant" : "FragmentBarycentricKHR",
+ "aliases" : ["FragmentBarycentricNV"],
"value" : 5284,
"extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
- "enumerant" : "FragmentBarycentricNV",
- "value" : 5284,
- "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
- "version" : "None"
- },
- {
- "enumerant" : "ComputeDerivativeGroupQuadsNV",
+ "enumerant" : "ComputeDerivativeGroupQuadsKHR",
+ "aliases" : ["ComputeDerivativeGroupQuadsNV"],
"value" : 5288,
- "extensions" : [ "SPV_NV_compute_shader_derivatives" ],
+ "capabilities" : [ "Shader" ],
+ "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ],
"version" : "None"
},
{
"enumerant" : "FragmentDensityEXT",
+ "aliases" : ["ShadingRateNV"],
"value" : 5291,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate" ],
"version" : "None"
},
{
- "enumerant" : "ShadingRateNV",
- "value" : 5291,
- "capabilities" : [ "Shader" ],
- "extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ],
- "version" : "None"
- },
- {
"enumerant" : "GroupNonUniformPartitionedNV",
"value" : 5297,
"extensions" : [ "SPV_NV_shader_subgroup_partitioned" ],
@@ -15804,12 +16957,7 @@
},
{
"enumerant" : "ShaderNonUniform",
- "value" : 5301,
- "capabilities" : [ "Shader" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "ShaderNonUniformEXT",
+ "aliases" : ["ShaderNonUniformEXT"],
"value" : 5301,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15817,12 +16965,7 @@
},
{
"enumerant" : "RuntimeDescriptorArray",
- "value" : 5302,
- "capabilities" : [ "Shader" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "RuntimeDescriptorArrayEXT",
+ "aliases" : ["RuntimeDescriptorArrayEXT"],
"value" : 5302,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15830,12 +16973,7 @@
},
{
"enumerant" : "InputAttachmentArrayDynamicIndexing",
- "value" : 5303,
- "capabilities" : [ "InputAttachment" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "InputAttachmentArrayDynamicIndexingEXT",
+ "aliases" : ["InputAttachmentArrayDynamicIndexingEXT"],
"value" : 5303,
"capabilities" : [ "InputAttachment" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15843,12 +16981,7 @@
},
{
"enumerant" : "UniformTexelBufferArrayDynamicIndexing",
- "value" : 5304,
- "capabilities" : [ "SampledBuffer" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "UniformTexelBufferArrayDynamicIndexingEXT",
+ "aliases" : ["UniformTexelBufferArrayDynamicIndexingEXT"],
"value" : 5304,
"capabilities" : [ "SampledBuffer" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15856,12 +16989,7 @@
},
{
"enumerant" : "StorageTexelBufferArrayDynamicIndexing",
- "value" : 5305,
- "capabilities" : [ "ImageBuffer" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "StorageTexelBufferArrayDynamicIndexingEXT",
+ "aliases" : ["StorageTexelBufferArrayDynamicIndexingEXT"],
"value" : 5305,
"capabilities" : [ "ImageBuffer" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15869,12 +16997,7 @@
},
{
"enumerant" : "UniformBufferArrayNonUniformIndexing",
- "value" : 5306,
- "capabilities" : [ "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "UniformBufferArrayNonUniformIndexingEXT",
+ "aliases" : ["UniformBufferArrayNonUniformIndexingEXT"],
"value" : 5306,
"capabilities" : [ "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15882,12 +17005,7 @@
},
{
"enumerant" : "SampledImageArrayNonUniformIndexing",
- "value" : 5307,
- "capabilities" : [ "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "SampledImageArrayNonUniformIndexingEXT",
+ "aliases" : ["SampledImageArrayNonUniformIndexingEXT"],
"value" : 5307,
"capabilities" : [ "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15895,12 +17013,7 @@
},
{
"enumerant" : "StorageBufferArrayNonUniformIndexing",
- "value" : 5308,
- "capabilities" : [ "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "StorageBufferArrayNonUniformIndexingEXT",
+ "aliases" : ["StorageBufferArrayNonUniformIndexingEXT"],
"value" : 5308,
"capabilities" : [ "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15908,12 +17021,7 @@
},
{
"enumerant" : "StorageImageArrayNonUniformIndexing",
- "value" : 5309,
- "capabilities" : [ "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "StorageImageArrayNonUniformIndexingEXT",
+ "aliases" : ["StorageImageArrayNonUniformIndexingEXT"],
"value" : 5309,
"capabilities" : [ "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15921,12 +17029,7 @@
},
{
"enumerant" : "InputAttachmentArrayNonUniformIndexing",
- "value" : 5310,
- "capabilities" : [ "InputAttachment", "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "InputAttachmentArrayNonUniformIndexingEXT",
+ "aliases" : ["InputAttachmentArrayNonUniformIndexingEXT"],
"value" : 5310,
"capabilities" : [ "InputAttachment", "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15934,12 +17037,7 @@
},
{
"enumerant" : "UniformTexelBufferArrayNonUniformIndexing",
- "value" : 5311,
- "capabilities" : [ "SampledBuffer", "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "UniformTexelBufferArrayNonUniformIndexingEXT",
+ "aliases" : ["UniformTexelBufferArrayNonUniformIndexingEXT"],
"value" : 5311,
"capabilities" : [ "SampledBuffer", "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15947,12 +17045,7 @@
},
{
"enumerant" : "StorageTexelBufferArrayNonUniformIndexing",
- "value" : 5312,
- "capabilities" : [ "ImageBuffer", "ShaderNonUniform" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "StorageTexelBufferArrayNonUniformIndexingEXT",
+ "aliases" : ["StorageTexelBufferArrayNonUniformIndexingEXT"],
"value" : 5312,
"capabilities" : [ "ImageBuffer", "ShaderNonUniform" ],
"extensions" : [ "SPV_EXT_descriptor_indexing" ],
@@ -15981,44 +17074,32 @@
},
{
"enumerant" : "VulkanMemoryModel",
- "value" : 5345,
- "version" : "1.5"
- },
- {
- "enumerant" : "VulkanMemoryModelKHR",
+ "aliases" : ["VulkanMemoryModelKHR"],
"value" : 5345,
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
"version" : "1.5"
},
{
"enumerant" : "VulkanMemoryModelDeviceScope",
- "value" : 5346,
- "version" : "1.5"
- },
- {
- "enumerant" : "VulkanMemoryModelDeviceScopeKHR",
+ "aliases" : ["VulkanMemoryModelDeviceScopeKHR"],
"value" : 5346,
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
"version" : "1.5"
},
{
"enumerant" : "PhysicalStorageBufferAddresses",
+ "aliases" : ["PhysicalStorageBufferAddressesEXT"],
"value" : 5347,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer" ],
"version" : "1.5"
},
{
- "enumerant" : "PhysicalStorageBufferAddressesEXT",
- "value" : 5347,
- "capabilities" : [ "Shader" ],
- "extensions" : [ "SPV_EXT_physical_storage_buffer" ],
- "version" : "1.5"
- },
- {
- "enumerant" : "ComputeDerivativeGroupLinearNV",
+ "enumerant" : "ComputeDerivativeGroupLinearKHR",
+ "aliases" : ["ComputeDerivativeGroupLinearNV"],
"value" : 5350,
- "extensions" : [ "SPV_NV_compute_shader_derivatives" ],
+ "capabilities" : [ "Shader" ],
+ "extensions" : [ "SPV_NV_compute_shader_derivatives", "SPV_KHR_compute_shader_derivatives" ],
"version" : "None"
},
{
@@ -16065,12 +17146,7 @@
},
{
"enumerant" : "DemoteToHelperInvocation",
- "value" : 5379,
- "capabilities" : [ "Shader" ],
- "version" : "1.6"
- },
- {
- "enumerant" : "DemoteToHelperInvocationEXT",
+ "aliases" : ["DemoteToHelperInvocationEXT"],
"value" : 5379,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
@@ -16086,7 +17162,7 @@
{
"enumerant" : "RayTracingOpacityMicromapEXT",
"value" : 5381,
- "capabilities" : [ "RayQueryKHR","RayTracingKHR" ],
+ "capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_opacity_micromap" ],
"version" : "None"
},
@@ -16111,6 +17187,12 @@
"version" : "None"
},
{
+ "enumerant" : "CooperativeVectorNV",
+ "value" : 5394,
+ "extensions" : [ "SPV_NV_cooperative_vector" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "AtomicFloat16VectorNV",
"value" : 5404,
"extensions" : [ "SPV_NV_shader_atomic_fp16_vector" ],
@@ -16130,6 +17212,67 @@
"version" : "None"
},
{
+ "enumerant" : "RayTracingSpheresGeometryNV",
+ "value" : 5418,
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "RayTracingLinearSweptSpheresGeometryNV",
+ "value" : 5419,
+ "extensions" : [ "SPV_NV_linear_swept_spheres" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixReductionsNV",
+ "value" : 5430,
+ "extensions" : [ "SPV_NV_cooperative_matrix2" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixConversionsNV",
+ "value" : 5431,
+ "extensions" : [ "SPV_NV_cooperative_matrix2" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixPerElementOperationsNV",
+ "value" : 5432,
+ "extensions" : [ "SPV_NV_cooperative_matrix2" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixTensorAddressingNV",
+ "value" : 5433,
+ "extensions" : [ "SPV_NV_cooperative_matrix2" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeMatrixBlockLoadsNV",
+ "value" : 5434,
+ "extensions" : [ "SPV_NV_cooperative_matrix2" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CooperativeVectorTrainingNV",
+ "value" : 5435,
+ "extensions" : [ "SPV_NV_cooperative_vector" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "RayTracingClusterAccelerationStructureNV",
+ "value" : 5437,
+ "capabilities" : [ "RayTracingKHR" ],
+ "extensions" : [ "SPV_NV_cluster_acceleration_structure" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TensorAddressingNV",
+ "value" : 5439,
+ "extensions" : [ "SPV_NV_tensor_addressing" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "SubgroupShuffleINTEL",
"value" : 5568,
"extensions" : [ "SPV_INTEL_subgroups" ],
@@ -16168,7 +17311,6 @@
{
"enumerant" : "IntegerFunctions2INTEL",
"value" : 5584,
- "capabilities" : [ "Shader" ],
"extensions" : [ "SPV_INTEL_shader_integer_functions2" ],
"version" : "None"
},
@@ -16386,23 +17528,14 @@
},
{
"enumerant" : "DotProductInputAll",
- "value" : 6016,
- "version" : "1.6"
- },
- {
- "enumerant" : "DotProductInputAllKHR",
+ "aliases" : ["DotProductInputAllKHR"],
"value" : 6016,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8Bit",
- "value" : 6017,
- "capabilities" : [ "Int8" ],
- "version" : "1.6"
- },
- {
- "enumerant" : "DotProductInput4x8BitKHR",
+ "aliases" : ["DotProductInput4x8BitKHR"],
"value" : 6017,
"capabilities" : [ "Int8" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
@@ -16410,22 +17543,14 @@
},
{
"enumerant" : "DotProductInput4x8BitPacked",
- "value" : 6018,
- "version" : "1.6"
- },
- {
- "enumerant" : "DotProductInput4x8BitPackedKHR",
+ "aliases" : ["DotProductInput4x8BitPackedKHR"],
"value" : 6018,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
},
{
"enumerant" : "DotProduct",
- "value" : 6019,
- "version" : "1.6"
- },
- {
- "enumerant" : "DotProductKHR",
+ "aliases" : ["DotProductKHR"],
"value" : 6019,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
@@ -16443,6 +17568,12 @@
"version" : "None"
},
{
+ "enumerant" : "ReplicatedCompositesEXT",
+ "value" : 6024,
+ "extensions" : [ "SPV_EXT_replicated_composites" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "BitInstructions",
"value" : 6025,
"extensions" : [ "SPV_KHR_bit_instructions" ],
@@ -16480,9 +17611,10 @@
"version" : "None"
},
{
- "enumerant" : "OptNoneINTEL",
+ "enumerant" : "OptNoneEXT",
+ "aliases" : ["OptNoneINTEL"],
"value" : 6094,
- "extensions" : [ "SPV_INTEL_optnone" ],
+ "extensions" : [ "SPV_EXT_optnone", "SPV_INTEL_optnone" ],
"version" : "None"
},
{
@@ -16510,6 +17642,12 @@
"version" : "None"
},
{
+ "enumerant" : "ArithmeticFenceEXT",
+ "value" : 6144,
+ "extensions" : [ "SPV_EXT_arithmetic_fence" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "FPGAClusterAttributesV2INTEL",
"value" : 6150,
"capabilities" : [ "FPGAClusterAttributesINTEL" ],
@@ -16524,6 +17662,12 @@
"version" : "None"
},
{
+ "enumerant" : "TaskSequenceINTEL",
+ "value" : 6162,
+ "extensions" : [ "SPV_INTEL_task_sequence" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "FPMaxErrorINTEL",
"value" : 6169,
"extensions" : [ "SPV_INTEL_fp_max_error" ],
@@ -16554,16 +17698,75 @@
"version" : "None"
},
{
+ "enumerant" : "SubgroupBufferPrefetchINTEL",
+ "value" : 6220,
+ "extensions": [ "SPV_INTEL_subgroup_buffer_prefetch" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Subgroup2DBlockIOINTEL",
+ "value" : 6228,
+ "extensions": [ "SPV_INTEL_2d_block_io" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Subgroup2DBlockTransformINTEL",
+ "value" : 6229,
+ "capabilities" : [ "Subgroup2DBlockIOINTEL" ],
+ "extensions": [ "SPV_INTEL_2d_block_io" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Subgroup2DBlockTransposeINTEL",
+ "value" : 6230,
+ "capabilities" : [ "Subgroup2DBlockIOINTEL" ],
+ "extensions": [ "SPV_INTEL_2d_block_io" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SubgroupMatrixMultiplyAccumulateINTEL",
+ "value" : 6236,
+ "extensions": [ "SPV_INTEL_subgroup_matrix_multiply_accumulate" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TernaryBitwiseFunctionINTEL",
+ "value" : 6241,
+ "extensions" : [ "SPV_INTEL_ternary_bitwise_function"],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SpecConditionalINTEL",
+ "value" : 6245,
+ "extensions" : [ "SPV_INTEL_function_variants" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
+ "enumerant" : "FunctionVariantsINTEL",
+ "value" : 6246,
+ "capabilities" : [ "SpecConditionalINTEL" ],
+ "extensions" : [ "SPV_INTEL_function_variants" ],
+ "provisional" : true,
+ "version": "None"
+ },
+ {
"enumerant" : "GroupUniformArithmeticKHR",
"value" : 6400,
"extensions" : [ "SPV_KHR_uniform_group_instructions"],
"version" : "None"
},
{
+ "enumerant" : "TensorFloat32RoundingINTEL",
+ "value" : 6425,
+ "extensions" : [ "SPV_INTEL_tensor_float32_conversion" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "MaskedGatherScatterINTEL",
- "value" : 6427,
- "extensions" : [ "SPV_INTEL_masked_gather_scatter"],
- "version" : "None"
+ "value" : 6427,
+ "extensions" : [ "SPV_INTEL_masked_gather_scatter"],
+ "version" : "None"
},
{
"enumerant" : "CacheControlsINTEL",
@@ -16576,6 +17779,13 @@
"value" : 6460,
"extensions" : [ "SPV_INTEL_maximum_registers" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "BindlessImagesINTEL",
+ "value" : 6528,
+ "extensions" : [ "SPV_INTEL_bindless_images" ],
+ "provisional" : true,
+ "version" : "None"
}
]
},
@@ -16645,11 +17855,7 @@
"enumerants" : [
{
"enumerant" : "PackedVectorFormat4x8Bit",
- "value" : 0,
- "version" : "1.6"
- },
- {
- "enumerant" : "PackedVectorFormat4x8BitKHR",
+ "aliases" : ["PackedVectorFormat4x8BitKHR"],
"value" : 0,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
"version" : "1.6"
@@ -16705,6 +17911,16 @@
"enumerant" : "ColumnMajorKHR",
"value" : 1,
"version" : "None"
+ },
+ {
+ "enumerant" : "RowBlockedInterleavedARM",
+ "value" : 4202,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "ColumnBlockedInterleavedARM",
+ "value" : 4203,
+ "version" : "None"
}
]
},
@@ -16730,6 +17946,87 @@
]
},
{
+ "category" : "BitEnum",
+ "kind" : "CooperativeMatrixReduce",
+ "enumerants" : [
+ {
+ "enumerant" : "Row",
+ "value" : "0x0001",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Column",
+ "value" : "0x0002",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "2x2",
+ "value" : "0x0004",
+ "version" : "None"
+ }
+ ]
+ },
+ {
+ "category" : "ValueEnum",
+ "kind" : "TensorClampMode",
+ "enumerants" : [
+ {
+ "enumerant" : "Undefined",
+ "value" : 0,
+ "version": "None"
+ },
+ {
+ "enumerant" : "Constant",
+ "value" : 1,
+ "version": "None"
+ },
+ {
+ "enumerant" : "ClampToEdge",
+ "value" : 2,
+ "version": "None"
+ },
+ {
+ "enumerant" : "Repeat",
+ "value" : 3,
+ "version": "None"
+ },
+ {
+ "enumerant" : "RepeatMirrored",
+ "value" : 4,
+ "version": "None"
+ }
+ ]
+ },
+ {
+ "category" : "BitEnum",
+ "kind" : "TensorAddressingOperands",
+ "enumerants" : [
+ {
+ "enumerant" : "None",
+ "value" : "0x0000",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TensorView",
+ "value" : "0x0001",
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "capabilities" : [ "CooperativeMatrixTensorAddressingNV" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "DecodeFunc",
+ "value" : "0x0002",
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "capabilities" : [ "CooperativeMatrixBlockLoadsNV" ],
+ "version" : "None"
+ }
+ ]
+ },
+ {
"category" : "ValueEnum",
"kind" : "InitializationModeQualifier",
"enumerants" : [
@@ -16826,6 +18123,218 @@
]
},
{
+ "category" : "BitEnum",
+ "kind" : "MatrixMultiplyAccumulateOperands",
+ "enumerants" : [
+ {
+ "enumerant" : "None",
+ "value" : "0x0",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixASignedComponentsINTEL",
+ "value" : "0x1",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixBSignedComponentsINTEL",
+ "value" : "0x2",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixCBFloat16INTEL",
+ "value" : "0x4",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixResultBFloat16INTEL",
+ "value" : "0x8",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixAPackedInt8INTEL",
+ "value" : "0x10",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixBPackedInt8INTEL",
+ "value" : "0x20",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixAPackedInt4INTEL",
+ "value" : "0x40",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixBPackedInt4INTEL",
+ "value" : "0x80",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixATF32INTEL",
+ "value" : "0x100",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixBTF32INTEL",
+ "value" : "0x200",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixAPackedFloat16INTEL",
+ "value" : "0x400",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixBPackedFloat16INTEL",
+ "value" : "0x800",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixAPackedBFloat16INTEL",
+ "value" : "0x1000",
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MatrixBPackedBFloat16INTEL",
+ "value" : "0x2000",
+ "version" : "None"
+ }
+ ]
+ },
+ {
+ "category" : "ValueEnum",
+ "kind" : "FPEncoding",
+ "enumerants" : [
+ {
+ "enumerant" : "BFloat16KHR",
+ "value" : 0,
+ "capabilities" : [ "BFloat16TypeKHR" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Float8E4M3EXT",
+ "value" : 4214,
+ "capabilities" : [ "Float8EXT" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Float8E5M2EXT",
+ "value" : 4215,
+ "capabilities" : [ "Float8EXT" ],
+ "version" : "None"
+ }
+ ]
+ },
+ {
+ "category" : "ValueEnum",
+ "kind" : "CooperativeVectorMatrixLayout",
+ "enumerants" : [
+ {
+ "enumerant" : "RowMajorNV",
+ "value" : 0,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "ColumnMajorNV",
+ "value" : 1,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "InferencingOptimalNV",
+ "value" : 2,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TrainingOptimalNV",
+ "value" : 3,
+ "version" : "None"
+ }
+ ]
+ },
+ {
+ "category" : "ValueEnum",
+ "kind" : "ComponentType",
+ "enumerants" : [
+ {
+ "enumerant" : "Float16NV",
+ "value" : 0,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Float32NV",
+ "value" : 1,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "Float64NV",
+ "value" : 2,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SignedInt8NV",
+ "value" : 3,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SignedInt16NV",
+ "value" : 4,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SignedInt32NV",
+ "value" : 5,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SignedInt64NV",
+ "value" : 6,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "UnsignedInt8NV",
+ "value" : 7,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "UnsignedInt16NV",
+ "value" : 8,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "UnsignedInt32NV",
+ "value" : 9,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "UnsignedInt64NV",
+ "value" : 10,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "SignedInt8PackedNV",
+ "value" : 1000491000,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "UnsignedInt8PackedNV",
+ "value" : 1000491001,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "FloatE4M3NV",
+ "value" : 1000491002,
+ "version" : "None"
+ },
+ {
+ "enumerant" : "FloatE5M2NV",
+ "value" : 1000491003,
+ "version" : "None"
+ }
+ ]
+ },
+ {
"category" : "Id",
"kind" : "IdResultType",
"doc" : "Reference to an <id> representing the result's type of the enclosing instruction"
@@ -16894,6 +18403,57 @@
"category" : "Composite",
"kind" : "PairIdRefIdRef",
"bases" : [ "IdRef", "IdRef" ]
+ },
+ {
+ "category" : "BitEnum",
+ "kind" : "TensorOperands",
+ "enumerants" : [
+ {
+ "enumerant" : "NoneARM",
+ "value" : "0x0000",
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "NontemporalARM",
+ "value" : "0x0001",
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutOfBoundsValueARM",
+ "value" : "0x0002",
+ "capabilities" : [ "TensorsARM" ],
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MakeElementAvailableARM",
+ "value" : "0x0004",
+ "capabilities" : [ "TensorsARM" ],
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MakeElementVisibleARM",
+ "value" : "0x0008",
+ "capabilities" : [ "TensorsARM" ],
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "NonPrivateElementARM",
+ "value" : "0x0010",
+ "capabilities" : [ "TensorsARM" ],
+ "version" : "None"
+ }
+ ]
}
]
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.cs b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.cs
index 8d85cce..4e61161 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.cs
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.cs
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 The Khronos Group Inc.
+// Copyright: 2014-2024 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
@@ -70,6 +54,8 @@
WGSL = 10,
Slang = 11,
Zig = 12,
+ Rust = 13,
+ Max = 0x7fffffff,
}
public enum ExecutionModel
@@ -97,6 +83,7 @@
CallableNV = 5318,
TaskEXT = 5364,
MeshEXT = 5365,
+ Max = 0x7fffffff,
}
public enum AddressingModel
@@ -106,6 +93,7 @@
Physical64 = 2,
PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348,
+ Max = 0x7fffffff,
}
public enum MemoryModel
@@ -115,6 +103,7 @@
OpenCL = 2,
Vulkan = 3,
VulkanKHR = 3,
+ Max = 0x7fffffff,
}
public enum ExecutionMode
@@ -167,9 +156,12 @@
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ NonCoherentTileAttachmentReadQCOM = 4489,
+ TileShadingRateQCOM = 4490,
EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
CoalescingAMDX = 5069,
+ IsApiEntryAMDX = 5070,
MaxNodeRecursionAMDX = 5071,
StaticNumWorkgroupsAMDX = 5072,
ShaderIndexAMDX = 5073,
@@ -182,11 +174,14 @@
StencilRefLessBackAMD = 5084,
QuadDerivativesKHR = 5088,
RequireFullQuadsKHR = 5089,
+ SharesInputWithAMDX = 5102,
OutputLinesEXT = 5269,
OutputLinesNV = 5269,
OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
+ DerivativeGroupQuadsKHR = 5289,
DerivativeGroupQuadsNV = 5289,
+ DerivativeGroupLinearKHR = 5290,
DerivativeGroupLinearNV = 5290,
OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
@@ -214,6 +209,7 @@
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
+ Max = 0x7fffffff,
}
public enum StorageClass
@@ -232,8 +228,8 @@
Image = 11,
StorageBuffer = 12,
TileImageEXT = 4172,
+ TileAttachmentQCOM = 4491,
NodePayloadAMDX = 5068,
- NodeOutputPayloadAMDX = 5076,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
@@ -253,6 +249,7 @@
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
+ Max = 0x7fffffff,
}
public enum Dim
@@ -265,6 +262,7 @@
Buffer = 5,
SubpassData = 6,
TileImageDataEXT = 4173,
+ Max = 0x7fffffff,
}
public enum SamplerAddressingMode
@@ -274,12 +272,14 @@
Clamp = 2,
Repeat = 3,
RepeatMirrored = 4,
+ Max = 0x7fffffff,
}
public enum SamplerFilterMode
{
Nearest = 0,
Linear = 1,
+ Max = 0x7fffffff,
}
public enum ImageFormat
@@ -326,6 +326,7 @@
R8ui = 39,
R64ui = 40,
R64i = 41,
+ Max = 0x7fffffff,
}
public enum ImageChannelOrder
@@ -350,6 +351,7 @@
sRGBA = 17,
sBGRA = 18,
ABGR = 19,
+ Max = 0x7fffffff,
}
public enum ImageChannelDataType
@@ -371,8 +373,16 @@
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
+ UnormInt10X6EXT = 17,
UnsignedIntRaw10EXT = 19,
UnsignedIntRaw12EXT = 20,
+ UnormInt2_101010EXT = 21,
+ UnsignedInt10X6EXT = 22,
+ UnsignedInt12X4EXT = 23,
+ UnsignedInt14X2EXT = 24,
+ UnormInt12X4EXT = 25,
+ UnormInt14X2EXT = 26,
+ Max = 0x7fffffff,
}
public enum ImageOperandsShift
@@ -397,6 +407,7 @@
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
+ Max = 0x7fffffff,
}
public enum ImageOperandsMask
@@ -436,6 +447,7 @@
AllowReassoc = 17,
AllowReassocINTEL = 17,
AllowTransform = 18,
+ Max = 0x7fffffff,
}
public enum FPFastMathModeMask
@@ -459,6 +471,7 @@
RTZ = 1,
RTP = 2,
RTN = 3,
+ Max = 0x7fffffff,
}
public enum LinkageType
@@ -466,6 +479,7 @@
Export = 0,
Import = 1,
LinkOnceODR = 2,
+ Max = 0x7fffffff,
}
public enum AccessQualifier
@@ -473,6 +487,7 @@
ReadOnly = 0,
WriteOnly = 1,
ReadWrite = 2,
+ Max = 0x7fffffff,
}
public enum FunctionParameterAttribute
@@ -486,6 +501,7 @@
NoWrite = 6,
NoReadWrite = 7,
RuntimeAlignedINTEL = 5940,
+ Max = 0x7fffffff,
}
public enum Decoration
@@ -537,6 +553,7 @@
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
+ SaturatedToLargestFloat8NormalConversionEXT = 4216,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
WeightTextureQCOM = 4487,
@@ -547,6 +564,10 @@
NodeMaxPayloadsAMDX = 5020,
TrackFinishWritingAMDX = 5078,
PayloadNodeNameAMDX = 5091,
+ PayloadNodeBaseIndexAMDX = 5098,
+ PayloadNodeSparseArrayAMDX = 5099,
+ PayloadNodeArraySizeAMDX = 5100,
+ PayloadDispatchIndirectAMDX = 5105,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
@@ -633,8 +654,10 @@
HostAccessINTEL = 6188,
InitModeINTEL = 6190,
ImplementInRegisterMapINTEL = 6191,
+ ConditionalINTEL = 6247,
CacheControlLoadINTEL = 6442,
CacheControlStoreINTEL = 6443,
+ Max = 0x7fffffff,
}
public enum BuiltIn
@@ -702,6 +725,9 @@
DeviceIndex = 4438,
ViewIndex = 4440,
ShadingRateKHR = 4444,
+ TileOffsetQCOM = 4492,
+ TileDimensionQCOM = 4493,
+ TileApronSizeQCOM = 4494,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
@@ -710,7 +736,7 @@
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
- CoalescedInputCountAMDX = 5021,
+ RemainingRecursionLevelsAMDX = 5021,
ShaderIndexAMDX = 5073,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
@@ -770,19 +796,28 @@
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
+ HitIsSphereNV = 5359,
+ HitIsLSSNV = 5360,
+ HitSpherePositionNV = 5361,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
+ HitLSSPositionsNV = 5396,
HitKindFrontFacingMicroTriangleNV = 5405,
HitKindBackFacingMicroTriangleNV = 5406,
+ HitSphereRadiusNV = 5420,
+ HitLSSRadiiNV = 5421,
+ ClusterIDNV = 5436,
CullMaskKHR = 6021,
+ Max = 0x7fffffff,
}
public enum SelectionControlShift
{
Flatten = 0,
DontFlatten = 1,
+ Max = 0x7fffffff,
}
public enum SelectionControlMask
@@ -813,6 +848,7 @@
NoFusionINTEL = 23,
LoopCountINTEL = 24,
MaxReinvocationDelayINTEL = 25,
+ Max = 0x7fffffff,
}
public enum LoopControlMask
@@ -845,7 +881,9 @@
DontInline = 1,
Pure = 2,
Const = 3,
+ OptNoneEXT = 16,
OptNoneINTEL = 16,
+ Max = 0x7fffffff,
}
public enum FunctionControlMask
@@ -855,6 +893,7 @@
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
+ OptNoneEXT = 0x00010000,
OptNoneINTEL = 0x00010000,
}
@@ -877,6 +916,7 @@
MakeVisible = 14,
MakeVisibleKHR = 14,
Volatile = 15,
+ Max = 0x7fffffff,
}
public enum MemorySemanticsMask
@@ -914,6 +954,7 @@
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
+ Max = 0x7fffffff,
}
public enum MemoryAccessMask
@@ -942,6 +983,7 @@
QueueFamily = 5,
QueueFamilyKHR = 5,
ShaderCallKHR = 6,
+ Max = 0x7fffffff,
}
public enum GroupOperation
@@ -953,6 +995,7 @@
PartitionedReduceNV = 6,
PartitionedInclusiveScanNV = 7,
PartitionedExclusiveScanNV = 8,
+ Max = 0x7fffffff,
}
public enum KernelEnqueueFlags
@@ -960,11 +1003,13 @@
NoWait = 0,
WaitKernel = 1,
WaitWorkGroup = 2,
+ Max = 0x7fffffff,
}
public enum KernelProfilingInfoShift
{
CmdExecTime = 0,
+ Max = 0x7fffffff,
}
public enum KernelProfilingInfoMask
@@ -1049,6 +1094,13 @@
TileImageColorReadAccessEXT = 4166,
TileImageDepthReadAccessEXT = 4167,
TileImageStencilReadAccessEXT = 4168,
+ TensorsARM = 4174,
+ StorageTensorArrayDynamicIndexingARM = 4175,
+ StorageTensorArrayNonUniformIndexingARM = 4176,
+ GraphARM = 4191,
+ CooperativeMatrixLayoutsARM = 4201,
+ Float8EXT = 4212,
+ Float8CooperativeMatrixEXT = 4213,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -1078,11 +1130,14 @@
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayQueryKHR = 4472,
+ UntypedPointersKHR = 4473,
RayTraversalPrimitiveCullingKHR = 4478,
RayTracingKHR = 4479,
TextureSampleWeightedQCOM = 4484,
TextureBoxFilterQCOM = 4485,
TextureBlockMatchQCOM = 4486,
+ TileShadingQCOM = 4495,
+ CooperativeMatrixConversionQCOM = 4496,
TextureBlockMatch2QCOM = 4498,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
@@ -1093,6 +1148,11 @@
ShaderClockKHR = 5055,
ShaderEnqueueAMDX = 5067,
QuadControlKHR = 5087,
+ Int4TypeINTEL = 5112,
+ Int4CooperativeMatrixINTEL = 5114,
+ BFloat16TypeKHR = 5116,
+ BFloat16DotProductKHR = 5117,
+ BFloat16CooperativeMatrixKHR = 5118,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
@@ -1106,6 +1166,7 @@
MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
+ ComputeDerivativeGroupQuadsKHR = 5288,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
@@ -1143,6 +1204,7 @@
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
+ ComputeDerivativeGroupLinearKHR = 5350,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
@@ -1157,9 +1219,20 @@
ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
RayQueryPositionFetchKHR = 5391,
+ CooperativeVectorNV = 5394,
AtomicFloat16VectorNV = 5404,
RayTracingDisplacementMicromapNV = 5409,
RawAccessChainsNV = 5414,
+ RayTracingSpheresGeometryNV = 5418,
+ RayTracingLinearSweptSpheresGeometryNV = 5419,
+ CooperativeMatrixReductionsNV = 5430,
+ CooperativeMatrixConversionsNV = 5431,
+ CooperativeMatrixPerElementOperationsNV = 5432,
+ CooperativeMatrixTensorAddressingNV = 5433,
+ CooperativeMatrixBlockLoadsNV = 5434,
+ CooperativeVectorTrainingNV = 5435,
+ RayTracingClusterAccelerationStructureNV = 5437,
+ TensorAddressingNV = 5439,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
@@ -1212,28 +1285,43 @@
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
CooperativeMatrixKHR = 6022,
+ ReplicatedCompositesEXT = 6024,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
FloatControls2 = 6029,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongCompositesINTEL = 6089,
+ OptNoneEXT = 6094,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
BFloat16ConversionINTEL = 6115,
SplitBarrierINTEL = 6141,
+ ArithmeticFenceEXT = 6144,
FPGAClusterAttributesV2INTEL = 6150,
FPGAKernelAttributesv2INTEL = 6161,
+ TaskSequenceINTEL = 6162,
FPMaxErrorINTEL = 6169,
FPGALatencyControlINTEL = 6171,
FPGAArgumentInterfacesINTEL = 6174,
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
+ SubgroupBufferPrefetchINTEL = 6220,
+ Subgroup2DBlockIOINTEL = 6228,
+ Subgroup2DBlockTransformINTEL = 6229,
+ Subgroup2DBlockTransposeINTEL = 6230,
+ SubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ TernaryBitwiseFunctionINTEL = 6241,
+ SpecConditionalINTEL = 6245,
+ FunctionVariantsINTEL = 6246,
GroupUniformArithmeticKHR = 6400,
+ TensorFloat32RoundingINTEL = 6425,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
+ BindlessImagesINTEL = 6528,
+ Max = 0x7fffffff,
}
public enum RayFlagsShift
@@ -1246,9 +1334,11 @@
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
+ SkipBuiltinPrimitivesNV = 8,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
ForceOpacityMicromap2StateEXT = 10,
+ Max = 0x7fffffff,
}
public enum RayFlagsMask
@@ -1262,6 +1352,7 @@
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
+ SkipBuiltinPrimitivesNV = 0x00000100,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
ForceOpacityMicromap2StateEXT = 0x00000400,
@@ -1271,6 +1362,7 @@
{
RayQueryCandidateIntersectionKHR = 0,
RayQueryCommittedIntersectionKHR = 1,
+ Max = 0x7fffffff,
}
public enum RayQueryCommittedIntersectionType
@@ -1278,12 +1370,14 @@
RayQueryCommittedIntersectionNoneKHR = 0,
RayQueryCommittedIntersectionTriangleKHR = 1,
RayQueryCommittedIntersectionGeneratedKHR = 2,
+ Max = 0x7fffffff,
}
public enum RayQueryCandidateIntersectionType
{
RayQueryCandidateIntersectionTriangleKHR = 0,
RayQueryCandidateIntersectionAABBKHR = 1,
+ Max = 0x7fffffff,
}
public enum FragmentShadingRateShift
@@ -1292,6 +1386,7 @@
Vertical4Pixels = 1,
Horizontal2Pixels = 2,
Horizontal4Pixels = 3,
+ Max = 0x7fffffff,
}
public enum FragmentShadingRateMask
@@ -1307,12 +1402,14 @@
{
Preserve = 0,
FlushToZero = 1,
+ Max = 0x7fffffff,
}
public enum FPOperationMode
{
IEEE = 0,
ALT = 1,
+ Max = 0x7fffffff,
}
public enum QuantizationModes
@@ -1325,6 +1422,7 @@
RND_MIN_INF = 5,
RND_CONV = 6,
RND_CONV_ODD = 7,
+ Max = 0x7fffffff,
}
public enum OverflowModes
@@ -1333,12 +1431,14 @@
SAT = 1,
SAT_ZERO = 2,
SAT_SYM = 3,
+ Max = 0x7fffffff,
}
public enum PackedVectorFormat
{
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
+ Max = 0x7fffffff,
}
public enum CooperativeMatrixOperandsShift
@@ -1348,6 +1448,7 @@
MatrixCSignedComponentsKHR = 2,
MatrixResultSignedComponentsKHR = 3,
SaturatingAccumulationKHR = 4,
+ Max = 0x7fffffff,
}
public enum CooperativeMatrixOperandsMask
@@ -1364,6 +1465,9 @@
{
RowMajorKHR = 0,
ColumnMajorKHR = 1,
+ RowBlockedInterleavedARM = 4202,
+ ColumnBlockedInterleavedARM = 4203,
+ Max = 0x7fffffff,
}
public enum CooperativeMatrixUse
@@ -1371,12 +1475,74 @@
MatrixAKHR = 0,
MatrixBKHR = 1,
MatrixAccumulatorKHR = 2,
+ Max = 0x7fffffff,
+ }
+
+ public enum CooperativeMatrixReduceShift
+ {
+ Row = 0,
+ Column = 1,
+ CooperativeMatrixReduce2x2 = 2,
+ Max = 0x7fffffff,
+ }
+
+ public enum CooperativeMatrixReduceMask
+ {
+ MaskNone = 0,
+ Row = 0x00000001,
+ Column = 0x00000002,
+ CooperativeMatrixReduce2x2 = 0x00000004,
+ }
+
+ public enum TensorClampMode
+ {
+ Undefined = 0,
+ Constant = 1,
+ ClampToEdge = 2,
+ Repeat = 3,
+ RepeatMirrored = 4,
+ Max = 0x7fffffff,
+ }
+
+ public enum TensorAddressingOperandsShift
+ {
+ TensorView = 0,
+ DecodeFunc = 1,
+ Max = 0x7fffffff,
+ }
+
+ public enum TensorAddressingOperandsMask
+ {
+ MaskNone = 0,
+ TensorView = 0x00000001,
+ DecodeFunc = 0x00000002,
+ }
+
+ public enum TensorOperandsShift
+ {
+ NontemporalARM = 0,
+ OutOfBoundsValueARM = 1,
+ MakeElementAvailableARM = 2,
+ MakeElementVisibleARM = 3,
+ NonPrivateElementARM = 4,
+ Max = 0x7fffffff,
+ }
+
+ public enum TensorOperandsMask
+ {
+ MaskNone = 0,
+ NontemporalARM = 0x00000001,
+ OutOfBoundsValueARM = 0x00000002,
+ MakeElementAvailableARM = 0x00000004,
+ MakeElementVisibleARM = 0x00000008,
+ NonPrivateElementARM = 0x00000010,
}
public enum InitializationModeQualifier
{
InitOnDeviceReprogramINTEL = 0,
InitOnDeviceResetINTEL = 1,
+ Max = 0x7fffffff,
}
public enum HostAccessQualifier
@@ -1385,6 +1551,7 @@
ReadINTEL = 1,
WriteINTEL = 2,
ReadWriteINTEL = 3,
+ Max = 0x7fffffff,
}
public enum LoadCacheControl
@@ -1394,6 +1561,7 @@
StreamingINTEL = 2,
InvalidateAfterReadINTEL = 3,
ConstCachedINTEL = 4,
+ Max = 0x7fffffff,
}
public enum StoreCacheControl
@@ -1402,17 +1570,58 @@
WriteThroughINTEL = 1,
WriteBackINTEL = 2,
StreamingINTEL = 3,
+ Max = 0x7fffffff,
}
public enum NamedMaximumNumberOfRegisters
{
AutoINTEL = 0,
+ Max = 0x7fffffff,
+ }
+
+ public enum MatrixMultiplyAccumulateOperandsShift
+ {
+ MatrixASignedComponentsINTEL = 0,
+ MatrixBSignedComponentsINTEL = 1,
+ MatrixCBFloat16INTEL = 2,
+ MatrixResultBFloat16INTEL = 3,
+ MatrixAPackedInt8INTEL = 4,
+ MatrixBPackedInt8INTEL = 5,
+ MatrixAPackedInt4INTEL = 6,
+ MatrixBPackedInt4INTEL = 7,
+ MatrixATF32INTEL = 8,
+ MatrixBTF32INTEL = 9,
+ MatrixAPackedFloat16INTEL = 10,
+ MatrixBPackedFloat16INTEL = 11,
+ MatrixAPackedBFloat16INTEL = 12,
+ MatrixBPackedBFloat16INTEL = 13,
+ Max = 0x7fffffff,
+ }
+
+ public enum MatrixMultiplyAccumulateOperandsMask
+ {
+ MaskNone = 0,
+ MatrixASignedComponentsINTEL = 0x00000001,
+ MatrixBSignedComponentsINTEL = 0x00000002,
+ MatrixCBFloat16INTEL = 0x00000004,
+ MatrixResultBFloat16INTEL = 0x00000008,
+ MatrixAPackedInt8INTEL = 0x00000010,
+ MatrixBPackedInt8INTEL = 0x00000020,
+ MatrixAPackedInt4INTEL = 0x00000040,
+ MatrixBPackedInt4INTEL = 0x00000080,
+ MatrixATF32INTEL = 0x00000100,
+ MatrixBTF32INTEL = 0x00000200,
+ MatrixAPackedFloat16INTEL = 0x00000400,
+ MatrixBPackedFloat16INTEL = 0x00000800,
+ MatrixAPackedBFloat16INTEL = 0x00001000,
+ MatrixBPackedBFloat16INTEL = 0x00002000,
}
public enum RawAccessChainOperandsShift
{
RobustnessPerComponentNV = 0,
RobustnessPerElementNV = 1,
+ Max = 0x7fffffff,
}
public enum RawAccessChainOperandsMask
@@ -1422,6 +1631,43 @@
RobustnessPerElementNV = 0x00000002,
}
+ public enum FPEncoding
+ {
+ BFloat16KHR = 0,
+ Float8E4M3EXT = 4214,
+ Float8E5M2EXT = 4215,
+ Max = 0x7fffffff,
+ }
+
+ public enum CooperativeVectorMatrixLayout
+ {
+ RowMajorNV = 0,
+ ColumnMajorNV = 1,
+ InferencingOptimalNV = 2,
+ TrainingOptimalNV = 3,
+ Max = 0x7fffffff,
+ }
+
+ public enum ComponentType
+ {
+ Float16NV = 0,
+ Float32NV = 1,
+ Float64NV = 2,
+ SignedInt8NV = 3,
+ SignedInt16NV = 4,
+ SignedInt32NV = 5,
+ SignedInt64NV = 6,
+ UnsignedInt8NV = 7,
+ UnsignedInt16NV = 8,
+ UnsignedInt32NV = 9,
+ UnsignedInt64NV = 10,
+ SignedInt8PackedNV = 1000491000,
+ UnsignedInt8PackedNV = 1000491001,
+ FloatE4M3NV = 1000491002,
+ FloatE5M2NV = 1000491003,
+ Max = 0x7fffffff,
+ }
+
public enum Op
{
OpNop = 0,
@@ -1771,14 +2017,35 @@
OpColorAttachmentReadEXT = 4160,
OpDepthAttachmentReadEXT = 4161,
OpStencilAttachmentReadEXT = 4162,
+ OpTypeTensorARM = 4163,
+ OpTensorReadARM = 4164,
+ OpTensorWriteARM = 4165,
+ OpTensorQuerySizeARM = 4166,
+ OpGraphConstantARM = 4181,
+ OpGraphEntryPointARM = 4182,
+ OpGraphARM = 4183,
+ OpGraphInputARM = 4184,
+ OpGraphSetOutputARM = 4185,
+ OpGraphEndARM = 4186,
+ OpTypeGraphARM = 4190,
OpTerminateInvocation = 4416,
+ OpTypeUntypedPointerKHR = 4417,
+ OpUntypedVariableKHR = 4418,
+ OpUntypedAccessChainKHR = 4419,
+ OpUntypedInBoundsAccessChainKHR = 4420,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
+ OpUntypedPtrAccessChainKHR = 4423,
+ OpUntypedInBoundsPtrAccessChainKHR = 4424,
+ OpUntypedArrayLengthKHR = 4425,
+ OpUntypedPrefetchKHR = 4426,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
+ OpExtInstWithForwardRefsKHR = 4433,
+ OpUntypedGroupAsyncCopyKHR = 4434,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
@@ -1801,6 +2068,9 @@
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
+ OpConstantCompositeReplicateEXT = 4461,
+ OpSpecConstantCompositeReplicateEXT = 4462,
+ OpCompositeConstructReplicateEXT = 4463,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@@ -1812,10 +2082,14 @@
OpImageBoxFilterQCOM = 4481,
OpImageBlockMatchSSDQCOM = 4482,
OpImageBlockMatchSADQCOM = 4483,
+ OpBitCastArrayQCOM = 4497,
OpImageBlockMatchWindowSSDQCOM = 4500,
OpImageBlockMatchWindowSADQCOM = 4501,
OpImageBlockMatchGatherSSDQCOM = 4502,
OpImageBlockMatchGatherSADQCOM = 4503,
+ OpCompositeConstructCoopMatQCOM = 4540,
+ OpCompositeExtractCoopMatQCOM = 4541,
+ OpExtractSubArrayQCOM = 4542,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@@ -1827,9 +2101,14 @@
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
- OpFinalizeNodePayloadsAMDX = 5075,
+ OpAllocateNodePayloadsAMDX = 5074,
+ OpEnqueueNodePayloadsAMDX = 5075,
+ OpTypeNodePayloadArrayAMDX = 5076,
OpFinishWritingNodePayloadAMDX = 5078,
- OpInitializeNodePayloadsAMDX = 5090,
+ OpNodePayloadArrayLengthAMDX = 5090,
+ OpIsNodePayloadValidAMDX = 5101,
+ OpConstantStringAMDX = 5103,
+ OpSpecConstantStringAMDX = 5104,
OpGroupNonUniformQuadAllKHR = 5110,
OpGroupNonUniformQuadAnyKHR = 5111,
OpHitObjectRecordHitMotionNV = 5249,
@@ -1866,12 +2145,20 @@
OpReorderThreadWithHintNV = 5280,
OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpTypeCooperativeVectorNV = 5288,
+ OpCooperativeVectorMatrixMulNV = 5289,
+ OpCooperativeVectorOuterProductAccumulateNV = 5290,
+ OpCooperativeVectorReduceSumAccumulateNV = 5291,
+ OpCooperativeVectorMatrixMulAddNV = 5292,
+ OpCooperativeMatrixConvertNV = 5293,
OpEmitMeshTasksEXT = 5294,
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
+ OpCooperativeVectorLoadNV = 5302,
+ OpCooperativeVectorStoreNV = 5303,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
@@ -1883,6 +2170,8 @@
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
+ OpRayQueryGetClusterIdNV = 5345,
+ OpHitObjectGetClusterIdNV = 5346,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
@@ -1890,9 +2179,26 @@
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
+ OpCooperativeMatrixReduceNV = 5366,
+ OpCooperativeMatrixLoadTensorNV = 5367,
+ OpCooperativeMatrixStoreTensorNV = 5368,
+ OpCooperativeMatrixPerElementOpNV = 5369,
+ OpTypeTensorLayoutNV = 5370,
+ OpTypeTensorViewNV = 5371,
+ OpCreateTensorLayoutNV = 5372,
+ OpTensorLayoutSetDimensionNV = 5373,
+ OpTensorLayoutSetStrideNV = 5374,
+ OpTensorLayoutSliceNV = 5375,
+ OpTensorLayoutSetClampValueNV = 5376,
+ OpCreateTensorViewNV = 5377,
+ OpTensorViewSetDimensionNV = 5378,
+ OpTensorViewSetStrideNV = 5379,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
+ OpTensorViewSetClipNV = 5382,
+ OpTensorLayoutSetBlockSizeNV = 5384,
+ OpCooperativeMatrixTransposeNV = 5390,
OpConvertUToImageNV = 5391,
OpConvertUToSamplerNV = 5392,
OpConvertImageToUNV = 5393,
@@ -1901,6 +2207,19 @@
OpConvertSampledImageToUNV = 5396,
OpSamplerImageAddressingModeNV = 5397,
OpRawAccessChainNV = 5398,
+ OpRayQueryGetIntersectionSpherePositionNV = 5427,
+ OpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ OpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ OpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ OpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ OpHitObjectGetSpherePositionNV = 5432,
+ OpHitObjectGetSphereRadiusNV = 5433,
+ OpHitObjectGetLSSPositionsNV = 5434,
+ OpHitObjectGetLSSRadiiNV = 5435,
+ OpHitObjectIsSphereHitNV = 5436,
+ OpHitObjectIsLSSHitNV = 5437,
+ OpRayQueryIsSphereHitNV = 5438,
+ OpRayQueryIsLSSHitNV = 5439,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -2147,6 +2466,27 @@
OpConvertBF16ToFINTEL = 6117,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
+ OpArithmeticFenceEXT = 6145,
+ OpTaskSequenceCreateINTEL = 6163,
+ OpTaskSequenceAsyncINTEL = 6164,
+ OpTaskSequenceGetINTEL = 6165,
+ OpTaskSequenceReleaseINTEL = 6166,
+ OpTypeTaskSequenceINTEL = 6199,
+ OpSubgroupBlockPrefetchINTEL = 6221,
+ OpSubgroup2DBlockLoadINTEL = 6231,
+ OpSubgroup2DBlockLoadTransformINTEL = 6232,
+ OpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ OpSubgroup2DBlockPrefetchINTEL = 6234,
+ OpSubgroup2DBlockStoreINTEL = 6235,
+ OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ OpBitwiseFunctionINTEL = 6242,
+ OpConditionalExtensionINTEL = 6248,
+ OpConditionalEntryPointINTEL = 6249,
+ OpConditionalCapabilityINTEL = 6250,
+ OpSpecConstantTargetINTEL = 6251,
+ OpSpecConstantArchitectureINTEL = 6252,
+ OpSpecConstantCapabilitiesINTEL = 6253,
+ OpConditionalCopyObjectINTEL = 6254,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
@@ -2155,8 +2495,13 @@
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
+ OpRoundFToTF32INTEL = 6426,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
+ OpConvertHandleToImageINTEL = 6529,
+ OpConvertHandleToSamplerINTEL = 6530,
+ OpConvertHandleToSampledImageINTEL = 6531,
+ Max = 0x7fffffff,
}
}
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.h b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.h
index e544a85..cf23bad 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.h
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.h
@@ -1,27 +1,11 @@
/*
-** Copyright (c) 2014-2024 The Khronos Group Inc.
+** Copyright: 2014-2024 The Khronos Group Inc.
+** License: MIT
**
-** 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.
+** 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/
*/
/*
@@ -78,6 +62,7 @@
SpvSourceLanguageWGSL = 10,
SpvSourceLanguageSlang = 11,
SpvSourceLanguageZig = 12,
+ SpvSourceLanguageRust = 13,
SpvSourceLanguageMax = 0x7fffffff,
} SpvSourceLanguage;
@@ -175,9 +160,12 @@
SpvExecutionModeSignedZeroInfNanPreserve = 4461,
SpvExecutionModeRoundingModeRTE = 4462,
SpvExecutionModeRoundingModeRTZ = 4463,
+ SpvExecutionModeNonCoherentTileAttachmentReadQCOM = 4489,
+ SpvExecutionModeTileShadingRateQCOM = 4490,
SpvExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
SpvExecutionModeStencilRefReplacingEXT = 5027,
SpvExecutionModeCoalescingAMDX = 5069,
+ SpvExecutionModeIsApiEntryAMDX = 5070,
SpvExecutionModeMaxNodeRecursionAMDX = 5071,
SpvExecutionModeStaticNumWorkgroupsAMDX = 5072,
SpvExecutionModeShaderIndexAMDX = 5073,
@@ -190,11 +178,14 @@
SpvExecutionModeStencilRefLessBackAMD = 5084,
SpvExecutionModeQuadDerivativesKHR = 5088,
SpvExecutionModeRequireFullQuadsKHR = 5089,
+ SpvExecutionModeSharesInputWithAMDX = 5102,
SpvExecutionModeOutputLinesEXT = 5269,
SpvExecutionModeOutputLinesNV = 5269,
SpvExecutionModeOutputPrimitivesEXT = 5270,
SpvExecutionModeOutputPrimitivesNV = 5270,
+ SpvExecutionModeDerivativeGroupQuadsKHR = 5289,
SpvExecutionModeDerivativeGroupQuadsNV = 5289,
+ SpvExecutionModeDerivativeGroupLinearKHR = 5290,
SpvExecutionModeDerivativeGroupLinearNV = 5290,
SpvExecutionModeOutputTrianglesEXT = 5298,
SpvExecutionModeOutputTrianglesNV = 5298,
@@ -240,8 +231,8 @@
SpvStorageClassImage = 11,
SpvStorageClassStorageBuffer = 12,
SpvStorageClassTileImageEXT = 4172,
+ SpvStorageClassTileAttachmentQCOM = 4491,
SpvStorageClassNodePayloadAMDX = 5068,
- SpvStorageClassNodeOutputPayloadAMDX = 5076,
SpvStorageClassCallableDataKHR = 5328,
SpvStorageClassCallableDataNV = 5328,
SpvStorageClassIncomingCallableDataKHR = 5329,
@@ -379,8 +370,15 @@
SpvImageChannelDataTypeFloat = 14,
SpvImageChannelDataTypeUnormInt24 = 15,
SpvImageChannelDataTypeUnormInt101010_2 = 16,
+ SpvImageChannelDataTypeUnormInt10X6EXT = 17,
SpvImageChannelDataTypeUnsignedIntRaw10EXT = 19,
SpvImageChannelDataTypeUnsignedIntRaw12EXT = 20,
+ SpvImageChannelDataTypeUnormInt2_101010EXT = 21,
+ SpvImageChannelDataTypeUnsignedInt10X6EXT = 22,
+ SpvImageChannelDataTypeUnsignedInt12X4EXT = 23,
+ SpvImageChannelDataTypeUnsignedInt14X2EXT = 24,
+ SpvImageChannelDataTypeUnormInt12X4EXT = 25,
+ SpvImageChannelDataTypeUnormInt14X2EXT = 26,
SpvImageChannelDataTypeMax = 0x7fffffff,
} SpvImageChannelDataType;
@@ -543,6 +541,7 @@
SpvDecorationMaxByteOffset = 45,
SpvDecorationAlignmentId = 46,
SpvDecorationMaxByteOffsetId = 47,
+ SpvDecorationSaturatedToLargestFloat8NormalConversionEXT = 4216,
SpvDecorationNoSignedWrap = 4469,
SpvDecorationNoUnsignedWrap = 4470,
SpvDecorationWeightTextureQCOM = 4487,
@@ -553,6 +552,10 @@
SpvDecorationNodeMaxPayloadsAMDX = 5020,
SpvDecorationTrackFinishWritingAMDX = 5078,
SpvDecorationPayloadNodeNameAMDX = 5091,
+ SpvDecorationPayloadNodeBaseIndexAMDX = 5098,
+ SpvDecorationPayloadNodeSparseArrayAMDX = 5099,
+ SpvDecorationPayloadNodeArraySizeAMDX = 5100,
+ SpvDecorationPayloadDispatchIndirectAMDX = 5105,
SpvDecorationOverrideCoverageNV = 5248,
SpvDecorationPassthroughNV = 5250,
SpvDecorationViewportRelativeNV = 5252,
@@ -639,6 +642,7 @@
SpvDecorationHostAccessINTEL = 6188,
SpvDecorationInitModeINTEL = 6190,
SpvDecorationImplementInRegisterMapINTEL = 6191,
+ SpvDecorationConditionalINTEL = 6247,
SpvDecorationCacheControlLoadINTEL = 6442,
SpvDecorationCacheControlStoreINTEL = 6443,
SpvDecorationMax = 0x7fffffff,
@@ -708,6 +712,9 @@
SpvBuiltInDeviceIndex = 4438,
SpvBuiltInViewIndex = 4440,
SpvBuiltInShadingRateKHR = 4444,
+ SpvBuiltInTileOffsetQCOM = 4492,
+ SpvBuiltInTileDimensionQCOM = 4493,
+ SpvBuiltInTileApronSizeQCOM = 4494,
SpvBuiltInBaryCoordNoPerspAMD = 4992,
SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993,
SpvBuiltInBaryCoordNoPerspSampleAMD = 4994,
@@ -716,7 +723,7 @@
SpvBuiltInBaryCoordSmoothSampleAMD = 4997,
SpvBuiltInBaryCoordPullModelAMD = 4998,
SpvBuiltInFragStencilRefEXT = 5014,
- SpvBuiltInCoalescedInputCountAMDX = 5021,
+ SpvBuiltInRemainingRecursionLevelsAMDX = 5021,
SpvBuiltInShaderIndexAMDX = 5073,
SpvBuiltInViewportMaskNV = 5253,
SpvBuiltInSecondaryPositionNV = 5257,
@@ -776,12 +783,19 @@
SpvBuiltInIncomingRayFlagsKHR = 5351,
SpvBuiltInIncomingRayFlagsNV = 5351,
SpvBuiltInRayGeometryIndexKHR = 5352,
+ SpvBuiltInHitIsSphereNV = 5359,
+ SpvBuiltInHitIsLSSNV = 5360,
+ SpvBuiltInHitSpherePositionNV = 5361,
SpvBuiltInWarpsPerSMNV = 5374,
SpvBuiltInSMCountNV = 5375,
SpvBuiltInWarpIDNV = 5376,
SpvBuiltInSMIDNV = 5377,
+ SpvBuiltInHitLSSPositionsNV = 5396,
SpvBuiltInHitKindFrontFacingMicroTriangleNV = 5405,
SpvBuiltInHitKindBackFacingMicroTriangleNV = 5406,
+ SpvBuiltInHitSphereRadiusNV = 5420,
+ SpvBuiltInHitLSSRadiiNV = 5421,
+ SpvBuiltInClusterIDNV = 5436,
SpvBuiltInCullMaskKHR = 6021,
SpvBuiltInMax = 0x7fffffff,
} SpvBuiltIn;
@@ -849,6 +863,7 @@
SpvFunctionControlDontInlineShift = 1,
SpvFunctionControlPureShift = 2,
SpvFunctionControlConstShift = 3,
+ SpvFunctionControlOptNoneEXTShift = 16,
SpvFunctionControlOptNoneINTELShift = 16,
SpvFunctionControlMax = 0x7fffffff,
} SpvFunctionControlShift;
@@ -859,6 +874,7 @@
SpvFunctionControlDontInlineMask = 0x00000002,
SpvFunctionControlPureMask = 0x00000004,
SpvFunctionControlConstMask = 0x00000008,
+ SpvFunctionControlOptNoneEXTMask = 0x00010000,
SpvFunctionControlOptNoneINTELMask = 0x00010000,
} SpvFunctionControlMask;
@@ -1049,6 +1065,13 @@
SpvCapabilityTileImageColorReadAccessEXT = 4166,
SpvCapabilityTileImageDepthReadAccessEXT = 4167,
SpvCapabilityTileImageStencilReadAccessEXT = 4168,
+ SpvCapabilityTensorsARM = 4174,
+ SpvCapabilityStorageTensorArrayDynamicIndexingARM = 4175,
+ SpvCapabilityStorageTensorArrayNonUniformIndexingARM = 4176,
+ SpvCapabilityGraphARM = 4191,
+ SpvCapabilityCooperativeMatrixLayoutsARM = 4201,
+ SpvCapabilityFloat8EXT = 4212,
+ SpvCapabilityFloat8CooperativeMatrixEXT = 4213,
SpvCapabilityFragmentShadingRateKHR = 4422,
SpvCapabilitySubgroupBallotKHR = 4423,
SpvCapabilityDrawParameters = 4427,
@@ -1078,11 +1101,14 @@
SpvCapabilityRoundingModeRTZ = 4468,
SpvCapabilityRayQueryProvisionalKHR = 4471,
SpvCapabilityRayQueryKHR = 4472,
+ SpvCapabilityUntypedPointersKHR = 4473,
SpvCapabilityRayTraversalPrimitiveCullingKHR = 4478,
SpvCapabilityRayTracingKHR = 4479,
SpvCapabilityTextureSampleWeightedQCOM = 4484,
SpvCapabilityTextureBoxFilterQCOM = 4485,
SpvCapabilityTextureBlockMatchQCOM = 4486,
+ SpvCapabilityTileShadingQCOM = 4495,
+ SpvCapabilityCooperativeMatrixConversionQCOM = 4496,
SpvCapabilityTextureBlockMatch2QCOM = 4498,
SpvCapabilityFloat16ImageAMD = 5008,
SpvCapabilityImageGatherBiasLodAMD = 5009,
@@ -1093,6 +1119,11 @@
SpvCapabilityShaderClockKHR = 5055,
SpvCapabilityShaderEnqueueAMDX = 5067,
SpvCapabilityQuadControlKHR = 5087,
+ SpvCapabilityInt4TypeINTEL = 5112,
+ SpvCapabilityInt4CooperativeMatrixINTEL = 5114,
+ SpvCapabilityBFloat16TypeKHR = 5116,
+ SpvCapabilityBFloat16DotProductKHR = 5117,
+ SpvCapabilityBFloat16CooperativeMatrixKHR = 5118,
SpvCapabilitySampleMaskOverrideCoverageNV = 5249,
SpvCapabilityGeometryShaderPassthroughNV = 5251,
SpvCapabilityShaderViewportIndexLayerEXT = 5254,
@@ -1106,6 +1137,7 @@
SpvCapabilityMeshShadingEXT = 5283,
SpvCapabilityFragmentBarycentricKHR = 5284,
SpvCapabilityFragmentBarycentricNV = 5284,
+ SpvCapabilityComputeDerivativeGroupQuadsKHR = 5288,
SpvCapabilityComputeDerivativeGroupQuadsNV = 5288,
SpvCapabilityFragmentDensityEXT = 5291,
SpvCapabilityShadingRateNV = 5291,
@@ -1143,6 +1175,7 @@
SpvCapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
SpvCapabilityPhysicalStorageBufferAddresses = 5347,
SpvCapabilityPhysicalStorageBufferAddressesEXT = 5347,
+ SpvCapabilityComputeDerivativeGroupLinearKHR = 5350,
SpvCapabilityComputeDerivativeGroupLinearNV = 5350,
SpvCapabilityRayTracingProvisionalKHR = 5353,
SpvCapabilityCooperativeMatrixNV = 5357,
@@ -1157,9 +1190,20 @@
SpvCapabilityShaderInvocationReorderNV = 5383,
SpvCapabilityBindlessTextureNV = 5390,
SpvCapabilityRayQueryPositionFetchKHR = 5391,
+ SpvCapabilityCooperativeVectorNV = 5394,
SpvCapabilityAtomicFloat16VectorNV = 5404,
SpvCapabilityRayTracingDisplacementMicromapNV = 5409,
SpvCapabilityRawAccessChainsNV = 5414,
+ SpvCapabilityRayTracingSpheresGeometryNV = 5418,
+ SpvCapabilityRayTracingLinearSweptSpheresGeometryNV = 5419,
+ SpvCapabilityCooperativeMatrixReductionsNV = 5430,
+ SpvCapabilityCooperativeMatrixConversionsNV = 5431,
+ SpvCapabilityCooperativeMatrixPerElementOperationsNV = 5432,
+ SpvCapabilityCooperativeMatrixTensorAddressingNV = 5433,
+ SpvCapabilityCooperativeMatrixBlockLoadsNV = 5434,
+ SpvCapabilityCooperativeVectorTrainingNV = 5435,
+ SpvCapabilityRayTracingClusterAccelerationStructureNV = 5437,
+ SpvCapabilityTensorAddressingNV = 5439,
SpvCapabilitySubgroupShuffleINTEL = 5568,
SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1212,28 +1256,42 @@
SpvCapabilityDotProductKHR = 6019,
SpvCapabilityRayCullMaskKHR = 6020,
SpvCapabilityCooperativeMatrixKHR = 6022,
+ SpvCapabilityReplicatedCompositesEXT = 6024,
SpvCapabilityBitInstructions = 6025,
SpvCapabilityGroupNonUniformRotateKHR = 6026,
SpvCapabilityFloatControls2 = 6029,
SpvCapabilityAtomicFloat32AddEXT = 6033,
SpvCapabilityAtomicFloat64AddEXT = 6034,
SpvCapabilityLongCompositesINTEL = 6089,
+ SpvCapabilityOptNoneEXT = 6094,
SpvCapabilityOptNoneINTEL = 6094,
SpvCapabilityAtomicFloat16AddEXT = 6095,
SpvCapabilityDebugInfoModuleINTEL = 6114,
SpvCapabilityBFloat16ConversionINTEL = 6115,
SpvCapabilitySplitBarrierINTEL = 6141,
+ SpvCapabilityArithmeticFenceEXT = 6144,
SpvCapabilityFPGAClusterAttributesV2INTEL = 6150,
SpvCapabilityFPGAKernelAttributesv2INTEL = 6161,
+ SpvCapabilityTaskSequenceINTEL = 6162,
SpvCapabilityFPMaxErrorINTEL = 6169,
SpvCapabilityFPGALatencyControlINTEL = 6171,
SpvCapabilityFPGAArgumentInterfacesINTEL = 6174,
SpvCapabilityGlobalVariableHostAccessINTEL = 6187,
SpvCapabilityGlobalVariableFPGADecorationsINTEL = 6189,
+ SpvCapabilitySubgroupBufferPrefetchINTEL = 6220,
+ SpvCapabilitySubgroup2DBlockIOINTEL = 6228,
+ SpvCapabilitySubgroup2DBlockTransformINTEL = 6229,
+ SpvCapabilitySubgroup2DBlockTransposeINTEL = 6230,
+ SpvCapabilitySubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ SpvCapabilityTernaryBitwiseFunctionINTEL = 6241,
+ SpvCapabilitySpecConditionalINTEL = 6245,
+ SpvCapabilityFunctionVariantsINTEL = 6246,
SpvCapabilityGroupUniformArithmeticKHR = 6400,
+ SpvCapabilityTensorFloat32RoundingINTEL = 6425,
SpvCapabilityMaskedGatherScatterINTEL = 6427,
SpvCapabilityCacheControlsINTEL = 6441,
SpvCapabilityRegisterLimitsINTEL = 6460,
+ SpvCapabilityBindlessImagesINTEL = 6528,
SpvCapabilityMax = 0x7fffffff,
} SpvCapability;
@@ -1246,6 +1304,7 @@
SpvRayFlagsCullFrontFacingTrianglesKHRShift = 5,
SpvRayFlagsCullOpaqueKHRShift = 6,
SpvRayFlagsCullNoOpaqueKHRShift = 7,
+ SpvRayFlagsSkipBuiltinPrimitivesNVShift = 8,
SpvRayFlagsSkipTrianglesKHRShift = 8,
SpvRayFlagsSkipAABBsKHRShift = 9,
SpvRayFlagsForceOpacityMicromap2StateEXTShift = 10,
@@ -1262,6 +1321,7 @@
SpvRayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020,
SpvRayFlagsCullOpaqueKHRMask = 0x00000040,
SpvRayFlagsCullNoOpaqueKHRMask = 0x00000080,
+ SpvRayFlagsSkipBuiltinPrimitivesNVMask = 0x00000100,
SpvRayFlagsSkipTrianglesKHRMask = 0x00000100,
SpvRayFlagsSkipAABBsKHRMask = 0x00000200,
SpvRayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400,
@@ -1361,6 +1421,8 @@
typedef enum SpvCooperativeMatrixLayout_ {
SpvCooperativeMatrixLayoutRowMajorKHR = 0,
SpvCooperativeMatrixLayoutColumnMajorKHR = 1,
+ SpvCooperativeMatrixLayoutRowBlockedInterleavedARM = 4202,
+ SpvCooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203,
SpvCooperativeMatrixLayoutMax = 0x7fffffff,
} SpvCooperativeMatrixLayout;
@@ -1371,6 +1433,59 @@
SpvCooperativeMatrixUseMax = 0x7fffffff,
} SpvCooperativeMatrixUse;
+typedef enum SpvCooperativeMatrixReduceShift_ {
+ SpvCooperativeMatrixReduceRowShift = 0,
+ SpvCooperativeMatrixReduceColumnShift = 1,
+ SpvCooperativeMatrixReduce2x2Shift = 2,
+ SpvCooperativeMatrixReduceMax = 0x7fffffff,
+} SpvCooperativeMatrixReduceShift;
+
+typedef enum SpvCooperativeMatrixReduceMask_ {
+ SpvCooperativeMatrixReduceMaskNone = 0,
+ SpvCooperativeMatrixReduceRowMask = 0x00000001,
+ SpvCooperativeMatrixReduceColumnMask = 0x00000002,
+ SpvCooperativeMatrixReduce2x2Mask = 0x00000004,
+} SpvCooperativeMatrixReduceMask;
+
+typedef enum SpvTensorClampMode_ {
+ SpvTensorClampModeUndefined = 0,
+ SpvTensorClampModeConstant = 1,
+ SpvTensorClampModeClampToEdge = 2,
+ SpvTensorClampModeRepeat = 3,
+ SpvTensorClampModeRepeatMirrored = 4,
+ SpvTensorClampModeMax = 0x7fffffff,
+} SpvTensorClampMode;
+
+typedef enum SpvTensorAddressingOperandsShift_ {
+ SpvTensorAddressingOperandsTensorViewShift = 0,
+ SpvTensorAddressingOperandsDecodeFuncShift = 1,
+ SpvTensorAddressingOperandsMax = 0x7fffffff,
+} SpvTensorAddressingOperandsShift;
+
+typedef enum SpvTensorAddressingOperandsMask_ {
+ SpvTensorAddressingOperandsMaskNone = 0,
+ SpvTensorAddressingOperandsTensorViewMask = 0x00000001,
+ SpvTensorAddressingOperandsDecodeFuncMask = 0x00000002,
+} SpvTensorAddressingOperandsMask;
+
+typedef enum SpvTensorOperandsShift_ {
+ SpvTensorOperandsNontemporalARMShift = 0,
+ SpvTensorOperandsOutOfBoundsValueARMShift = 1,
+ SpvTensorOperandsMakeElementAvailableARMShift = 2,
+ SpvTensorOperandsMakeElementVisibleARMShift = 3,
+ SpvTensorOperandsNonPrivateElementARMShift = 4,
+ SpvTensorOperandsMax = 0x7fffffff,
+} SpvTensorOperandsShift;
+
+typedef enum SpvTensorOperandsMask_ {
+ SpvTensorOperandsMaskNone = 0,
+ SpvTensorOperandsNontemporalARMMask = 0x00000001,
+ SpvTensorOperandsOutOfBoundsValueARMMask = 0x00000002,
+ SpvTensorOperandsMakeElementAvailableARMMask = 0x00000004,
+ SpvTensorOperandsMakeElementVisibleARMMask = 0x00000008,
+ SpvTensorOperandsNonPrivateElementARMMask = 0x00000010,
+} SpvTensorOperandsMask;
+
typedef enum SpvInitializationModeQualifier_ {
SpvInitializationModeQualifierInitOnDeviceReprogramINTEL = 0,
SpvInitializationModeQualifierInitOnDeviceResetINTEL = 1,
@@ -1407,6 +1522,42 @@
SpvNamedMaximumNumberOfRegistersMax = 0x7fffffff,
} SpvNamedMaximumNumberOfRegisters;
+typedef enum SpvMatrixMultiplyAccumulateOperandsShift_ {
+ SpvMatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELShift = 0,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELShift = 1,
+ SpvMatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELShift = 2,
+ SpvMatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELShift = 3,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELShift = 4,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELShift = 5,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELShift = 6,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELShift = 7,
+ SpvMatrixMultiplyAccumulateOperandsMatrixATF32INTELShift = 8,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBTF32INTELShift = 9,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELShift = 10,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELShift = 11,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELShift = 12,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELShift = 13,
+ SpvMatrixMultiplyAccumulateOperandsMax = 0x7fffffff,
+} SpvMatrixMultiplyAccumulateOperandsShift;
+
+typedef enum SpvMatrixMultiplyAccumulateOperandsMask_ {
+ SpvMatrixMultiplyAccumulateOperandsMaskNone = 0,
+ SpvMatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELMask = 0x00000001,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELMask = 0x00000002,
+ SpvMatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELMask = 0x00000004,
+ SpvMatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELMask = 0x00000008,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELMask = 0x00000010,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELMask = 0x00000020,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELMask = 0x00000040,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELMask = 0x00000080,
+ SpvMatrixMultiplyAccumulateOperandsMatrixATF32INTELMask = 0x00000100,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBTF32INTELMask = 0x00000200,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELMask = 0x00000400,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELMask = 0x00000800,
+ SpvMatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELMask = 0x00001000,
+ SpvMatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELMask = 0x00002000,
+} SpvMatrixMultiplyAccumulateOperandsMask;
+
typedef enum SpvRawAccessChainOperandsShift_ {
SpvRawAccessChainOperandsRobustnessPerComponentNVShift = 0,
SpvRawAccessChainOperandsRobustnessPerElementNVShift = 1,
@@ -1419,6 +1570,40 @@
SpvRawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002,
} SpvRawAccessChainOperandsMask;
+typedef enum SpvFPEncoding_ {
+ SpvFPEncodingBFloat16KHR = 0,
+ SpvFPEncodingFloat8E4M3EXT = 4214,
+ SpvFPEncodingFloat8E5M2EXT = 4215,
+ SpvFPEncodingMax = 0x7fffffff,
+} SpvFPEncoding;
+
+typedef enum SpvCooperativeVectorMatrixLayout_ {
+ SpvCooperativeVectorMatrixLayoutRowMajorNV = 0,
+ SpvCooperativeVectorMatrixLayoutColumnMajorNV = 1,
+ SpvCooperativeVectorMatrixLayoutInferencingOptimalNV = 2,
+ SpvCooperativeVectorMatrixLayoutTrainingOptimalNV = 3,
+ SpvCooperativeVectorMatrixLayoutMax = 0x7fffffff,
+} SpvCooperativeVectorMatrixLayout;
+
+typedef enum SpvComponentType_ {
+ SpvComponentTypeFloat16NV = 0,
+ SpvComponentTypeFloat32NV = 1,
+ SpvComponentTypeFloat64NV = 2,
+ SpvComponentTypeSignedInt8NV = 3,
+ SpvComponentTypeSignedInt16NV = 4,
+ SpvComponentTypeSignedInt32NV = 5,
+ SpvComponentTypeSignedInt64NV = 6,
+ SpvComponentTypeUnsignedInt8NV = 7,
+ SpvComponentTypeUnsignedInt16NV = 8,
+ SpvComponentTypeUnsignedInt32NV = 9,
+ SpvComponentTypeUnsignedInt64NV = 10,
+ SpvComponentTypeSignedInt8PackedNV = 1000491000,
+ SpvComponentTypeUnsignedInt8PackedNV = 1000491001,
+ SpvComponentTypeFloatE4M3NV = 1000491002,
+ SpvComponentTypeFloatE5M2NV = 1000491003,
+ SpvComponentTypeMax = 0x7fffffff,
+} SpvComponentType;
+
typedef enum SpvOp_ {
SpvOpNop = 0,
SpvOpUndef = 1,
@@ -1767,14 +1952,35 @@
SpvOpColorAttachmentReadEXT = 4160,
SpvOpDepthAttachmentReadEXT = 4161,
SpvOpStencilAttachmentReadEXT = 4162,
+ SpvOpTypeTensorARM = 4163,
+ SpvOpTensorReadARM = 4164,
+ SpvOpTensorWriteARM = 4165,
+ SpvOpTensorQuerySizeARM = 4166,
+ SpvOpGraphConstantARM = 4181,
+ SpvOpGraphEntryPointARM = 4182,
+ SpvOpGraphARM = 4183,
+ SpvOpGraphInputARM = 4184,
+ SpvOpGraphSetOutputARM = 4185,
+ SpvOpGraphEndARM = 4186,
+ SpvOpTypeGraphARM = 4190,
SpvOpTerminateInvocation = 4416,
+ SpvOpTypeUntypedPointerKHR = 4417,
+ SpvOpUntypedVariableKHR = 4418,
+ SpvOpUntypedAccessChainKHR = 4419,
+ SpvOpUntypedInBoundsAccessChainKHR = 4420,
SpvOpSubgroupBallotKHR = 4421,
SpvOpSubgroupFirstInvocationKHR = 4422,
+ SpvOpUntypedPtrAccessChainKHR = 4423,
+ SpvOpUntypedInBoundsPtrAccessChainKHR = 4424,
+ SpvOpUntypedArrayLengthKHR = 4425,
+ SpvOpUntypedPrefetchKHR = 4426,
SpvOpSubgroupAllKHR = 4428,
SpvOpSubgroupAnyKHR = 4429,
SpvOpSubgroupAllEqualKHR = 4430,
SpvOpGroupNonUniformRotateKHR = 4431,
SpvOpSubgroupReadInvocationKHR = 4432,
+ SpvOpExtInstWithForwardRefsKHR = 4433,
+ SpvOpUntypedGroupAsyncCopyKHR = 4434,
SpvOpTraceRayKHR = 4445,
SpvOpExecuteCallableKHR = 4446,
SpvOpConvertUToAccelerationStructureKHR = 4447,
@@ -1797,6 +2003,9 @@
SpvOpCooperativeMatrixStoreKHR = 4458,
SpvOpCooperativeMatrixMulAddKHR = 4459,
SpvOpCooperativeMatrixLengthKHR = 4460,
+ SpvOpConstantCompositeReplicateEXT = 4461,
+ SpvOpSpecConstantCompositeReplicateEXT = 4462,
+ SpvOpCompositeConstructReplicateEXT = 4463,
SpvOpTypeRayQueryKHR = 4472,
SpvOpRayQueryInitializeKHR = 4473,
SpvOpRayQueryTerminateKHR = 4474,
@@ -1808,10 +2017,14 @@
SpvOpImageBoxFilterQCOM = 4481,
SpvOpImageBlockMatchSSDQCOM = 4482,
SpvOpImageBlockMatchSADQCOM = 4483,
+ SpvOpBitCastArrayQCOM = 4497,
SpvOpImageBlockMatchWindowSSDQCOM = 4500,
SpvOpImageBlockMatchWindowSADQCOM = 4501,
SpvOpImageBlockMatchGatherSSDQCOM = 4502,
SpvOpImageBlockMatchGatherSADQCOM = 4503,
+ SpvOpCompositeConstructCoopMatQCOM = 4540,
+ SpvOpCompositeExtractCoopMatQCOM = 4541,
+ SpvOpExtractSubArrayQCOM = 4542,
SpvOpGroupIAddNonUniformAMD = 5000,
SpvOpGroupFAddNonUniformAMD = 5001,
SpvOpGroupFMinNonUniformAMD = 5002,
@@ -1823,9 +2036,14 @@
SpvOpFragmentMaskFetchAMD = 5011,
SpvOpFragmentFetchAMD = 5012,
SpvOpReadClockKHR = 5056,
- SpvOpFinalizeNodePayloadsAMDX = 5075,
+ SpvOpAllocateNodePayloadsAMDX = 5074,
+ SpvOpEnqueueNodePayloadsAMDX = 5075,
+ SpvOpTypeNodePayloadArrayAMDX = 5076,
SpvOpFinishWritingNodePayloadAMDX = 5078,
- SpvOpInitializeNodePayloadsAMDX = 5090,
+ SpvOpNodePayloadArrayLengthAMDX = 5090,
+ SpvOpIsNodePayloadValidAMDX = 5101,
+ SpvOpConstantStringAMDX = 5103,
+ SpvOpSpecConstantStringAMDX = 5104,
SpvOpGroupNonUniformQuadAllKHR = 5110,
SpvOpGroupNonUniformQuadAnyKHR = 5111,
SpvOpHitObjectRecordHitMotionNV = 5249,
@@ -1862,12 +2080,20 @@
SpvOpReorderThreadWithHintNV = 5280,
SpvOpTypeHitObjectNV = 5281,
SpvOpImageSampleFootprintNV = 5283,
+ SpvOpTypeCooperativeVectorNV = 5288,
+ SpvOpCooperativeVectorMatrixMulNV = 5289,
+ SpvOpCooperativeVectorOuterProductAccumulateNV = 5290,
+ SpvOpCooperativeVectorReduceSumAccumulateNV = 5291,
+ SpvOpCooperativeVectorMatrixMulAddNV = 5292,
+ SpvOpCooperativeMatrixConvertNV = 5293,
SpvOpEmitMeshTasksEXT = 5294,
SpvOpSetMeshOutputsEXT = 5295,
SpvOpGroupNonUniformPartitionNV = 5296,
SpvOpWritePackedPrimitiveIndices4x8NV = 5299,
SpvOpFetchMicroTriangleVertexPositionNV = 5300,
SpvOpFetchMicroTriangleVertexBarycentricNV = 5301,
+ SpvOpCooperativeVectorLoadNV = 5302,
+ SpvOpCooperativeVectorStoreNV = 5303,
SpvOpReportIntersectionKHR = 5334,
SpvOpReportIntersectionNV = 5334,
SpvOpIgnoreIntersectionNV = 5335,
@@ -1879,6 +2105,8 @@
SpvOpTypeAccelerationStructureKHR = 5341,
SpvOpTypeAccelerationStructureNV = 5341,
SpvOpExecuteCallableNV = 5344,
+ SpvOpRayQueryGetClusterIdNV = 5345,
+ SpvOpHitObjectGetClusterIdNV = 5346,
SpvOpTypeCooperativeMatrixNV = 5358,
SpvOpCooperativeMatrixLoadNV = 5359,
SpvOpCooperativeMatrixStoreNV = 5360,
@@ -1886,9 +2114,26 @@
SpvOpCooperativeMatrixLengthNV = 5362,
SpvOpBeginInvocationInterlockEXT = 5364,
SpvOpEndInvocationInterlockEXT = 5365,
+ SpvOpCooperativeMatrixReduceNV = 5366,
+ SpvOpCooperativeMatrixLoadTensorNV = 5367,
+ SpvOpCooperativeMatrixStoreTensorNV = 5368,
+ SpvOpCooperativeMatrixPerElementOpNV = 5369,
+ SpvOpTypeTensorLayoutNV = 5370,
+ SpvOpTypeTensorViewNV = 5371,
+ SpvOpCreateTensorLayoutNV = 5372,
+ SpvOpTensorLayoutSetDimensionNV = 5373,
+ SpvOpTensorLayoutSetStrideNV = 5374,
+ SpvOpTensorLayoutSliceNV = 5375,
+ SpvOpTensorLayoutSetClampValueNV = 5376,
+ SpvOpCreateTensorViewNV = 5377,
+ SpvOpTensorViewSetDimensionNV = 5378,
+ SpvOpTensorViewSetStrideNV = 5379,
SpvOpDemoteToHelperInvocation = 5380,
SpvOpDemoteToHelperInvocationEXT = 5380,
SpvOpIsHelperInvocationEXT = 5381,
+ SpvOpTensorViewSetClipNV = 5382,
+ SpvOpTensorLayoutSetBlockSizeNV = 5384,
+ SpvOpCooperativeMatrixTransposeNV = 5390,
SpvOpConvertUToImageNV = 5391,
SpvOpConvertUToSamplerNV = 5392,
SpvOpConvertImageToUNV = 5393,
@@ -1897,6 +2142,19 @@
SpvOpConvertSampledImageToUNV = 5396,
SpvOpSamplerImageAddressingModeNV = 5397,
SpvOpRawAccessChainNV = 5398,
+ SpvOpRayQueryGetIntersectionSpherePositionNV = 5427,
+ SpvOpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ SpvOpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ SpvOpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ SpvOpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ SpvOpHitObjectGetSpherePositionNV = 5432,
+ SpvOpHitObjectGetSphereRadiusNV = 5433,
+ SpvOpHitObjectGetLSSPositionsNV = 5434,
+ SpvOpHitObjectGetLSSRadiiNV = 5435,
+ SpvOpHitObjectIsSphereHitNV = 5436,
+ SpvOpHitObjectIsLSSHitNV = 5437,
+ SpvOpRayQueryIsSphereHitNV = 5438,
+ SpvOpRayQueryIsLSSHitNV = 5439,
SpvOpSubgroupShuffleINTEL = 5571,
SpvOpSubgroupShuffleDownINTEL = 5572,
SpvOpSubgroupShuffleUpINTEL = 5573,
@@ -2143,6 +2401,27 @@
SpvOpConvertBF16ToFINTEL = 6117,
SpvOpControlBarrierArriveINTEL = 6142,
SpvOpControlBarrierWaitINTEL = 6143,
+ SpvOpArithmeticFenceEXT = 6145,
+ SpvOpTaskSequenceCreateINTEL = 6163,
+ SpvOpTaskSequenceAsyncINTEL = 6164,
+ SpvOpTaskSequenceGetINTEL = 6165,
+ SpvOpTaskSequenceReleaseINTEL = 6166,
+ SpvOpTypeTaskSequenceINTEL = 6199,
+ SpvOpSubgroupBlockPrefetchINTEL = 6221,
+ SpvOpSubgroup2DBlockLoadINTEL = 6231,
+ SpvOpSubgroup2DBlockLoadTransformINTEL = 6232,
+ SpvOpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ SpvOpSubgroup2DBlockPrefetchINTEL = 6234,
+ SpvOpSubgroup2DBlockStoreINTEL = 6235,
+ SpvOpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ SpvOpBitwiseFunctionINTEL = 6242,
+ SpvOpConditionalExtensionINTEL = 6248,
+ SpvOpConditionalEntryPointINTEL = 6249,
+ SpvOpConditionalCapabilityINTEL = 6250,
+ SpvOpSpecConstantTargetINTEL = 6251,
+ SpvOpSpecConstantArchitectureINTEL = 6252,
+ SpvOpSpecConstantCapabilitiesINTEL = 6253,
+ SpvOpConditionalCopyObjectINTEL = 6254,
SpvOpGroupIMulKHR = 6401,
SpvOpGroupFMulKHR = 6402,
SpvOpGroupBitwiseAndKHR = 6403,
@@ -2151,8 +2430,12 @@
SpvOpGroupLogicalAndKHR = 6406,
SpvOpGroupLogicalOrKHR = 6407,
SpvOpGroupLogicalXorKHR = 6408,
+ SpvOpRoundFToTF32INTEL = 6426,
SpvOpMaskedGatherINTEL = 6428,
SpvOpMaskedScatterINTEL = 6429,
+ SpvOpConvertHandleToImageINTEL = 6529,
+ SpvOpConvertHandleToSamplerINTEL = 6530,
+ SpvOpConvertHandleToSampledImageINTEL = 6531,
SpvOpMax = 0x7fffffff,
} SpvOp;
@@ -2511,14 +2794,35 @@
case SpvOpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
case SpvOpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
case SpvOpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTypeTensorARM: *hasResult = true; *hasResultType = false; break;
+ case SpvOpTensorReadARM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorWriteARM: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGraphConstantARM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGraphEntryPointARM: *hasResult = false; *hasResultType = false; break;
+ case SpvOpGraphARM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGraphInputARM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGraphSetOutputARM: *hasResult = false; *hasResultType = false; break;
+ case SpvOpGraphEndARM: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTypeGraphARM: *hasResult = true; *hasResultType = false; break;
case SpvOpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break;
+ case SpvOpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUntypedGroupAsyncCopyKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
@@ -2535,6 +2839,9 @@
case SpvOpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break;
case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2546,10 +2853,14 @@
case SpvOpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break;
+ case SpvOpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
@@ -2561,9 +2872,14 @@
case SpvOpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpFinalizeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case SpvOpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break;
+ case SpvOpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break;
case SpvOpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break;
- case SpvOpInitializeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case SpvOpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break;
+ case SpvOpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConstantStringAMDX: *hasResult = true; *hasResultType = false; break;
+ case SpvOpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break;
case SpvOpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
@@ -2600,21 +2916,31 @@
case SpvOpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break;
case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break;
+ case SpvOpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeMatrixConvertNV: *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 SpvOpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break;
case SpvOpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break;
- case SpvOpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
+ case SpvOpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break;
case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
case SpvOpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
case SpvOpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
@@ -2622,8 +2948,25 @@
case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
+ case SpvOpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break;
+ case SpvOpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break;
+ case SpvOpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break;
case SpvOpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break;
case SpvOpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
case SpvOpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
case SpvOpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
@@ -2632,6 +2975,19 @@
case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case SpvOpRawAccessChainNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2658,7 +3014,7 @@
case SpvOpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
- case SpvOpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break;
case SpvOpAsmINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
@@ -2876,6 +3232,27 @@
case SpvOpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTaskSequenceCreateINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTaskSequenceAsyncINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTaskSequenceGetINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTaskSequenceReleaseINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTypeTaskSequenceINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpBitwiseFunctionINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConditionalExtensionINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpConditionalEntryPointINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpConditionalCapabilityINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSpecConstantTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSpecConstantArchitectureINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSpecConstantCapabilitiesINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConditionalCopyObjectINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
@@ -2884,10 +3261,2005 @@
case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRoundFToTF32INTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpConvertHandleToImageINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertHandleToSamplerINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertHandleToSampledImageINTEL: *hasResult = true; *hasResultType = true; break;
}
}
+inline const char* SpvSourceLanguageToString(SpvSourceLanguage value) {
+ switch (value) {
+ case SpvSourceLanguageUnknown: return "Unknown";
+ case SpvSourceLanguageESSL: return "ESSL";
+ case SpvSourceLanguageGLSL: return "GLSL";
+ case SpvSourceLanguageOpenCL_C: return "OpenCL_C";
+ case SpvSourceLanguageOpenCL_CPP: return "OpenCL_CPP";
+ case SpvSourceLanguageHLSL: return "HLSL";
+ case SpvSourceLanguageCPP_for_OpenCL: return "CPP_for_OpenCL";
+ case SpvSourceLanguageSYCL: return "SYCL";
+ case SpvSourceLanguageHERO_C: return "HERO_C";
+ case SpvSourceLanguageNZSL: return "NZSL";
+ case SpvSourceLanguageWGSL: return "WGSL";
+ case SpvSourceLanguageSlang: return "Slang";
+ case SpvSourceLanguageZig: return "Zig";
+ case SpvSourceLanguageRust: return "Rust";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvExecutionModelToString(SpvExecutionModel value) {
+ switch (value) {
+ case SpvExecutionModelVertex: return "Vertex";
+ case SpvExecutionModelTessellationControl: return "TessellationControl";
+ case SpvExecutionModelTessellationEvaluation: return "TessellationEvaluation";
+ case SpvExecutionModelGeometry: return "Geometry";
+ case SpvExecutionModelFragment: return "Fragment";
+ case SpvExecutionModelGLCompute: return "GLCompute";
+ case SpvExecutionModelKernel: return "Kernel";
+ case SpvExecutionModelTaskNV: return "TaskNV";
+ case SpvExecutionModelMeshNV: return "MeshNV";
+ case SpvExecutionModelRayGenerationKHR: return "RayGenerationKHR";
+ case SpvExecutionModelIntersectionKHR: return "IntersectionKHR";
+ case SpvExecutionModelAnyHitKHR: return "AnyHitKHR";
+ case SpvExecutionModelClosestHitKHR: return "ClosestHitKHR";
+ case SpvExecutionModelMissKHR: return "MissKHR";
+ case SpvExecutionModelCallableKHR: return "CallableKHR";
+ case SpvExecutionModelTaskEXT: return "TaskEXT";
+ case SpvExecutionModelMeshEXT: return "MeshEXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvAddressingModelToString(SpvAddressingModel value) {
+ switch (value) {
+ case SpvAddressingModelLogical: return "Logical";
+ case SpvAddressingModelPhysical32: return "Physical32";
+ case SpvAddressingModelPhysical64: return "Physical64";
+ case SpvAddressingModelPhysicalStorageBuffer64: return "PhysicalStorageBuffer64";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvMemoryModelToString(SpvMemoryModel value) {
+ switch (value) {
+ case SpvMemoryModelSimple: return "Simple";
+ case SpvMemoryModelGLSL450: return "GLSL450";
+ case SpvMemoryModelOpenCL: return "OpenCL";
+ case SpvMemoryModelVulkan: return "Vulkan";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvExecutionModeToString(SpvExecutionMode value) {
+ switch (value) {
+ case SpvExecutionModeInvocations: return "Invocations";
+ case SpvExecutionModeSpacingEqual: return "SpacingEqual";
+ case SpvExecutionModeSpacingFractionalEven: return "SpacingFractionalEven";
+ case SpvExecutionModeSpacingFractionalOdd: return "SpacingFractionalOdd";
+ case SpvExecutionModeVertexOrderCw: return "VertexOrderCw";
+ case SpvExecutionModeVertexOrderCcw: return "VertexOrderCcw";
+ case SpvExecutionModePixelCenterInteger: return "PixelCenterInteger";
+ case SpvExecutionModeOriginUpperLeft: return "OriginUpperLeft";
+ case SpvExecutionModeOriginLowerLeft: return "OriginLowerLeft";
+ case SpvExecutionModeEarlyFragmentTests: return "EarlyFragmentTests";
+ case SpvExecutionModePointMode: return "PointMode";
+ case SpvExecutionModeXfb: return "Xfb";
+ case SpvExecutionModeDepthReplacing: return "DepthReplacing";
+ case SpvExecutionModeDepthGreater: return "DepthGreater";
+ case SpvExecutionModeDepthLess: return "DepthLess";
+ case SpvExecutionModeDepthUnchanged: return "DepthUnchanged";
+ case SpvExecutionModeLocalSize: return "LocalSize";
+ case SpvExecutionModeLocalSizeHint: return "LocalSizeHint";
+ case SpvExecutionModeInputPoints: return "InputPoints";
+ case SpvExecutionModeInputLines: return "InputLines";
+ case SpvExecutionModeInputLinesAdjacency: return "InputLinesAdjacency";
+ case SpvExecutionModeTriangles: return "Triangles";
+ case SpvExecutionModeInputTrianglesAdjacency: return "InputTrianglesAdjacency";
+ case SpvExecutionModeQuads: return "Quads";
+ case SpvExecutionModeIsolines: return "Isolines";
+ case SpvExecutionModeOutputVertices: return "OutputVertices";
+ case SpvExecutionModeOutputPoints: return "OutputPoints";
+ case SpvExecutionModeOutputLineStrip: return "OutputLineStrip";
+ case SpvExecutionModeOutputTriangleStrip: return "OutputTriangleStrip";
+ case SpvExecutionModeVecTypeHint: return "VecTypeHint";
+ case SpvExecutionModeContractionOff: return "ContractionOff";
+ case SpvExecutionModeInitializer: return "Initializer";
+ case SpvExecutionModeFinalizer: return "Finalizer";
+ case SpvExecutionModeSubgroupSize: return "SubgroupSize";
+ case SpvExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup";
+ case SpvExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId";
+ case SpvExecutionModeLocalSizeId: return "LocalSizeId";
+ case SpvExecutionModeLocalSizeHintId: return "LocalSizeHintId";
+ case SpvExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT";
+ case SpvExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT";
+ case SpvExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT";
+ case SpvExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR";
+ case SpvExecutionModePostDepthCoverage: return "PostDepthCoverage";
+ case SpvExecutionModeDenormPreserve: return "DenormPreserve";
+ case SpvExecutionModeDenormFlushToZero: return "DenormFlushToZero";
+ case SpvExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case SpvExecutionModeRoundingModeRTE: return "RoundingModeRTE";
+ case SpvExecutionModeRoundingModeRTZ: return "RoundingModeRTZ";
+ case SpvExecutionModeNonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM";
+ case SpvExecutionModeTileShadingRateQCOM: return "TileShadingRateQCOM";
+ case SpvExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD";
+ case SpvExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT";
+ case SpvExecutionModeCoalescingAMDX: return "CoalescingAMDX";
+ case SpvExecutionModeIsApiEntryAMDX: return "IsApiEntryAMDX";
+ case SpvExecutionModeMaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX";
+ case SpvExecutionModeStaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX";
+ case SpvExecutionModeShaderIndexAMDX: return "ShaderIndexAMDX";
+ case SpvExecutionModeMaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX";
+ case SpvExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD";
+ case SpvExecutionModeStencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD";
+ case SpvExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD";
+ case SpvExecutionModeStencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD";
+ case SpvExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD";
+ case SpvExecutionModeStencilRefLessBackAMD: return "StencilRefLessBackAMD";
+ case SpvExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR";
+ case SpvExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR";
+ case SpvExecutionModeSharesInputWithAMDX: return "SharesInputWithAMDX";
+ case SpvExecutionModeOutputLinesEXT: return "OutputLinesEXT";
+ case SpvExecutionModeOutputPrimitivesEXT: return "OutputPrimitivesEXT";
+ case SpvExecutionModeDerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR";
+ case SpvExecutionModeDerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR";
+ case SpvExecutionModeOutputTrianglesEXT: return "OutputTrianglesEXT";
+ case SpvExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT";
+ case SpvExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT";
+ case SpvExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT";
+ case SpvExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT";
+ case SpvExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT";
+ case SpvExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT";
+ case SpvExecutionModeSharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL";
+ case SpvExecutionModeRoundingModeRTPINTEL: return "RoundingModeRTPINTEL";
+ case SpvExecutionModeRoundingModeRTNINTEL: return "RoundingModeRTNINTEL";
+ case SpvExecutionModeFloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL";
+ case SpvExecutionModeFloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL";
+ case SpvExecutionModeMaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL";
+ case SpvExecutionModeMaxWorkDimINTEL: return "MaxWorkDimINTEL";
+ case SpvExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL";
+ case SpvExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL";
+ case SpvExecutionModeSchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL";
+ case SpvExecutionModeMaximallyReconvergesKHR: return "MaximallyReconvergesKHR";
+ case SpvExecutionModeFPFastMathDefault: return "FPFastMathDefault";
+ case SpvExecutionModeStreamingInterfaceINTEL: return "StreamingInterfaceINTEL";
+ case SpvExecutionModeRegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL";
+ case SpvExecutionModeNamedBarrierCountINTEL: return "NamedBarrierCountINTEL";
+ case SpvExecutionModeMaximumRegistersINTEL: return "MaximumRegistersINTEL";
+ case SpvExecutionModeMaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL";
+ case SpvExecutionModeNamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvStorageClassToString(SpvStorageClass value) {
+ switch (value) {
+ case SpvStorageClassUniformConstant: return "UniformConstant";
+ case SpvStorageClassInput: return "Input";
+ case SpvStorageClassUniform: return "Uniform";
+ case SpvStorageClassOutput: return "Output";
+ case SpvStorageClassWorkgroup: return "Workgroup";
+ case SpvStorageClassCrossWorkgroup: return "CrossWorkgroup";
+ case SpvStorageClassPrivate: return "Private";
+ case SpvStorageClassFunction: return "Function";
+ case SpvStorageClassGeneric: return "Generic";
+ case SpvStorageClassPushConstant: return "PushConstant";
+ case SpvStorageClassAtomicCounter: return "AtomicCounter";
+ case SpvStorageClassImage: return "Image";
+ case SpvStorageClassStorageBuffer: return "StorageBuffer";
+ case SpvStorageClassTileImageEXT: return "TileImageEXT";
+ case SpvStorageClassTileAttachmentQCOM: return "TileAttachmentQCOM";
+ case SpvStorageClassNodePayloadAMDX: return "NodePayloadAMDX";
+ case SpvStorageClassCallableDataKHR: return "CallableDataKHR";
+ case SpvStorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR";
+ case SpvStorageClassRayPayloadKHR: return "RayPayloadKHR";
+ case SpvStorageClassHitAttributeKHR: return "HitAttributeKHR";
+ case SpvStorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR";
+ case SpvStorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR";
+ case SpvStorageClassPhysicalStorageBuffer: return "PhysicalStorageBuffer";
+ case SpvStorageClassHitObjectAttributeNV: return "HitObjectAttributeNV";
+ case SpvStorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
+ case SpvStorageClassCodeSectionINTEL: return "CodeSectionINTEL";
+ case SpvStorageClassDeviceOnlyINTEL: return "DeviceOnlyINTEL";
+ case SpvStorageClassHostOnlyINTEL: return "HostOnlyINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvDimToString(SpvDim value) {
+ switch (value) {
+ case SpvDim1D: return "1D";
+ case SpvDim2D: return "2D";
+ case SpvDim3D: return "3D";
+ case SpvDimCube: return "Cube";
+ case SpvDimRect: return "Rect";
+ case SpvDimBuffer: return "Buffer";
+ case SpvDimSubpassData: return "SubpassData";
+ case SpvDimTileImageDataEXT: return "TileImageDataEXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvSamplerAddressingModeToString(SpvSamplerAddressingMode value) {
+ switch (value) {
+ case SpvSamplerAddressingModeNone: return "None";
+ case SpvSamplerAddressingModeClampToEdge: return "ClampToEdge";
+ case SpvSamplerAddressingModeClamp: return "Clamp";
+ case SpvSamplerAddressingModeRepeat: return "Repeat";
+ case SpvSamplerAddressingModeRepeatMirrored: return "RepeatMirrored";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvSamplerFilterModeToString(SpvSamplerFilterMode value) {
+ switch (value) {
+ case SpvSamplerFilterModeNearest: return "Nearest";
+ case SpvSamplerFilterModeLinear: return "Linear";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvImageFormatToString(SpvImageFormat value) {
+ switch (value) {
+ case SpvImageFormatUnknown: return "Unknown";
+ case SpvImageFormatRgba32f: return "Rgba32f";
+ case SpvImageFormatRgba16f: return "Rgba16f";
+ case SpvImageFormatR32f: return "R32f";
+ case SpvImageFormatRgba8: return "Rgba8";
+ case SpvImageFormatRgba8Snorm: return "Rgba8Snorm";
+ case SpvImageFormatRg32f: return "Rg32f";
+ case SpvImageFormatRg16f: return "Rg16f";
+ case SpvImageFormatR11fG11fB10f: return "R11fG11fB10f";
+ case SpvImageFormatR16f: return "R16f";
+ case SpvImageFormatRgba16: return "Rgba16";
+ case SpvImageFormatRgb10A2: return "Rgb10A2";
+ case SpvImageFormatRg16: return "Rg16";
+ case SpvImageFormatRg8: return "Rg8";
+ case SpvImageFormatR16: return "R16";
+ case SpvImageFormatR8: return "R8";
+ case SpvImageFormatRgba16Snorm: return "Rgba16Snorm";
+ case SpvImageFormatRg16Snorm: return "Rg16Snorm";
+ case SpvImageFormatRg8Snorm: return "Rg8Snorm";
+ case SpvImageFormatR16Snorm: return "R16Snorm";
+ case SpvImageFormatR8Snorm: return "R8Snorm";
+ case SpvImageFormatRgba32i: return "Rgba32i";
+ case SpvImageFormatRgba16i: return "Rgba16i";
+ case SpvImageFormatRgba8i: return "Rgba8i";
+ case SpvImageFormatR32i: return "R32i";
+ case SpvImageFormatRg32i: return "Rg32i";
+ case SpvImageFormatRg16i: return "Rg16i";
+ case SpvImageFormatRg8i: return "Rg8i";
+ case SpvImageFormatR16i: return "R16i";
+ case SpvImageFormatR8i: return "R8i";
+ case SpvImageFormatRgba32ui: return "Rgba32ui";
+ case SpvImageFormatRgba16ui: return "Rgba16ui";
+ case SpvImageFormatRgba8ui: return "Rgba8ui";
+ case SpvImageFormatR32ui: return "R32ui";
+ case SpvImageFormatRgb10a2ui: return "Rgb10a2ui";
+ case SpvImageFormatRg32ui: return "Rg32ui";
+ case SpvImageFormatRg16ui: return "Rg16ui";
+ case SpvImageFormatRg8ui: return "Rg8ui";
+ case SpvImageFormatR16ui: return "R16ui";
+ case SpvImageFormatR8ui: return "R8ui";
+ case SpvImageFormatR64ui: return "R64ui";
+ case SpvImageFormatR64i: return "R64i";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvImageChannelOrderToString(SpvImageChannelOrder value) {
+ switch (value) {
+ case SpvImageChannelOrderR: return "R";
+ case SpvImageChannelOrderA: return "A";
+ case SpvImageChannelOrderRG: return "RG";
+ case SpvImageChannelOrderRA: return "RA";
+ case SpvImageChannelOrderRGB: return "RGB";
+ case SpvImageChannelOrderRGBA: return "RGBA";
+ case SpvImageChannelOrderBGRA: return "BGRA";
+ case SpvImageChannelOrderARGB: return "ARGB";
+ case SpvImageChannelOrderIntensity: return "Intensity";
+ case SpvImageChannelOrderLuminance: return "Luminance";
+ case SpvImageChannelOrderRx: return "Rx";
+ case SpvImageChannelOrderRGx: return "RGx";
+ case SpvImageChannelOrderRGBx: return "RGBx";
+ case SpvImageChannelOrderDepth: return "Depth";
+ case SpvImageChannelOrderDepthStencil: return "DepthStencil";
+ case SpvImageChannelOrdersRGB: return "sRGB";
+ case SpvImageChannelOrdersRGBx: return "sRGBx";
+ case SpvImageChannelOrdersRGBA: return "sRGBA";
+ case SpvImageChannelOrdersBGRA: return "sBGRA";
+ case SpvImageChannelOrderABGR: return "ABGR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvImageChannelDataTypeToString(SpvImageChannelDataType value) {
+ switch (value) {
+ case SpvImageChannelDataTypeSnormInt8: return "SnormInt8";
+ case SpvImageChannelDataTypeSnormInt16: return "SnormInt16";
+ case SpvImageChannelDataTypeUnormInt8: return "UnormInt8";
+ case SpvImageChannelDataTypeUnormInt16: return "UnormInt16";
+ case SpvImageChannelDataTypeUnormShort565: return "UnormShort565";
+ case SpvImageChannelDataTypeUnormShort555: return "UnormShort555";
+ case SpvImageChannelDataTypeUnormInt101010: return "UnormInt101010";
+ case SpvImageChannelDataTypeSignedInt8: return "SignedInt8";
+ case SpvImageChannelDataTypeSignedInt16: return "SignedInt16";
+ case SpvImageChannelDataTypeSignedInt32: return "SignedInt32";
+ case SpvImageChannelDataTypeUnsignedInt8: return "UnsignedInt8";
+ case SpvImageChannelDataTypeUnsignedInt16: return "UnsignedInt16";
+ case SpvImageChannelDataTypeUnsignedInt32: return "UnsignedInt32";
+ case SpvImageChannelDataTypeHalfFloat: return "HalfFloat";
+ case SpvImageChannelDataTypeFloat: return "Float";
+ case SpvImageChannelDataTypeUnormInt24: return "UnormInt24";
+ case SpvImageChannelDataTypeUnormInt101010_2: return "UnormInt101010_2";
+ case SpvImageChannelDataTypeUnormInt10X6EXT: return "UnormInt10X6EXT";
+ case SpvImageChannelDataTypeUnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT";
+ case SpvImageChannelDataTypeUnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT";
+ case SpvImageChannelDataTypeUnormInt2_101010EXT: return "UnormInt2_101010EXT";
+ case SpvImageChannelDataTypeUnsignedInt10X6EXT: return "UnsignedInt10X6EXT";
+ case SpvImageChannelDataTypeUnsignedInt12X4EXT: return "UnsignedInt12X4EXT";
+ case SpvImageChannelDataTypeUnsignedInt14X2EXT: return "UnsignedInt14X2EXT";
+ case SpvImageChannelDataTypeUnormInt12X4EXT: return "UnormInt12X4EXT";
+ case SpvImageChannelDataTypeUnormInt14X2EXT: return "UnormInt14X2EXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvFPRoundingModeToString(SpvFPRoundingMode value) {
+ switch (value) {
+ case SpvFPRoundingModeRTE: return "RTE";
+ case SpvFPRoundingModeRTZ: return "RTZ";
+ case SpvFPRoundingModeRTP: return "RTP";
+ case SpvFPRoundingModeRTN: return "RTN";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvLinkageTypeToString(SpvLinkageType value) {
+ switch (value) {
+ case SpvLinkageTypeExport: return "Export";
+ case SpvLinkageTypeImport: return "Import";
+ case SpvLinkageTypeLinkOnceODR: return "LinkOnceODR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvAccessQualifierToString(SpvAccessQualifier value) {
+ switch (value) {
+ case SpvAccessQualifierReadOnly: return "ReadOnly";
+ case SpvAccessQualifierWriteOnly: return "WriteOnly";
+ case SpvAccessQualifierReadWrite: return "ReadWrite";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvFunctionParameterAttributeToString(SpvFunctionParameterAttribute value) {
+ switch (value) {
+ case SpvFunctionParameterAttributeZext: return "Zext";
+ case SpvFunctionParameterAttributeSext: return "Sext";
+ case SpvFunctionParameterAttributeByVal: return "ByVal";
+ case SpvFunctionParameterAttributeSret: return "Sret";
+ case SpvFunctionParameterAttributeNoAlias: return "NoAlias";
+ case SpvFunctionParameterAttributeNoCapture: return "NoCapture";
+ case SpvFunctionParameterAttributeNoWrite: return "NoWrite";
+ case SpvFunctionParameterAttributeNoReadWrite: return "NoReadWrite";
+ case SpvFunctionParameterAttributeRuntimeAlignedINTEL: return "RuntimeAlignedINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvDecorationToString(SpvDecoration value) {
+ switch (value) {
+ case SpvDecorationRelaxedPrecision: return "RelaxedPrecision";
+ case SpvDecorationSpecId: return "SpecId";
+ case SpvDecorationBlock: return "Block";
+ case SpvDecorationBufferBlock: return "BufferBlock";
+ case SpvDecorationRowMajor: return "RowMajor";
+ case SpvDecorationColMajor: return "ColMajor";
+ case SpvDecorationArrayStride: return "ArrayStride";
+ case SpvDecorationMatrixStride: return "MatrixStride";
+ case SpvDecorationGLSLShared: return "GLSLShared";
+ case SpvDecorationGLSLPacked: return "GLSLPacked";
+ case SpvDecorationCPacked: return "CPacked";
+ case SpvDecorationBuiltIn: return "BuiltIn";
+ case SpvDecorationNoPerspective: return "NoPerspective";
+ case SpvDecorationFlat: return "Flat";
+ case SpvDecorationPatch: return "Patch";
+ case SpvDecorationCentroid: return "Centroid";
+ case SpvDecorationSample: return "Sample";
+ case SpvDecorationInvariant: return "Invariant";
+ case SpvDecorationRestrict: return "Restrict";
+ case SpvDecorationAliased: return "Aliased";
+ case SpvDecorationVolatile: return "Volatile";
+ case SpvDecorationConstant: return "Constant";
+ case SpvDecorationCoherent: return "Coherent";
+ case SpvDecorationNonWritable: return "NonWritable";
+ case SpvDecorationNonReadable: return "NonReadable";
+ case SpvDecorationUniform: return "Uniform";
+ case SpvDecorationUniformId: return "UniformId";
+ case SpvDecorationSaturatedConversion: return "SaturatedConversion";
+ case SpvDecorationStream: return "Stream";
+ case SpvDecorationLocation: return "Location";
+ case SpvDecorationComponent: return "Component";
+ case SpvDecorationIndex: return "Index";
+ case SpvDecorationBinding: return "Binding";
+ case SpvDecorationDescriptorSet: return "DescriptorSet";
+ case SpvDecorationOffset: return "Offset";
+ case SpvDecorationXfbBuffer: return "XfbBuffer";
+ case SpvDecorationXfbStride: return "XfbStride";
+ case SpvDecorationFuncParamAttr: return "FuncParamAttr";
+ case SpvDecorationFPRoundingMode: return "FPRoundingMode";
+ case SpvDecorationFPFastMathMode: return "FPFastMathMode";
+ case SpvDecorationLinkageAttributes: return "LinkageAttributes";
+ case SpvDecorationNoContraction: return "NoContraction";
+ case SpvDecorationInputAttachmentIndex: return "InputAttachmentIndex";
+ case SpvDecorationAlignment: return "Alignment";
+ case SpvDecorationMaxByteOffset: return "MaxByteOffset";
+ case SpvDecorationAlignmentId: return "AlignmentId";
+ case SpvDecorationMaxByteOffsetId: return "MaxByteOffsetId";
+ case SpvDecorationSaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT";
+ case SpvDecorationNoSignedWrap: return "NoSignedWrap";
+ case SpvDecorationNoUnsignedWrap: return "NoUnsignedWrap";
+ case SpvDecorationWeightTextureQCOM: return "WeightTextureQCOM";
+ case SpvDecorationBlockMatchTextureQCOM: return "BlockMatchTextureQCOM";
+ case SpvDecorationBlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM";
+ case SpvDecorationExplicitInterpAMD: return "ExplicitInterpAMD";
+ case SpvDecorationNodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX";
+ case SpvDecorationNodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX";
+ case SpvDecorationTrackFinishWritingAMDX: return "TrackFinishWritingAMDX";
+ case SpvDecorationPayloadNodeNameAMDX: return "PayloadNodeNameAMDX";
+ case SpvDecorationPayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX";
+ case SpvDecorationPayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX";
+ case SpvDecorationPayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX";
+ case SpvDecorationPayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX";
+ case SpvDecorationOverrideCoverageNV: return "OverrideCoverageNV";
+ case SpvDecorationPassthroughNV: return "PassthroughNV";
+ case SpvDecorationViewportRelativeNV: return "ViewportRelativeNV";
+ case SpvDecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV";
+ case SpvDecorationPerPrimitiveEXT: return "PerPrimitiveEXT";
+ case SpvDecorationPerViewNV: return "PerViewNV";
+ case SpvDecorationPerTaskNV: return "PerTaskNV";
+ case SpvDecorationPerVertexKHR: return "PerVertexKHR";
+ case SpvDecorationNonUniform: return "NonUniform";
+ case SpvDecorationRestrictPointer: return "RestrictPointer";
+ case SpvDecorationAliasedPointer: return "AliasedPointer";
+ case SpvDecorationHitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV";
+ case SpvDecorationBindlessSamplerNV: return "BindlessSamplerNV";
+ case SpvDecorationBindlessImageNV: return "BindlessImageNV";
+ case SpvDecorationBoundSamplerNV: return "BoundSamplerNV";
+ case SpvDecorationBoundImageNV: return "BoundImageNV";
+ case SpvDecorationSIMTCallINTEL: return "SIMTCallINTEL";
+ case SpvDecorationReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL";
+ case SpvDecorationClobberINTEL: return "ClobberINTEL";
+ case SpvDecorationSideEffectsINTEL: return "SideEffectsINTEL";
+ case SpvDecorationVectorComputeVariableINTEL: return "VectorComputeVariableINTEL";
+ case SpvDecorationFuncParamIOKindINTEL: return "FuncParamIOKindINTEL";
+ case SpvDecorationVectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL";
+ case SpvDecorationStackCallINTEL: return "StackCallINTEL";
+ case SpvDecorationGlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL";
+ case SpvDecorationCounterBuffer: return "CounterBuffer";
+ case SpvDecorationHlslSemanticGOOGLE: return "HlslSemanticGOOGLE";
+ case SpvDecorationUserTypeGOOGLE: return "UserTypeGOOGLE";
+ case SpvDecorationFunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL";
+ case SpvDecorationFunctionDenormModeINTEL: return "FunctionDenormModeINTEL";
+ case SpvDecorationRegisterINTEL: return "RegisterINTEL";
+ case SpvDecorationMemoryINTEL: return "MemoryINTEL";
+ case SpvDecorationNumbanksINTEL: return "NumbanksINTEL";
+ case SpvDecorationBankwidthINTEL: return "BankwidthINTEL";
+ case SpvDecorationMaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL";
+ case SpvDecorationSinglepumpINTEL: return "SinglepumpINTEL";
+ case SpvDecorationDoublepumpINTEL: return "DoublepumpINTEL";
+ case SpvDecorationMaxReplicatesINTEL: return "MaxReplicatesINTEL";
+ case SpvDecorationSimpleDualPortINTEL: return "SimpleDualPortINTEL";
+ case SpvDecorationMergeINTEL: return "MergeINTEL";
+ case SpvDecorationBankBitsINTEL: return "BankBitsINTEL";
+ case SpvDecorationForcePow2DepthINTEL: return "ForcePow2DepthINTEL";
+ case SpvDecorationStridesizeINTEL: return "StridesizeINTEL";
+ case SpvDecorationWordsizeINTEL: return "WordsizeINTEL";
+ case SpvDecorationTrueDualPortINTEL: return "TrueDualPortINTEL";
+ case SpvDecorationBurstCoalesceINTEL: return "BurstCoalesceINTEL";
+ case SpvDecorationCacheSizeINTEL: return "CacheSizeINTEL";
+ case SpvDecorationDontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL";
+ case SpvDecorationPrefetchINTEL: return "PrefetchINTEL";
+ case SpvDecorationStallEnableINTEL: return "StallEnableINTEL";
+ case SpvDecorationFuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL";
+ case SpvDecorationMathOpDSPModeINTEL: return "MathOpDSPModeINTEL";
+ case SpvDecorationAliasScopeINTEL: return "AliasScopeINTEL";
+ case SpvDecorationNoAliasINTEL: return "NoAliasINTEL";
+ case SpvDecorationInitiationIntervalINTEL: return "InitiationIntervalINTEL";
+ case SpvDecorationMaxConcurrencyINTEL: return "MaxConcurrencyINTEL";
+ case SpvDecorationPipelineEnableINTEL: return "PipelineEnableINTEL";
+ case SpvDecorationBufferLocationINTEL: return "BufferLocationINTEL";
+ case SpvDecorationIOPipeStorageINTEL: return "IOPipeStorageINTEL";
+ case SpvDecorationFunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL";
+ case SpvDecorationSingleElementVectorINTEL: return "SingleElementVectorINTEL";
+ case SpvDecorationVectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL";
+ case SpvDecorationMediaBlockIOINTEL: return "MediaBlockIOINTEL";
+ case SpvDecorationStallFreeINTEL: return "StallFreeINTEL";
+ case SpvDecorationFPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL";
+ case SpvDecorationLatencyControlLabelINTEL: return "LatencyControlLabelINTEL";
+ case SpvDecorationLatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL";
+ case SpvDecorationConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL";
+ case SpvDecorationRegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL";
+ case SpvDecorationMMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL";
+ case SpvDecorationMMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL";
+ case SpvDecorationMMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL";
+ case SpvDecorationMMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL";
+ case SpvDecorationMMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL";
+ case SpvDecorationMMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL";
+ case SpvDecorationStableKernelArgumentINTEL: return "StableKernelArgumentINTEL";
+ case SpvDecorationHostAccessINTEL: return "HostAccessINTEL";
+ case SpvDecorationInitModeINTEL: return "InitModeINTEL";
+ case SpvDecorationImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL";
+ case SpvDecorationConditionalINTEL: return "ConditionalINTEL";
+ case SpvDecorationCacheControlLoadINTEL: return "CacheControlLoadINTEL";
+ case SpvDecorationCacheControlStoreINTEL: return "CacheControlStoreINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvBuiltInToString(SpvBuiltIn value) {
+ switch (value) {
+ case SpvBuiltInPosition: return "Position";
+ case SpvBuiltInPointSize: return "PointSize";
+ case SpvBuiltInClipDistance: return "ClipDistance";
+ case SpvBuiltInCullDistance: return "CullDistance";
+ case SpvBuiltInVertexId: return "VertexId";
+ case SpvBuiltInInstanceId: return "InstanceId";
+ case SpvBuiltInPrimitiveId: return "PrimitiveId";
+ case SpvBuiltInInvocationId: return "InvocationId";
+ case SpvBuiltInLayer: return "Layer";
+ case SpvBuiltInViewportIndex: return "ViewportIndex";
+ case SpvBuiltInTessLevelOuter: return "TessLevelOuter";
+ case SpvBuiltInTessLevelInner: return "TessLevelInner";
+ case SpvBuiltInTessCoord: return "TessCoord";
+ case SpvBuiltInPatchVertices: return "PatchVertices";
+ case SpvBuiltInFragCoord: return "FragCoord";
+ case SpvBuiltInPointCoord: return "PointCoord";
+ case SpvBuiltInFrontFacing: return "FrontFacing";
+ case SpvBuiltInSampleId: return "SampleId";
+ case SpvBuiltInSamplePosition: return "SamplePosition";
+ case SpvBuiltInSampleMask: return "SampleMask";
+ case SpvBuiltInFragDepth: return "FragDepth";
+ case SpvBuiltInHelperInvocation: return "HelperInvocation";
+ case SpvBuiltInNumWorkgroups: return "NumWorkgroups";
+ case SpvBuiltInWorkgroupSize: return "WorkgroupSize";
+ case SpvBuiltInWorkgroupId: return "WorkgroupId";
+ case SpvBuiltInLocalInvocationId: return "LocalInvocationId";
+ case SpvBuiltInGlobalInvocationId: return "GlobalInvocationId";
+ case SpvBuiltInLocalInvocationIndex: return "LocalInvocationIndex";
+ case SpvBuiltInWorkDim: return "WorkDim";
+ case SpvBuiltInGlobalSize: return "GlobalSize";
+ case SpvBuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize";
+ case SpvBuiltInGlobalOffset: return "GlobalOffset";
+ case SpvBuiltInGlobalLinearId: return "GlobalLinearId";
+ case SpvBuiltInSubgroupSize: return "SubgroupSize";
+ case SpvBuiltInSubgroupMaxSize: return "SubgroupMaxSize";
+ case SpvBuiltInNumSubgroups: return "NumSubgroups";
+ case SpvBuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups";
+ case SpvBuiltInSubgroupId: return "SubgroupId";
+ case SpvBuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
+ case SpvBuiltInVertexIndex: return "VertexIndex";
+ case SpvBuiltInInstanceIndex: return "InstanceIndex";
+ case SpvBuiltInCoreIDARM: return "CoreIDARM";
+ case SpvBuiltInCoreCountARM: return "CoreCountARM";
+ case SpvBuiltInCoreMaxIDARM: return "CoreMaxIDARM";
+ case SpvBuiltInWarpIDARM: return "WarpIDARM";
+ case SpvBuiltInWarpMaxIDARM: return "WarpMaxIDARM";
+ case SpvBuiltInSubgroupEqMask: return "SubgroupEqMask";
+ case SpvBuiltInSubgroupGeMask: return "SubgroupGeMask";
+ case SpvBuiltInSubgroupGtMask: return "SubgroupGtMask";
+ case SpvBuiltInSubgroupLeMask: return "SubgroupLeMask";
+ case SpvBuiltInSubgroupLtMask: return "SubgroupLtMask";
+ case SpvBuiltInBaseVertex: return "BaseVertex";
+ case SpvBuiltInBaseInstance: return "BaseInstance";
+ case SpvBuiltInDrawIndex: return "DrawIndex";
+ case SpvBuiltInPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR";
+ case SpvBuiltInDeviceIndex: return "DeviceIndex";
+ case SpvBuiltInViewIndex: return "ViewIndex";
+ case SpvBuiltInShadingRateKHR: return "ShadingRateKHR";
+ case SpvBuiltInTileOffsetQCOM: return "TileOffsetQCOM";
+ case SpvBuiltInTileDimensionQCOM: return "TileDimensionQCOM";
+ case SpvBuiltInTileApronSizeQCOM: return "TileApronSizeQCOM";
+ case SpvBuiltInBaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD";
+ case SpvBuiltInBaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD";
+ case SpvBuiltInBaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD";
+ case SpvBuiltInBaryCoordSmoothAMD: return "BaryCoordSmoothAMD";
+ case SpvBuiltInBaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD";
+ case SpvBuiltInBaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD";
+ case SpvBuiltInBaryCoordPullModelAMD: return "BaryCoordPullModelAMD";
+ case SpvBuiltInFragStencilRefEXT: return "FragStencilRefEXT";
+ case SpvBuiltInRemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX";
+ case SpvBuiltInShaderIndexAMDX: return "ShaderIndexAMDX";
+ case SpvBuiltInViewportMaskNV: return "ViewportMaskNV";
+ case SpvBuiltInSecondaryPositionNV: return "SecondaryPositionNV";
+ case SpvBuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
+ case SpvBuiltInPositionPerViewNV: return "PositionPerViewNV";
+ case SpvBuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
+ case SpvBuiltInFullyCoveredEXT: return "FullyCoveredEXT";
+ case SpvBuiltInTaskCountNV: return "TaskCountNV";
+ case SpvBuiltInPrimitiveCountNV: return "PrimitiveCountNV";
+ case SpvBuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV";
+ case SpvBuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV";
+ case SpvBuiltInCullDistancePerViewNV: return "CullDistancePerViewNV";
+ case SpvBuiltInLayerPerViewNV: return "LayerPerViewNV";
+ case SpvBuiltInMeshViewCountNV: return "MeshViewCountNV";
+ case SpvBuiltInMeshViewIndicesNV: return "MeshViewIndicesNV";
+ case SpvBuiltInBaryCoordKHR: return "BaryCoordKHR";
+ case SpvBuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR";
+ case SpvBuiltInFragSizeEXT: return "FragSizeEXT";
+ case SpvBuiltInFragInvocationCountEXT: return "FragInvocationCountEXT";
+ case SpvBuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT";
+ case SpvBuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
+ case SpvBuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
+ case SpvBuiltInCullPrimitiveEXT: return "CullPrimitiveEXT";
+ case SpvBuiltInLaunchIdKHR: return "LaunchIdKHR";
+ case SpvBuiltInLaunchSizeKHR: return "LaunchSizeKHR";
+ case SpvBuiltInWorldRayOriginKHR: return "WorldRayOriginKHR";
+ case SpvBuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR";
+ case SpvBuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR";
+ case SpvBuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR";
+ case SpvBuiltInRayTminKHR: return "RayTminKHR";
+ case SpvBuiltInRayTmaxKHR: return "RayTmaxKHR";
+ case SpvBuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR";
+ case SpvBuiltInObjectToWorldKHR: return "ObjectToWorldKHR";
+ case SpvBuiltInWorldToObjectKHR: return "WorldToObjectKHR";
+ case SpvBuiltInHitTNV: return "HitTNV";
+ case SpvBuiltInHitKindKHR: return "HitKindKHR";
+ case SpvBuiltInCurrentRayTimeNV: return "CurrentRayTimeNV";
+ case SpvBuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR";
+ case SpvBuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV";
+ case SpvBuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV";
+ case SpvBuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR";
+ case SpvBuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR";
+ case SpvBuiltInHitIsSphereNV: return "HitIsSphereNV";
+ case SpvBuiltInHitIsLSSNV: return "HitIsLSSNV";
+ case SpvBuiltInHitSpherePositionNV: return "HitSpherePositionNV";
+ case SpvBuiltInWarpsPerSMNV: return "WarpsPerSMNV";
+ case SpvBuiltInSMCountNV: return "SMCountNV";
+ case SpvBuiltInWarpIDNV: return "WarpIDNV";
+ case SpvBuiltInSMIDNV: return "SMIDNV";
+ case SpvBuiltInHitLSSPositionsNV: return "HitLSSPositionsNV";
+ case SpvBuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV";
+ case SpvBuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV";
+ case SpvBuiltInHitSphereRadiusNV: return "HitSphereRadiusNV";
+ case SpvBuiltInHitLSSRadiiNV: return "HitLSSRadiiNV";
+ case SpvBuiltInClusterIDNV: return "ClusterIDNV";
+ case SpvBuiltInCullMaskKHR: return "CullMaskKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvScopeToString(SpvScope value) {
+ switch (value) {
+ case SpvScopeCrossDevice: return "CrossDevice";
+ case SpvScopeDevice: return "Device";
+ case SpvScopeWorkgroup: return "Workgroup";
+ case SpvScopeSubgroup: return "Subgroup";
+ case SpvScopeInvocation: return "Invocation";
+ case SpvScopeQueueFamily: return "QueueFamily";
+ case SpvScopeShaderCallKHR: return "ShaderCallKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvGroupOperationToString(SpvGroupOperation value) {
+ switch (value) {
+ case SpvGroupOperationReduce: return "Reduce";
+ case SpvGroupOperationInclusiveScan: return "InclusiveScan";
+ case SpvGroupOperationExclusiveScan: return "ExclusiveScan";
+ case SpvGroupOperationClusteredReduce: return "ClusteredReduce";
+ case SpvGroupOperationPartitionedReduceNV: return "PartitionedReduceNV";
+ case SpvGroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV";
+ case SpvGroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvKernelEnqueueFlagsToString(SpvKernelEnqueueFlags value) {
+ switch (value) {
+ case SpvKernelEnqueueFlagsNoWait: return "NoWait";
+ case SpvKernelEnqueueFlagsWaitKernel: return "WaitKernel";
+ case SpvKernelEnqueueFlagsWaitWorkGroup: return "WaitWorkGroup";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvCapabilityToString(SpvCapability value) {
+ switch (value) {
+ case SpvCapabilityMatrix: return "Matrix";
+ case SpvCapabilityShader: return "Shader";
+ case SpvCapabilityGeometry: return "Geometry";
+ case SpvCapabilityTessellation: return "Tessellation";
+ case SpvCapabilityAddresses: return "Addresses";
+ case SpvCapabilityLinkage: return "Linkage";
+ case SpvCapabilityKernel: return "Kernel";
+ case SpvCapabilityVector16: return "Vector16";
+ case SpvCapabilityFloat16Buffer: return "Float16Buffer";
+ case SpvCapabilityFloat16: return "Float16";
+ case SpvCapabilityFloat64: return "Float64";
+ case SpvCapabilityInt64: return "Int64";
+ case SpvCapabilityInt64Atomics: return "Int64Atomics";
+ case SpvCapabilityImageBasic: return "ImageBasic";
+ case SpvCapabilityImageReadWrite: return "ImageReadWrite";
+ case SpvCapabilityImageMipmap: return "ImageMipmap";
+ case SpvCapabilityPipes: return "Pipes";
+ case SpvCapabilityGroups: return "Groups";
+ case SpvCapabilityDeviceEnqueue: return "DeviceEnqueue";
+ case SpvCapabilityLiteralSampler: return "LiteralSampler";
+ case SpvCapabilityAtomicStorage: return "AtomicStorage";
+ case SpvCapabilityInt16: return "Int16";
+ case SpvCapabilityTessellationPointSize: return "TessellationPointSize";
+ case SpvCapabilityGeometryPointSize: return "GeometryPointSize";
+ case SpvCapabilityImageGatherExtended: return "ImageGatherExtended";
+ case SpvCapabilityStorageImageMultisample: return "StorageImageMultisample";
+ case SpvCapabilityUniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing";
+ case SpvCapabilitySampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing";
+ case SpvCapabilityStorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing";
+ case SpvCapabilityStorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing";
+ case SpvCapabilityClipDistance: return "ClipDistance";
+ case SpvCapabilityCullDistance: return "CullDistance";
+ case SpvCapabilityImageCubeArray: return "ImageCubeArray";
+ case SpvCapabilitySampleRateShading: return "SampleRateShading";
+ case SpvCapabilityImageRect: return "ImageRect";
+ case SpvCapabilitySampledRect: return "SampledRect";
+ case SpvCapabilityGenericPointer: return "GenericPointer";
+ case SpvCapabilityInt8: return "Int8";
+ case SpvCapabilityInputAttachment: return "InputAttachment";
+ case SpvCapabilitySparseResidency: return "SparseResidency";
+ case SpvCapabilityMinLod: return "MinLod";
+ case SpvCapabilitySampled1D: return "Sampled1D";
+ case SpvCapabilityImage1D: return "Image1D";
+ case SpvCapabilitySampledCubeArray: return "SampledCubeArray";
+ case SpvCapabilitySampledBuffer: return "SampledBuffer";
+ case SpvCapabilityImageBuffer: return "ImageBuffer";
+ case SpvCapabilityImageMSArray: return "ImageMSArray";
+ case SpvCapabilityStorageImageExtendedFormats: return "StorageImageExtendedFormats";
+ case SpvCapabilityImageQuery: return "ImageQuery";
+ case SpvCapabilityDerivativeControl: return "DerivativeControl";
+ case SpvCapabilityInterpolationFunction: return "InterpolationFunction";
+ case SpvCapabilityTransformFeedback: return "TransformFeedback";
+ case SpvCapabilityGeometryStreams: return "GeometryStreams";
+ case SpvCapabilityStorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat";
+ case SpvCapabilityStorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat";
+ case SpvCapabilityMultiViewport: return "MultiViewport";
+ case SpvCapabilitySubgroupDispatch: return "SubgroupDispatch";
+ case SpvCapabilityNamedBarrier: return "NamedBarrier";
+ case SpvCapabilityPipeStorage: return "PipeStorage";
+ case SpvCapabilityGroupNonUniform: return "GroupNonUniform";
+ case SpvCapabilityGroupNonUniformVote: return "GroupNonUniformVote";
+ case SpvCapabilityGroupNonUniformArithmetic: return "GroupNonUniformArithmetic";
+ case SpvCapabilityGroupNonUniformBallot: return "GroupNonUniformBallot";
+ case SpvCapabilityGroupNonUniformShuffle: return "GroupNonUniformShuffle";
+ case SpvCapabilityGroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative";
+ case SpvCapabilityGroupNonUniformClustered: return "GroupNonUniformClustered";
+ case SpvCapabilityGroupNonUniformQuad: return "GroupNonUniformQuad";
+ case SpvCapabilityShaderLayer: return "ShaderLayer";
+ case SpvCapabilityShaderViewportIndex: return "ShaderViewportIndex";
+ case SpvCapabilityUniformDecoration: return "UniformDecoration";
+ case SpvCapabilityCoreBuiltinsARM: return "CoreBuiltinsARM";
+ case SpvCapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
+ case SpvCapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
+ case SpvCapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT";
+ case SpvCapabilityTensorsARM: return "TensorsARM";
+ case SpvCapabilityStorageTensorArrayDynamicIndexingARM: return "StorageTensorArrayDynamicIndexingARM";
+ case SpvCapabilityStorageTensorArrayNonUniformIndexingARM: return "StorageTensorArrayNonUniformIndexingARM";
+ case SpvCapabilityGraphARM: return "GraphARM";
+ case SpvCapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM";
+ case SpvCapabilityFloat8EXT: return "Float8EXT";
+ case SpvCapabilityFloat8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT";
+ case SpvCapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR";
+ case SpvCapabilitySubgroupBallotKHR: return "SubgroupBallotKHR";
+ case SpvCapabilityDrawParameters: return "DrawParameters";
+ case SpvCapabilityWorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR";
+ case SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR";
+ case SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR";
+ case SpvCapabilitySubgroupVoteKHR: return "SubgroupVoteKHR";
+ case SpvCapabilityStorageBuffer16BitAccess: return "StorageBuffer16BitAccess";
+ case SpvCapabilityStorageUniform16: return "StorageUniform16";
+ case SpvCapabilityStoragePushConstant16: return "StoragePushConstant16";
+ case SpvCapabilityStorageInputOutput16: return "StorageInputOutput16";
+ case SpvCapabilityDeviceGroup: return "DeviceGroup";
+ case SpvCapabilityMultiView: return "MultiView";
+ case SpvCapabilityVariablePointersStorageBuffer: return "VariablePointersStorageBuffer";
+ case SpvCapabilityVariablePointers: return "VariablePointers";
+ case SpvCapabilityAtomicStorageOps: return "AtomicStorageOps";
+ case SpvCapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage";
+ case SpvCapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess";
+ case SpvCapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess";
+ case SpvCapabilityStoragePushConstant8: return "StoragePushConstant8";
+ case SpvCapabilityDenormPreserve: return "DenormPreserve";
+ case SpvCapabilityDenormFlushToZero: return "DenormFlushToZero";
+ case SpvCapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case SpvCapabilityRoundingModeRTE: return "RoundingModeRTE";
+ case SpvCapabilityRoundingModeRTZ: return "RoundingModeRTZ";
+ case SpvCapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR";
+ case SpvCapabilityRayQueryKHR: return "RayQueryKHR";
+ case SpvCapabilityUntypedPointersKHR: return "UntypedPointersKHR";
+ case SpvCapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR";
+ case SpvCapabilityRayTracingKHR: return "RayTracingKHR";
+ case SpvCapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM";
+ case SpvCapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM";
+ case SpvCapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM";
+ case SpvCapabilityTileShadingQCOM: return "TileShadingQCOM";
+ case SpvCapabilityCooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM";
+ case SpvCapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM";
+ case SpvCapabilityFloat16ImageAMD: return "Float16ImageAMD";
+ case SpvCapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";
+ case SpvCapabilityFragmentMaskAMD: return "FragmentMaskAMD";
+ case SpvCapabilityStencilExportEXT: return "StencilExportEXT";
+ case SpvCapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD";
+ case SpvCapabilityInt64ImageEXT: return "Int64ImageEXT";
+ case SpvCapabilityShaderClockKHR: return "ShaderClockKHR";
+ case SpvCapabilityShaderEnqueueAMDX: return "ShaderEnqueueAMDX";
+ case SpvCapabilityQuadControlKHR: return "QuadControlKHR";
+ case SpvCapabilityInt4TypeINTEL: return "Int4TypeINTEL";
+ case SpvCapabilityInt4CooperativeMatrixINTEL: return "Int4CooperativeMatrixINTEL";
+ case SpvCapabilityBFloat16TypeKHR: return "BFloat16TypeKHR";
+ case SpvCapabilityBFloat16DotProductKHR: return "BFloat16DotProductKHR";
+ case SpvCapabilityBFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR";
+ case SpvCapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV";
+ case SpvCapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV";
+ case SpvCapabilityShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT";
+ case SpvCapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV";
+ case SpvCapabilityShaderStereoViewNV: return "ShaderStereoViewNV";
+ case SpvCapabilityPerViewAttributesNV: return "PerViewAttributesNV";
+ case SpvCapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";
+ case SpvCapabilityMeshShadingNV: return "MeshShadingNV";
+ case SpvCapabilityImageFootprintNV: return "ImageFootprintNV";
+ case SpvCapabilityMeshShadingEXT: return "MeshShadingEXT";
+ case SpvCapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR";
+ case SpvCapabilityComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR";
+ case SpvCapabilityFragmentDensityEXT: return "FragmentDensityEXT";
+ case SpvCapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV";
+ case SpvCapabilityShaderNonUniform: return "ShaderNonUniform";
+ case SpvCapabilityRuntimeDescriptorArray: return "RuntimeDescriptorArray";
+ case SpvCapabilityInputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing";
+ case SpvCapabilityUniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing";
+ case SpvCapabilityStorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing";
+ case SpvCapabilityUniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing";
+ case SpvCapabilitySampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing";
+ case SpvCapabilityStorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing";
+ case SpvCapabilityStorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing";
+ case SpvCapabilityInputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing";
+ case SpvCapabilityUniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing";
+ case SpvCapabilityStorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing";
+ case SpvCapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR";
+ case SpvCapabilityRayTracingNV: return "RayTracingNV";
+ case SpvCapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV";
+ case SpvCapabilityVulkanMemoryModel: return "VulkanMemoryModel";
+ case SpvCapabilityVulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope";
+ case SpvCapabilityPhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses";
+ case SpvCapabilityComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR";
+ case SpvCapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
+ case SpvCapabilityCooperativeMatrixNV: return "CooperativeMatrixNV";
+ case SpvCapabilityFragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT";
+ case SpvCapabilityFragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT";
+ case SpvCapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV";
+ case SpvCapabilityFragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT";
+ case SpvCapabilityDemoteToHelperInvocation: return "DemoteToHelperInvocation";
+ case SpvCapabilityDisplacementMicromapNV: return "DisplacementMicromapNV";
+ case SpvCapabilityRayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT";
+ case SpvCapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV";
+ case SpvCapabilityBindlessTextureNV: return "BindlessTextureNV";
+ case SpvCapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
+ case SpvCapabilityCooperativeVectorNV: return "CooperativeVectorNV";
+ case SpvCapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV";
+ case SpvCapabilityRayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV";
+ case SpvCapabilityRawAccessChainsNV: return "RawAccessChainsNV";
+ case SpvCapabilityRayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV";
+ case SpvCapabilityRayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV";
+ case SpvCapabilityCooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV";
+ case SpvCapabilityCooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV";
+ case SpvCapabilityCooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV";
+ case SpvCapabilityCooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV";
+ case SpvCapabilityCooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV";
+ case SpvCapabilityCooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV";
+ case SpvCapabilityRayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV";
+ case SpvCapabilityTensorAddressingNV: return "TensorAddressingNV";
+ case SpvCapabilitySubgroupShuffleINTEL: return "SubgroupShuffleINTEL";
+ case SpvCapabilitySubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL";
+ case SpvCapabilitySubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL";
+ case SpvCapabilitySubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL";
+ case SpvCapabilityRoundToInfinityINTEL: return "RoundToInfinityINTEL";
+ case SpvCapabilityFloatingPointModeINTEL: return "FloatingPointModeINTEL";
+ case SpvCapabilityIntegerFunctions2INTEL: return "IntegerFunctions2INTEL";
+ case SpvCapabilityFunctionPointersINTEL: return "FunctionPointersINTEL";
+ case SpvCapabilityIndirectReferencesINTEL: return "IndirectReferencesINTEL";
+ case SpvCapabilityAsmINTEL: return "AsmINTEL";
+ case SpvCapabilityAtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT";
+ case SpvCapabilityAtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT";
+ case SpvCapabilityAtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT";
+ case SpvCapabilityVectorComputeINTEL: return "VectorComputeINTEL";
+ case SpvCapabilityVectorAnyINTEL: return "VectorAnyINTEL";
+ case SpvCapabilityExpectAssumeKHR: return "ExpectAssumeKHR";
+ case SpvCapabilitySubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL";
+ case SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL";
+ case SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL";
+ case SpvCapabilityVariableLengthArrayINTEL: return "VariableLengthArrayINTEL";
+ case SpvCapabilityFunctionFloatControlINTEL: return "FunctionFloatControlINTEL";
+ case SpvCapabilityFPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL";
+ case SpvCapabilityFPFastMathModeINTEL: return "FPFastMathModeINTEL";
+ case SpvCapabilityArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL";
+ case SpvCapabilityArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL";
+ case SpvCapabilityUnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL";
+ case SpvCapabilityFPGALoopControlsINTEL: return "FPGALoopControlsINTEL";
+ case SpvCapabilityKernelAttributesINTEL: return "KernelAttributesINTEL";
+ case SpvCapabilityFPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL";
+ case SpvCapabilityFPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL";
+ case SpvCapabilityFPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL";
+ case SpvCapabilityLoopFuseINTEL: return "LoopFuseINTEL";
+ case SpvCapabilityFPGADSPControlINTEL: return "FPGADSPControlINTEL";
+ case SpvCapabilityMemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL";
+ case SpvCapabilityFPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL";
+ case SpvCapabilityFPGABufferLocationINTEL: return "FPGABufferLocationINTEL";
+ case SpvCapabilityArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL";
+ case SpvCapabilityUSMStorageClassesINTEL: return "USMStorageClassesINTEL";
+ case SpvCapabilityRuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL";
+ case SpvCapabilityIOPipesINTEL: return "IOPipesINTEL";
+ case SpvCapabilityBlockingPipesINTEL: return "BlockingPipesINTEL";
+ case SpvCapabilityFPGARegINTEL: return "FPGARegINTEL";
+ case SpvCapabilityDotProductInputAll: return "DotProductInputAll";
+ case SpvCapabilityDotProductInput4x8Bit: return "DotProductInput4x8Bit";
+ case SpvCapabilityDotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked";
+ case SpvCapabilityDotProduct: return "DotProduct";
+ case SpvCapabilityRayCullMaskKHR: return "RayCullMaskKHR";
+ case SpvCapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR";
+ case SpvCapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT";
+ case SpvCapabilityBitInstructions: return "BitInstructions";
+ case SpvCapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR";
+ case SpvCapabilityFloatControls2: return "FloatControls2";
+ case SpvCapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT";
+ case SpvCapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT";
+ case SpvCapabilityLongCompositesINTEL: return "LongCompositesINTEL";
+ case SpvCapabilityOptNoneEXT: return "OptNoneEXT";
+ case SpvCapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT";
+ case SpvCapabilityDebugInfoModuleINTEL: return "DebugInfoModuleINTEL";
+ case SpvCapabilityBFloat16ConversionINTEL: return "BFloat16ConversionINTEL";
+ case SpvCapabilitySplitBarrierINTEL: return "SplitBarrierINTEL";
+ case SpvCapabilityArithmeticFenceEXT: return "ArithmeticFenceEXT";
+ case SpvCapabilityFPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL";
+ case SpvCapabilityFPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL";
+ case SpvCapabilityTaskSequenceINTEL: return "TaskSequenceINTEL";
+ case SpvCapabilityFPMaxErrorINTEL: return "FPMaxErrorINTEL";
+ case SpvCapabilityFPGALatencyControlINTEL: return "FPGALatencyControlINTEL";
+ case SpvCapabilityFPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL";
+ case SpvCapabilityGlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL";
+ case SpvCapabilityGlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL";
+ case SpvCapabilitySubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL";
+ case SpvCapabilitySubgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL";
+ case SpvCapabilitySubgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL";
+ case SpvCapabilitySubgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL";
+ case SpvCapabilitySubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL";
+ case SpvCapabilityTernaryBitwiseFunctionINTEL: return "TernaryBitwiseFunctionINTEL";
+ case SpvCapabilitySpecConditionalINTEL: return "SpecConditionalINTEL";
+ case SpvCapabilityFunctionVariantsINTEL: return "FunctionVariantsINTEL";
+ case SpvCapabilityGroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR";
+ case SpvCapabilityTensorFloat32RoundingINTEL: return "TensorFloat32RoundingINTEL";
+ case SpvCapabilityMaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL";
+ case SpvCapabilityCacheControlsINTEL: return "CacheControlsINTEL";
+ case SpvCapabilityRegisterLimitsINTEL: return "RegisterLimitsINTEL";
+ case SpvCapabilityBindlessImagesINTEL: return "BindlessImagesINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvRayQueryIntersectionToString(SpvRayQueryIntersection value) {
+ switch (value) {
+ case SpvRayQueryIntersectionRayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR";
+ case SpvRayQueryIntersectionRayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvRayQueryCommittedIntersectionTypeToString(SpvRayQueryCommittedIntersectionType value) {
+ switch (value) {
+ case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR";
+ case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR";
+ case SpvRayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvRayQueryCandidateIntersectionTypeToString(SpvRayQueryCandidateIntersectionType value) {
+ switch (value) {
+ case SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR";
+ case SpvRayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvFPDenormModeToString(SpvFPDenormMode value) {
+ switch (value) {
+ case SpvFPDenormModePreserve: return "Preserve";
+ case SpvFPDenormModeFlushToZero: return "FlushToZero";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvFPOperationModeToString(SpvFPOperationMode value) {
+ switch (value) {
+ case SpvFPOperationModeIEEE: return "IEEE";
+ case SpvFPOperationModeALT: return "ALT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvQuantizationModesToString(SpvQuantizationModes value) {
+ switch (value) {
+ case SpvQuantizationModesTRN: return "TRN";
+ case SpvQuantizationModesTRN_ZERO: return "TRN_ZERO";
+ case SpvQuantizationModesRND: return "RND";
+ case SpvQuantizationModesRND_ZERO: return "RND_ZERO";
+ case SpvQuantizationModesRND_INF: return "RND_INF";
+ case SpvQuantizationModesRND_MIN_INF: return "RND_MIN_INF";
+ case SpvQuantizationModesRND_CONV: return "RND_CONV";
+ case SpvQuantizationModesRND_CONV_ODD: return "RND_CONV_ODD";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvOverflowModesToString(SpvOverflowModes value) {
+ switch (value) {
+ case SpvOverflowModesWRAP: return "WRAP";
+ case SpvOverflowModesSAT: return "SAT";
+ case SpvOverflowModesSAT_ZERO: return "SAT_ZERO";
+ case SpvOverflowModesSAT_SYM: return "SAT_SYM";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvPackedVectorFormatToString(SpvPackedVectorFormat value) {
+ switch (value) {
+ case SpvPackedVectorFormatPackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvCooperativeMatrixLayoutToString(SpvCooperativeMatrixLayout value) {
+ switch (value) {
+ case SpvCooperativeMatrixLayoutRowMajorKHR: return "RowMajorKHR";
+ case SpvCooperativeMatrixLayoutColumnMajorKHR: return "ColumnMajorKHR";
+ case SpvCooperativeMatrixLayoutRowBlockedInterleavedARM: return "RowBlockedInterleavedARM";
+ case SpvCooperativeMatrixLayoutColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvCooperativeMatrixUseToString(SpvCooperativeMatrixUse value) {
+ switch (value) {
+ case SpvCooperativeMatrixUseMatrixAKHR: return "MatrixAKHR";
+ case SpvCooperativeMatrixUseMatrixBKHR: return "MatrixBKHR";
+ case SpvCooperativeMatrixUseMatrixAccumulatorKHR: return "MatrixAccumulatorKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvTensorClampModeToString(SpvTensorClampMode value) {
+ switch (value) {
+ case SpvTensorClampModeUndefined: return "Undefined";
+ case SpvTensorClampModeConstant: return "Constant";
+ case SpvTensorClampModeClampToEdge: return "ClampToEdge";
+ case SpvTensorClampModeRepeat: return "Repeat";
+ case SpvTensorClampModeRepeatMirrored: return "RepeatMirrored";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvInitializationModeQualifierToString(SpvInitializationModeQualifier value) {
+ switch (value) {
+ case SpvInitializationModeQualifierInitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL";
+ case SpvInitializationModeQualifierInitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvHostAccessQualifierToString(SpvHostAccessQualifier value) {
+ switch (value) {
+ case SpvHostAccessQualifierNoneINTEL: return "NoneINTEL";
+ case SpvHostAccessQualifierReadINTEL: return "ReadINTEL";
+ case SpvHostAccessQualifierWriteINTEL: return "WriteINTEL";
+ case SpvHostAccessQualifierReadWriteINTEL: return "ReadWriteINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvLoadCacheControlToString(SpvLoadCacheControl value) {
+ switch (value) {
+ case SpvLoadCacheControlUncachedINTEL: return "UncachedINTEL";
+ case SpvLoadCacheControlCachedINTEL: return "CachedINTEL";
+ case SpvLoadCacheControlStreamingINTEL: return "StreamingINTEL";
+ case SpvLoadCacheControlInvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL";
+ case SpvLoadCacheControlConstCachedINTEL: return "ConstCachedINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvStoreCacheControlToString(SpvStoreCacheControl value) {
+ switch (value) {
+ case SpvStoreCacheControlUncachedINTEL: return "UncachedINTEL";
+ case SpvStoreCacheControlWriteThroughINTEL: return "WriteThroughINTEL";
+ case SpvStoreCacheControlWriteBackINTEL: return "WriteBackINTEL";
+ case SpvStoreCacheControlStreamingINTEL: return "StreamingINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvNamedMaximumNumberOfRegistersToString(SpvNamedMaximumNumberOfRegisters value) {
+ switch (value) {
+ case SpvNamedMaximumNumberOfRegistersAutoINTEL: return "AutoINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvFPEncodingToString(SpvFPEncoding value) {
+ switch (value) {
+ case SpvFPEncodingBFloat16KHR: return "BFloat16KHR";
+ case SpvFPEncodingFloat8E4M3EXT: return "Float8E4M3EXT";
+ case SpvFPEncodingFloat8E5M2EXT: return "Float8E5M2EXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvCooperativeVectorMatrixLayoutToString(SpvCooperativeVectorMatrixLayout value) {
+ switch (value) {
+ case SpvCooperativeVectorMatrixLayoutRowMajorNV: return "RowMajorNV";
+ case SpvCooperativeVectorMatrixLayoutColumnMajorNV: return "ColumnMajorNV";
+ case SpvCooperativeVectorMatrixLayoutInferencingOptimalNV: return "InferencingOptimalNV";
+ case SpvCooperativeVectorMatrixLayoutTrainingOptimalNV: return "TrainingOptimalNV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvComponentTypeToString(SpvComponentType value) {
+ switch (value) {
+ case SpvComponentTypeFloat16NV: return "Float16NV";
+ case SpvComponentTypeFloat32NV: return "Float32NV";
+ case SpvComponentTypeFloat64NV: return "Float64NV";
+ case SpvComponentTypeSignedInt8NV: return "SignedInt8NV";
+ case SpvComponentTypeSignedInt16NV: return "SignedInt16NV";
+ case SpvComponentTypeSignedInt32NV: return "SignedInt32NV";
+ case SpvComponentTypeSignedInt64NV: return "SignedInt64NV";
+ case SpvComponentTypeUnsignedInt8NV: return "UnsignedInt8NV";
+ case SpvComponentTypeUnsignedInt16NV: return "UnsignedInt16NV";
+ case SpvComponentTypeUnsignedInt32NV: return "UnsignedInt32NV";
+ case SpvComponentTypeUnsignedInt64NV: return "UnsignedInt64NV";
+ case SpvComponentTypeSignedInt8PackedNV: return "SignedInt8PackedNV";
+ case SpvComponentTypeUnsignedInt8PackedNV: return "UnsignedInt8PackedNV";
+ case SpvComponentTypeFloatE4M3NV: return "FloatE4M3NV";
+ case SpvComponentTypeFloatE5M2NV: return "FloatE5M2NV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SpvOpToString(SpvOp value) {
+ switch (value) {
+ case SpvOpNop: return "OpNop";
+ case SpvOpUndef: return "OpUndef";
+ case SpvOpSourceContinued: return "OpSourceContinued";
+ case SpvOpSource: return "OpSource";
+ case SpvOpSourceExtension: return "OpSourceExtension";
+ case SpvOpName: return "OpName";
+ case SpvOpMemberName: return "OpMemberName";
+ case SpvOpString: return "OpString";
+ case SpvOpLine: return "OpLine";
+ case SpvOpExtension: return "OpExtension";
+ case SpvOpExtInstImport: return "OpExtInstImport";
+ case SpvOpExtInst: return "OpExtInst";
+ case SpvOpMemoryModel: return "OpMemoryModel";
+ case SpvOpEntryPoint: return "OpEntryPoint";
+ case SpvOpExecutionMode: return "OpExecutionMode";
+ case SpvOpCapability: return "OpCapability";
+ case SpvOpTypeVoid: return "OpTypeVoid";
+ case SpvOpTypeBool: return "OpTypeBool";
+ case SpvOpTypeInt: return "OpTypeInt";
+ case SpvOpTypeFloat: return "OpTypeFloat";
+ case SpvOpTypeVector: return "OpTypeVector";
+ case SpvOpTypeMatrix: return "OpTypeMatrix";
+ case SpvOpTypeImage: return "OpTypeImage";
+ case SpvOpTypeSampler: return "OpTypeSampler";
+ case SpvOpTypeSampledImage: return "OpTypeSampledImage";
+ case SpvOpTypeArray: return "OpTypeArray";
+ case SpvOpTypeRuntimeArray: return "OpTypeRuntimeArray";
+ case SpvOpTypeStruct: return "OpTypeStruct";
+ case SpvOpTypeOpaque: return "OpTypeOpaque";
+ case SpvOpTypePointer: return "OpTypePointer";
+ case SpvOpTypeFunction: return "OpTypeFunction";
+ case SpvOpTypeEvent: return "OpTypeEvent";
+ case SpvOpTypeDeviceEvent: return "OpTypeDeviceEvent";
+ case SpvOpTypeReserveId: return "OpTypeReserveId";
+ case SpvOpTypeQueue: return "OpTypeQueue";
+ case SpvOpTypePipe: return "OpTypePipe";
+ case SpvOpTypeForwardPointer: return "OpTypeForwardPointer";
+ case SpvOpConstantTrue: return "OpConstantTrue";
+ case SpvOpConstantFalse: return "OpConstantFalse";
+ case SpvOpConstant: return "OpConstant";
+ case SpvOpConstantComposite: return "OpConstantComposite";
+ case SpvOpConstantSampler: return "OpConstantSampler";
+ case SpvOpConstantNull: return "OpConstantNull";
+ case SpvOpSpecConstantTrue: return "OpSpecConstantTrue";
+ case SpvOpSpecConstantFalse: return "OpSpecConstantFalse";
+ case SpvOpSpecConstant: return "OpSpecConstant";
+ case SpvOpSpecConstantComposite: return "OpSpecConstantComposite";
+ case SpvOpSpecConstantOp: return "OpSpecConstantOp";
+ case SpvOpFunction: return "OpFunction";
+ case SpvOpFunctionParameter: return "OpFunctionParameter";
+ case SpvOpFunctionEnd: return "OpFunctionEnd";
+ case SpvOpFunctionCall: return "OpFunctionCall";
+ case SpvOpVariable: return "OpVariable";
+ case SpvOpImageTexelPointer: return "OpImageTexelPointer";
+ case SpvOpLoad: return "OpLoad";
+ case SpvOpStore: return "OpStore";
+ case SpvOpCopyMemory: return "OpCopyMemory";
+ case SpvOpCopyMemorySized: return "OpCopyMemorySized";
+ case SpvOpAccessChain: return "OpAccessChain";
+ case SpvOpInBoundsAccessChain: return "OpInBoundsAccessChain";
+ case SpvOpPtrAccessChain: return "OpPtrAccessChain";
+ case SpvOpArrayLength: return "OpArrayLength";
+ case SpvOpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics";
+ case SpvOpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain";
+ case SpvOpDecorate: return "OpDecorate";
+ case SpvOpMemberDecorate: return "OpMemberDecorate";
+ case SpvOpDecorationGroup: return "OpDecorationGroup";
+ case SpvOpGroupDecorate: return "OpGroupDecorate";
+ case SpvOpGroupMemberDecorate: return "OpGroupMemberDecorate";
+ case SpvOpVectorExtractDynamic: return "OpVectorExtractDynamic";
+ case SpvOpVectorInsertDynamic: return "OpVectorInsertDynamic";
+ case SpvOpVectorShuffle: return "OpVectorShuffle";
+ case SpvOpCompositeConstruct: return "OpCompositeConstruct";
+ case SpvOpCompositeExtract: return "OpCompositeExtract";
+ case SpvOpCompositeInsert: return "OpCompositeInsert";
+ case SpvOpCopyObject: return "OpCopyObject";
+ case SpvOpTranspose: return "OpTranspose";
+ case SpvOpSampledImage: return "OpSampledImage";
+ case SpvOpImageSampleImplicitLod: return "OpImageSampleImplicitLod";
+ case SpvOpImageSampleExplicitLod: return "OpImageSampleExplicitLod";
+ case SpvOpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod";
+ case SpvOpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod";
+ case SpvOpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod";
+ case SpvOpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod";
+ case SpvOpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod";
+ case SpvOpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod";
+ case SpvOpImageFetch: return "OpImageFetch";
+ case SpvOpImageGather: return "OpImageGather";
+ case SpvOpImageDrefGather: return "OpImageDrefGather";
+ case SpvOpImageRead: return "OpImageRead";
+ case SpvOpImageWrite: return "OpImageWrite";
+ case SpvOpImage: return "OpImage";
+ case SpvOpImageQueryFormat: return "OpImageQueryFormat";
+ case SpvOpImageQueryOrder: return "OpImageQueryOrder";
+ case SpvOpImageQuerySizeLod: return "OpImageQuerySizeLod";
+ case SpvOpImageQuerySize: return "OpImageQuerySize";
+ case SpvOpImageQueryLod: return "OpImageQueryLod";
+ case SpvOpImageQueryLevels: return "OpImageQueryLevels";
+ case SpvOpImageQuerySamples: return "OpImageQuerySamples";
+ case SpvOpConvertFToU: return "OpConvertFToU";
+ case SpvOpConvertFToS: return "OpConvertFToS";
+ case SpvOpConvertSToF: return "OpConvertSToF";
+ case SpvOpConvertUToF: return "OpConvertUToF";
+ case SpvOpUConvert: return "OpUConvert";
+ case SpvOpSConvert: return "OpSConvert";
+ case SpvOpFConvert: return "OpFConvert";
+ case SpvOpQuantizeToF16: return "OpQuantizeToF16";
+ case SpvOpConvertPtrToU: return "OpConvertPtrToU";
+ case SpvOpSatConvertSToU: return "OpSatConvertSToU";
+ case SpvOpSatConvertUToS: return "OpSatConvertUToS";
+ case SpvOpConvertUToPtr: return "OpConvertUToPtr";
+ case SpvOpPtrCastToGeneric: return "OpPtrCastToGeneric";
+ case SpvOpGenericCastToPtr: return "OpGenericCastToPtr";
+ case SpvOpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit";
+ case SpvOpBitcast: return "OpBitcast";
+ case SpvOpSNegate: return "OpSNegate";
+ case SpvOpFNegate: return "OpFNegate";
+ case SpvOpIAdd: return "OpIAdd";
+ case SpvOpFAdd: return "OpFAdd";
+ case SpvOpISub: return "OpISub";
+ case SpvOpFSub: return "OpFSub";
+ case SpvOpIMul: return "OpIMul";
+ case SpvOpFMul: return "OpFMul";
+ case SpvOpUDiv: return "OpUDiv";
+ case SpvOpSDiv: return "OpSDiv";
+ case SpvOpFDiv: return "OpFDiv";
+ case SpvOpUMod: return "OpUMod";
+ case SpvOpSRem: return "OpSRem";
+ case SpvOpSMod: return "OpSMod";
+ case SpvOpFRem: return "OpFRem";
+ case SpvOpFMod: return "OpFMod";
+ case SpvOpVectorTimesScalar: return "OpVectorTimesScalar";
+ case SpvOpMatrixTimesScalar: return "OpMatrixTimesScalar";
+ case SpvOpVectorTimesMatrix: return "OpVectorTimesMatrix";
+ case SpvOpMatrixTimesVector: return "OpMatrixTimesVector";
+ case SpvOpMatrixTimesMatrix: return "OpMatrixTimesMatrix";
+ case SpvOpOuterProduct: return "OpOuterProduct";
+ case SpvOpDot: return "OpDot";
+ case SpvOpIAddCarry: return "OpIAddCarry";
+ case SpvOpISubBorrow: return "OpISubBorrow";
+ case SpvOpUMulExtended: return "OpUMulExtended";
+ case SpvOpSMulExtended: return "OpSMulExtended";
+ case SpvOpAny: return "OpAny";
+ case SpvOpAll: return "OpAll";
+ case SpvOpIsNan: return "OpIsNan";
+ case SpvOpIsInf: return "OpIsInf";
+ case SpvOpIsFinite: return "OpIsFinite";
+ case SpvOpIsNormal: return "OpIsNormal";
+ case SpvOpSignBitSet: return "OpSignBitSet";
+ case SpvOpLessOrGreater: return "OpLessOrGreater";
+ case SpvOpOrdered: return "OpOrdered";
+ case SpvOpUnordered: return "OpUnordered";
+ case SpvOpLogicalEqual: return "OpLogicalEqual";
+ case SpvOpLogicalNotEqual: return "OpLogicalNotEqual";
+ case SpvOpLogicalOr: return "OpLogicalOr";
+ case SpvOpLogicalAnd: return "OpLogicalAnd";
+ case SpvOpLogicalNot: return "OpLogicalNot";
+ case SpvOpSelect: return "OpSelect";
+ case SpvOpIEqual: return "OpIEqual";
+ case SpvOpINotEqual: return "OpINotEqual";
+ case SpvOpUGreaterThan: return "OpUGreaterThan";
+ case SpvOpSGreaterThan: return "OpSGreaterThan";
+ case SpvOpUGreaterThanEqual: return "OpUGreaterThanEqual";
+ case SpvOpSGreaterThanEqual: return "OpSGreaterThanEqual";
+ case SpvOpULessThan: return "OpULessThan";
+ case SpvOpSLessThan: return "OpSLessThan";
+ case SpvOpULessThanEqual: return "OpULessThanEqual";
+ case SpvOpSLessThanEqual: return "OpSLessThanEqual";
+ case SpvOpFOrdEqual: return "OpFOrdEqual";
+ case SpvOpFUnordEqual: return "OpFUnordEqual";
+ case SpvOpFOrdNotEqual: return "OpFOrdNotEqual";
+ case SpvOpFUnordNotEqual: return "OpFUnordNotEqual";
+ case SpvOpFOrdLessThan: return "OpFOrdLessThan";
+ case SpvOpFUnordLessThan: return "OpFUnordLessThan";
+ case SpvOpFOrdGreaterThan: return "OpFOrdGreaterThan";
+ case SpvOpFUnordGreaterThan: return "OpFUnordGreaterThan";
+ case SpvOpFOrdLessThanEqual: return "OpFOrdLessThanEqual";
+ case SpvOpFUnordLessThanEqual: return "OpFUnordLessThanEqual";
+ case SpvOpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual";
+ case SpvOpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual";
+ case SpvOpShiftRightLogical: return "OpShiftRightLogical";
+ case SpvOpShiftRightArithmetic: return "OpShiftRightArithmetic";
+ case SpvOpShiftLeftLogical: return "OpShiftLeftLogical";
+ case SpvOpBitwiseOr: return "OpBitwiseOr";
+ case SpvOpBitwiseXor: return "OpBitwiseXor";
+ case SpvOpBitwiseAnd: return "OpBitwiseAnd";
+ case SpvOpNot: return "OpNot";
+ case SpvOpBitFieldInsert: return "OpBitFieldInsert";
+ case SpvOpBitFieldSExtract: return "OpBitFieldSExtract";
+ case SpvOpBitFieldUExtract: return "OpBitFieldUExtract";
+ case SpvOpBitReverse: return "OpBitReverse";
+ case SpvOpBitCount: return "OpBitCount";
+ case SpvOpDPdx: return "OpDPdx";
+ case SpvOpDPdy: return "OpDPdy";
+ case SpvOpFwidth: return "OpFwidth";
+ case SpvOpDPdxFine: return "OpDPdxFine";
+ case SpvOpDPdyFine: return "OpDPdyFine";
+ case SpvOpFwidthFine: return "OpFwidthFine";
+ case SpvOpDPdxCoarse: return "OpDPdxCoarse";
+ case SpvOpDPdyCoarse: return "OpDPdyCoarse";
+ case SpvOpFwidthCoarse: return "OpFwidthCoarse";
+ case SpvOpEmitVertex: return "OpEmitVertex";
+ case SpvOpEndPrimitive: return "OpEndPrimitive";
+ case SpvOpEmitStreamVertex: return "OpEmitStreamVertex";
+ case SpvOpEndStreamPrimitive: return "OpEndStreamPrimitive";
+ case SpvOpControlBarrier: return "OpControlBarrier";
+ case SpvOpMemoryBarrier: return "OpMemoryBarrier";
+ case SpvOpAtomicLoad: return "OpAtomicLoad";
+ case SpvOpAtomicStore: return "OpAtomicStore";
+ case SpvOpAtomicExchange: return "OpAtomicExchange";
+ case SpvOpAtomicCompareExchange: return "OpAtomicCompareExchange";
+ case SpvOpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak";
+ case SpvOpAtomicIIncrement: return "OpAtomicIIncrement";
+ case SpvOpAtomicIDecrement: return "OpAtomicIDecrement";
+ case SpvOpAtomicIAdd: return "OpAtomicIAdd";
+ case SpvOpAtomicISub: return "OpAtomicISub";
+ case SpvOpAtomicSMin: return "OpAtomicSMin";
+ case SpvOpAtomicUMin: return "OpAtomicUMin";
+ case SpvOpAtomicSMax: return "OpAtomicSMax";
+ case SpvOpAtomicUMax: return "OpAtomicUMax";
+ case SpvOpAtomicAnd: return "OpAtomicAnd";
+ case SpvOpAtomicOr: return "OpAtomicOr";
+ case SpvOpAtomicXor: return "OpAtomicXor";
+ case SpvOpPhi: return "OpPhi";
+ case SpvOpLoopMerge: return "OpLoopMerge";
+ case SpvOpSelectionMerge: return "OpSelectionMerge";
+ case SpvOpLabel: return "OpLabel";
+ case SpvOpBranch: return "OpBranch";
+ case SpvOpBranchConditional: return "OpBranchConditional";
+ case SpvOpSwitch: return "OpSwitch";
+ case SpvOpKill: return "OpKill";
+ case SpvOpReturn: return "OpReturn";
+ case SpvOpReturnValue: return "OpReturnValue";
+ case SpvOpUnreachable: return "OpUnreachable";
+ case SpvOpLifetimeStart: return "OpLifetimeStart";
+ case SpvOpLifetimeStop: return "OpLifetimeStop";
+ case SpvOpGroupAsyncCopy: return "OpGroupAsyncCopy";
+ case SpvOpGroupWaitEvents: return "OpGroupWaitEvents";
+ case SpvOpGroupAll: return "OpGroupAll";
+ case SpvOpGroupAny: return "OpGroupAny";
+ case SpvOpGroupBroadcast: return "OpGroupBroadcast";
+ case SpvOpGroupIAdd: return "OpGroupIAdd";
+ case SpvOpGroupFAdd: return "OpGroupFAdd";
+ case SpvOpGroupFMin: return "OpGroupFMin";
+ case SpvOpGroupUMin: return "OpGroupUMin";
+ case SpvOpGroupSMin: return "OpGroupSMin";
+ case SpvOpGroupFMax: return "OpGroupFMax";
+ case SpvOpGroupUMax: return "OpGroupUMax";
+ case SpvOpGroupSMax: return "OpGroupSMax";
+ case SpvOpReadPipe: return "OpReadPipe";
+ case SpvOpWritePipe: return "OpWritePipe";
+ case SpvOpReservedReadPipe: return "OpReservedReadPipe";
+ case SpvOpReservedWritePipe: return "OpReservedWritePipe";
+ case SpvOpReserveReadPipePackets: return "OpReserveReadPipePackets";
+ case SpvOpReserveWritePipePackets: return "OpReserveWritePipePackets";
+ case SpvOpCommitReadPipe: return "OpCommitReadPipe";
+ case SpvOpCommitWritePipe: return "OpCommitWritePipe";
+ case SpvOpIsValidReserveId: return "OpIsValidReserveId";
+ case SpvOpGetNumPipePackets: return "OpGetNumPipePackets";
+ case SpvOpGetMaxPipePackets: return "OpGetMaxPipePackets";
+ case SpvOpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets";
+ case SpvOpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets";
+ case SpvOpGroupCommitReadPipe: return "OpGroupCommitReadPipe";
+ case SpvOpGroupCommitWritePipe: return "OpGroupCommitWritePipe";
+ case SpvOpEnqueueMarker: return "OpEnqueueMarker";
+ case SpvOpEnqueueKernel: return "OpEnqueueKernel";
+ case SpvOpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount";
+ case SpvOpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize";
+ case SpvOpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize";
+ case SpvOpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple";
+ case SpvOpRetainEvent: return "OpRetainEvent";
+ case SpvOpReleaseEvent: return "OpReleaseEvent";
+ case SpvOpCreateUserEvent: return "OpCreateUserEvent";
+ case SpvOpIsValidEvent: return "OpIsValidEvent";
+ case SpvOpSetUserEventStatus: return "OpSetUserEventStatus";
+ case SpvOpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo";
+ case SpvOpGetDefaultQueue: return "OpGetDefaultQueue";
+ case SpvOpBuildNDRange: return "OpBuildNDRange";
+ case SpvOpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod";
+ case SpvOpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod";
+ case SpvOpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod";
+ case SpvOpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod";
+ case SpvOpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod";
+ case SpvOpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod";
+ case SpvOpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod";
+ case SpvOpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod";
+ case SpvOpImageSparseFetch: return "OpImageSparseFetch";
+ case SpvOpImageSparseGather: return "OpImageSparseGather";
+ case SpvOpImageSparseDrefGather: return "OpImageSparseDrefGather";
+ case SpvOpImageSparseTexelsResident: return "OpImageSparseTexelsResident";
+ case SpvOpNoLine: return "OpNoLine";
+ case SpvOpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet";
+ case SpvOpAtomicFlagClear: return "OpAtomicFlagClear";
+ case SpvOpImageSparseRead: return "OpImageSparseRead";
+ case SpvOpSizeOf: return "OpSizeOf";
+ case SpvOpTypePipeStorage: return "OpTypePipeStorage";
+ case SpvOpConstantPipeStorage: return "OpConstantPipeStorage";
+ case SpvOpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage";
+ case SpvOpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount";
+ case SpvOpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups";
+ case SpvOpTypeNamedBarrier: return "OpTypeNamedBarrier";
+ case SpvOpNamedBarrierInitialize: return "OpNamedBarrierInitialize";
+ case SpvOpMemoryNamedBarrier: return "OpMemoryNamedBarrier";
+ case SpvOpModuleProcessed: return "OpModuleProcessed";
+ case SpvOpExecutionModeId: return "OpExecutionModeId";
+ case SpvOpDecorateId: return "OpDecorateId";
+ case SpvOpGroupNonUniformElect: return "OpGroupNonUniformElect";
+ case SpvOpGroupNonUniformAll: return "OpGroupNonUniformAll";
+ case SpvOpGroupNonUniformAny: return "OpGroupNonUniformAny";
+ case SpvOpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual";
+ case SpvOpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast";
+ case SpvOpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst";
+ case SpvOpGroupNonUniformBallot: return "OpGroupNonUniformBallot";
+ case SpvOpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot";
+ case SpvOpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract";
+ case SpvOpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount";
+ case SpvOpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB";
+ case SpvOpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB";
+ case SpvOpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle";
+ case SpvOpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor";
+ case SpvOpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp";
+ case SpvOpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown";
+ case SpvOpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd";
+ case SpvOpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd";
+ case SpvOpGroupNonUniformIMul: return "OpGroupNonUniformIMul";
+ case SpvOpGroupNonUniformFMul: return "OpGroupNonUniformFMul";
+ case SpvOpGroupNonUniformSMin: return "OpGroupNonUniformSMin";
+ case SpvOpGroupNonUniformUMin: return "OpGroupNonUniformUMin";
+ case SpvOpGroupNonUniformFMin: return "OpGroupNonUniformFMin";
+ case SpvOpGroupNonUniformSMax: return "OpGroupNonUniformSMax";
+ case SpvOpGroupNonUniformUMax: return "OpGroupNonUniformUMax";
+ case SpvOpGroupNonUniformFMax: return "OpGroupNonUniformFMax";
+ case SpvOpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd";
+ case SpvOpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr";
+ case SpvOpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor";
+ case SpvOpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd";
+ case SpvOpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr";
+ case SpvOpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor";
+ case SpvOpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast";
+ case SpvOpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap";
+ case SpvOpCopyLogical: return "OpCopyLogical";
+ case SpvOpPtrEqual: return "OpPtrEqual";
+ case SpvOpPtrNotEqual: return "OpPtrNotEqual";
+ case SpvOpPtrDiff: return "OpPtrDiff";
+ case SpvOpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
+ case SpvOpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
+ case SpvOpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
+ case SpvOpTypeTensorARM: return "OpTypeTensorARM";
+ case SpvOpTensorReadARM: return "OpTensorReadARM";
+ case SpvOpTensorWriteARM: return "OpTensorWriteARM";
+ case SpvOpTensorQuerySizeARM: return "OpTensorQuerySizeARM";
+ case SpvOpGraphConstantARM: return "OpGraphConstantARM";
+ case SpvOpGraphEntryPointARM: return "OpGraphEntryPointARM";
+ case SpvOpGraphARM: return "OpGraphARM";
+ case SpvOpGraphInputARM: return "OpGraphInputARM";
+ case SpvOpGraphSetOutputARM: return "OpGraphSetOutputARM";
+ case SpvOpGraphEndARM: return "OpGraphEndARM";
+ case SpvOpTypeGraphARM: return "OpTypeGraphARM";
+ case SpvOpTerminateInvocation: return "OpTerminateInvocation";
+ case SpvOpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR";
+ case SpvOpUntypedVariableKHR: return "OpUntypedVariableKHR";
+ case SpvOpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR";
+ case SpvOpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR";
+ case SpvOpSubgroupBallotKHR: return "OpSubgroupBallotKHR";
+ case SpvOpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR";
+ case SpvOpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR";
+ case SpvOpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR";
+ case SpvOpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR";
+ case SpvOpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR";
+ case SpvOpSubgroupAllKHR: return "OpSubgroupAllKHR";
+ case SpvOpSubgroupAnyKHR: return "OpSubgroupAnyKHR";
+ case SpvOpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR";
+ case SpvOpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR";
+ case SpvOpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR";
+ case SpvOpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR";
+ case SpvOpUntypedGroupAsyncCopyKHR: return "OpUntypedGroupAsyncCopyKHR";
+ case SpvOpTraceRayKHR: return "OpTraceRayKHR";
+ case SpvOpExecuteCallableKHR: return "OpExecuteCallableKHR";
+ case SpvOpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR";
+ case SpvOpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR";
+ case SpvOpTerminateRayKHR: return "OpTerminateRayKHR";
+ case SpvOpSDot: return "OpSDot";
+ case SpvOpUDot: return "OpUDot";
+ case SpvOpSUDot: return "OpSUDot";
+ case SpvOpSDotAccSat: return "OpSDotAccSat";
+ case SpvOpUDotAccSat: return "OpUDotAccSat";
+ case SpvOpSUDotAccSat: return "OpSUDotAccSat";
+ case SpvOpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR";
+ case SpvOpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR";
+ case SpvOpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR";
+ case SpvOpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR";
+ case SpvOpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR";
+ case SpvOpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT";
+ case SpvOpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT";
+ case SpvOpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT";
+ case SpvOpTypeRayQueryKHR: return "OpTypeRayQueryKHR";
+ case SpvOpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR";
+ case SpvOpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR";
+ case SpvOpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR";
+ case SpvOpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR";
+ case SpvOpRayQueryProceedKHR: return "OpRayQueryProceedKHR";
+ case SpvOpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR";
+ case SpvOpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM";
+ case SpvOpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM";
+ case SpvOpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM";
+ case SpvOpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM";
+ case SpvOpBitCastArrayQCOM: return "OpBitCastArrayQCOM";
+ case SpvOpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM";
+ case SpvOpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM";
+ case SpvOpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM";
+ case SpvOpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM";
+ case SpvOpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM";
+ case SpvOpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM";
+ case SpvOpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM";
+ case SpvOpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD";
+ case SpvOpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD";
+ case SpvOpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD";
+ case SpvOpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD";
+ case SpvOpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD";
+ case SpvOpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD";
+ case SpvOpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD";
+ case SpvOpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD";
+ case SpvOpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD";
+ case SpvOpFragmentFetchAMD: return "OpFragmentFetchAMD";
+ case SpvOpReadClockKHR: return "OpReadClockKHR";
+ case SpvOpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX";
+ case SpvOpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX";
+ case SpvOpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX";
+ case SpvOpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX";
+ case SpvOpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX";
+ case SpvOpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX";
+ case SpvOpConstantStringAMDX: return "OpConstantStringAMDX";
+ case SpvOpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX";
+ case SpvOpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR";
+ case SpvOpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR";
+ case SpvOpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV";
+ case SpvOpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV";
+ case SpvOpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV";
+ case SpvOpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV";
+ case SpvOpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV";
+ case SpvOpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV";
+ case SpvOpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV";
+ case SpvOpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV";
+ case SpvOpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV";
+ case SpvOpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV";
+ case SpvOpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV";
+ case SpvOpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV";
+ case SpvOpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV";
+ case SpvOpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV";
+ case SpvOpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV";
+ case SpvOpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV";
+ case SpvOpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV";
+ case SpvOpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV";
+ case SpvOpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV";
+ case SpvOpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV";
+ case SpvOpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV";
+ case SpvOpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV";
+ case SpvOpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV";
+ case SpvOpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV";
+ case SpvOpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV";
+ case SpvOpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV";
+ case SpvOpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV";
+ case SpvOpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV";
+ case SpvOpHitObjectIsHitNV: return "OpHitObjectIsHitNV";
+ case SpvOpHitObjectIsMissNV: return "OpHitObjectIsMissNV";
+ case SpvOpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV";
+ case SpvOpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV";
+ case SpvOpTypeHitObjectNV: return "OpTypeHitObjectNV";
+ case SpvOpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
+ case SpvOpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV";
+ case SpvOpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV";
+ case SpvOpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV";
+ case SpvOpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV";
+ case SpvOpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV";
+ case SpvOpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV";
+ case SpvOpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT";
+ case SpvOpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT";
+ case SpvOpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
+ case SpvOpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
+ case SpvOpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV";
+ case SpvOpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV";
+ case SpvOpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV";
+ case SpvOpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV";
+ case SpvOpReportIntersectionKHR: return "OpReportIntersectionKHR";
+ case SpvOpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
+ case SpvOpTerminateRayNV: return "OpTerminateRayNV";
+ case SpvOpTraceNV: return "OpTraceNV";
+ case SpvOpTraceMotionNV: return "OpTraceMotionNV";
+ case SpvOpTraceRayMotionNV: return "OpTraceRayMotionNV";
+ case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR";
+ case SpvOpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR";
+ case SpvOpExecuteCallableNV: return "OpExecuteCallableNV";
+ case SpvOpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV";
+ case SpvOpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV";
+ case SpvOpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
+ case SpvOpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
+ case SpvOpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
+ case SpvOpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
+ case SpvOpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
+ case SpvOpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT";
+ case SpvOpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT";
+ case SpvOpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV";
+ case SpvOpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV";
+ case SpvOpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV";
+ case SpvOpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV";
+ case SpvOpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV";
+ case SpvOpTypeTensorViewNV: return "OpTypeTensorViewNV";
+ case SpvOpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV";
+ case SpvOpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV";
+ case SpvOpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV";
+ case SpvOpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV";
+ case SpvOpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV";
+ case SpvOpCreateTensorViewNV: return "OpCreateTensorViewNV";
+ case SpvOpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV";
+ case SpvOpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV";
+ case SpvOpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation";
+ case SpvOpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT";
+ case SpvOpTensorViewSetClipNV: return "OpTensorViewSetClipNV";
+ case SpvOpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV";
+ case SpvOpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV";
+ case SpvOpConvertUToImageNV: return "OpConvertUToImageNV";
+ case SpvOpConvertUToSamplerNV: return "OpConvertUToSamplerNV";
+ case SpvOpConvertImageToUNV: return "OpConvertImageToUNV";
+ case SpvOpConvertSamplerToUNV: return "OpConvertSamplerToUNV";
+ case SpvOpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV";
+ case SpvOpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV";
+ case SpvOpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV";
+ case SpvOpRawAccessChainNV: return "OpRawAccessChainNV";
+ case SpvOpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV";
+ case SpvOpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV";
+ case SpvOpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV";
+ case SpvOpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV";
+ case SpvOpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV";
+ case SpvOpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV";
+ case SpvOpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV";
+ case SpvOpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV";
+ case SpvOpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV";
+ case SpvOpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV";
+ case SpvOpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV";
+ case SpvOpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV";
+ case SpvOpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV";
+ case SpvOpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL";
+ case SpvOpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL";
+ case SpvOpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL";
+ case SpvOpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL";
+ case SpvOpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL";
+ case SpvOpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL";
+ case SpvOpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL";
+ case SpvOpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL";
+ case SpvOpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL";
+ case SpvOpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL";
+ case SpvOpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL";
+ case SpvOpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL";
+ case SpvOpAbsISubINTEL: return "OpAbsISubINTEL";
+ case SpvOpAbsUSubINTEL: return "OpAbsUSubINTEL";
+ case SpvOpIAddSatINTEL: return "OpIAddSatINTEL";
+ case SpvOpUAddSatINTEL: return "OpUAddSatINTEL";
+ case SpvOpIAverageINTEL: return "OpIAverageINTEL";
+ case SpvOpUAverageINTEL: return "OpUAverageINTEL";
+ case SpvOpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL";
+ case SpvOpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL";
+ case SpvOpISubSatINTEL: return "OpISubSatINTEL";
+ case SpvOpUSubSatINTEL: return "OpUSubSatINTEL";
+ case SpvOpIMul32x16INTEL: return "OpIMul32x16INTEL";
+ case SpvOpUMul32x16INTEL: return "OpUMul32x16INTEL";
+ case SpvOpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL";
+ case SpvOpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL";
+ case SpvOpAsmTargetINTEL: return "OpAsmTargetINTEL";
+ case SpvOpAsmINTEL: return "OpAsmINTEL";
+ case SpvOpAsmCallINTEL: return "OpAsmCallINTEL";
+ case SpvOpAtomicFMinEXT: return "OpAtomicFMinEXT";
+ case SpvOpAtomicFMaxEXT: return "OpAtomicFMaxEXT";
+ case SpvOpAssumeTrueKHR: return "OpAssumeTrueKHR";
+ case SpvOpExpectKHR: return "OpExpectKHR";
+ case SpvOpDecorateString: return "OpDecorateString";
+ case SpvOpMemberDecorateString: return "OpMemberDecorateString";
+ case SpvOpVmeImageINTEL: return "OpVmeImageINTEL";
+ case SpvOpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL";
+ case SpvOpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL";
+ case SpvOpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL";
+ case SpvOpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL";
+ case SpvOpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL";
+ case SpvOpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL";
+ case SpvOpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL";
+ case SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL";
+ case SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL";
+ case SpvOpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL";
+ case SpvOpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL";
+ case SpvOpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL";
+ case SpvOpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL";
+ case SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL";
+ case SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL";
+ case SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL";
+ case SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL";
+ case SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL";
+ case SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL";
+ case SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL";
+ case SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL";
+ case SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL";
+ case SpvOpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL";
+ case SpvOpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL";
+ case SpvOpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL";
+ case SpvOpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL";
+ case SpvOpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL";
+ case SpvOpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL";
+ case SpvOpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL";
+ case SpvOpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL";
+ case SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL";
+ case SpvOpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL";
+ case SpvOpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL";
+ case SpvOpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL";
+ case SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL";
+ case SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL";
+ case SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL";
+ case SpvOpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL";
+ case SpvOpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL";
+ case SpvOpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL";
+ case SpvOpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL";
+ case SpvOpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL";
+ case SpvOpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL";
+ case SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL";
+ case SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL";
+ case SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL";
+ case SpvOpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL";
+ case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL";
+ case SpvOpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL";
+ case SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL";
+ case SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL";
+ case SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL";
+ case SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL";
+ case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL";
+ case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL";
+ case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL";
+ case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL";
+ case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL";
+ case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL";
+ case SpvOpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL";
+ case SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL";
+ case SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL";
+ case SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL";
+ case SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL";
+ case SpvOpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL";
+ case SpvOpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL";
+ case SpvOpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL";
+ case SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL";
+ case SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL";
+ case SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL";
+ case SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL";
+ case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL";
+ case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL";
+ case SpvOpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL";
+ case SpvOpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL";
+ case SpvOpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL";
+ case SpvOpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL";
+ case SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL";
+ case SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL";
+ case SpvOpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL";
+ case SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL";
+ case SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL";
+ case SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL";
+ case SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL";
+ case SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL";
+ case SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL";
+ case SpvOpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL";
+ case SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL";
+ case SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL";
+ case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL";
+ case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL";
+ case SpvOpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL";
+ case SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL";
+ case SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL";
+ case SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL";
+ case SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL";
+ case SpvOpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL";
+ case SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL";
+ case SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL";
+ case SpvOpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL";
+ case SpvOpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL";
+ case SpvOpSaveMemoryINTEL: return "OpSaveMemoryINTEL";
+ case SpvOpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL";
+ case SpvOpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL";
+ case SpvOpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL";
+ case SpvOpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL";
+ case SpvOpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL";
+ case SpvOpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL";
+ case SpvOpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL";
+ case SpvOpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL";
+ case SpvOpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL";
+ case SpvOpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL";
+ case SpvOpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL";
+ case SpvOpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL";
+ case SpvOpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL";
+ case SpvOpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL";
+ case SpvOpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL";
+ case SpvOpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL";
+ case SpvOpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL";
+ case SpvOpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL";
+ case SpvOpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL";
+ case SpvOpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL";
+ case SpvOpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL";
+ case SpvOpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL";
+ case SpvOpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL";
+ case SpvOpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL";
+ case SpvOpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL";
+ case SpvOpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL";
+ case SpvOpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL";
+ case SpvOpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL";
+ case SpvOpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL";
+ case SpvOpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL";
+ case SpvOpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL";
+ case SpvOpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL";
+ case SpvOpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL";
+ case SpvOpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL";
+ case SpvOpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL";
+ case SpvOpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL";
+ case SpvOpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL";
+ case SpvOpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL";
+ case SpvOpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL";
+ case SpvOpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL";
+ case SpvOpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL";
+ case SpvOpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL";
+ case SpvOpLoopControlINTEL: return "OpLoopControlINTEL";
+ case SpvOpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL";
+ case SpvOpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL";
+ case SpvOpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL";
+ case SpvOpFixedSqrtINTEL: return "OpFixedSqrtINTEL";
+ case SpvOpFixedRecipINTEL: return "OpFixedRecipINTEL";
+ case SpvOpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL";
+ case SpvOpFixedSinINTEL: return "OpFixedSinINTEL";
+ case SpvOpFixedCosINTEL: return "OpFixedCosINTEL";
+ case SpvOpFixedSinCosINTEL: return "OpFixedSinCosINTEL";
+ case SpvOpFixedSinPiINTEL: return "OpFixedSinPiINTEL";
+ case SpvOpFixedCosPiINTEL: return "OpFixedCosPiINTEL";
+ case SpvOpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL";
+ case SpvOpFixedLogINTEL: return "OpFixedLogINTEL";
+ case SpvOpFixedExpINTEL: return "OpFixedExpINTEL";
+ case SpvOpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL";
+ case SpvOpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL";
+ case SpvOpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL";
+ case SpvOpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL";
+ case SpvOpFPGARegINTEL: return "OpFPGARegINTEL";
+ case SpvOpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR";
+ case SpvOpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR";
+ case SpvOpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR";
+ case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR";
+ case SpvOpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR";
+ case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR";
+ case SpvOpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR";
+ case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR";
+ case SpvOpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR";
+ case SpvOpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR";
+ case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR";
+ case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR";
+ case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR";
+ case SpvOpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR";
+ case SpvOpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR";
+ case SpvOpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR";
+ case SpvOpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR";
+ case SpvOpAtomicFAddEXT: return "OpAtomicFAddEXT";
+ case SpvOpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL";
+ case SpvOpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL";
+ case SpvOpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL";
+ case SpvOpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL";
+ case SpvOpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL";
+ case SpvOpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL";
+ case SpvOpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL";
+ case SpvOpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL";
+ case SpvOpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL";
+ case SpvOpArithmeticFenceEXT: return "OpArithmeticFenceEXT";
+ case SpvOpTaskSequenceCreateINTEL: return "OpTaskSequenceCreateINTEL";
+ case SpvOpTaskSequenceAsyncINTEL: return "OpTaskSequenceAsyncINTEL";
+ case SpvOpTaskSequenceGetINTEL: return "OpTaskSequenceGetINTEL";
+ case SpvOpTaskSequenceReleaseINTEL: return "OpTaskSequenceReleaseINTEL";
+ case SpvOpTypeTaskSequenceINTEL: return "OpTypeTaskSequenceINTEL";
+ case SpvOpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL";
+ case SpvOpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL";
+ case SpvOpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL";
+ case SpvOpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL";
+ case SpvOpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL";
+ case SpvOpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL";
+ case SpvOpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL";
+ case SpvOpBitwiseFunctionINTEL: return "OpBitwiseFunctionINTEL";
+ case SpvOpConditionalExtensionINTEL: return "OpConditionalExtensionINTEL";
+ case SpvOpConditionalEntryPointINTEL: return "OpConditionalEntryPointINTEL";
+ case SpvOpConditionalCapabilityINTEL: return "OpConditionalCapabilityINTEL";
+ case SpvOpSpecConstantTargetINTEL: return "OpSpecConstantTargetINTEL";
+ case SpvOpSpecConstantArchitectureINTEL: return "OpSpecConstantArchitectureINTEL";
+ case SpvOpSpecConstantCapabilitiesINTEL: return "OpSpecConstantCapabilitiesINTEL";
+ case SpvOpConditionalCopyObjectINTEL: return "OpConditionalCopyObjectINTEL";
+ case SpvOpGroupIMulKHR: return "OpGroupIMulKHR";
+ case SpvOpGroupFMulKHR: return "OpGroupFMulKHR";
+ case SpvOpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR";
+ case SpvOpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR";
+ case SpvOpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR";
+ case SpvOpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR";
+ case SpvOpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR";
+ case SpvOpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR";
+ case SpvOpRoundFToTF32INTEL: return "OpRoundFToTF32INTEL";
+ case SpvOpMaskedGatherINTEL: return "OpMaskedGatherINTEL";
+ case SpvOpMaskedScatterINTEL: return "OpMaskedScatterINTEL";
+ case SpvOpConvertHandleToImageINTEL: return "OpConvertHandleToImageINTEL";
+ case SpvOpConvertHandleToSamplerINTEL: return "OpConvertHandleToSamplerINTEL";
+ case SpvOpConvertHandleToSampledImageINTEL: return "OpConvertHandleToSampledImageINTEL";
+ default: return "Unknown";
+ }
+}
+
#endif /* SPV_ENABLE_UTILITY_CODE */
#endif
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp
index a383739..2e1f217 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 The Khronos Group Inc.
+// Copyright: 2014-2024 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
@@ -74,6 +58,7 @@
SourceLanguageWGSL = 10,
SourceLanguageSlang = 11,
SourceLanguageZig = 12,
+ SourceLanguageRust = 13,
SourceLanguageMax = 0x7fffffff,
};
@@ -171,9 +156,12 @@
ExecutionModeSignedZeroInfNanPreserve = 4461,
ExecutionModeRoundingModeRTE = 4462,
ExecutionModeRoundingModeRTZ = 4463,
+ ExecutionModeNonCoherentTileAttachmentReadQCOM = 4489,
+ ExecutionModeTileShadingRateQCOM = 4490,
ExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
ExecutionModeStencilRefReplacingEXT = 5027,
ExecutionModeCoalescingAMDX = 5069,
+ ExecutionModeIsApiEntryAMDX = 5070,
ExecutionModeMaxNodeRecursionAMDX = 5071,
ExecutionModeStaticNumWorkgroupsAMDX = 5072,
ExecutionModeShaderIndexAMDX = 5073,
@@ -186,11 +174,14 @@
ExecutionModeStencilRefLessBackAMD = 5084,
ExecutionModeQuadDerivativesKHR = 5088,
ExecutionModeRequireFullQuadsKHR = 5089,
+ ExecutionModeSharesInputWithAMDX = 5102,
ExecutionModeOutputLinesEXT = 5269,
ExecutionModeOutputLinesNV = 5269,
ExecutionModeOutputPrimitivesEXT = 5270,
ExecutionModeOutputPrimitivesNV = 5270,
+ ExecutionModeDerivativeGroupQuadsKHR = 5289,
ExecutionModeDerivativeGroupQuadsNV = 5289,
+ ExecutionModeDerivativeGroupLinearKHR = 5290,
ExecutionModeDerivativeGroupLinearNV = 5290,
ExecutionModeOutputTrianglesEXT = 5298,
ExecutionModeOutputTrianglesNV = 5298,
@@ -236,8 +227,8 @@
StorageClassImage = 11,
StorageClassStorageBuffer = 12,
StorageClassTileImageEXT = 4172,
+ StorageClassTileAttachmentQCOM = 4491,
StorageClassNodePayloadAMDX = 5068,
- StorageClassNodeOutputPayloadAMDX = 5076,
StorageClassCallableDataKHR = 5328,
StorageClassCallableDataNV = 5328,
StorageClassIncomingCallableDataKHR = 5329,
@@ -375,8 +366,15 @@
ImageChannelDataTypeFloat = 14,
ImageChannelDataTypeUnormInt24 = 15,
ImageChannelDataTypeUnormInt101010_2 = 16,
+ ImageChannelDataTypeUnormInt10X6EXT = 17,
ImageChannelDataTypeUnsignedIntRaw10EXT = 19,
ImageChannelDataTypeUnsignedIntRaw12EXT = 20,
+ ImageChannelDataTypeUnormInt2_101010EXT = 21,
+ ImageChannelDataTypeUnsignedInt10X6EXT = 22,
+ ImageChannelDataTypeUnsignedInt12X4EXT = 23,
+ ImageChannelDataTypeUnsignedInt14X2EXT = 24,
+ ImageChannelDataTypeUnormInt12X4EXT = 25,
+ ImageChannelDataTypeUnormInt14X2EXT = 26,
ImageChannelDataTypeMax = 0x7fffffff,
};
@@ -539,6 +537,7 @@
DecorationMaxByteOffset = 45,
DecorationAlignmentId = 46,
DecorationMaxByteOffsetId = 47,
+ DecorationSaturatedToLargestFloat8NormalConversionEXT = 4216,
DecorationNoSignedWrap = 4469,
DecorationNoUnsignedWrap = 4470,
DecorationWeightTextureQCOM = 4487,
@@ -549,6 +548,10 @@
DecorationNodeMaxPayloadsAMDX = 5020,
DecorationTrackFinishWritingAMDX = 5078,
DecorationPayloadNodeNameAMDX = 5091,
+ DecorationPayloadNodeBaseIndexAMDX = 5098,
+ DecorationPayloadNodeSparseArrayAMDX = 5099,
+ DecorationPayloadNodeArraySizeAMDX = 5100,
+ DecorationPayloadDispatchIndirectAMDX = 5105,
DecorationOverrideCoverageNV = 5248,
DecorationPassthroughNV = 5250,
DecorationViewportRelativeNV = 5252,
@@ -635,6 +638,7 @@
DecorationHostAccessINTEL = 6188,
DecorationInitModeINTEL = 6190,
DecorationImplementInRegisterMapINTEL = 6191,
+ DecorationConditionalINTEL = 6247,
DecorationCacheControlLoadINTEL = 6442,
DecorationCacheControlStoreINTEL = 6443,
DecorationMax = 0x7fffffff,
@@ -704,6 +708,9 @@
BuiltInDeviceIndex = 4438,
BuiltInViewIndex = 4440,
BuiltInShadingRateKHR = 4444,
+ BuiltInTileOffsetQCOM = 4492,
+ BuiltInTileDimensionQCOM = 4493,
+ BuiltInTileApronSizeQCOM = 4494,
BuiltInBaryCoordNoPerspAMD = 4992,
BuiltInBaryCoordNoPerspCentroidAMD = 4993,
BuiltInBaryCoordNoPerspSampleAMD = 4994,
@@ -712,7 +719,7 @@
BuiltInBaryCoordSmoothSampleAMD = 4997,
BuiltInBaryCoordPullModelAMD = 4998,
BuiltInFragStencilRefEXT = 5014,
- BuiltInCoalescedInputCountAMDX = 5021,
+ BuiltInRemainingRecursionLevelsAMDX = 5021,
BuiltInShaderIndexAMDX = 5073,
BuiltInViewportMaskNV = 5253,
BuiltInSecondaryPositionNV = 5257,
@@ -772,12 +779,19 @@
BuiltInIncomingRayFlagsKHR = 5351,
BuiltInIncomingRayFlagsNV = 5351,
BuiltInRayGeometryIndexKHR = 5352,
+ BuiltInHitIsSphereNV = 5359,
+ BuiltInHitIsLSSNV = 5360,
+ BuiltInHitSpherePositionNV = 5361,
BuiltInWarpsPerSMNV = 5374,
BuiltInSMCountNV = 5375,
BuiltInWarpIDNV = 5376,
BuiltInSMIDNV = 5377,
+ BuiltInHitLSSPositionsNV = 5396,
BuiltInHitKindFrontFacingMicroTriangleNV = 5405,
BuiltInHitKindBackFacingMicroTriangleNV = 5406,
+ BuiltInHitSphereRadiusNV = 5420,
+ BuiltInHitLSSRadiiNV = 5421,
+ BuiltInClusterIDNV = 5436,
BuiltInCullMaskKHR = 6021,
BuiltInMax = 0x7fffffff,
};
@@ -845,6 +859,7 @@
FunctionControlDontInlineShift = 1,
FunctionControlPureShift = 2,
FunctionControlConstShift = 3,
+ FunctionControlOptNoneEXTShift = 16,
FunctionControlOptNoneINTELShift = 16,
FunctionControlMax = 0x7fffffff,
};
@@ -855,6 +870,7 @@
FunctionControlDontInlineMask = 0x00000002,
FunctionControlPureMask = 0x00000004,
FunctionControlConstMask = 0x00000008,
+ FunctionControlOptNoneEXTMask = 0x00010000,
FunctionControlOptNoneINTELMask = 0x00010000,
};
@@ -1045,6 +1061,13 @@
CapabilityTileImageColorReadAccessEXT = 4166,
CapabilityTileImageDepthReadAccessEXT = 4167,
CapabilityTileImageStencilReadAccessEXT = 4168,
+ CapabilityTensorsARM = 4174,
+ CapabilityStorageTensorArrayDynamicIndexingARM = 4175,
+ CapabilityStorageTensorArrayNonUniformIndexingARM = 4176,
+ CapabilityGraphARM = 4191,
+ CapabilityCooperativeMatrixLayoutsARM = 4201,
+ CapabilityFloat8EXT = 4212,
+ CapabilityFloat8CooperativeMatrixEXT = 4213,
CapabilityFragmentShadingRateKHR = 4422,
CapabilitySubgroupBallotKHR = 4423,
CapabilityDrawParameters = 4427,
@@ -1074,11 +1097,14 @@
CapabilityRoundingModeRTZ = 4468,
CapabilityRayQueryProvisionalKHR = 4471,
CapabilityRayQueryKHR = 4472,
+ CapabilityUntypedPointersKHR = 4473,
CapabilityRayTraversalPrimitiveCullingKHR = 4478,
CapabilityRayTracingKHR = 4479,
CapabilityTextureSampleWeightedQCOM = 4484,
CapabilityTextureBoxFilterQCOM = 4485,
CapabilityTextureBlockMatchQCOM = 4486,
+ CapabilityTileShadingQCOM = 4495,
+ CapabilityCooperativeMatrixConversionQCOM = 4496,
CapabilityTextureBlockMatch2QCOM = 4498,
CapabilityFloat16ImageAMD = 5008,
CapabilityImageGatherBiasLodAMD = 5009,
@@ -1089,6 +1115,11 @@
CapabilityShaderClockKHR = 5055,
CapabilityShaderEnqueueAMDX = 5067,
CapabilityQuadControlKHR = 5087,
+ CapabilityInt4TypeINTEL = 5112,
+ CapabilityInt4CooperativeMatrixINTEL = 5114,
+ CapabilityBFloat16TypeKHR = 5116,
+ CapabilityBFloat16DotProductKHR = 5117,
+ CapabilityBFloat16CooperativeMatrixKHR = 5118,
CapabilitySampleMaskOverrideCoverageNV = 5249,
CapabilityGeometryShaderPassthroughNV = 5251,
CapabilityShaderViewportIndexLayerEXT = 5254,
@@ -1102,6 +1133,7 @@
CapabilityMeshShadingEXT = 5283,
CapabilityFragmentBarycentricKHR = 5284,
CapabilityFragmentBarycentricNV = 5284,
+ CapabilityComputeDerivativeGroupQuadsKHR = 5288,
CapabilityComputeDerivativeGroupQuadsNV = 5288,
CapabilityFragmentDensityEXT = 5291,
CapabilityShadingRateNV = 5291,
@@ -1139,6 +1171,7 @@
CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
CapabilityPhysicalStorageBufferAddresses = 5347,
CapabilityPhysicalStorageBufferAddressesEXT = 5347,
+ CapabilityComputeDerivativeGroupLinearKHR = 5350,
CapabilityComputeDerivativeGroupLinearNV = 5350,
CapabilityRayTracingProvisionalKHR = 5353,
CapabilityCooperativeMatrixNV = 5357,
@@ -1153,9 +1186,20 @@
CapabilityShaderInvocationReorderNV = 5383,
CapabilityBindlessTextureNV = 5390,
CapabilityRayQueryPositionFetchKHR = 5391,
+ CapabilityCooperativeVectorNV = 5394,
CapabilityAtomicFloat16VectorNV = 5404,
CapabilityRayTracingDisplacementMicromapNV = 5409,
CapabilityRawAccessChainsNV = 5414,
+ CapabilityRayTracingSpheresGeometryNV = 5418,
+ CapabilityRayTracingLinearSweptSpheresGeometryNV = 5419,
+ CapabilityCooperativeMatrixReductionsNV = 5430,
+ CapabilityCooperativeMatrixConversionsNV = 5431,
+ CapabilityCooperativeMatrixPerElementOperationsNV = 5432,
+ CapabilityCooperativeMatrixTensorAddressingNV = 5433,
+ CapabilityCooperativeMatrixBlockLoadsNV = 5434,
+ CapabilityCooperativeVectorTrainingNV = 5435,
+ CapabilityRayTracingClusterAccelerationStructureNV = 5437,
+ CapabilityTensorAddressingNV = 5439,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1208,28 +1252,42 @@
CapabilityDotProductKHR = 6019,
CapabilityRayCullMaskKHR = 6020,
CapabilityCooperativeMatrixKHR = 6022,
+ CapabilityReplicatedCompositesEXT = 6024,
CapabilityBitInstructions = 6025,
CapabilityGroupNonUniformRotateKHR = 6026,
CapabilityFloatControls2 = 6029,
CapabilityAtomicFloat32AddEXT = 6033,
CapabilityAtomicFloat64AddEXT = 6034,
CapabilityLongCompositesINTEL = 6089,
+ CapabilityOptNoneEXT = 6094,
CapabilityOptNoneINTEL = 6094,
CapabilityAtomicFloat16AddEXT = 6095,
CapabilityDebugInfoModuleINTEL = 6114,
CapabilityBFloat16ConversionINTEL = 6115,
CapabilitySplitBarrierINTEL = 6141,
+ CapabilityArithmeticFenceEXT = 6144,
CapabilityFPGAClusterAttributesV2INTEL = 6150,
CapabilityFPGAKernelAttributesv2INTEL = 6161,
+ CapabilityTaskSequenceINTEL = 6162,
CapabilityFPMaxErrorINTEL = 6169,
CapabilityFPGALatencyControlINTEL = 6171,
CapabilityFPGAArgumentInterfacesINTEL = 6174,
CapabilityGlobalVariableHostAccessINTEL = 6187,
CapabilityGlobalVariableFPGADecorationsINTEL = 6189,
+ CapabilitySubgroupBufferPrefetchINTEL = 6220,
+ CapabilitySubgroup2DBlockIOINTEL = 6228,
+ CapabilitySubgroup2DBlockTransformINTEL = 6229,
+ CapabilitySubgroup2DBlockTransposeINTEL = 6230,
+ CapabilitySubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ CapabilityTernaryBitwiseFunctionINTEL = 6241,
+ CapabilitySpecConditionalINTEL = 6245,
+ CapabilityFunctionVariantsINTEL = 6246,
CapabilityGroupUniformArithmeticKHR = 6400,
+ CapabilityTensorFloat32RoundingINTEL = 6425,
CapabilityMaskedGatherScatterINTEL = 6427,
CapabilityCacheControlsINTEL = 6441,
CapabilityRegisterLimitsINTEL = 6460,
+ CapabilityBindlessImagesINTEL = 6528,
CapabilityMax = 0x7fffffff,
};
@@ -1242,6 +1300,7 @@
RayFlagsCullFrontFacingTrianglesKHRShift = 5,
RayFlagsCullOpaqueKHRShift = 6,
RayFlagsCullNoOpaqueKHRShift = 7,
+ RayFlagsSkipBuiltinPrimitivesNVShift = 8,
RayFlagsSkipTrianglesKHRShift = 8,
RayFlagsSkipAABBsKHRShift = 9,
RayFlagsForceOpacityMicromap2StateEXTShift = 10,
@@ -1258,6 +1317,7 @@
RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020,
RayFlagsCullOpaqueKHRMask = 0x00000040,
RayFlagsCullNoOpaqueKHRMask = 0x00000080,
+ RayFlagsSkipBuiltinPrimitivesNVMask = 0x00000100,
RayFlagsSkipTrianglesKHRMask = 0x00000100,
RayFlagsSkipAABBsKHRMask = 0x00000200,
RayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400,
@@ -1357,6 +1417,8 @@
enum CooperativeMatrixLayout {
CooperativeMatrixLayoutRowMajorKHR = 0,
CooperativeMatrixLayoutColumnMajorKHR = 1,
+ CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202,
+ CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203,
CooperativeMatrixLayoutMax = 0x7fffffff,
};
@@ -1367,6 +1429,59 @@
CooperativeMatrixUseMax = 0x7fffffff,
};
+enum CooperativeMatrixReduceShift {
+ CooperativeMatrixReduceRowShift = 0,
+ CooperativeMatrixReduceColumnShift = 1,
+ CooperativeMatrixReduce2x2Shift = 2,
+ CooperativeMatrixReduceMax = 0x7fffffff,
+};
+
+enum CooperativeMatrixReduceMask {
+ CooperativeMatrixReduceMaskNone = 0,
+ CooperativeMatrixReduceRowMask = 0x00000001,
+ CooperativeMatrixReduceColumnMask = 0x00000002,
+ CooperativeMatrixReduce2x2Mask = 0x00000004,
+};
+
+enum TensorClampMode {
+ TensorClampModeUndefined = 0,
+ TensorClampModeConstant = 1,
+ TensorClampModeClampToEdge = 2,
+ TensorClampModeRepeat = 3,
+ TensorClampModeRepeatMirrored = 4,
+ TensorClampModeMax = 0x7fffffff,
+};
+
+enum TensorAddressingOperandsShift {
+ TensorAddressingOperandsTensorViewShift = 0,
+ TensorAddressingOperandsDecodeFuncShift = 1,
+ TensorAddressingOperandsMax = 0x7fffffff,
+};
+
+enum TensorAddressingOperandsMask {
+ TensorAddressingOperandsMaskNone = 0,
+ TensorAddressingOperandsTensorViewMask = 0x00000001,
+ TensorAddressingOperandsDecodeFuncMask = 0x00000002,
+};
+
+enum TensorOperandsShift {
+ TensorOperandsNontemporalARMShift = 0,
+ TensorOperandsOutOfBoundsValueARMShift = 1,
+ TensorOperandsMakeElementAvailableARMShift = 2,
+ TensorOperandsMakeElementVisibleARMShift = 3,
+ TensorOperandsNonPrivateElementARMShift = 4,
+ TensorOperandsMax = 0x7fffffff,
+};
+
+enum TensorOperandsMask {
+ TensorOperandsMaskNone = 0,
+ TensorOperandsNontemporalARMMask = 0x00000001,
+ TensorOperandsOutOfBoundsValueARMMask = 0x00000002,
+ TensorOperandsMakeElementAvailableARMMask = 0x00000004,
+ TensorOperandsMakeElementVisibleARMMask = 0x00000008,
+ TensorOperandsNonPrivateElementARMMask = 0x00000010,
+};
+
enum InitializationModeQualifier {
InitializationModeQualifierInitOnDeviceReprogramINTEL = 0,
InitializationModeQualifierInitOnDeviceResetINTEL = 1,
@@ -1403,6 +1518,42 @@
NamedMaximumNumberOfRegistersMax = 0x7fffffff,
};
+enum MatrixMultiplyAccumulateOperandsShift {
+ MatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELShift = 0,
+ MatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELShift = 1,
+ MatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELShift = 2,
+ MatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELShift = 3,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELShift = 4,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELShift = 5,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELShift = 6,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELShift = 7,
+ MatrixMultiplyAccumulateOperandsMatrixATF32INTELShift = 8,
+ MatrixMultiplyAccumulateOperandsMatrixBTF32INTELShift = 9,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELShift = 10,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELShift = 11,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELShift = 12,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELShift = 13,
+ MatrixMultiplyAccumulateOperandsMax = 0x7fffffff,
+};
+
+enum MatrixMultiplyAccumulateOperandsMask {
+ MatrixMultiplyAccumulateOperandsMaskNone = 0,
+ MatrixMultiplyAccumulateOperandsMatrixASignedComponentsINTELMask = 0x00000001,
+ MatrixMultiplyAccumulateOperandsMatrixBSignedComponentsINTELMask = 0x00000002,
+ MatrixMultiplyAccumulateOperandsMatrixCBFloat16INTELMask = 0x00000004,
+ MatrixMultiplyAccumulateOperandsMatrixResultBFloat16INTELMask = 0x00000008,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedInt8INTELMask = 0x00000010,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedInt8INTELMask = 0x00000020,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedInt4INTELMask = 0x00000040,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedInt4INTELMask = 0x00000080,
+ MatrixMultiplyAccumulateOperandsMatrixATF32INTELMask = 0x00000100,
+ MatrixMultiplyAccumulateOperandsMatrixBTF32INTELMask = 0x00000200,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedFloat16INTELMask = 0x00000400,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedFloat16INTELMask = 0x00000800,
+ MatrixMultiplyAccumulateOperandsMatrixAPackedBFloat16INTELMask = 0x00001000,
+ MatrixMultiplyAccumulateOperandsMatrixBPackedBFloat16INTELMask = 0x00002000,
+};
+
enum RawAccessChainOperandsShift {
RawAccessChainOperandsRobustnessPerComponentNVShift = 0,
RawAccessChainOperandsRobustnessPerElementNVShift = 1,
@@ -1415,6 +1566,40 @@
RawAccessChainOperandsRobustnessPerElementNVMask = 0x00000002,
};
+enum FPEncoding {
+ FPEncodingBFloat16KHR = 0,
+ FPEncodingFloat8E4M3EXT = 4214,
+ FPEncodingFloat8E5M2EXT = 4215,
+ FPEncodingMax = 0x7fffffff,
+};
+
+enum CooperativeVectorMatrixLayout {
+ CooperativeVectorMatrixLayoutRowMajorNV = 0,
+ CooperativeVectorMatrixLayoutColumnMajorNV = 1,
+ CooperativeVectorMatrixLayoutInferencingOptimalNV = 2,
+ CooperativeVectorMatrixLayoutTrainingOptimalNV = 3,
+ CooperativeVectorMatrixLayoutMax = 0x7fffffff,
+};
+
+enum ComponentType {
+ ComponentTypeFloat16NV = 0,
+ ComponentTypeFloat32NV = 1,
+ ComponentTypeFloat64NV = 2,
+ ComponentTypeSignedInt8NV = 3,
+ ComponentTypeSignedInt16NV = 4,
+ ComponentTypeSignedInt32NV = 5,
+ ComponentTypeSignedInt64NV = 6,
+ ComponentTypeUnsignedInt8NV = 7,
+ ComponentTypeUnsignedInt16NV = 8,
+ ComponentTypeUnsignedInt32NV = 9,
+ ComponentTypeUnsignedInt64NV = 10,
+ ComponentTypeSignedInt8PackedNV = 1000491000,
+ ComponentTypeUnsignedInt8PackedNV = 1000491001,
+ ComponentTypeFloatE4M3NV = 1000491002,
+ ComponentTypeFloatE5M2NV = 1000491003,
+ ComponentTypeMax = 0x7fffffff,
+};
+
enum Op {
OpNop = 0,
OpUndef = 1,
@@ -1763,14 +1948,35 @@
OpColorAttachmentReadEXT = 4160,
OpDepthAttachmentReadEXT = 4161,
OpStencilAttachmentReadEXT = 4162,
+ OpTypeTensorARM = 4163,
+ OpTensorReadARM = 4164,
+ OpTensorWriteARM = 4165,
+ OpTensorQuerySizeARM = 4166,
+ OpGraphConstantARM = 4181,
+ OpGraphEntryPointARM = 4182,
+ OpGraphARM = 4183,
+ OpGraphInputARM = 4184,
+ OpGraphSetOutputARM = 4185,
+ OpGraphEndARM = 4186,
+ OpTypeGraphARM = 4190,
OpTerminateInvocation = 4416,
+ OpTypeUntypedPointerKHR = 4417,
+ OpUntypedVariableKHR = 4418,
+ OpUntypedAccessChainKHR = 4419,
+ OpUntypedInBoundsAccessChainKHR = 4420,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
+ OpUntypedPtrAccessChainKHR = 4423,
+ OpUntypedInBoundsPtrAccessChainKHR = 4424,
+ OpUntypedArrayLengthKHR = 4425,
+ OpUntypedPrefetchKHR = 4426,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
+ OpExtInstWithForwardRefsKHR = 4433,
+ OpUntypedGroupAsyncCopyKHR = 4434,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
@@ -1793,6 +1999,9 @@
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
+ OpConstantCompositeReplicateEXT = 4461,
+ OpSpecConstantCompositeReplicateEXT = 4462,
+ OpCompositeConstructReplicateEXT = 4463,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@@ -1804,10 +2013,14 @@
OpImageBoxFilterQCOM = 4481,
OpImageBlockMatchSSDQCOM = 4482,
OpImageBlockMatchSADQCOM = 4483,
+ OpBitCastArrayQCOM = 4497,
OpImageBlockMatchWindowSSDQCOM = 4500,
OpImageBlockMatchWindowSADQCOM = 4501,
OpImageBlockMatchGatherSSDQCOM = 4502,
OpImageBlockMatchGatherSADQCOM = 4503,
+ OpCompositeConstructCoopMatQCOM = 4540,
+ OpCompositeExtractCoopMatQCOM = 4541,
+ OpExtractSubArrayQCOM = 4542,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@@ -1819,9 +2032,14 @@
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
- OpFinalizeNodePayloadsAMDX = 5075,
+ OpAllocateNodePayloadsAMDX = 5074,
+ OpEnqueueNodePayloadsAMDX = 5075,
+ OpTypeNodePayloadArrayAMDX = 5076,
OpFinishWritingNodePayloadAMDX = 5078,
- OpInitializeNodePayloadsAMDX = 5090,
+ OpNodePayloadArrayLengthAMDX = 5090,
+ OpIsNodePayloadValidAMDX = 5101,
+ OpConstantStringAMDX = 5103,
+ OpSpecConstantStringAMDX = 5104,
OpGroupNonUniformQuadAllKHR = 5110,
OpGroupNonUniformQuadAnyKHR = 5111,
OpHitObjectRecordHitMotionNV = 5249,
@@ -1858,12 +2076,20 @@
OpReorderThreadWithHintNV = 5280,
OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpTypeCooperativeVectorNV = 5288,
+ OpCooperativeVectorMatrixMulNV = 5289,
+ OpCooperativeVectorOuterProductAccumulateNV = 5290,
+ OpCooperativeVectorReduceSumAccumulateNV = 5291,
+ OpCooperativeVectorMatrixMulAddNV = 5292,
+ OpCooperativeMatrixConvertNV = 5293,
OpEmitMeshTasksEXT = 5294,
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
+ OpCooperativeVectorLoadNV = 5302,
+ OpCooperativeVectorStoreNV = 5303,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
@@ -1875,6 +2101,8 @@
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
+ OpRayQueryGetClusterIdNV = 5345,
+ OpHitObjectGetClusterIdNV = 5346,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
@@ -1882,9 +2110,26 @@
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
+ OpCooperativeMatrixReduceNV = 5366,
+ OpCooperativeMatrixLoadTensorNV = 5367,
+ OpCooperativeMatrixStoreTensorNV = 5368,
+ OpCooperativeMatrixPerElementOpNV = 5369,
+ OpTypeTensorLayoutNV = 5370,
+ OpTypeTensorViewNV = 5371,
+ OpCreateTensorLayoutNV = 5372,
+ OpTensorLayoutSetDimensionNV = 5373,
+ OpTensorLayoutSetStrideNV = 5374,
+ OpTensorLayoutSliceNV = 5375,
+ OpTensorLayoutSetClampValueNV = 5376,
+ OpCreateTensorViewNV = 5377,
+ OpTensorViewSetDimensionNV = 5378,
+ OpTensorViewSetStrideNV = 5379,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
+ OpTensorViewSetClipNV = 5382,
+ OpTensorLayoutSetBlockSizeNV = 5384,
+ OpCooperativeMatrixTransposeNV = 5390,
OpConvertUToImageNV = 5391,
OpConvertUToSamplerNV = 5392,
OpConvertImageToUNV = 5393,
@@ -1893,6 +2138,19 @@
OpConvertSampledImageToUNV = 5396,
OpSamplerImageAddressingModeNV = 5397,
OpRawAccessChainNV = 5398,
+ OpRayQueryGetIntersectionSpherePositionNV = 5427,
+ OpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ OpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ OpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ OpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ OpHitObjectGetSpherePositionNV = 5432,
+ OpHitObjectGetSphereRadiusNV = 5433,
+ OpHitObjectGetLSSPositionsNV = 5434,
+ OpHitObjectGetLSSRadiiNV = 5435,
+ OpHitObjectIsSphereHitNV = 5436,
+ OpHitObjectIsLSSHitNV = 5437,
+ OpRayQueryIsSphereHitNV = 5438,
+ OpRayQueryIsLSSHitNV = 5439,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -2139,6 +2397,27 @@
OpConvertBF16ToFINTEL = 6117,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
+ OpArithmeticFenceEXT = 6145,
+ OpTaskSequenceCreateINTEL = 6163,
+ OpTaskSequenceAsyncINTEL = 6164,
+ OpTaskSequenceGetINTEL = 6165,
+ OpTaskSequenceReleaseINTEL = 6166,
+ OpTypeTaskSequenceINTEL = 6199,
+ OpSubgroupBlockPrefetchINTEL = 6221,
+ OpSubgroup2DBlockLoadINTEL = 6231,
+ OpSubgroup2DBlockLoadTransformINTEL = 6232,
+ OpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ OpSubgroup2DBlockPrefetchINTEL = 6234,
+ OpSubgroup2DBlockStoreINTEL = 6235,
+ OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ OpBitwiseFunctionINTEL = 6242,
+ OpConditionalExtensionINTEL = 6248,
+ OpConditionalEntryPointINTEL = 6249,
+ OpConditionalCapabilityINTEL = 6250,
+ OpSpecConstantTargetINTEL = 6251,
+ OpSpecConstantArchitectureINTEL = 6252,
+ OpSpecConstantCapabilitiesINTEL = 6253,
+ OpConditionalCopyObjectINTEL = 6254,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
@@ -2147,8 +2426,12 @@
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
+ OpRoundFToTF32INTEL = 6426,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
+ OpConvertHandleToImageINTEL = 6529,
+ OpConvertHandleToSamplerINTEL = 6530,
+ OpConvertHandleToSampledImageINTEL = 6531,
OpMax = 0x7fffffff,
};
@@ -2507,14 +2790,35 @@
case OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
case OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
case OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
+ case OpTypeTensorARM: *hasResult = true; *hasResultType = false; break;
+ case OpTensorReadARM: *hasResult = true; *hasResultType = true; break;
+ case OpTensorWriteARM: *hasResult = false; *hasResultType = false; break;
+ case OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break;
+ case OpGraphConstantARM: *hasResult = true; *hasResultType = true; break;
+ case OpGraphEntryPointARM: *hasResult = false; *hasResultType = false; break;
+ case OpGraphARM: *hasResult = true; *hasResultType = true; break;
+ case OpGraphInputARM: *hasResult = true; *hasResultType = true; break;
+ case OpGraphSetOutputARM: *hasResult = false; *hasResultType = false; break;
+ case OpGraphEndARM: *hasResult = false; *hasResultType = false; break;
+ case OpTypeGraphARM: *hasResult = true; *hasResultType = false; break;
case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
+ case OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break;
+ case OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break;
case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
+ case OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break;
+ case OpUntypedGroupAsyncCopyKHR: *hasResult = true; *hasResultType = true; break;
case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
@@ -2531,6 +2835,9 @@
case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break;
case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break;
case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break;
+ case OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break;
+ case OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break;
+ case OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break;
case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2542,10 +2849,14 @@
case OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break;
case OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break;
case OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break;
+ case OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break;
case OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break;
case OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break;
case OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break;
case OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break;
+ case OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break;
+ case OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break;
+ case OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break;
case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
@@ -2557,9 +2868,14 @@
case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
- case OpFinalizeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case OpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break;
+ case OpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case OpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break;
case OpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break;
- case OpInitializeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case OpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break;
+ case OpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break;
+ case OpConstantStringAMDX: *hasResult = true; *hasResultType = false; break;
+ case OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break;
case OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break;
case OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
@@ -2596,21 +2912,31 @@
case OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break;
case OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break;
case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case OpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break;
+ case OpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break;
+ case OpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break;
+ case OpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeMatrixConvertNV: *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 OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break;
case OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break;
- case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break;
+ case OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break;
case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
case OpTraceNV: *hasResult = false; *hasResultType = false; break;
case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break;
- case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
+ case OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break;
case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
+ case OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
@@ -2618,8 +2944,25 @@
case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
+ case OpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break;
+ case OpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break;
+ case OpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break;
+ case OpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break;
+ case OpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break;
+ case OpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break;
case OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case OpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break;
+ case OpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break;
+ case OpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break;
case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
case OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
@@ -2628,6 +2971,19 @@
case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break;
+ case OpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2654,7 +3010,7 @@
case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break;
case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
case OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
@@ -2872,6 +3228,27 @@
case OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break;
case OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
case OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break;
+ case OpTaskSequenceCreateINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpTaskSequenceAsyncINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpTaskSequenceGetINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpTaskSequenceReleaseINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpTypeTaskSequenceINTEL: *hasResult = true; *hasResultType = false; break;
+ case OpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpBitwiseFunctionINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpConditionalExtensionINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpConditionalEntryPointINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpConditionalCapabilityINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpSpecConstantTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpSpecConstantArchitectureINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpSpecConstantCapabilitiesINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpConditionalCopyObjectINTEL: *hasResult = true; *hasResultType = true; break;
case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
@@ -2880,10 +3257,2005 @@
case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
+ case OpRoundFToTF32INTEL: *hasResult = true; *hasResultType = true; break;
case OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break;
case OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpConvertHandleToImageINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpConvertHandleToSamplerINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpConvertHandleToSampledImageINTEL: *hasResult = true; *hasResultType = true; break;
}
}
+inline const char* SourceLanguageToString(SourceLanguage value) {
+ switch (value) {
+ case SourceLanguageUnknown: return "Unknown";
+ case SourceLanguageESSL: return "ESSL";
+ case SourceLanguageGLSL: return "GLSL";
+ case SourceLanguageOpenCL_C: return "OpenCL_C";
+ case SourceLanguageOpenCL_CPP: return "OpenCL_CPP";
+ case SourceLanguageHLSL: return "HLSL";
+ case SourceLanguageCPP_for_OpenCL: return "CPP_for_OpenCL";
+ case SourceLanguageSYCL: return "SYCL";
+ case SourceLanguageHERO_C: return "HERO_C";
+ case SourceLanguageNZSL: return "NZSL";
+ case SourceLanguageWGSL: return "WGSL";
+ case SourceLanguageSlang: return "Slang";
+ case SourceLanguageZig: return "Zig";
+ case SourceLanguageRust: return "Rust";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ExecutionModelToString(ExecutionModel value) {
+ switch (value) {
+ case ExecutionModelVertex: return "Vertex";
+ case ExecutionModelTessellationControl: return "TessellationControl";
+ case ExecutionModelTessellationEvaluation: return "TessellationEvaluation";
+ case ExecutionModelGeometry: return "Geometry";
+ case ExecutionModelFragment: return "Fragment";
+ case ExecutionModelGLCompute: return "GLCompute";
+ case ExecutionModelKernel: return "Kernel";
+ case ExecutionModelTaskNV: return "TaskNV";
+ case ExecutionModelMeshNV: return "MeshNV";
+ case ExecutionModelRayGenerationKHR: return "RayGenerationKHR";
+ case ExecutionModelIntersectionKHR: return "IntersectionKHR";
+ case ExecutionModelAnyHitKHR: return "AnyHitKHR";
+ case ExecutionModelClosestHitKHR: return "ClosestHitKHR";
+ case ExecutionModelMissKHR: return "MissKHR";
+ case ExecutionModelCallableKHR: return "CallableKHR";
+ case ExecutionModelTaskEXT: return "TaskEXT";
+ case ExecutionModelMeshEXT: return "MeshEXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* AddressingModelToString(AddressingModel value) {
+ switch (value) {
+ case AddressingModelLogical: return "Logical";
+ case AddressingModelPhysical32: return "Physical32";
+ case AddressingModelPhysical64: return "Physical64";
+ case AddressingModelPhysicalStorageBuffer64: return "PhysicalStorageBuffer64";
+ default: return "Unknown";
+ }
+}
+
+inline const char* MemoryModelToString(MemoryModel value) {
+ switch (value) {
+ case MemoryModelSimple: return "Simple";
+ case MemoryModelGLSL450: return "GLSL450";
+ case MemoryModelOpenCL: return "OpenCL";
+ case MemoryModelVulkan: return "Vulkan";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ExecutionModeToString(ExecutionMode value) {
+ switch (value) {
+ case ExecutionModeInvocations: return "Invocations";
+ case ExecutionModeSpacingEqual: return "SpacingEqual";
+ case ExecutionModeSpacingFractionalEven: return "SpacingFractionalEven";
+ case ExecutionModeSpacingFractionalOdd: return "SpacingFractionalOdd";
+ case ExecutionModeVertexOrderCw: return "VertexOrderCw";
+ case ExecutionModeVertexOrderCcw: return "VertexOrderCcw";
+ case ExecutionModePixelCenterInteger: return "PixelCenterInteger";
+ case ExecutionModeOriginUpperLeft: return "OriginUpperLeft";
+ case ExecutionModeOriginLowerLeft: return "OriginLowerLeft";
+ case ExecutionModeEarlyFragmentTests: return "EarlyFragmentTests";
+ case ExecutionModePointMode: return "PointMode";
+ case ExecutionModeXfb: return "Xfb";
+ case ExecutionModeDepthReplacing: return "DepthReplacing";
+ case ExecutionModeDepthGreater: return "DepthGreater";
+ case ExecutionModeDepthLess: return "DepthLess";
+ case ExecutionModeDepthUnchanged: return "DepthUnchanged";
+ case ExecutionModeLocalSize: return "LocalSize";
+ case ExecutionModeLocalSizeHint: return "LocalSizeHint";
+ case ExecutionModeInputPoints: return "InputPoints";
+ case ExecutionModeInputLines: return "InputLines";
+ case ExecutionModeInputLinesAdjacency: return "InputLinesAdjacency";
+ case ExecutionModeTriangles: return "Triangles";
+ case ExecutionModeInputTrianglesAdjacency: return "InputTrianglesAdjacency";
+ case ExecutionModeQuads: return "Quads";
+ case ExecutionModeIsolines: return "Isolines";
+ case ExecutionModeOutputVertices: return "OutputVertices";
+ case ExecutionModeOutputPoints: return "OutputPoints";
+ case ExecutionModeOutputLineStrip: return "OutputLineStrip";
+ case ExecutionModeOutputTriangleStrip: return "OutputTriangleStrip";
+ case ExecutionModeVecTypeHint: return "VecTypeHint";
+ case ExecutionModeContractionOff: return "ContractionOff";
+ case ExecutionModeInitializer: return "Initializer";
+ case ExecutionModeFinalizer: return "Finalizer";
+ case ExecutionModeSubgroupSize: return "SubgroupSize";
+ case ExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup";
+ case ExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId";
+ case ExecutionModeLocalSizeId: return "LocalSizeId";
+ case ExecutionModeLocalSizeHintId: return "LocalSizeHintId";
+ case ExecutionModeNonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT";
+ case ExecutionModeNonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT";
+ case ExecutionModeNonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT";
+ case ExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR";
+ case ExecutionModePostDepthCoverage: return "PostDepthCoverage";
+ case ExecutionModeDenormPreserve: return "DenormPreserve";
+ case ExecutionModeDenormFlushToZero: return "DenormFlushToZero";
+ case ExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case ExecutionModeRoundingModeRTE: return "RoundingModeRTE";
+ case ExecutionModeRoundingModeRTZ: return "RoundingModeRTZ";
+ case ExecutionModeNonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM";
+ case ExecutionModeTileShadingRateQCOM: return "TileShadingRateQCOM";
+ case ExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD";
+ case ExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT";
+ case ExecutionModeCoalescingAMDX: return "CoalescingAMDX";
+ case ExecutionModeIsApiEntryAMDX: return "IsApiEntryAMDX";
+ case ExecutionModeMaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX";
+ case ExecutionModeStaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX";
+ case ExecutionModeShaderIndexAMDX: return "ShaderIndexAMDX";
+ case ExecutionModeMaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX";
+ case ExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD";
+ case ExecutionModeStencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD";
+ case ExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD";
+ case ExecutionModeStencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD";
+ case ExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD";
+ case ExecutionModeStencilRefLessBackAMD: return "StencilRefLessBackAMD";
+ case ExecutionModeQuadDerivativesKHR: return "QuadDerivativesKHR";
+ case ExecutionModeRequireFullQuadsKHR: return "RequireFullQuadsKHR";
+ case ExecutionModeSharesInputWithAMDX: return "SharesInputWithAMDX";
+ case ExecutionModeOutputLinesEXT: return "OutputLinesEXT";
+ case ExecutionModeOutputPrimitivesEXT: return "OutputPrimitivesEXT";
+ case ExecutionModeDerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR";
+ case ExecutionModeDerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR";
+ case ExecutionModeOutputTrianglesEXT: return "OutputTrianglesEXT";
+ case ExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT";
+ case ExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT";
+ case ExecutionModeSampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT";
+ case ExecutionModeSampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT";
+ case ExecutionModeShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT";
+ case ExecutionModeShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT";
+ case ExecutionModeSharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL";
+ case ExecutionModeRoundingModeRTPINTEL: return "RoundingModeRTPINTEL";
+ case ExecutionModeRoundingModeRTNINTEL: return "RoundingModeRTNINTEL";
+ case ExecutionModeFloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL";
+ case ExecutionModeFloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL";
+ case ExecutionModeMaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL";
+ case ExecutionModeMaxWorkDimINTEL: return "MaxWorkDimINTEL";
+ case ExecutionModeNoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL";
+ case ExecutionModeNumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL";
+ case ExecutionModeSchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL";
+ case ExecutionModeMaximallyReconvergesKHR: return "MaximallyReconvergesKHR";
+ case ExecutionModeFPFastMathDefault: return "FPFastMathDefault";
+ case ExecutionModeStreamingInterfaceINTEL: return "StreamingInterfaceINTEL";
+ case ExecutionModeRegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL";
+ case ExecutionModeNamedBarrierCountINTEL: return "NamedBarrierCountINTEL";
+ case ExecutionModeMaximumRegistersINTEL: return "MaximumRegistersINTEL";
+ case ExecutionModeMaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL";
+ case ExecutionModeNamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* StorageClassToString(StorageClass value) {
+ switch (value) {
+ case StorageClassUniformConstant: return "UniformConstant";
+ case StorageClassInput: return "Input";
+ case StorageClassUniform: return "Uniform";
+ case StorageClassOutput: return "Output";
+ case StorageClassWorkgroup: return "Workgroup";
+ case StorageClassCrossWorkgroup: return "CrossWorkgroup";
+ case StorageClassPrivate: return "Private";
+ case StorageClassFunction: return "Function";
+ case StorageClassGeneric: return "Generic";
+ case StorageClassPushConstant: return "PushConstant";
+ case StorageClassAtomicCounter: return "AtomicCounter";
+ case StorageClassImage: return "Image";
+ case StorageClassStorageBuffer: return "StorageBuffer";
+ case StorageClassTileImageEXT: return "TileImageEXT";
+ case StorageClassTileAttachmentQCOM: return "TileAttachmentQCOM";
+ case StorageClassNodePayloadAMDX: return "NodePayloadAMDX";
+ case StorageClassCallableDataKHR: return "CallableDataKHR";
+ case StorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR";
+ case StorageClassRayPayloadKHR: return "RayPayloadKHR";
+ case StorageClassHitAttributeKHR: return "HitAttributeKHR";
+ case StorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR";
+ case StorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR";
+ case StorageClassPhysicalStorageBuffer: return "PhysicalStorageBuffer";
+ case StorageClassHitObjectAttributeNV: return "HitObjectAttributeNV";
+ case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
+ case StorageClassCodeSectionINTEL: return "CodeSectionINTEL";
+ case StorageClassDeviceOnlyINTEL: return "DeviceOnlyINTEL";
+ case StorageClassHostOnlyINTEL: return "HostOnlyINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* DimToString(Dim value) {
+ switch (value) {
+ case Dim1D: return "1D";
+ case Dim2D: return "2D";
+ case Dim3D: return "3D";
+ case DimCube: return "Cube";
+ case DimRect: return "Rect";
+ case DimBuffer: return "Buffer";
+ case DimSubpassData: return "SubpassData";
+ case DimTileImageDataEXT: return "TileImageDataEXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) {
+ switch (value) {
+ case SamplerAddressingModeNone: return "None";
+ case SamplerAddressingModeClampToEdge: return "ClampToEdge";
+ case SamplerAddressingModeClamp: return "Clamp";
+ case SamplerAddressingModeRepeat: return "Repeat";
+ case SamplerAddressingModeRepeatMirrored: return "RepeatMirrored";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SamplerFilterModeToString(SamplerFilterMode value) {
+ switch (value) {
+ case SamplerFilterModeNearest: return "Nearest";
+ case SamplerFilterModeLinear: return "Linear";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ImageFormatToString(ImageFormat value) {
+ switch (value) {
+ case ImageFormatUnknown: return "Unknown";
+ case ImageFormatRgba32f: return "Rgba32f";
+ case ImageFormatRgba16f: return "Rgba16f";
+ case ImageFormatR32f: return "R32f";
+ case ImageFormatRgba8: return "Rgba8";
+ case ImageFormatRgba8Snorm: return "Rgba8Snorm";
+ case ImageFormatRg32f: return "Rg32f";
+ case ImageFormatRg16f: return "Rg16f";
+ case ImageFormatR11fG11fB10f: return "R11fG11fB10f";
+ case ImageFormatR16f: return "R16f";
+ case ImageFormatRgba16: return "Rgba16";
+ case ImageFormatRgb10A2: return "Rgb10A2";
+ case ImageFormatRg16: return "Rg16";
+ case ImageFormatRg8: return "Rg8";
+ case ImageFormatR16: return "R16";
+ case ImageFormatR8: return "R8";
+ case ImageFormatRgba16Snorm: return "Rgba16Snorm";
+ case ImageFormatRg16Snorm: return "Rg16Snorm";
+ case ImageFormatRg8Snorm: return "Rg8Snorm";
+ case ImageFormatR16Snorm: return "R16Snorm";
+ case ImageFormatR8Snorm: return "R8Snorm";
+ case ImageFormatRgba32i: return "Rgba32i";
+ case ImageFormatRgba16i: return "Rgba16i";
+ case ImageFormatRgba8i: return "Rgba8i";
+ case ImageFormatR32i: return "R32i";
+ case ImageFormatRg32i: return "Rg32i";
+ case ImageFormatRg16i: return "Rg16i";
+ case ImageFormatRg8i: return "Rg8i";
+ case ImageFormatR16i: return "R16i";
+ case ImageFormatR8i: return "R8i";
+ case ImageFormatRgba32ui: return "Rgba32ui";
+ case ImageFormatRgba16ui: return "Rgba16ui";
+ case ImageFormatRgba8ui: return "Rgba8ui";
+ case ImageFormatR32ui: return "R32ui";
+ case ImageFormatRgb10a2ui: return "Rgb10a2ui";
+ case ImageFormatRg32ui: return "Rg32ui";
+ case ImageFormatRg16ui: return "Rg16ui";
+ case ImageFormatRg8ui: return "Rg8ui";
+ case ImageFormatR16ui: return "R16ui";
+ case ImageFormatR8ui: return "R8ui";
+ case ImageFormatR64ui: return "R64ui";
+ case ImageFormatR64i: return "R64i";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ImageChannelOrderToString(ImageChannelOrder value) {
+ switch (value) {
+ case ImageChannelOrderR: return "R";
+ case ImageChannelOrderA: return "A";
+ case ImageChannelOrderRG: return "RG";
+ case ImageChannelOrderRA: return "RA";
+ case ImageChannelOrderRGB: return "RGB";
+ case ImageChannelOrderRGBA: return "RGBA";
+ case ImageChannelOrderBGRA: return "BGRA";
+ case ImageChannelOrderARGB: return "ARGB";
+ case ImageChannelOrderIntensity: return "Intensity";
+ case ImageChannelOrderLuminance: return "Luminance";
+ case ImageChannelOrderRx: return "Rx";
+ case ImageChannelOrderRGx: return "RGx";
+ case ImageChannelOrderRGBx: return "RGBx";
+ case ImageChannelOrderDepth: return "Depth";
+ case ImageChannelOrderDepthStencil: return "DepthStencil";
+ case ImageChannelOrdersRGB: return "sRGB";
+ case ImageChannelOrdersRGBx: return "sRGBx";
+ case ImageChannelOrdersRGBA: return "sRGBA";
+ case ImageChannelOrdersBGRA: return "sBGRA";
+ case ImageChannelOrderABGR: return "ABGR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) {
+ switch (value) {
+ case ImageChannelDataTypeSnormInt8: return "SnormInt8";
+ case ImageChannelDataTypeSnormInt16: return "SnormInt16";
+ case ImageChannelDataTypeUnormInt8: return "UnormInt8";
+ case ImageChannelDataTypeUnormInt16: return "UnormInt16";
+ case ImageChannelDataTypeUnormShort565: return "UnormShort565";
+ case ImageChannelDataTypeUnormShort555: return "UnormShort555";
+ case ImageChannelDataTypeUnormInt101010: return "UnormInt101010";
+ case ImageChannelDataTypeSignedInt8: return "SignedInt8";
+ case ImageChannelDataTypeSignedInt16: return "SignedInt16";
+ case ImageChannelDataTypeSignedInt32: return "SignedInt32";
+ case ImageChannelDataTypeUnsignedInt8: return "UnsignedInt8";
+ case ImageChannelDataTypeUnsignedInt16: return "UnsignedInt16";
+ case ImageChannelDataTypeUnsignedInt32: return "UnsignedInt32";
+ case ImageChannelDataTypeHalfFloat: return "HalfFloat";
+ case ImageChannelDataTypeFloat: return "Float";
+ case ImageChannelDataTypeUnormInt24: return "UnormInt24";
+ case ImageChannelDataTypeUnormInt101010_2: return "UnormInt101010_2";
+ case ImageChannelDataTypeUnormInt10X6EXT: return "UnormInt10X6EXT";
+ case ImageChannelDataTypeUnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT";
+ case ImageChannelDataTypeUnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT";
+ case ImageChannelDataTypeUnormInt2_101010EXT: return "UnormInt2_101010EXT";
+ case ImageChannelDataTypeUnsignedInt10X6EXT: return "UnsignedInt10X6EXT";
+ case ImageChannelDataTypeUnsignedInt12X4EXT: return "UnsignedInt12X4EXT";
+ case ImageChannelDataTypeUnsignedInt14X2EXT: return "UnsignedInt14X2EXT";
+ case ImageChannelDataTypeUnormInt12X4EXT: return "UnormInt12X4EXT";
+ case ImageChannelDataTypeUnormInt14X2EXT: return "UnormInt14X2EXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPRoundingModeToString(FPRoundingMode value) {
+ switch (value) {
+ case FPRoundingModeRTE: return "RTE";
+ case FPRoundingModeRTZ: return "RTZ";
+ case FPRoundingModeRTP: return "RTP";
+ case FPRoundingModeRTN: return "RTN";
+ default: return "Unknown";
+ }
+}
+
+inline const char* LinkageTypeToString(LinkageType value) {
+ switch (value) {
+ case LinkageTypeExport: return "Export";
+ case LinkageTypeImport: return "Import";
+ case LinkageTypeLinkOnceODR: return "LinkOnceODR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* AccessQualifierToString(AccessQualifier value) {
+ switch (value) {
+ case AccessQualifierReadOnly: return "ReadOnly";
+ case AccessQualifierWriteOnly: return "WriteOnly";
+ case AccessQualifierReadWrite: return "ReadWrite";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) {
+ switch (value) {
+ case FunctionParameterAttributeZext: return "Zext";
+ case FunctionParameterAttributeSext: return "Sext";
+ case FunctionParameterAttributeByVal: return "ByVal";
+ case FunctionParameterAttributeSret: return "Sret";
+ case FunctionParameterAttributeNoAlias: return "NoAlias";
+ case FunctionParameterAttributeNoCapture: return "NoCapture";
+ case FunctionParameterAttributeNoWrite: return "NoWrite";
+ case FunctionParameterAttributeNoReadWrite: return "NoReadWrite";
+ case FunctionParameterAttributeRuntimeAlignedINTEL: return "RuntimeAlignedINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* DecorationToString(Decoration value) {
+ switch (value) {
+ case DecorationRelaxedPrecision: return "RelaxedPrecision";
+ case DecorationSpecId: return "SpecId";
+ case DecorationBlock: return "Block";
+ case DecorationBufferBlock: return "BufferBlock";
+ case DecorationRowMajor: return "RowMajor";
+ case DecorationColMajor: return "ColMajor";
+ case DecorationArrayStride: return "ArrayStride";
+ case DecorationMatrixStride: return "MatrixStride";
+ case DecorationGLSLShared: return "GLSLShared";
+ case DecorationGLSLPacked: return "GLSLPacked";
+ case DecorationCPacked: return "CPacked";
+ case DecorationBuiltIn: return "BuiltIn";
+ case DecorationNoPerspective: return "NoPerspective";
+ case DecorationFlat: return "Flat";
+ case DecorationPatch: return "Patch";
+ case DecorationCentroid: return "Centroid";
+ case DecorationSample: return "Sample";
+ case DecorationInvariant: return "Invariant";
+ case DecorationRestrict: return "Restrict";
+ case DecorationAliased: return "Aliased";
+ case DecorationVolatile: return "Volatile";
+ case DecorationConstant: return "Constant";
+ case DecorationCoherent: return "Coherent";
+ case DecorationNonWritable: return "NonWritable";
+ case DecorationNonReadable: return "NonReadable";
+ case DecorationUniform: return "Uniform";
+ case DecorationUniformId: return "UniformId";
+ case DecorationSaturatedConversion: return "SaturatedConversion";
+ case DecorationStream: return "Stream";
+ case DecorationLocation: return "Location";
+ case DecorationComponent: return "Component";
+ case DecorationIndex: return "Index";
+ case DecorationBinding: return "Binding";
+ case DecorationDescriptorSet: return "DescriptorSet";
+ case DecorationOffset: return "Offset";
+ case DecorationXfbBuffer: return "XfbBuffer";
+ case DecorationXfbStride: return "XfbStride";
+ case DecorationFuncParamAttr: return "FuncParamAttr";
+ case DecorationFPRoundingMode: return "FPRoundingMode";
+ case DecorationFPFastMathMode: return "FPFastMathMode";
+ case DecorationLinkageAttributes: return "LinkageAttributes";
+ case DecorationNoContraction: return "NoContraction";
+ case DecorationInputAttachmentIndex: return "InputAttachmentIndex";
+ case DecorationAlignment: return "Alignment";
+ case DecorationMaxByteOffset: return "MaxByteOffset";
+ case DecorationAlignmentId: return "AlignmentId";
+ case DecorationMaxByteOffsetId: return "MaxByteOffsetId";
+ case DecorationSaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT";
+ case DecorationNoSignedWrap: return "NoSignedWrap";
+ case DecorationNoUnsignedWrap: return "NoUnsignedWrap";
+ case DecorationWeightTextureQCOM: return "WeightTextureQCOM";
+ case DecorationBlockMatchTextureQCOM: return "BlockMatchTextureQCOM";
+ case DecorationBlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM";
+ case DecorationExplicitInterpAMD: return "ExplicitInterpAMD";
+ case DecorationNodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX";
+ case DecorationNodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX";
+ case DecorationTrackFinishWritingAMDX: return "TrackFinishWritingAMDX";
+ case DecorationPayloadNodeNameAMDX: return "PayloadNodeNameAMDX";
+ case DecorationPayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX";
+ case DecorationPayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX";
+ case DecorationPayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX";
+ case DecorationPayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX";
+ case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
+ case DecorationPassthroughNV: return "PassthroughNV";
+ case DecorationViewportRelativeNV: return "ViewportRelativeNV";
+ case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV";
+ case DecorationPerPrimitiveEXT: return "PerPrimitiveEXT";
+ case DecorationPerViewNV: return "PerViewNV";
+ case DecorationPerTaskNV: return "PerTaskNV";
+ case DecorationPerVertexKHR: return "PerVertexKHR";
+ case DecorationNonUniform: return "NonUniform";
+ case DecorationRestrictPointer: return "RestrictPointer";
+ case DecorationAliasedPointer: return "AliasedPointer";
+ case DecorationHitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV";
+ case DecorationBindlessSamplerNV: return "BindlessSamplerNV";
+ case DecorationBindlessImageNV: return "BindlessImageNV";
+ case DecorationBoundSamplerNV: return "BoundSamplerNV";
+ case DecorationBoundImageNV: return "BoundImageNV";
+ case DecorationSIMTCallINTEL: return "SIMTCallINTEL";
+ case DecorationReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL";
+ case DecorationClobberINTEL: return "ClobberINTEL";
+ case DecorationSideEffectsINTEL: return "SideEffectsINTEL";
+ case DecorationVectorComputeVariableINTEL: return "VectorComputeVariableINTEL";
+ case DecorationFuncParamIOKindINTEL: return "FuncParamIOKindINTEL";
+ case DecorationVectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL";
+ case DecorationStackCallINTEL: return "StackCallINTEL";
+ case DecorationGlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL";
+ case DecorationCounterBuffer: return "CounterBuffer";
+ case DecorationHlslSemanticGOOGLE: return "HlslSemanticGOOGLE";
+ case DecorationUserTypeGOOGLE: return "UserTypeGOOGLE";
+ case DecorationFunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL";
+ case DecorationFunctionDenormModeINTEL: return "FunctionDenormModeINTEL";
+ case DecorationRegisterINTEL: return "RegisterINTEL";
+ case DecorationMemoryINTEL: return "MemoryINTEL";
+ case DecorationNumbanksINTEL: return "NumbanksINTEL";
+ case DecorationBankwidthINTEL: return "BankwidthINTEL";
+ case DecorationMaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL";
+ case DecorationSinglepumpINTEL: return "SinglepumpINTEL";
+ case DecorationDoublepumpINTEL: return "DoublepumpINTEL";
+ case DecorationMaxReplicatesINTEL: return "MaxReplicatesINTEL";
+ case DecorationSimpleDualPortINTEL: return "SimpleDualPortINTEL";
+ case DecorationMergeINTEL: return "MergeINTEL";
+ case DecorationBankBitsINTEL: return "BankBitsINTEL";
+ case DecorationForcePow2DepthINTEL: return "ForcePow2DepthINTEL";
+ case DecorationStridesizeINTEL: return "StridesizeINTEL";
+ case DecorationWordsizeINTEL: return "WordsizeINTEL";
+ case DecorationTrueDualPortINTEL: return "TrueDualPortINTEL";
+ case DecorationBurstCoalesceINTEL: return "BurstCoalesceINTEL";
+ case DecorationCacheSizeINTEL: return "CacheSizeINTEL";
+ case DecorationDontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL";
+ case DecorationPrefetchINTEL: return "PrefetchINTEL";
+ case DecorationStallEnableINTEL: return "StallEnableINTEL";
+ case DecorationFuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL";
+ case DecorationMathOpDSPModeINTEL: return "MathOpDSPModeINTEL";
+ case DecorationAliasScopeINTEL: return "AliasScopeINTEL";
+ case DecorationNoAliasINTEL: return "NoAliasINTEL";
+ case DecorationInitiationIntervalINTEL: return "InitiationIntervalINTEL";
+ case DecorationMaxConcurrencyINTEL: return "MaxConcurrencyINTEL";
+ case DecorationPipelineEnableINTEL: return "PipelineEnableINTEL";
+ case DecorationBufferLocationINTEL: return "BufferLocationINTEL";
+ case DecorationIOPipeStorageINTEL: return "IOPipeStorageINTEL";
+ case DecorationFunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL";
+ case DecorationSingleElementVectorINTEL: return "SingleElementVectorINTEL";
+ case DecorationVectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL";
+ case DecorationMediaBlockIOINTEL: return "MediaBlockIOINTEL";
+ case DecorationStallFreeINTEL: return "StallFreeINTEL";
+ case DecorationFPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL";
+ case DecorationLatencyControlLabelINTEL: return "LatencyControlLabelINTEL";
+ case DecorationLatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL";
+ case DecorationConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL";
+ case DecorationRegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL";
+ case DecorationMMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL";
+ case DecorationMMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL";
+ case DecorationMMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL";
+ case DecorationMMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL";
+ case DecorationMMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL";
+ case DecorationMMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL";
+ case DecorationStableKernelArgumentINTEL: return "StableKernelArgumentINTEL";
+ case DecorationHostAccessINTEL: return "HostAccessINTEL";
+ case DecorationInitModeINTEL: return "InitModeINTEL";
+ case DecorationImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL";
+ case DecorationConditionalINTEL: return "ConditionalINTEL";
+ case DecorationCacheControlLoadINTEL: return "CacheControlLoadINTEL";
+ case DecorationCacheControlStoreINTEL: return "CacheControlStoreINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* BuiltInToString(BuiltIn value) {
+ switch (value) {
+ case BuiltInPosition: return "Position";
+ case BuiltInPointSize: return "PointSize";
+ case BuiltInClipDistance: return "ClipDistance";
+ case BuiltInCullDistance: return "CullDistance";
+ case BuiltInVertexId: return "VertexId";
+ case BuiltInInstanceId: return "InstanceId";
+ case BuiltInPrimitiveId: return "PrimitiveId";
+ case BuiltInInvocationId: return "InvocationId";
+ case BuiltInLayer: return "Layer";
+ case BuiltInViewportIndex: return "ViewportIndex";
+ case BuiltInTessLevelOuter: return "TessLevelOuter";
+ case BuiltInTessLevelInner: return "TessLevelInner";
+ case BuiltInTessCoord: return "TessCoord";
+ case BuiltInPatchVertices: return "PatchVertices";
+ case BuiltInFragCoord: return "FragCoord";
+ case BuiltInPointCoord: return "PointCoord";
+ case BuiltInFrontFacing: return "FrontFacing";
+ case BuiltInSampleId: return "SampleId";
+ case BuiltInSamplePosition: return "SamplePosition";
+ case BuiltInSampleMask: return "SampleMask";
+ case BuiltInFragDepth: return "FragDepth";
+ case BuiltInHelperInvocation: return "HelperInvocation";
+ case BuiltInNumWorkgroups: return "NumWorkgroups";
+ case BuiltInWorkgroupSize: return "WorkgroupSize";
+ case BuiltInWorkgroupId: return "WorkgroupId";
+ case BuiltInLocalInvocationId: return "LocalInvocationId";
+ case BuiltInGlobalInvocationId: return "GlobalInvocationId";
+ case BuiltInLocalInvocationIndex: return "LocalInvocationIndex";
+ case BuiltInWorkDim: return "WorkDim";
+ case BuiltInGlobalSize: return "GlobalSize";
+ case BuiltInEnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize";
+ case BuiltInGlobalOffset: return "GlobalOffset";
+ case BuiltInGlobalLinearId: return "GlobalLinearId";
+ case BuiltInSubgroupSize: return "SubgroupSize";
+ case BuiltInSubgroupMaxSize: return "SubgroupMaxSize";
+ case BuiltInNumSubgroups: return "NumSubgroups";
+ case BuiltInNumEnqueuedSubgroups: return "NumEnqueuedSubgroups";
+ case BuiltInSubgroupId: return "SubgroupId";
+ case BuiltInSubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
+ case BuiltInVertexIndex: return "VertexIndex";
+ case BuiltInInstanceIndex: return "InstanceIndex";
+ case BuiltInCoreIDARM: return "CoreIDARM";
+ case BuiltInCoreCountARM: return "CoreCountARM";
+ case BuiltInCoreMaxIDARM: return "CoreMaxIDARM";
+ case BuiltInWarpIDARM: return "WarpIDARM";
+ case BuiltInWarpMaxIDARM: return "WarpMaxIDARM";
+ case BuiltInSubgroupEqMask: return "SubgroupEqMask";
+ case BuiltInSubgroupGeMask: return "SubgroupGeMask";
+ case BuiltInSubgroupGtMask: return "SubgroupGtMask";
+ case BuiltInSubgroupLeMask: return "SubgroupLeMask";
+ case BuiltInSubgroupLtMask: return "SubgroupLtMask";
+ case BuiltInBaseVertex: return "BaseVertex";
+ case BuiltInBaseInstance: return "BaseInstance";
+ case BuiltInDrawIndex: return "DrawIndex";
+ case BuiltInPrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR";
+ case BuiltInDeviceIndex: return "DeviceIndex";
+ case BuiltInViewIndex: return "ViewIndex";
+ case BuiltInShadingRateKHR: return "ShadingRateKHR";
+ case BuiltInTileOffsetQCOM: return "TileOffsetQCOM";
+ case BuiltInTileDimensionQCOM: return "TileDimensionQCOM";
+ case BuiltInTileApronSizeQCOM: return "TileApronSizeQCOM";
+ case BuiltInBaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD";
+ case BuiltInBaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD";
+ case BuiltInBaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD";
+ case BuiltInBaryCoordSmoothAMD: return "BaryCoordSmoothAMD";
+ case BuiltInBaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD";
+ case BuiltInBaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD";
+ case BuiltInBaryCoordPullModelAMD: return "BaryCoordPullModelAMD";
+ case BuiltInFragStencilRefEXT: return "FragStencilRefEXT";
+ case BuiltInRemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX";
+ case BuiltInShaderIndexAMDX: return "ShaderIndexAMDX";
+ case BuiltInViewportMaskNV: return "ViewportMaskNV";
+ case BuiltInSecondaryPositionNV: return "SecondaryPositionNV";
+ case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
+ case BuiltInPositionPerViewNV: return "PositionPerViewNV";
+ case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
+ case BuiltInFullyCoveredEXT: return "FullyCoveredEXT";
+ case BuiltInTaskCountNV: return "TaskCountNV";
+ case BuiltInPrimitiveCountNV: return "PrimitiveCountNV";
+ case BuiltInPrimitiveIndicesNV: return "PrimitiveIndicesNV";
+ case BuiltInClipDistancePerViewNV: return "ClipDistancePerViewNV";
+ case BuiltInCullDistancePerViewNV: return "CullDistancePerViewNV";
+ case BuiltInLayerPerViewNV: return "LayerPerViewNV";
+ case BuiltInMeshViewCountNV: return "MeshViewCountNV";
+ case BuiltInMeshViewIndicesNV: return "MeshViewIndicesNV";
+ case BuiltInBaryCoordKHR: return "BaryCoordKHR";
+ case BuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR";
+ case BuiltInFragSizeEXT: return "FragSizeEXT";
+ case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT";
+ case BuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT";
+ case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
+ case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
+ case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT";
+ case BuiltInLaunchIdKHR: return "LaunchIdKHR";
+ case BuiltInLaunchSizeKHR: return "LaunchSizeKHR";
+ case BuiltInWorldRayOriginKHR: return "WorldRayOriginKHR";
+ case BuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR";
+ case BuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR";
+ case BuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR";
+ case BuiltInRayTminKHR: return "RayTminKHR";
+ case BuiltInRayTmaxKHR: return "RayTmaxKHR";
+ case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR";
+ case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR";
+ case BuiltInWorldToObjectKHR: return "WorldToObjectKHR";
+ case BuiltInHitTNV: return "HitTNV";
+ case BuiltInHitKindKHR: return "HitKindKHR";
+ case BuiltInCurrentRayTimeNV: return "CurrentRayTimeNV";
+ case BuiltInHitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR";
+ case BuiltInHitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV";
+ case BuiltInHitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV";
+ case BuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR";
+ case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR";
+ case BuiltInHitIsSphereNV: return "HitIsSphereNV";
+ case BuiltInHitIsLSSNV: return "HitIsLSSNV";
+ case BuiltInHitSpherePositionNV: return "HitSpherePositionNV";
+ case BuiltInWarpsPerSMNV: return "WarpsPerSMNV";
+ case BuiltInSMCountNV: return "SMCountNV";
+ case BuiltInWarpIDNV: return "WarpIDNV";
+ case BuiltInSMIDNV: return "SMIDNV";
+ case BuiltInHitLSSPositionsNV: return "HitLSSPositionsNV";
+ case BuiltInHitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV";
+ case BuiltInHitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV";
+ case BuiltInHitSphereRadiusNV: return "HitSphereRadiusNV";
+ case BuiltInHitLSSRadiiNV: return "HitLSSRadiiNV";
+ case BuiltInClusterIDNV: return "ClusterIDNV";
+ case BuiltInCullMaskKHR: return "CullMaskKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ScopeToString(Scope value) {
+ switch (value) {
+ case ScopeCrossDevice: return "CrossDevice";
+ case ScopeDevice: return "Device";
+ case ScopeWorkgroup: return "Workgroup";
+ case ScopeSubgroup: return "Subgroup";
+ case ScopeInvocation: return "Invocation";
+ case ScopeQueueFamily: return "QueueFamily";
+ case ScopeShaderCallKHR: return "ShaderCallKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* GroupOperationToString(GroupOperation value) {
+ switch (value) {
+ case GroupOperationReduce: return "Reduce";
+ case GroupOperationInclusiveScan: return "InclusiveScan";
+ case GroupOperationExclusiveScan: return "ExclusiveScan";
+ case GroupOperationClusteredReduce: return "ClusteredReduce";
+ case GroupOperationPartitionedReduceNV: return "PartitionedReduceNV";
+ case GroupOperationPartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV";
+ case GroupOperationPartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) {
+ switch (value) {
+ case KernelEnqueueFlagsNoWait: return "NoWait";
+ case KernelEnqueueFlagsWaitKernel: return "WaitKernel";
+ case KernelEnqueueFlagsWaitWorkGroup: return "WaitWorkGroup";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CapabilityToString(Capability value) {
+ switch (value) {
+ case CapabilityMatrix: return "Matrix";
+ case CapabilityShader: return "Shader";
+ case CapabilityGeometry: return "Geometry";
+ case CapabilityTessellation: return "Tessellation";
+ case CapabilityAddresses: return "Addresses";
+ case CapabilityLinkage: return "Linkage";
+ case CapabilityKernel: return "Kernel";
+ case CapabilityVector16: return "Vector16";
+ case CapabilityFloat16Buffer: return "Float16Buffer";
+ case CapabilityFloat16: return "Float16";
+ case CapabilityFloat64: return "Float64";
+ case CapabilityInt64: return "Int64";
+ case CapabilityInt64Atomics: return "Int64Atomics";
+ case CapabilityImageBasic: return "ImageBasic";
+ case CapabilityImageReadWrite: return "ImageReadWrite";
+ case CapabilityImageMipmap: return "ImageMipmap";
+ case CapabilityPipes: return "Pipes";
+ case CapabilityGroups: return "Groups";
+ case CapabilityDeviceEnqueue: return "DeviceEnqueue";
+ case CapabilityLiteralSampler: return "LiteralSampler";
+ case CapabilityAtomicStorage: return "AtomicStorage";
+ case CapabilityInt16: return "Int16";
+ case CapabilityTessellationPointSize: return "TessellationPointSize";
+ case CapabilityGeometryPointSize: return "GeometryPointSize";
+ case CapabilityImageGatherExtended: return "ImageGatherExtended";
+ case CapabilityStorageImageMultisample: return "StorageImageMultisample";
+ case CapabilityUniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing";
+ case CapabilitySampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing";
+ case CapabilityStorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing";
+ case CapabilityStorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing";
+ case CapabilityClipDistance: return "ClipDistance";
+ case CapabilityCullDistance: return "CullDistance";
+ case CapabilityImageCubeArray: return "ImageCubeArray";
+ case CapabilitySampleRateShading: return "SampleRateShading";
+ case CapabilityImageRect: return "ImageRect";
+ case CapabilitySampledRect: return "SampledRect";
+ case CapabilityGenericPointer: return "GenericPointer";
+ case CapabilityInt8: return "Int8";
+ case CapabilityInputAttachment: return "InputAttachment";
+ case CapabilitySparseResidency: return "SparseResidency";
+ case CapabilityMinLod: return "MinLod";
+ case CapabilitySampled1D: return "Sampled1D";
+ case CapabilityImage1D: return "Image1D";
+ case CapabilitySampledCubeArray: return "SampledCubeArray";
+ case CapabilitySampledBuffer: return "SampledBuffer";
+ case CapabilityImageBuffer: return "ImageBuffer";
+ case CapabilityImageMSArray: return "ImageMSArray";
+ case CapabilityStorageImageExtendedFormats: return "StorageImageExtendedFormats";
+ case CapabilityImageQuery: return "ImageQuery";
+ case CapabilityDerivativeControl: return "DerivativeControl";
+ case CapabilityInterpolationFunction: return "InterpolationFunction";
+ case CapabilityTransformFeedback: return "TransformFeedback";
+ case CapabilityGeometryStreams: return "GeometryStreams";
+ case CapabilityStorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat";
+ case CapabilityStorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat";
+ case CapabilityMultiViewport: return "MultiViewport";
+ case CapabilitySubgroupDispatch: return "SubgroupDispatch";
+ case CapabilityNamedBarrier: return "NamedBarrier";
+ case CapabilityPipeStorage: return "PipeStorage";
+ case CapabilityGroupNonUniform: return "GroupNonUniform";
+ case CapabilityGroupNonUniformVote: return "GroupNonUniformVote";
+ case CapabilityGroupNonUniformArithmetic: return "GroupNonUniformArithmetic";
+ case CapabilityGroupNonUniformBallot: return "GroupNonUniformBallot";
+ case CapabilityGroupNonUniformShuffle: return "GroupNonUniformShuffle";
+ case CapabilityGroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative";
+ case CapabilityGroupNonUniformClustered: return "GroupNonUniformClustered";
+ case CapabilityGroupNonUniformQuad: return "GroupNonUniformQuad";
+ case CapabilityShaderLayer: return "ShaderLayer";
+ case CapabilityShaderViewportIndex: return "ShaderViewportIndex";
+ case CapabilityUniformDecoration: return "UniformDecoration";
+ case CapabilityCoreBuiltinsARM: return "CoreBuiltinsARM";
+ case CapabilityTileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
+ case CapabilityTileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
+ case CapabilityTileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT";
+ case CapabilityTensorsARM: return "TensorsARM";
+ case CapabilityStorageTensorArrayDynamicIndexingARM: return "StorageTensorArrayDynamicIndexingARM";
+ case CapabilityStorageTensorArrayNonUniformIndexingARM: return "StorageTensorArrayNonUniformIndexingARM";
+ case CapabilityGraphARM: return "GraphARM";
+ case CapabilityCooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM";
+ case CapabilityFloat8EXT: return "Float8EXT";
+ case CapabilityFloat8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT";
+ case CapabilityFragmentShadingRateKHR: return "FragmentShadingRateKHR";
+ case CapabilitySubgroupBallotKHR: return "SubgroupBallotKHR";
+ case CapabilityDrawParameters: return "DrawParameters";
+ case CapabilityWorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR";
+ case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR";
+ case CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR";
+ case CapabilitySubgroupVoteKHR: return "SubgroupVoteKHR";
+ case CapabilityStorageBuffer16BitAccess: return "StorageBuffer16BitAccess";
+ case CapabilityStorageUniform16: return "StorageUniform16";
+ case CapabilityStoragePushConstant16: return "StoragePushConstant16";
+ case CapabilityStorageInputOutput16: return "StorageInputOutput16";
+ case CapabilityDeviceGroup: return "DeviceGroup";
+ case CapabilityMultiView: return "MultiView";
+ case CapabilityVariablePointersStorageBuffer: return "VariablePointersStorageBuffer";
+ case CapabilityVariablePointers: return "VariablePointers";
+ case CapabilityAtomicStorageOps: return "AtomicStorageOps";
+ case CapabilitySampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage";
+ case CapabilityStorageBuffer8BitAccess: return "StorageBuffer8BitAccess";
+ case CapabilityUniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess";
+ case CapabilityStoragePushConstant8: return "StoragePushConstant8";
+ case CapabilityDenormPreserve: return "DenormPreserve";
+ case CapabilityDenormFlushToZero: return "DenormFlushToZero";
+ case CapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case CapabilityRoundingModeRTE: return "RoundingModeRTE";
+ case CapabilityRoundingModeRTZ: return "RoundingModeRTZ";
+ case CapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR";
+ case CapabilityRayQueryKHR: return "RayQueryKHR";
+ case CapabilityUntypedPointersKHR: return "UntypedPointersKHR";
+ case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR";
+ case CapabilityRayTracingKHR: return "RayTracingKHR";
+ case CapabilityTextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM";
+ case CapabilityTextureBoxFilterQCOM: return "TextureBoxFilterQCOM";
+ case CapabilityTextureBlockMatchQCOM: return "TextureBlockMatchQCOM";
+ case CapabilityTileShadingQCOM: return "TileShadingQCOM";
+ case CapabilityCooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM";
+ case CapabilityTextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM";
+ case CapabilityFloat16ImageAMD: return "Float16ImageAMD";
+ case CapabilityImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";
+ case CapabilityFragmentMaskAMD: return "FragmentMaskAMD";
+ case CapabilityStencilExportEXT: return "StencilExportEXT";
+ case CapabilityImageReadWriteLodAMD: return "ImageReadWriteLodAMD";
+ case CapabilityInt64ImageEXT: return "Int64ImageEXT";
+ case CapabilityShaderClockKHR: return "ShaderClockKHR";
+ case CapabilityShaderEnqueueAMDX: return "ShaderEnqueueAMDX";
+ case CapabilityQuadControlKHR: return "QuadControlKHR";
+ case CapabilityInt4TypeINTEL: return "Int4TypeINTEL";
+ case CapabilityInt4CooperativeMatrixINTEL: return "Int4CooperativeMatrixINTEL";
+ case CapabilityBFloat16TypeKHR: return "BFloat16TypeKHR";
+ case CapabilityBFloat16DotProductKHR: return "BFloat16DotProductKHR";
+ case CapabilityBFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR";
+ case CapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV";
+ case CapabilityGeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV";
+ case CapabilityShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT";
+ case CapabilityShaderViewportMaskNV: return "ShaderViewportMaskNV";
+ case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV";
+ case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
+ case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";
+ case CapabilityMeshShadingNV: return "MeshShadingNV";
+ case CapabilityImageFootprintNV: return "ImageFootprintNV";
+ case CapabilityMeshShadingEXT: return "MeshShadingEXT";
+ case CapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR";
+ case CapabilityComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR";
+ case CapabilityFragmentDensityEXT: return "FragmentDensityEXT";
+ case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV";
+ case CapabilityShaderNonUniform: return "ShaderNonUniform";
+ case CapabilityRuntimeDescriptorArray: return "RuntimeDescriptorArray";
+ case CapabilityInputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing";
+ case CapabilityUniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing";
+ case CapabilityStorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing";
+ case CapabilityUniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing";
+ case CapabilitySampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing";
+ case CapabilityStorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing";
+ case CapabilityStorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing";
+ case CapabilityInputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing";
+ case CapabilityUniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing";
+ case CapabilityStorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing";
+ case CapabilityRayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR";
+ case CapabilityRayTracingNV: return "RayTracingNV";
+ case CapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV";
+ case CapabilityVulkanMemoryModel: return "VulkanMemoryModel";
+ case CapabilityVulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope";
+ case CapabilityPhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses";
+ case CapabilityComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR";
+ case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
+ case CapabilityCooperativeMatrixNV: return "CooperativeMatrixNV";
+ case CapabilityFragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT";
+ case CapabilityFragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT";
+ case CapabilityShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV";
+ case CapabilityFragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT";
+ case CapabilityDemoteToHelperInvocation: return "DemoteToHelperInvocation";
+ case CapabilityDisplacementMicromapNV: return "DisplacementMicromapNV";
+ case CapabilityRayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT";
+ case CapabilityShaderInvocationReorderNV: return "ShaderInvocationReorderNV";
+ case CapabilityBindlessTextureNV: return "BindlessTextureNV";
+ case CapabilityRayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
+ case CapabilityCooperativeVectorNV: return "CooperativeVectorNV";
+ case CapabilityAtomicFloat16VectorNV: return "AtomicFloat16VectorNV";
+ case CapabilityRayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV";
+ case CapabilityRawAccessChainsNV: return "RawAccessChainsNV";
+ case CapabilityRayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV";
+ case CapabilityRayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV";
+ case CapabilityCooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV";
+ case CapabilityCooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV";
+ case CapabilityCooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV";
+ case CapabilityCooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV";
+ case CapabilityCooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV";
+ case CapabilityCooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV";
+ case CapabilityRayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV";
+ case CapabilityTensorAddressingNV: return "TensorAddressingNV";
+ case CapabilitySubgroupShuffleINTEL: return "SubgroupShuffleINTEL";
+ case CapabilitySubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL";
+ case CapabilitySubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL";
+ case CapabilitySubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL";
+ case CapabilityRoundToInfinityINTEL: return "RoundToInfinityINTEL";
+ case CapabilityFloatingPointModeINTEL: return "FloatingPointModeINTEL";
+ case CapabilityIntegerFunctions2INTEL: return "IntegerFunctions2INTEL";
+ case CapabilityFunctionPointersINTEL: return "FunctionPointersINTEL";
+ case CapabilityIndirectReferencesINTEL: return "IndirectReferencesINTEL";
+ case CapabilityAsmINTEL: return "AsmINTEL";
+ case CapabilityAtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT";
+ case CapabilityAtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT";
+ case CapabilityAtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT";
+ case CapabilityVectorComputeINTEL: return "VectorComputeINTEL";
+ case CapabilityVectorAnyINTEL: return "VectorAnyINTEL";
+ case CapabilityExpectAssumeKHR: return "ExpectAssumeKHR";
+ case CapabilitySubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL";
+ case CapabilitySubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL";
+ case CapabilitySubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL";
+ case CapabilityVariableLengthArrayINTEL: return "VariableLengthArrayINTEL";
+ case CapabilityFunctionFloatControlINTEL: return "FunctionFloatControlINTEL";
+ case CapabilityFPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL";
+ case CapabilityFPFastMathModeINTEL: return "FPFastMathModeINTEL";
+ case CapabilityArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL";
+ case CapabilityArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL";
+ case CapabilityUnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL";
+ case CapabilityFPGALoopControlsINTEL: return "FPGALoopControlsINTEL";
+ case CapabilityKernelAttributesINTEL: return "KernelAttributesINTEL";
+ case CapabilityFPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL";
+ case CapabilityFPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL";
+ case CapabilityFPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL";
+ case CapabilityLoopFuseINTEL: return "LoopFuseINTEL";
+ case CapabilityFPGADSPControlINTEL: return "FPGADSPControlINTEL";
+ case CapabilityMemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL";
+ case CapabilityFPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL";
+ case CapabilityFPGABufferLocationINTEL: return "FPGABufferLocationINTEL";
+ case CapabilityArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL";
+ case CapabilityUSMStorageClassesINTEL: return "USMStorageClassesINTEL";
+ case CapabilityRuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL";
+ case CapabilityIOPipesINTEL: return "IOPipesINTEL";
+ case CapabilityBlockingPipesINTEL: return "BlockingPipesINTEL";
+ case CapabilityFPGARegINTEL: return "FPGARegINTEL";
+ case CapabilityDotProductInputAll: return "DotProductInputAll";
+ case CapabilityDotProductInput4x8Bit: return "DotProductInput4x8Bit";
+ case CapabilityDotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked";
+ case CapabilityDotProduct: return "DotProduct";
+ case CapabilityRayCullMaskKHR: return "RayCullMaskKHR";
+ case CapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR";
+ case CapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT";
+ case CapabilityBitInstructions: return "BitInstructions";
+ case CapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR";
+ case CapabilityFloatControls2: return "FloatControls2";
+ case CapabilityAtomicFloat32AddEXT: return "AtomicFloat32AddEXT";
+ case CapabilityAtomicFloat64AddEXT: return "AtomicFloat64AddEXT";
+ case CapabilityLongCompositesINTEL: return "LongCompositesINTEL";
+ case CapabilityOptNoneEXT: return "OptNoneEXT";
+ case CapabilityAtomicFloat16AddEXT: return "AtomicFloat16AddEXT";
+ case CapabilityDebugInfoModuleINTEL: return "DebugInfoModuleINTEL";
+ case CapabilityBFloat16ConversionINTEL: return "BFloat16ConversionINTEL";
+ case CapabilitySplitBarrierINTEL: return "SplitBarrierINTEL";
+ case CapabilityArithmeticFenceEXT: return "ArithmeticFenceEXT";
+ case CapabilityFPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL";
+ case CapabilityFPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL";
+ case CapabilityTaskSequenceINTEL: return "TaskSequenceINTEL";
+ case CapabilityFPMaxErrorINTEL: return "FPMaxErrorINTEL";
+ case CapabilityFPGALatencyControlINTEL: return "FPGALatencyControlINTEL";
+ case CapabilityFPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL";
+ case CapabilityGlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL";
+ case CapabilityGlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL";
+ case CapabilitySubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL";
+ case CapabilitySubgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL";
+ case CapabilitySubgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL";
+ case CapabilitySubgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL";
+ case CapabilitySubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL";
+ case CapabilityTernaryBitwiseFunctionINTEL: return "TernaryBitwiseFunctionINTEL";
+ case CapabilitySpecConditionalINTEL: return "SpecConditionalINTEL";
+ case CapabilityFunctionVariantsINTEL: return "FunctionVariantsINTEL";
+ case CapabilityGroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR";
+ case CapabilityTensorFloat32RoundingINTEL: return "TensorFloat32RoundingINTEL";
+ case CapabilityMaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL";
+ case CapabilityCacheControlsINTEL: return "CacheControlsINTEL";
+ case CapabilityRegisterLimitsINTEL: return "RegisterLimitsINTEL";
+ case CapabilityBindlessImagesINTEL: return "BindlessImagesINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* RayQueryIntersectionToString(RayQueryIntersection value) {
+ switch (value) {
+ case RayQueryIntersectionRayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR";
+ case RayQueryIntersectionRayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) {
+ switch (value) {
+ case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR";
+ case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR";
+ case RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) {
+ switch (value) {
+ case RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR";
+ case RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPDenormModeToString(FPDenormMode value) {
+ switch (value) {
+ case FPDenormModePreserve: return "Preserve";
+ case FPDenormModeFlushToZero: return "FlushToZero";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPOperationModeToString(FPOperationMode value) {
+ switch (value) {
+ case FPOperationModeIEEE: return "IEEE";
+ case FPOperationModeALT: return "ALT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* QuantizationModesToString(QuantizationModes value) {
+ switch (value) {
+ case QuantizationModesTRN: return "TRN";
+ case QuantizationModesTRN_ZERO: return "TRN_ZERO";
+ case QuantizationModesRND: return "RND";
+ case QuantizationModesRND_ZERO: return "RND_ZERO";
+ case QuantizationModesRND_INF: return "RND_INF";
+ case QuantizationModesRND_MIN_INF: return "RND_MIN_INF";
+ case QuantizationModesRND_CONV: return "RND_CONV";
+ case QuantizationModesRND_CONV_ODD: return "RND_CONV_ODD";
+ default: return "Unknown";
+ }
+}
+
+inline const char* OverflowModesToString(OverflowModes value) {
+ switch (value) {
+ case OverflowModesWRAP: return "WRAP";
+ case OverflowModesSAT: return "SAT";
+ case OverflowModesSAT_ZERO: return "SAT_ZERO";
+ case OverflowModesSAT_SYM: return "SAT_SYM";
+ default: return "Unknown";
+ }
+}
+
+inline const char* PackedVectorFormatToString(PackedVectorFormat value) {
+ switch (value) {
+ case PackedVectorFormatPackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) {
+ switch (value) {
+ case CooperativeMatrixLayoutRowMajorKHR: return "RowMajorKHR";
+ case CooperativeMatrixLayoutColumnMajorKHR: return "ColumnMajorKHR";
+ case CooperativeMatrixLayoutRowBlockedInterleavedARM: return "RowBlockedInterleavedARM";
+ case CooperativeMatrixLayoutColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) {
+ switch (value) {
+ case CooperativeMatrixUseMatrixAKHR: return "MatrixAKHR";
+ case CooperativeMatrixUseMatrixBKHR: return "MatrixBKHR";
+ case CooperativeMatrixUseMatrixAccumulatorKHR: return "MatrixAccumulatorKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* TensorClampModeToString(TensorClampMode value) {
+ switch (value) {
+ case TensorClampModeUndefined: return "Undefined";
+ case TensorClampModeConstant: return "Constant";
+ case TensorClampModeClampToEdge: return "ClampToEdge";
+ case TensorClampModeRepeat: return "Repeat";
+ case TensorClampModeRepeatMirrored: return "RepeatMirrored";
+ default: return "Unknown";
+ }
+}
+
+inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) {
+ switch (value) {
+ case InitializationModeQualifierInitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL";
+ case InitializationModeQualifierInitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* HostAccessQualifierToString(HostAccessQualifier value) {
+ switch (value) {
+ case HostAccessQualifierNoneINTEL: return "NoneINTEL";
+ case HostAccessQualifierReadINTEL: return "ReadINTEL";
+ case HostAccessQualifierWriteINTEL: return "WriteINTEL";
+ case HostAccessQualifierReadWriteINTEL: return "ReadWriteINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* LoadCacheControlToString(LoadCacheControl value) {
+ switch (value) {
+ case LoadCacheControlUncachedINTEL: return "UncachedINTEL";
+ case LoadCacheControlCachedINTEL: return "CachedINTEL";
+ case LoadCacheControlStreamingINTEL: return "StreamingINTEL";
+ case LoadCacheControlInvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL";
+ case LoadCacheControlConstCachedINTEL: return "ConstCachedINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* StoreCacheControlToString(StoreCacheControl value) {
+ switch (value) {
+ case StoreCacheControlUncachedINTEL: return "UncachedINTEL";
+ case StoreCacheControlWriteThroughINTEL: return "WriteThroughINTEL";
+ case StoreCacheControlWriteBackINTEL: return "WriteBackINTEL";
+ case StoreCacheControlStreamingINTEL: return "StreamingINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) {
+ switch (value) {
+ case NamedMaximumNumberOfRegistersAutoINTEL: return "AutoINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPEncodingToString(FPEncoding value) {
+ switch (value) {
+ case FPEncodingBFloat16KHR: return "BFloat16KHR";
+ case FPEncodingFloat8E4M3EXT: return "Float8E4M3EXT";
+ case FPEncodingFloat8E5M2EXT: return "Float8E5M2EXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CooperativeVectorMatrixLayoutToString(CooperativeVectorMatrixLayout value) {
+ switch (value) {
+ case CooperativeVectorMatrixLayoutRowMajorNV: return "RowMajorNV";
+ case CooperativeVectorMatrixLayoutColumnMajorNV: return "ColumnMajorNV";
+ case CooperativeVectorMatrixLayoutInferencingOptimalNV: return "InferencingOptimalNV";
+ case CooperativeVectorMatrixLayoutTrainingOptimalNV: return "TrainingOptimalNV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ComponentTypeToString(ComponentType value) {
+ switch (value) {
+ case ComponentTypeFloat16NV: return "Float16NV";
+ case ComponentTypeFloat32NV: return "Float32NV";
+ case ComponentTypeFloat64NV: return "Float64NV";
+ case ComponentTypeSignedInt8NV: return "SignedInt8NV";
+ case ComponentTypeSignedInt16NV: return "SignedInt16NV";
+ case ComponentTypeSignedInt32NV: return "SignedInt32NV";
+ case ComponentTypeSignedInt64NV: return "SignedInt64NV";
+ case ComponentTypeUnsignedInt8NV: return "UnsignedInt8NV";
+ case ComponentTypeUnsignedInt16NV: return "UnsignedInt16NV";
+ case ComponentTypeUnsignedInt32NV: return "UnsignedInt32NV";
+ case ComponentTypeUnsignedInt64NV: return "UnsignedInt64NV";
+ case ComponentTypeSignedInt8PackedNV: return "SignedInt8PackedNV";
+ case ComponentTypeUnsignedInt8PackedNV: return "UnsignedInt8PackedNV";
+ case ComponentTypeFloatE4M3NV: return "FloatE4M3NV";
+ case ComponentTypeFloatE5M2NV: return "FloatE5M2NV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* OpToString(Op value) {
+ switch (value) {
+ case OpNop: return "OpNop";
+ case OpUndef: return "OpUndef";
+ case OpSourceContinued: return "OpSourceContinued";
+ case OpSource: return "OpSource";
+ case OpSourceExtension: return "OpSourceExtension";
+ case OpName: return "OpName";
+ case OpMemberName: return "OpMemberName";
+ case OpString: return "OpString";
+ case OpLine: return "OpLine";
+ case OpExtension: return "OpExtension";
+ case OpExtInstImport: return "OpExtInstImport";
+ case OpExtInst: return "OpExtInst";
+ case OpMemoryModel: return "OpMemoryModel";
+ case OpEntryPoint: return "OpEntryPoint";
+ case OpExecutionMode: return "OpExecutionMode";
+ case OpCapability: return "OpCapability";
+ case OpTypeVoid: return "OpTypeVoid";
+ case OpTypeBool: return "OpTypeBool";
+ case OpTypeInt: return "OpTypeInt";
+ case OpTypeFloat: return "OpTypeFloat";
+ case OpTypeVector: return "OpTypeVector";
+ case OpTypeMatrix: return "OpTypeMatrix";
+ case OpTypeImage: return "OpTypeImage";
+ case OpTypeSampler: return "OpTypeSampler";
+ case OpTypeSampledImage: return "OpTypeSampledImage";
+ case OpTypeArray: return "OpTypeArray";
+ case OpTypeRuntimeArray: return "OpTypeRuntimeArray";
+ case OpTypeStruct: return "OpTypeStruct";
+ case OpTypeOpaque: return "OpTypeOpaque";
+ case OpTypePointer: return "OpTypePointer";
+ case OpTypeFunction: return "OpTypeFunction";
+ case OpTypeEvent: return "OpTypeEvent";
+ case OpTypeDeviceEvent: return "OpTypeDeviceEvent";
+ case OpTypeReserveId: return "OpTypeReserveId";
+ case OpTypeQueue: return "OpTypeQueue";
+ case OpTypePipe: return "OpTypePipe";
+ case OpTypeForwardPointer: return "OpTypeForwardPointer";
+ case OpConstantTrue: return "OpConstantTrue";
+ case OpConstantFalse: return "OpConstantFalse";
+ case OpConstant: return "OpConstant";
+ case OpConstantComposite: return "OpConstantComposite";
+ case OpConstantSampler: return "OpConstantSampler";
+ case OpConstantNull: return "OpConstantNull";
+ case OpSpecConstantTrue: return "OpSpecConstantTrue";
+ case OpSpecConstantFalse: return "OpSpecConstantFalse";
+ case OpSpecConstant: return "OpSpecConstant";
+ case OpSpecConstantComposite: return "OpSpecConstantComposite";
+ case OpSpecConstantOp: return "OpSpecConstantOp";
+ case OpFunction: return "OpFunction";
+ case OpFunctionParameter: return "OpFunctionParameter";
+ case OpFunctionEnd: return "OpFunctionEnd";
+ case OpFunctionCall: return "OpFunctionCall";
+ case OpVariable: return "OpVariable";
+ case OpImageTexelPointer: return "OpImageTexelPointer";
+ case OpLoad: return "OpLoad";
+ case OpStore: return "OpStore";
+ case OpCopyMemory: return "OpCopyMemory";
+ case OpCopyMemorySized: return "OpCopyMemorySized";
+ case OpAccessChain: return "OpAccessChain";
+ case OpInBoundsAccessChain: return "OpInBoundsAccessChain";
+ case OpPtrAccessChain: return "OpPtrAccessChain";
+ case OpArrayLength: return "OpArrayLength";
+ case OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics";
+ case OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain";
+ case OpDecorate: return "OpDecorate";
+ case OpMemberDecorate: return "OpMemberDecorate";
+ case OpDecorationGroup: return "OpDecorationGroup";
+ case OpGroupDecorate: return "OpGroupDecorate";
+ case OpGroupMemberDecorate: return "OpGroupMemberDecorate";
+ case OpVectorExtractDynamic: return "OpVectorExtractDynamic";
+ case OpVectorInsertDynamic: return "OpVectorInsertDynamic";
+ case OpVectorShuffle: return "OpVectorShuffle";
+ case OpCompositeConstruct: return "OpCompositeConstruct";
+ case OpCompositeExtract: return "OpCompositeExtract";
+ case OpCompositeInsert: return "OpCompositeInsert";
+ case OpCopyObject: return "OpCopyObject";
+ case OpTranspose: return "OpTranspose";
+ case OpSampledImage: return "OpSampledImage";
+ case OpImageSampleImplicitLod: return "OpImageSampleImplicitLod";
+ case OpImageSampleExplicitLod: return "OpImageSampleExplicitLod";
+ case OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod";
+ case OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod";
+ case OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod";
+ case OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod";
+ case OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod";
+ case OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod";
+ case OpImageFetch: return "OpImageFetch";
+ case OpImageGather: return "OpImageGather";
+ case OpImageDrefGather: return "OpImageDrefGather";
+ case OpImageRead: return "OpImageRead";
+ case OpImageWrite: return "OpImageWrite";
+ case OpImage: return "OpImage";
+ case OpImageQueryFormat: return "OpImageQueryFormat";
+ case OpImageQueryOrder: return "OpImageQueryOrder";
+ case OpImageQuerySizeLod: return "OpImageQuerySizeLod";
+ case OpImageQuerySize: return "OpImageQuerySize";
+ case OpImageQueryLod: return "OpImageQueryLod";
+ case OpImageQueryLevels: return "OpImageQueryLevels";
+ case OpImageQuerySamples: return "OpImageQuerySamples";
+ case OpConvertFToU: return "OpConvertFToU";
+ case OpConvertFToS: return "OpConvertFToS";
+ case OpConvertSToF: return "OpConvertSToF";
+ case OpConvertUToF: return "OpConvertUToF";
+ case OpUConvert: return "OpUConvert";
+ case OpSConvert: return "OpSConvert";
+ case OpFConvert: return "OpFConvert";
+ case OpQuantizeToF16: return "OpQuantizeToF16";
+ case OpConvertPtrToU: return "OpConvertPtrToU";
+ case OpSatConvertSToU: return "OpSatConvertSToU";
+ case OpSatConvertUToS: return "OpSatConvertUToS";
+ case OpConvertUToPtr: return "OpConvertUToPtr";
+ case OpPtrCastToGeneric: return "OpPtrCastToGeneric";
+ case OpGenericCastToPtr: return "OpGenericCastToPtr";
+ case OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit";
+ case OpBitcast: return "OpBitcast";
+ case OpSNegate: return "OpSNegate";
+ case OpFNegate: return "OpFNegate";
+ case OpIAdd: return "OpIAdd";
+ case OpFAdd: return "OpFAdd";
+ case OpISub: return "OpISub";
+ case OpFSub: return "OpFSub";
+ case OpIMul: return "OpIMul";
+ case OpFMul: return "OpFMul";
+ case OpUDiv: return "OpUDiv";
+ case OpSDiv: return "OpSDiv";
+ case OpFDiv: return "OpFDiv";
+ case OpUMod: return "OpUMod";
+ case OpSRem: return "OpSRem";
+ case OpSMod: return "OpSMod";
+ case OpFRem: return "OpFRem";
+ case OpFMod: return "OpFMod";
+ case OpVectorTimesScalar: return "OpVectorTimesScalar";
+ case OpMatrixTimesScalar: return "OpMatrixTimesScalar";
+ case OpVectorTimesMatrix: return "OpVectorTimesMatrix";
+ case OpMatrixTimesVector: return "OpMatrixTimesVector";
+ case OpMatrixTimesMatrix: return "OpMatrixTimesMatrix";
+ case OpOuterProduct: return "OpOuterProduct";
+ case OpDot: return "OpDot";
+ case OpIAddCarry: return "OpIAddCarry";
+ case OpISubBorrow: return "OpISubBorrow";
+ case OpUMulExtended: return "OpUMulExtended";
+ case OpSMulExtended: return "OpSMulExtended";
+ case OpAny: return "OpAny";
+ case OpAll: return "OpAll";
+ case OpIsNan: return "OpIsNan";
+ case OpIsInf: return "OpIsInf";
+ case OpIsFinite: return "OpIsFinite";
+ case OpIsNormal: return "OpIsNormal";
+ case OpSignBitSet: return "OpSignBitSet";
+ case OpLessOrGreater: return "OpLessOrGreater";
+ case OpOrdered: return "OpOrdered";
+ case OpUnordered: return "OpUnordered";
+ case OpLogicalEqual: return "OpLogicalEqual";
+ case OpLogicalNotEqual: return "OpLogicalNotEqual";
+ case OpLogicalOr: return "OpLogicalOr";
+ case OpLogicalAnd: return "OpLogicalAnd";
+ case OpLogicalNot: return "OpLogicalNot";
+ case OpSelect: return "OpSelect";
+ case OpIEqual: return "OpIEqual";
+ case OpINotEqual: return "OpINotEqual";
+ case OpUGreaterThan: return "OpUGreaterThan";
+ case OpSGreaterThan: return "OpSGreaterThan";
+ case OpUGreaterThanEqual: return "OpUGreaterThanEqual";
+ case OpSGreaterThanEqual: return "OpSGreaterThanEqual";
+ case OpULessThan: return "OpULessThan";
+ case OpSLessThan: return "OpSLessThan";
+ case OpULessThanEqual: return "OpULessThanEqual";
+ case OpSLessThanEqual: return "OpSLessThanEqual";
+ case OpFOrdEqual: return "OpFOrdEqual";
+ case OpFUnordEqual: return "OpFUnordEqual";
+ case OpFOrdNotEqual: return "OpFOrdNotEqual";
+ case OpFUnordNotEqual: return "OpFUnordNotEqual";
+ case OpFOrdLessThan: return "OpFOrdLessThan";
+ case OpFUnordLessThan: return "OpFUnordLessThan";
+ case OpFOrdGreaterThan: return "OpFOrdGreaterThan";
+ case OpFUnordGreaterThan: return "OpFUnordGreaterThan";
+ case OpFOrdLessThanEqual: return "OpFOrdLessThanEqual";
+ case OpFUnordLessThanEqual: return "OpFUnordLessThanEqual";
+ case OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual";
+ case OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual";
+ case OpShiftRightLogical: return "OpShiftRightLogical";
+ case OpShiftRightArithmetic: return "OpShiftRightArithmetic";
+ case OpShiftLeftLogical: return "OpShiftLeftLogical";
+ case OpBitwiseOr: return "OpBitwiseOr";
+ case OpBitwiseXor: return "OpBitwiseXor";
+ case OpBitwiseAnd: return "OpBitwiseAnd";
+ case OpNot: return "OpNot";
+ case OpBitFieldInsert: return "OpBitFieldInsert";
+ case OpBitFieldSExtract: return "OpBitFieldSExtract";
+ case OpBitFieldUExtract: return "OpBitFieldUExtract";
+ case OpBitReverse: return "OpBitReverse";
+ case OpBitCount: return "OpBitCount";
+ case OpDPdx: return "OpDPdx";
+ case OpDPdy: return "OpDPdy";
+ case OpFwidth: return "OpFwidth";
+ case OpDPdxFine: return "OpDPdxFine";
+ case OpDPdyFine: return "OpDPdyFine";
+ case OpFwidthFine: return "OpFwidthFine";
+ case OpDPdxCoarse: return "OpDPdxCoarse";
+ case OpDPdyCoarse: return "OpDPdyCoarse";
+ case OpFwidthCoarse: return "OpFwidthCoarse";
+ case OpEmitVertex: return "OpEmitVertex";
+ case OpEndPrimitive: return "OpEndPrimitive";
+ case OpEmitStreamVertex: return "OpEmitStreamVertex";
+ case OpEndStreamPrimitive: return "OpEndStreamPrimitive";
+ case OpControlBarrier: return "OpControlBarrier";
+ case OpMemoryBarrier: return "OpMemoryBarrier";
+ case OpAtomicLoad: return "OpAtomicLoad";
+ case OpAtomicStore: return "OpAtomicStore";
+ case OpAtomicExchange: return "OpAtomicExchange";
+ case OpAtomicCompareExchange: return "OpAtomicCompareExchange";
+ case OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak";
+ case OpAtomicIIncrement: return "OpAtomicIIncrement";
+ case OpAtomicIDecrement: return "OpAtomicIDecrement";
+ case OpAtomicIAdd: return "OpAtomicIAdd";
+ case OpAtomicISub: return "OpAtomicISub";
+ case OpAtomicSMin: return "OpAtomicSMin";
+ case OpAtomicUMin: return "OpAtomicUMin";
+ case OpAtomicSMax: return "OpAtomicSMax";
+ case OpAtomicUMax: return "OpAtomicUMax";
+ case OpAtomicAnd: return "OpAtomicAnd";
+ case OpAtomicOr: return "OpAtomicOr";
+ case OpAtomicXor: return "OpAtomicXor";
+ case OpPhi: return "OpPhi";
+ case OpLoopMerge: return "OpLoopMerge";
+ case OpSelectionMerge: return "OpSelectionMerge";
+ case OpLabel: return "OpLabel";
+ case OpBranch: return "OpBranch";
+ case OpBranchConditional: return "OpBranchConditional";
+ case OpSwitch: return "OpSwitch";
+ case OpKill: return "OpKill";
+ case OpReturn: return "OpReturn";
+ case OpReturnValue: return "OpReturnValue";
+ case OpUnreachable: return "OpUnreachable";
+ case OpLifetimeStart: return "OpLifetimeStart";
+ case OpLifetimeStop: return "OpLifetimeStop";
+ case OpGroupAsyncCopy: return "OpGroupAsyncCopy";
+ case OpGroupWaitEvents: return "OpGroupWaitEvents";
+ case OpGroupAll: return "OpGroupAll";
+ case OpGroupAny: return "OpGroupAny";
+ case OpGroupBroadcast: return "OpGroupBroadcast";
+ case OpGroupIAdd: return "OpGroupIAdd";
+ case OpGroupFAdd: return "OpGroupFAdd";
+ case OpGroupFMin: return "OpGroupFMin";
+ case OpGroupUMin: return "OpGroupUMin";
+ case OpGroupSMin: return "OpGroupSMin";
+ case OpGroupFMax: return "OpGroupFMax";
+ case OpGroupUMax: return "OpGroupUMax";
+ case OpGroupSMax: return "OpGroupSMax";
+ case OpReadPipe: return "OpReadPipe";
+ case OpWritePipe: return "OpWritePipe";
+ case OpReservedReadPipe: return "OpReservedReadPipe";
+ case OpReservedWritePipe: return "OpReservedWritePipe";
+ case OpReserveReadPipePackets: return "OpReserveReadPipePackets";
+ case OpReserveWritePipePackets: return "OpReserveWritePipePackets";
+ case OpCommitReadPipe: return "OpCommitReadPipe";
+ case OpCommitWritePipe: return "OpCommitWritePipe";
+ case OpIsValidReserveId: return "OpIsValidReserveId";
+ case OpGetNumPipePackets: return "OpGetNumPipePackets";
+ case OpGetMaxPipePackets: return "OpGetMaxPipePackets";
+ case OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets";
+ case OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets";
+ case OpGroupCommitReadPipe: return "OpGroupCommitReadPipe";
+ case OpGroupCommitWritePipe: return "OpGroupCommitWritePipe";
+ case OpEnqueueMarker: return "OpEnqueueMarker";
+ case OpEnqueueKernel: return "OpEnqueueKernel";
+ case OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount";
+ case OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize";
+ case OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize";
+ case OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple";
+ case OpRetainEvent: return "OpRetainEvent";
+ case OpReleaseEvent: return "OpReleaseEvent";
+ case OpCreateUserEvent: return "OpCreateUserEvent";
+ case OpIsValidEvent: return "OpIsValidEvent";
+ case OpSetUserEventStatus: return "OpSetUserEventStatus";
+ case OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo";
+ case OpGetDefaultQueue: return "OpGetDefaultQueue";
+ case OpBuildNDRange: return "OpBuildNDRange";
+ case OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod";
+ case OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod";
+ case OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod";
+ case OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod";
+ case OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod";
+ case OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod";
+ case OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod";
+ case OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod";
+ case OpImageSparseFetch: return "OpImageSparseFetch";
+ case OpImageSparseGather: return "OpImageSparseGather";
+ case OpImageSparseDrefGather: return "OpImageSparseDrefGather";
+ case OpImageSparseTexelsResident: return "OpImageSparseTexelsResident";
+ case OpNoLine: return "OpNoLine";
+ case OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet";
+ case OpAtomicFlagClear: return "OpAtomicFlagClear";
+ case OpImageSparseRead: return "OpImageSparseRead";
+ case OpSizeOf: return "OpSizeOf";
+ case OpTypePipeStorage: return "OpTypePipeStorage";
+ case OpConstantPipeStorage: return "OpConstantPipeStorage";
+ case OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage";
+ case OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount";
+ case OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups";
+ case OpTypeNamedBarrier: return "OpTypeNamedBarrier";
+ case OpNamedBarrierInitialize: return "OpNamedBarrierInitialize";
+ case OpMemoryNamedBarrier: return "OpMemoryNamedBarrier";
+ case OpModuleProcessed: return "OpModuleProcessed";
+ case OpExecutionModeId: return "OpExecutionModeId";
+ case OpDecorateId: return "OpDecorateId";
+ case OpGroupNonUniformElect: return "OpGroupNonUniformElect";
+ case OpGroupNonUniformAll: return "OpGroupNonUniformAll";
+ case OpGroupNonUniformAny: return "OpGroupNonUniformAny";
+ case OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual";
+ case OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast";
+ case OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst";
+ case OpGroupNonUniformBallot: return "OpGroupNonUniformBallot";
+ case OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot";
+ case OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract";
+ case OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount";
+ case OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB";
+ case OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB";
+ case OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle";
+ case OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor";
+ case OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp";
+ case OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown";
+ case OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd";
+ case OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd";
+ case OpGroupNonUniformIMul: return "OpGroupNonUniformIMul";
+ case OpGroupNonUniformFMul: return "OpGroupNonUniformFMul";
+ case OpGroupNonUniformSMin: return "OpGroupNonUniformSMin";
+ case OpGroupNonUniformUMin: return "OpGroupNonUniformUMin";
+ case OpGroupNonUniformFMin: return "OpGroupNonUniformFMin";
+ case OpGroupNonUniformSMax: return "OpGroupNonUniformSMax";
+ case OpGroupNonUniformUMax: return "OpGroupNonUniformUMax";
+ case OpGroupNonUniformFMax: return "OpGroupNonUniformFMax";
+ case OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd";
+ case OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr";
+ case OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor";
+ case OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd";
+ case OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr";
+ case OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor";
+ case OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast";
+ case OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap";
+ case OpCopyLogical: return "OpCopyLogical";
+ case OpPtrEqual: return "OpPtrEqual";
+ case OpPtrNotEqual: return "OpPtrNotEqual";
+ case OpPtrDiff: return "OpPtrDiff";
+ case OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
+ case OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
+ case OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
+ case OpTypeTensorARM: return "OpTypeTensorARM";
+ case OpTensorReadARM: return "OpTensorReadARM";
+ case OpTensorWriteARM: return "OpTensorWriteARM";
+ case OpTensorQuerySizeARM: return "OpTensorQuerySizeARM";
+ case OpGraphConstantARM: return "OpGraphConstantARM";
+ case OpGraphEntryPointARM: return "OpGraphEntryPointARM";
+ case OpGraphARM: return "OpGraphARM";
+ case OpGraphInputARM: return "OpGraphInputARM";
+ case OpGraphSetOutputARM: return "OpGraphSetOutputARM";
+ case OpGraphEndARM: return "OpGraphEndARM";
+ case OpTypeGraphARM: return "OpTypeGraphARM";
+ case OpTerminateInvocation: return "OpTerminateInvocation";
+ case OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR";
+ case OpUntypedVariableKHR: return "OpUntypedVariableKHR";
+ case OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR";
+ case OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR";
+ case OpSubgroupBallotKHR: return "OpSubgroupBallotKHR";
+ case OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR";
+ case OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR";
+ case OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR";
+ case OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR";
+ case OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR";
+ case OpSubgroupAllKHR: return "OpSubgroupAllKHR";
+ case OpSubgroupAnyKHR: return "OpSubgroupAnyKHR";
+ case OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR";
+ case OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR";
+ case OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR";
+ case OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR";
+ case OpUntypedGroupAsyncCopyKHR: return "OpUntypedGroupAsyncCopyKHR";
+ case OpTraceRayKHR: return "OpTraceRayKHR";
+ case OpExecuteCallableKHR: return "OpExecuteCallableKHR";
+ case OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR";
+ case OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR";
+ case OpTerminateRayKHR: return "OpTerminateRayKHR";
+ case OpSDot: return "OpSDot";
+ case OpUDot: return "OpUDot";
+ case OpSUDot: return "OpSUDot";
+ case OpSDotAccSat: return "OpSDotAccSat";
+ case OpUDotAccSat: return "OpUDotAccSat";
+ case OpSUDotAccSat: return "OpSUDotAccSat";
+ case OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR";
+ case OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR";
+ case OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR";
+ case OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR";
+ case OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR";
+ case OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT";
+ case OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT";
+ case OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT";
+ case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR";
+ case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR";
+ case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR";
+ case OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR";
+ case OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR";
+ case OpRayQueryProceedKHR: return "OpRayQueryProceedKHR";
+ case OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR";
+ case OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM";
+ case OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM";
+ case OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM";
+ case OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM";
+ case OpBitCastArrayQCOM: return "OpBitCastArrayQCOM";
+ case OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM";
+ case OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM";
+ case OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM";
+ case OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM";
+ case OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM";
+ case OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM";
+ case OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM";
+ case OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD";
+ case OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD";
+ case OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD";
+ case OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD";
+ case OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD";
+ case OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD";
+ case OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD";
+ case OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD";
+ case OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD";
+ case OpFragmentFetchAMD: return "OpFragmentFetchAMD";
+ case OpReadClockKHR: return "OpReadClockKHR";
+ case OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX";
+ case OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX";
+ case OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX";
+ case OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX";
+ case OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX";
+ case OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX";
+ case OpConstantStringAMDX: return "OpConstantStringAMDX";
+ case OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX";
+ case OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR";
+ case OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR";
+ case OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV";
+ case OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV";
+ case OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV";
+ case OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV";
+ case OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV";
+ case OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV";
+ case OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV";
+ case OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV";
+ case OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV";
+ case OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV";
+ case OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV";
+ case OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV";
+ case OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV";
+ case OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV";
+ case OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV";
+ case OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV";
+ case OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV";
+ case OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV";
+ case OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV";
+ case OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV";
+ case OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV";
+ case OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV";
+ case OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV";
+ case OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV";
+ case OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV";
+ case OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV";
+ case OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV";
+ case OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV";
+ case OpHitObjectIsHitNV: return "OpHitObjectIsHitNV";
+ case OpHitObjectIsMissNV: return "OpHitObjectIsMissNV";
+ case OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV";
+ case OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV";
+ case OpTypeHitObjectNV: return "OpTypeHitObjectNV";
+ case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
+ case OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV";
+ case OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV";
+ case OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV";
+ case OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV";
+ case OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV";
+ case OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV";
+ case OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT";
+ case OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT";
+ case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
+ case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
+ case OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV";
+ case OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV";
+ case OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV";
+ case OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV";
+ case OpReportIntersectionKHR: return "OpReportIntersectionKHR";
+ case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
+ case OpTerminateRayNV: return "OpTerminateRayNV";
+ case OpTraceNV: return "OpTraceNV";
+ case OpTraceMotionNV: return "OpTraceMotionNV";
+ case OpTraceRayMotionNV: return "OpTraceRayMotionNV";
+ case OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR";
+ case OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR";
+ case OpExecuteCallableNV: return "OpExecuteCallableNV";
+ case OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV";
+ case OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV";
+ case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
+ case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
+ case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
+ case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
+ case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
+ case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT";
+ case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT";
+ case OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV";
+ case OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV";
+ case OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV";
+ case OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV";
+ case OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV";
+ case OpTypeTensorViewNV: return "OpTypeTensorViewNV";
+ case OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV";
+ case OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV";
+ case OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV";
+ case OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV";
+ case OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV";
+ case OpCreateTensorViewNV: return "OpCreateTensorViewNV";
+ case OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV";
+ case OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV";
+ case OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation";
+ case OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT";
+ case OpTensorViewSetClipNV: return "OpTensorViewSetClipNV";
+ case OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV";
+ case OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV";
+ case OpConvertUToImageNV: return "OpConvertUToImageNV";
+ case OpConvertUToSamplerNV: return "OpConvertUToSamplerNV";
+ case OpConvertImageToUNV: return "OpConvertImageToUNV";
+ case OpConvertSamplerToUNV: return "OpConvertSamplerToUNV";
+ case OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV";
+ case OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV";
+ case OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV";
+ case OpRawAccessChainNV: return "OpRawAccessChainNV";
+ case OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV";
+ case OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV";
+ case OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV";
+ case OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV";
+ case OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV";
+ case OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV";
+ case OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV";
+ case OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV";
+ case OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV";
+ case OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV";
+ case OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV";
+ case OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV";
+ case OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV";
+ case OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL";
+ case OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL";
+ case OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL";
+ case OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL";
+ case OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL";
+ case OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL";
+ case OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL";
+ case OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL";
+ case OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL";
+ case OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL";
+ case OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL";
+ case OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL";
+ case OpAbsISubINTEL: return "OpAbsISubINTEL";
+ case OpAbsUSubINTEL: return "OpAbsUSubINTEL";
+ case OpIAddSatINTEL: return "OpIAddSatINTEL";
+ case OpUAddSatINTEL: return "OpUAddSatINTEL";
+ case OpIAverageINTEL: return "OpIAverageINTEL";
+ case OpUAverageINTEL: return "OpUAverageINTEL";
+ case OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL";
+ case OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL";
+ case OpISubSatINTEL: return "OpISubSatINTEL";
+ case OpUSubSatINTEL: return "OpUSubSatINTEL";
+ case OpIMul32x16INTEL: return "OpIMul32x16INTEL";
+ case OpUMul32x16INTEL: return "OpUMul32x16INTEL";
+ case OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL";
+ case OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL";
+ case OpAsmTargetINTEL: return "OpAsmTargetINTEL";
+ case OpAsmINTEL: return "OpAsmINTEL";
+ case OpAsmCallINTEL: return "OpAsmCallINTEL";
+ case OpAtomicFMinEXT: return "OpAtomicFMinEXT";
+ case OpAtomicFMaxEXT: return "OpAtomicFMaxEXT";
+ case OpAssumeTrueKHR: return "OpAssumeTrueKHR";
+ case OpExpectKHR: return "OpExpectKHR";
+ case OpDecorateString: return "OpDecorateString";
+ case OpMemberDecorateString: return "OpMemberDecorateString";
+ case OpVmeImageINTEL: return "OpVmeImageINTEL";
+ case OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL";
+ case OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL";
+ case OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL";
+ case OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL";
+ case OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL";
+ case OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL";
+ case OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL";
+ case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL";
+ case OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL";
+ case OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL";
+ case OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL";
+ case OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL";
+ case OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL";
+ case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL";
+ case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL";
+ case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL";
+ case OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL";
+ case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL";
+ case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL";
+ case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL";
+ case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL";
+ case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL";
+ case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL";
+ case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL";
+ case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL";
+ case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL";
+ case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL";
+ case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL";
+ case OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL";
+ case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL";
+ case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL";
+ case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL";
+ case OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL";
+ case OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL";
+ case OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL";
+ case OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL";
+ case OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL";
+ case OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL";
+ case OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL";
+ case OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL";
+ case OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL";
+ case OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL";
+ case OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL";
+ case OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL";
+ case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL";
+ case OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL";
+ case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL";
+ case OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL";
+ case OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL";
+ case OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL";
+ case OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL";
+ case OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL";
+ case OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL";
+ case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL";
+ case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL";
+ case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL";
+ case OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL";
+ case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL";
+ case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL";
+ case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL";
+ case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL";
+ case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL";
+ case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL";
+ case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL";
+ case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL";
+ case OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL";
+ case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL";
+ case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL";
+ case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL";
+ case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL";
+ case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL";
+ case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL";
+ case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL";
+ case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL";
+ case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL";
+ case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL";
+ case OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL";
+ case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL";
+ case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL";
+ case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL";
+ case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL";
+ case OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL";
+ case OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL";
+ case OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL";
+ case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL";
+ case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL";
+ case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL";
+ case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL";
+ case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL";
+ case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL";
+ case OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL";
+ case OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL";
+ case OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL";
+ case OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL";
+ case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL";
+ case OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL";
+ case OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL";
+ case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL";
+ case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL";
+ case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL";
+ case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL";
+ case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL";
+ case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL";
+ case OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL";
+ case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL";
+ case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL";
+ case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL";
+ case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL";
+ case OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL";
+ case OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL";
+ case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL";
+ case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL";
+ case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL";
+ case OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL";
+ case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL";
+ case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL";
+ case OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL";
+ case OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL";
+ case OpSaveMemoryINTEL: return "OpSaveMemoryINTEL";
+ case OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL";
+ case OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL";
+ case OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL";
+ case OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL";
+ case OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL";
+ case OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL";
+ case OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL";
+ case OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL";
+ case OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL";
+ case OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL";
+ case OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL";
+ case OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL";
+ case OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL";
+ case OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL";
+ case OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL";
+ case OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL";
+ case OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL";
+ case OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL";
+ case OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL";
+ case OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL";
+ case OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL";
+ case OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL";
+ case OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL";
+ case OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL";
+ case OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL";
+ case OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL";
+ case OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL";
+ case OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL";
+ case OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL";
+ case OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL";
+ case OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL";
+ case OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL";
+ case OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL";
+ case OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL";
+ case OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL";
+ case OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL";
+ case OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL";
+ case OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL";
+ case OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL";
+ case OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL";
+ case OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL";
+ case OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL";
+ case OpLoopControlINTEL: return "OpLoopControlINTEL";
+ case OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL";
+ case OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL";
+ case OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL";
+ case OpFixedSqrtINTEL: return "OpFixedSqrtINTEL";
+ case OpFixedRecipINTEL: return "OpFixedRecipINTEL";
+ case OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL";
+ case OpFixedSinINTEL: return "OpFixedSinINTEL";
+ case OpFixedCosINTEL: return "OpFixedCosINTEL";
+ case OpFixedSinCosINTEL: return "OpFixedSinCosINTEL";
+ case OpFixedSinPiINTEL: return "OpFixedSinPiINTEL";
+ case OpFixedCosPiINTEL: return "OpFixedCosPiINTEL";
+ case OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL";
+ case OpFixedLogINTEL: return "OpFixedLogINTEL";
+ case OpFixedExpINTEL: return "OpFixedExpINTEL";
+ case OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL";
+ case OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL";
+ case OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL";
+ case OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL";
+ case OpFPGARegINTEL: return "OpFPGARegINTEL";
+ case OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR";
+ case OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR";
+ case OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR";
+ case OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR";
+ case OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR";
+ case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR";
+ case OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR";
+ case OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR";
+ case OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR";
+ case OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR";
+ case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR";
+ case OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR";
+ case OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR";
+ case OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR";
+ case OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR";
+ case OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR";
+ case OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR";
+ case OpAtomicFAddEXT: return "OpAtomicFAddEXT";
+ case OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL";
+ case OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL";
+ case OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL";
+ case OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL";
+ case OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL";
+ case OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL";
+ case OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL";
+ case OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL";
+ case OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL";
+ case OpArithmeticFenceEXT: return "OpArithmeticFenceEXT";
+ case OpTaskSequenceCreateINTEL: return "OpTaskSequenceCreateINTEL";
+ case OpTaskSequenceAsyncINTEL: return "OpTaskSequenceAsyncINTEL";
+ case OpTaskSequenceGetINTEL: return "OpTaskSequenceGetINTEL";
+ case OpTaskSequenceReleaseINTEL: return "OpTaskSequenceReleaseINTEL";
+ case OpTypeTaskSequenceINTEL: return "OpTypeTaskSequenceINTEL";
+ case OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL";
+ case OpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL";
+ case OpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL";
+ case OpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL";
+ case OpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL";
+ case OpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL";
+ case OpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL";
+ case OpBitwiseFunctionINTEL: return "OpBitwiseFunctionINTEL";
+ case OpConditionalExtensionINTEL: return "OpConditionalExtensionINTEL";
+ case OpConditionalEntryPointINTEL: return "OpConditionalEntryPointINTEL";
+ case OpConditionalCapabilityINTEL: return "OpConditionalCapabilityINTEL";
+ case OpSpecConstantTargetINTEL: return "OpSpecConstantTargetINTEL";
+ case OpSpecConstantArchitectureINTEL: return "OpSpecConstantArchitectureINTEL";
+ case OpSpecConstantCapabilitiesINTEL: return "OpSpecConstantCapabilitiesINTEL";
+ case OpConditionalCopyObjectINTEL: return "OpConditionalCopyObjectINTEL";
+ case OpGroupIMulKHR: return "OpGroupIMulKHR";
+ case OpGroupFMulKHR: return "OpGroupFMulKHR";
+ case OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR";
+ case OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR";
+ case OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR";
+ case OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR";
+ case OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR";
+ case OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR";
+ case OpRoundFToTF32INTEL: return "OpRoundFToTF32INTEL";
+ case OpMaskedGatherINTEL: return "OpMaskedGatherINTEL";
+ case OpMaskedScatterINTEL: return "OpMaskedScatterINTEL";
+ case OpConvertHandleToImageINTEL: return "OpConvertHandleToImageINTEL";
+ case OpConvertHandleToSamplerINTEL: return "OpConvertHandleToSamplerINTEL";
+ case OpConvertHandleToSampledImageINTEL: return "OpConvertHandleToSampledImageINTEL";
+ default: return "Unknown";
+ }
+}
+
#endif /* SPV_ENABLE_UTILITY_CODE */
// Overload bitwise operators for mask bit combining
@@ -2932,6 +5304,22 @@
inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
+inline CooperativeMatrixReduceMask operator|(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) | unsigned(b)); }
+inline CooperativeMatrixReduceMask operator&(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) & unsigned(b)); }
+inline CooperativeMatrixReduceMask operator^(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) ^ unsigned(b)); }
+inline CooperativeMatrixReduceMask operator~(CooperativeMatrixReduceMask a) { return CooperativeMatrixReduceMask(~unsigned(a)); }
+inline TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) | unsigned(b)); }
+inline TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); }
+inline TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); }
+inline TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); }
+inline TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); }
+inline TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); }
+inline TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); }
+inline TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); }
+inline MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); }
+inline MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); }
+inline MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); }
+inline MatrixMultiplyAccumulateOperandsMask operator~(MatrixMultiplyAccumulateOperandsMask a) { return MatrixMultiplyAccumulateOperandsMask(~unsigned(a)); }
inline RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); }
inline RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); }
inline RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); }
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp11 b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp11
index d6b4fb7..c920184 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp11
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.hpp11
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 The Khronos Group Inc.
+// Copyright: 2014-2024 The Khronos Group Inc.
+// License: MIT
//
-// 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.
+// 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/
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
@@ -74,6 +58,7 @@
WGSL = 10,
Slang = 11,
Zig = 12,
+ Rust = 13,
Max = 0x7fffffff,
};
@@ -171,9 +156,12 @@
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ NonCoherentTileAttachmentReadQCOM = 4489,
+ TileShadingRateQCOM = 4490,
EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
CoalescingAMDX = 5069,
+ IsApiEntryAMDX = 5070,
MaxNodeRecursionAMDX = 5071,
StaticNumWorkgroupsAMDX = 5072,
ShaderIndexAMDX = 5073,
@@ -186,11 +174,14 @@
StencilRefLessBackAMD = 5084,
QuadDerivativesKHR = 5088,
RequireFullQuadsKHR = 5089,
+ SharesInputWithAMDX = 5102,
OutputLinesEXT = 5269,
OutputLinesNV = 5269,
OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
+ DerivativeGroupQuadsKHR = 5289,
DerivativeGroupQuadsNV = 5289,
+ DerivativeGroupLinearKHR = 5290,
DerivativeGroupLinearNV = 5290,
OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
@@ -236,8 +227,8 @@
Image = 11,
StorageBuffer = 12,
TileImageEXT = 4172,
+ TileAttachmentQCOM = 4491,
NodePayloadAMDX = 5068,
- NodeOutputPayloadAMDX = 5076,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
@@ -375,8 +366,15 @@
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
+ UnormInt10X6EXT = 17,
UnsignedIntRaw10EXT = 19,
UnsignedIntRaw12EXT = 20,
+ UnormInt2_101010EXT = 21,
+ UnsignedInt10X6EXT = 22,
+ UnsignedInt12X4EXT = 23,
+ UnsignedInt14X2EXT = 24,
+ UnormInt12X4EXT = 25,
+ UnormInt14X2EXT = 26,
Max = 0x7fffffff,
};
@@ -539,6 +537,7 @@
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
+ SaturatedToLargestFloat8NormalConversionEXT = 4216,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
WeightTextureQCOM = 4487,
@@ -549,6 +548,10 @@
NodeMaxPayloadsAMDX = 5020,
TrackFinishWritingAMDX = 5078,
PayloadNodeNameAMDX = 5091,
+ PayloadNodeBaseIndexAMDX = 5098,
+ PayloadNodeSparseArrayAMDX = 5099,
+ PayloadNodeArraySizeAMDX = 5100,
+ PayloadDispatchIndirectAMDX = 5105,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
@@ -635,6 +638,7 @@
HostAccessINTEL = 6188,
InitModeINTEL = 6190,
ImplementInRegisterMapINTEL = 6191,
+ ConditionalINTEL = 6247,
CacheControlLoadINTEL = 6442,
CacheControlStoreINTEL = 6443,
Max = 0x7fffffff,
@@ -704,6 +708,9 @@
DeviceIndex = 4438,
ViewIndex = 4440,
ShadingRateKHR = 4444,
+ TileOffsetQCOM = 4492,
+ TileDimensionQCOM = 4493,
+ TileApronSizeQCOM = 4494,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
@@ -712,7 +719,7 @@
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
- CoalescedInputCountAMDX = 5021,
+ RemainingRecursionLevelsAMDX = 5021,
ShaderIndexAMDX = 5073,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
@@ -772,12 +779,19 @@
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
+ HitIsSphereNV = 5359,
+ HitIsLSSNV = 5360,
+ HitSpherePositionNV = 5361,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
+ HitLSSPositionsNV = 5396,
HitKindFrontFacingMicroTriangleNV = 5405,
HitKindBackFacingMicroTriangleNV = 5406,
+ HitSphereRadiusNV = 5420,
+ HitLSSRadiiNV = 5421,
+ ClusterIDNV = 5436,
CullMaskKHR = 6021,
Max = 0x7fffffff,
};
@@ -845,6 +859,7 @@
DontInline = 1,
Pure = 2,
Const = 3,
+ OptNoneEXT = 16,
OptNoneINTEL = 16,
Max = 0x7fffffff,
};
@@ -855,6 +870,7 @@
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
+ OptNoneEXT = 0x00010000,
OptNoneINTEL = 0x00010000,
};
@@ -1045,6 +1061,13 @@
TileImageColorReadAccessEXT = 4166,
TileImageDepthReadAccessEXT = 4167,
TileImageStencilReadAccessEXT = 4168,
+ TensorsARM = 4174,
+ StorageTensorArrayDynamicIndexingARM = 4175,
+ StorageTensorArrayNonUniformIndexingARM = 4176,
+ GraphARM = 4191,
+ CooperativeMatrixLayoutsARM = 4201,
+ Float8EXT = 4212,
+ Float8CooperativeMatrixEXT = 4213,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -1074,11 +1097,14 @@
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayQueryKHR = 4472,
+ UntypedPointersKHR = 4473,
RayTraversalPrimitiveCullingKHR = 4478,
RayTracingKHR = 4479,
TextureSampleWeightedQCOM = 4484,
TextureBoxFilterQCOM = 4485,
TextureBlockMatchQCOM = 4486,
+ TileShadingQCOM = 4495,
+ CooperativeMatrixConversionQCOM = 4496,
TextureBlockMatch2QCOM = 4498,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
@@ -1089,6 +1115,11 @@
ShaderClockKHR = 5055,
ShaderEnqueueAMDX = 5067,
QuadControlKHR = 5087,
+ Int4TypeINTEL = 5112,
+ Int4CooperativeMatrixINTEL = 5114,
+ BFloat16TypeKHR = 5116,
+ BFloat16DotProductKHR = 5117,
+ BFloat16CooperativeMatrixKHR = 5118,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
@@ -1102,6 +1133,7 @@
MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
+ ComputeDerivativeGroupQuadsKHR = 5288,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
@@ -1139,6 +1171,7 @@
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
+ ComputeDerivativeGroupLinearKHR = 5350,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
@@ -1153,9 +1186,20 @@
ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
RayQueryPositionFetchKHR = 5391,
+ CooperativeVectorNV = 5394,
AtomicFloat16VectorNV = 5404,
RayTracingDisplacementMicromapNV = 5409,
RawAccessChainsNV = 5414,
+ RayTracingSpheresGeometryNV = 5418,
+ RayTracingLinearSweptSpheresGeometryNV = 5419,
+ CooperativeMatrixReductionsNV = 5430,
+ CooperativeMatrixConversionsNV = 5431,
+ CooperativeMatrixPerElementOperationsNV = 5432,
+ CooperativeMatrixTensorAddressingNV = 5433,
+ CooperativeMatrixBlockLoadsNV = 5434,
+ CooperativeVectorTrainingNV = 5435,
+ RayTracingClusterAccelerationStructureNV = 5437,
+ TensorAddressingNV = 5439,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
@@ -1208,28 +1252,42 @@
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
CooperativeMatrixKHR = 6022,
+ ReplicatedCompositesEXT = 6024,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
FloatControls2 = 6029,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongCompositesINTEL = 6089,
+ OptNoneEXT = 6094,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
BFloat16ConversionINTEL = 6115,
SplitBarrierINTEL = 6141,
+ ArithmeticFenceEXT = 6144,
FPGAClusterAttributesV2INTEL = 6150,
FPGAKernelAttributesv2INTEL = 6161,
+ TaskSequenceINTEL = 6162,
FPMaxErrorINTEL = 6169,
FPGALatencyControlINTEL = 6171,
FPGAArgumentInterfacesINTEL = 6174,
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
+ SubgroupBufferPrefetchINTEL = 6220,
+ Subgroup2DBlockIOINTEL = 6228,
+ Subgroup2DBlockTransformINTEL = 6229,
+ Subgroup2DBlockTransposeINTEL = 6230,
+ SubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ TernaryBitwiseFunctionINTEL = 6241,
+ SpecConditionalINTEL = 6245,
+ FunctionVariantsINTEL = 6246,
GroupUniformArithmeticKHR = 6400,
+ TensorFloat32RoundingINTEL = 6425,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
+ BindlessImagesINTEL = 6528,
Max = 0x7fffffff,
};
@@ -1242,6 +1300,7 @@
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
+ SkipBuiltinPrimitivesNV = 8,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
ForceOpacityMicromap2StateEXT = 10,
@@ -1258,6 +1317,7 @@
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
+ SkipBuiltinPrimitivesNV = 0x00000100,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
ForceOpacityMicromap2StateEXT = 0x00000400,
@@ -1357,6 +1417,8 @@
enum class CooperativeMatrixLayout : unsigned {
RowMajorKHR = 0,
ColumnMajorKHR = 1,
+ RowBlockedInterleavedARM = 4202,
+ ColumnBlockedInterleavedARM = 4203,
Max = 0x7fffffff,
};
@@ -1367,6 +1429,59 @@
Max = 0x7fffffff,
};
+enum class CooperativeMatrixReduceShift : unsigned {
+ Row = 0,
+ Column = 1,
+ CooperativeMatrixReduce2x2 = 2,
+ Max = 0x7fffffff,
+};
+
+enum class CooperativeMatrixReduceMask : unsigned {
+ MaskNone = 0,
+ Row = 0x00000001,
+ Column = 0x00000002,
+ CooperativeMatrixReduce2x2 = 0x00000004,
+};
+
+enum class TensorClampMode : unsigned {
+ Undefined = 0,
+ Constant = 1,
+ ClampToEdge = 2,
+ Repeat = 3,
+ RepeatMirrored = 4,
+ Max = 0x7fffffff,
+};
+
+enum class TensorAddressingOperandsShift : unsigned {
+ TensorView = 0,
+ DecodeFunc = 1,
+ Max = 0x7fffffff,
+};
+
+enum class TensorAddressingOperandsMask : unsigned {
+ MaskNone = 0,
+ TensorView = 0x00000001,
+ DecodeFunc = 0x00000002,
+};
+
+enum class TensorOperandsShift : unsigned {
+ NontemporalARM = 0,
+ OutOfBoundsValueARM = 1,
+ MakeElementAvailableARM = 2,
+ MakeElementVisibleARM = 3,
+ NonPrivateElementARM = 4,
+ Max = 0x7fffffff,
+};
+
+enum class TensorOperandsMask : unsigned {
+ MaskNone = 0,
+ NontemporalARM = 0x00000001,
+ OutOfBoundsValueARM = 0x00000002,
+ MakeElementAvailableARM = 0x00000004,
+ MakeElementVisibleARM = 0x00000008,
+ NonPrivateElementARM = 0x00000010,
+};
+
enum class InitializationModeQualifier : unsigned {
InitOnDeviceReprogramINTEL = 0,
InitOnDeviceResetINTEL = 1,
@@ -1403,6 +1518,42 @@
Max = 0x7fffffff,
};
+enum class MatrixMultiplyAccumulateOperandsShift : unsigned {
+ MatrixASignedComponentsINTEL = 0,
+ MatrixBSignedComponentsINTEL = 1,
+ MatrixCBFloat16INTEL = 2,
+ MatrixResultBFloat16INTEL = 3,
+ MatrixAPackedInt8INTEL = 4,
+ MatrixBPackedInt8INTEL = 5,
+ MatrixAPackedInt4INTEL = 6,
+ MatrixBPackedInt4INTEL = 7,
+ MatrixATF32INTEL = 8,
+ MatrixBTF32INTEL = 9,
+ MatrixAPackedFloat16INTEL = 10,
+ MatrixBPackedFloat16INTEL = 11,
+ MatrixAPackedBFloat16INTEL = 12,
+ MatrixBPackedBFloat16INTEL = 13,
+ Max = 0x7fffffff,
+};
+
+enum class MatrixMultiplyAccumulateOperandsMask : unsigned {
+ MaskNone = 0,
+ MatrixASignedComponentsINTEL = 0x00000001,
+ MatrixBSignedComponentsINTEL = 0x00000002,
+ MatrixCBFloat16INTEL = 0x00000004,
+ MatrixResultBFloat16INTEL = 0x00000008,
+ MatrixAPackedInt8INTEL = 0x00000010,
+ MatrixBPackedInt8INTEL = 0x00000020,
+ MatrixAPackedInt4INTEL = 0x00000040,
+ MatrixBPackedInt4INTEL = 0x00000080,
+ MatrixATF32INTEL = 0x00000100,
+ MatrixBTF32INTEL = 0x00000200,
+ MatrixAPackedFloat16INTEL = 0x00000400,
+ MatrixBPackedFloat16INTEL = 0x00000800,
+ MatrixAPackedBFloat16INTEL = 0x00001000,
+ MatrixBPackedBFloat16INTEL = 0x00002000,
+};
+
enum class RawAccessChainOperandsShift : unsigned {
RobustnessPerComponentNV = 0,
RobustnessPerElementNV = 1,
@@ -1415,6 +1566,40 @@
RobustnessPerElementNV = 0x00000002,
};
+enum class FPEncoding : unsigned {
+ BFloat16KHR = 0,
+ Float8E4M3EXT = 4214,
+ Float8E5M2EXT = 4215,
+ Max = 0x7fffffff,
+};
+
+enum class CooperativeVectorMatrixLayout : unsigned {
+ RowMajorNV = 0,
+ ColumnMajorNV = 1,
+ InferencingOptimalNV = 2,
+ TrainingOptimalNV = 3,
+ Max = 0x7fffffff,
+};
+
+enum class ComponentType : unsigned {
+ Float16NV = 0,
+ Float32NV = 1,
+ Float64NV = 2,
+ SignedInt8NV = 3,
+ SignedInt16NV = 4,
+ SignedInt32NV = 5,
+ SignedInt64NV = 6,
+ UnsignedInt8NV = 7,
+ UnsignedInt16NV = 8,
+ UnsignedInt32NV = 9,
+ UnsignedInt64NV = 10,
+ SignedInt8PackedNV = 1000491000,
+ UnsignedInt8PackedNV = 1000491001,
+ FloatE4M3NV = 1000491002,
+ FloatE5M2NV = 1000491003,
+ Max = 0x7fffffff,
+};
+
enum class Op : unsigned {
OpNop = 0,
OpUndef = 1,
@@ -1763,14 +1948,35 @@
OpColorAttachmentReadEXT = 4160,
OpDepthAttachmentReadEXT = 4161,
OpStencilAttachmentReadEXT = 4162,
+ OpTypeTensorARM = 4163,
+ OpTensorReadARM = 4164,
+ OpTensorWriteARM = 4165,
+ OpTensorQuerySizeARM = 4166,
+ OpGraphConstantARM = 4181,
+ OpGraphEntryPointARM = 4182,
+ OpGraphARM = 4183,
+ OpGraphInputARM = 4184,
+ OpGraphSetOutputARM = 4185,
+ OpGraphEndARM = 4186,
+ OpTypeGraphARM = 4190,
OpTerminateInvocation = 4416,
+ OpTypeUntypedPointerKHR = 4417,
+ OpUntypedVariableKHR = 4418,
+ OpUntypedAccessChainKHR = 4419,
+ OpUntypedInBoundsAccessChainKHR = 4420,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
+ OpUntypedPtrAccessChainKHR = 4423,
+ OpUntypedInBoundsPtrAccessChainKHR = 4424,
+ OpUntypedArrayLengthKHR = 4425,
+ OpUntypedPrefetchKHR = 4426,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
+ OpExtInstWithForwardRefsKHR = 4433,
+ OpUntypedGroupAsyncCopyKHR = 4434,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
@@ -1793,6 +1999,9 @@
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
+ OpConstantCompositeReplicateEXT = 4461,
+ OpSpecConstantCompositeReplicateEXT = 4462,
+ OpCompositeConstructReplicateEXT = 4463,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@@ -1804,10 +2013,14 @@
OpImageBoxFilterQCOM = 4481,
OpImageBlockMatchSSDQCOM = 4482,
OpImageBlockMatchSADQCOM = 4483,
+ OpBitCastArrayQCOM = 4497,
OpImageBlockMatchWindowSSDQCOM = 4500,
OpImageBlockMatchWindowSADQCOM = 4501,
OpImageBlockMatchGatherSSDQCOM = 4502,
OpImageBlockMatchGatherSADQCOM = 4503,
+ OpCompositeConstructCoopMatQCOM = 4540,
+ OpCompositeExtractCoopMatQCOM = 4541,
+ OpExtractSubArrayQCOM = 4542,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@@ -1819,9 +2032,14 @@
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
- OpFinalizeNodePayloadsAMDX = 5075,
+ OpAllocateNodePayloadsAMDX = 5074,
+ OpEnqueueNodePayloadsAMDX = 5075,
+ OpTypeNodePayloadArrayAMDX = 5076,
OpFinishWritingNodePayloadAMDX = 5078,
- OpInitializeNodePayloadsAMDX = 5090,
+ OpNodePayloadArrayLengthAMDX = 5090,
+ OpIsNodePayloadValidAMDX = 5101,
+ OpConstantStringAMDX = 5103,
+ OpSpecConstantStringAMDX = 5104,
OpGroupNonUniformQuadAllKHR = 5110,
OpGroupNonUniformQuadAnyKHR = 5111,
OpHitObjectRecordHitMotionNV = 5249,
@@ -1858,12 +2076,20 @@
OpReorderThreadWithHintNV = 5280,
OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpTypeCooperativeVectorNV = 5288,
+ OpCooperativeVectorMatrixMulNV = 5289,
+ OpCooperativeVectorOuterProductAccumulateNV = 5290,
+ OpCooperativeVectorReduceSumAccumulateNV = 5291,
+ OpCooperativeVectorMatrixMulAddNV = 5292,
+ OpCooperativeMatrixConvertNV = 5293,
OpEmitMeshTasksEXT = 5294,
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
+ OpCooperativeVectorLoadNV = 5302,
+ OpCooperativeVectorStoreNV = 5303,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
@@ -1875,6 +2101,8 @@
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
+ OpRayQueryGetClusterIdNV = 5345,
+ OpHitObjectGetClusterIdNV = 5346,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
@@ -1882,9 +2110,26 @@
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
+ OpCooperativeMatrixReduceNV = 5366,
+ OpCooperativeMatrixLoadTensorNV = 5367,
+ OpCooperativeMatrixStoreTensorNV = 5368,
+ OpCooperativeMatrixPerElementOpNV = 5369,
+ OpTypeTensorLayoutNV = 5370,
+ OpTypeTensorViewNV = 5371,
+ OpCreateTensorLayoutNV = 5372,
+ OpTensorLayoutSetDimensionNV = 5373,
+ OpTensorLayoutSetStrideNV = 5374,
+ OpTensorLayoutSliceNV = 5375,
+ OpTensorLayoutSetClampValueNV = 5376,
+ OpCreateTensorViewNV = 5377,
+ OpTensorViewSetDimensionNV = 5378,
+ OpTensorViewSetStrideNV = 5379,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
+ OpTensorViewSetClipNV = 5382,
+ OpTensorLayoutSetBlockSizeNV = 5384,
+ OpCooperativeMatrixTransposeNV = 5390,
OpConvertUToImageNV = 5391,
OpConvertUToSamplerNV = 5392,
OpConvertImageToUNV = 5393,
@@ -1893,6 +2138,19 @@
OpConvertSampledImageToUNV = 5396,
OpSamplerImageAddressingModeNV = 5397,
OpRawAccessChainNV = 5398,
+ OpRayQueryGetIntersectionSpherePositionNV = 5427,
+ OpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ OpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ OpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ OpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ OpHitObjectGetSpherePositionNV = 5432,
+ OpHitObjectGetSphereRadiusNV = 5433,
+ OpHitObjectGetLSSPositionsNV = 5434,
+ OpHitObjectGetLSSRadiiNV = 5435,
+ OpHitObjectIsSphereHitNV = 5436,
+ OpHitObjectIsLSSHitNV = 5437,
+ OpRayQueryIsSphereHitNV = 5438,
+ OpRayQueryIsLSSHitNV = 5439,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -2139,6 +2397,27 @@
OpConvertBF16ToFINTEL = 6117,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
+ OpArithmeticFenceEXT = 6145,
+ OpTaskSequenceCreateINTEL = 6163,
+ OpTaskSequenceAsyncINTEL = 6164,
+ OpTaskSequenceGetINTEL = 6165,
+ OpTaskSequenceReleaseINTEL = 6166,
+ OpTypeTaskSequenceINTEL = 6199,
+ OpSubgroupBlockPrefetchINTEL = 6221,
+ OpSubgroup2DBlockLoadINTEL = 6231,
+ OpSubgroup2DBlockLoadTransformINTEL = 6232,
+ OpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ OpSubgroup2DBlockPrefetchINTEL = 6234,
+ OpSubgroup2DBlockStoreINTEL = 6235,
+ OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ OpBitwiseFunctionINTEL = 6242,
+ OpConditionalExtensionINTEL = 6248,
+ OpConditionalEntryPointINTEL = 6249,
+ OpConditionalCapabilityINTEL = 6250,
+ OpSpecConstantTargetINTEL = 6251,
+ OpSpecConstantArchitectureINTEL = 6252,
+ OpSpecConstantCapabilitiesINTEL = 6253,
+ OpConditionalCopyObjectINTEL = 6254,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
@@ -2147,8 +2426,12 @@
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
+ OpRoundFToTF32INTEL = 6426,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
+ OpConvertHandleToImageINTEL = 6529,
+ OpConvertHandleToSamplerINTEL = 6530,
+ OpConvertHandleToSampledImageINTEL = 6531,
Max = 0x7fffffff,
};
@@ -2507,14 +2790,35 @@
case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTypeTensorARM: *hasResult = true; *hasResultType = false; break;
+ case Op::OpTensorReadARM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorWriteARM: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpGraphConstantARM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpGraphEntryPointARM: *hasResult = false; *hasResultType = false; break;
+ case Op::OpGraphARM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpGraphInputARM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpGraphSetOutputARM: *hasResult = false; *hasResultType = false; break;
+ case Op::OpGraphEndARM: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTypeGraphARM: *hasResult = true; *hasResultType = false; break;
case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break;
+ case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedInBoundsAccessChainKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedInBoundsPtrAccessChainKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedArrayLengthKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedPrefetchKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpUntypedGroupAsyncCopyKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
@@ -2531,6 +2835,9 @@
case Op::OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break;
+ case Op::OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCompositeConstructReplicateEXT: *hasResult = true; *hasResultType = true; break;
case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2542,10 +2849,14 @@
case Op::OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break;
+ case Op::OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
@@ -2557,9 +2868,14 @@
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::OpFinalizeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case Op::OpAllocateNodePayloadsAMDX: *hasResult = true; *hasResultType = true; break;
+ case Op::OpEnqueueNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTypeNodePayloadArrayAMDX: *hasResult = true; *hasResultType = false; break;
case Op::OpFinishWritingNodePayloadAMDX: *hasResult = true; *hasResultType = true; break;
- case Op::OpInitializeNodePayloadsAMDX: *hasResult = false; *hasResultType = false; break;
+ case Op::OpNodePayloadArrayLengthAMDX: *hasResult = true; *hasResultType = true; break;
+ case Op::OpIsNodePayloadValidAMDX: *hasResult = true; *hasResultType = true; break;
+ case Op::OpConstantStringAMDX: *hasResult = true; *hasResultType = false; break;
+ case Op::OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break;
case Op::OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
@@ -2596,21 +2912,31 @@
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::OpTypeCooperativeVectorNV: *hasResult = true; *hasResultType = false; break;
+ case Op::OpCooperativeVectorMatrixMulNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeVectorOuterProductAccumulateNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpCooperativeVectorReduceSumAccumulateNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpCooperativeVectorMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeMatrixConvertNV: *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::OpFetchMicroTriangleVertexPositionNV: *hasResult = true; *hasResultType = true; break;
case Op::OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break;
- case Op::OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break;
case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: *hasResult = true; *hasResultType = true; break;
- case Op::OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
+ case Op::OpTypeAccelerationStructureKHR: *hasResult = true; *hasResultType = false; break;
case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
@@ -2618,8 +2944,25 @@
case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
+ case Op::OpCooperativeMatrixReduceNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeMatrixLoadTensorNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeMatrixStoreTensorNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpCooperativeMatrixPerElementOpNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTypeTensorLayoutNV: *hasResult = true; *hasResultType = false; break;
+ case Op::OpTypeTensorViewNV: *hasResult = true; *hasResultType = false; break;
+ case Op::OpCreateTensorLayoutNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorLayoutSetDimensionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorLayoutSetStrideNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorLayoutSliceNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorLayoutSetClampValueNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCreateTensorViewNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorViewSetDimensionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorViewSetStrideNV: *hasResult = true; *hasResultType = true; break;
case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorViewSetClipNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTensorLayoutSetBlockSizeNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpCooperativeMatrixTransposeNV: *hasResult = true; *hasResultType = true; break;
case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
case Op::OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
@@ -2628,6 +2971,19 @@
case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case Op::OpRawAccessChainNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryGetIntersectionSpherePositionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryGetIntersectionSphereRadiusNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryGetIntersectionLSSPositionsNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryGetIntersectionLSSRadiiNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryGetIntersectionLSSHitValueNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetSpherePositionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetSphereRadiusNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetLSSPositionsNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetLSSRadiiNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectIsSphereHitNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectIsLSSHitNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryIsSphereHitNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRayQueryIsLSSHitNV: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2654,7 +3010,7 @@
case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
- case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = false; break;
case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
@@ -2872,6 +3228,27 @@
case Op::OpConvertBF16ToFINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpArithmeticFenceEXT: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTaskSequenceCreateINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTaskSequenceAsyncINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTaskSequenceGetINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpTaskSequenceReleaseINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTypeTaskSequenceINTEL: *hasResult = true; *hasResultType = false; break;
+ case Op::OpSubgroupBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSubgroup2DBlockLoadINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSubgroup2DBlockLoadTransformINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSubgroup2DBlockLoadTransposeINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSubgroup2DBlockPrefetchINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSubgroup2DBlockStoreINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpBitwiseFunctionINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpConditionalExtensionINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpConditionalEntryPointINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpConditionalCapabilityINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSpecConstantTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpSpecConstantArchitectureINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpSpecConstantCapabilitiesINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpConditionalCopyObjectINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
@@ -2880,10 +3257,2005 @@
case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpRoundFToTF32INTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break;
+ case Op::OpConvertHandleToImageINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpConvertHandleToSamplerINTEL: *hasResult = true; *hasResultType = true; break;
+ case Op::OpConvertHandleToSampledImageINTEL: *hasResult = true; *hasResultType = true; break;
}
}
+inline const char* SourceLanguageToString(SourceLanguage value) {
+ switch (value) {
+ case SourceLanguage::Unknown: return "Unknown";
+ case SourceLanguage::ESSL: return "ESSL";
+ case SourceLanguage::GLSL: return "GLSL";
+ case SourceLanguage::OpenCL_C: return "OpenCL_C";
+ case SourceLanguage::OpenCL_CPP: return "OpenCL_CPP";
+ case SourceLanguage::HLSL: return "HLSL";
+ case SourceLanguage::CPP_for_OpenCL: return "CPP_for_OpenCL";
+ case SourceLanguage::SYCL: return "SYCL";
+ case SourceLanguage::HERO_C: return "HERO_C";
+ case SourceLanguage::NZSL: return "NZSL";
+ case SourceLanguage::WGSL: return "WGSL";
+ case SourceLanguage::Slang: return "Slang";
+ case SourceLanguage::Zig: return "Zig";
+ case SourceLanguage::Rust: return "Rust";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ExecutionModelToString(ExecutionModel value) {
+ switch (value) {
+ case ExecutionModel::Vertex: return "Vertex";
+ case ExecutionModel::TessellationControl: return "TessellationControl";
+ case ExecutionModel::TessellationEvaluation: return "TessellationEvaluation";
+ case ExecutionModel::Geometry: return "Geometry";
+ case ExecutionModel::Fragment: return "Fragment";
+ case ExecutionModel::GLCompute: return "GLCompute";
+ case ExecutionModel::Kernel: return "Kernel";
+ case ExecutionModel::TaskNV: return "TaskNV";
+ case ExecutionModel::MeshNV: return "MeshNV";
+ case ExecutionModel::RayGenerationKHR: return "RayGenerationKHR";
+ case ExecutionModel::IntersectionKHR: return "IntersectionKHR";
+ case ExecutionModel::AnyHitKHR: return "AnyHitKHR";
+ case ExecutionModel::ClosestHitKHR: return "ClosestHitKHR";
+ case ExecutionModel::MissKHR: return "MissKHR";
+ case ExecutionModel::CallableKHR: return "CallableKHR";
+ case ExecutionModel::TaskEXT: return "TaskEXT";
+ case ExecutionModel::MeshEXT: return "MeshEXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* AddressingModelToString(AddressingModel value) {
+ switch (value) {
+ case AddressingModel::Logical: return "Logical";
+ case AddressingModel::Physical32: return "Physical32";
+ case AddressingModel::Physical64: return "Physical64";
+ case AddressingModel::PhysicalStorageBuffer64: return "PhysicalStorageBuffer64";
+ default: return "Unknown";
+ }
+}
+
+inline const char* MemoryModelToString(MemoryModel value) {
+ switch (value) {
+ case MemoryModel::Simple: return "Simple";
+ case MemoryModel::GLSL450: return "GLSL450";
+ case MemoryModel::OpenCL: return "OpenCL";
+ case MemoryModel::Vulkan: return "Vulkan";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ExecutionModeToString(ExecutionMode value) {
+ switch (value) {
+ case ExecutionMode::Invocations: return "Invocations";
+ case ExecutionMode::SpacingEqual: return "SpacingEqual";
+ case ExecutionMode::SpacingFractionalEven: return "SpacingFractionalEven";
+ case ExecutionMode::SpacingFractionalOdd: return "SpacingFractionalOdd";
+ case ExecutionMode::VertexOrderCw: return "VertexOrderCw";
+ case ExecutionMode::VertexOrderCcw: return "VertexOrderCcw";
+ case ExecutionMode::PixelCenterInteger: return "PixelCenterInteger";
+ case ExecutionMode::OriginUpperLeft: return "OriginUpperLeft";
+ case ExecutionMode::OriginLowerLeft: return "OriginLowerLeft";
+ case ExecutionMode::EarlyFragmentTests: return "EarlyFragmentTests";
+ case ExecutionMode::PointMode: return "PointMode";
+ case ExecutionMode::Xfb: return "Xfb";
+ case ExecutionMode::DepthReplacing: return "DepthReplacing";
+ case ExecutionMode::DepthGreater: return "DepthGreater";
+ case ExecutionMode::DepthLess: return "DepthLess";
+ case ExecutionMode::DepthUnchanged: return "DepthUnchanged";
+ case ExecutionMode::LocalSize: return "LocalSize";
+ case ExecutionMode::LocalSizeHint: return "LocalSizeHint";
+ case ExecutionMode::InputPoints: return "InputPoints";
+ case ExecutionMode::InputLines: return "InputLines";
+ case ExecutionMode::InputLinesAdjacency: return "InputLinesAdjacency";
+ case ExecutionMode::Triangles: return "Triangles";
+ case ExecutionMode::InputTrianglesAdjacency: return "InputTrianglesAdjacency";
+ case ExecutionMode::Quads: return "Quads";
+ case ExecutionMode::Isolines: return "Isolines";
+ case ExecutionMode::OutputVertices: return "OutputVertices";
+ case ExecutionMode::OutputPoints: return "OutputPoints";
+ case ExecutionMode::OutputLineStrip: return "OutputLineStrip";
+ case ExecutionMode::OutputTriangleStrip: return "OutputTriangleStrip";
+ case ExecutionMode::VecTypeHint: return "VecTypeHint";
+ case ExecutionMode::ContractionOff: return "ContractionOff";
+ case ExecutionMode::Initializer: return "Initializer";
+ case ExecutionMode::Finalizer: return "Finalizer";
+ case ExecutionMode::SubgroupSize: return "SubgroupSize";
+ case ExecutionMode::SubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup";
+ case ExecutionMode::SubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId";
+ case ExecutionMode::LocalSizeId: return "LocalSizeId";
+ case ExecutionMode::LocalSizeHintId: return "LocalSizeHintId";
+ case ExecutionMode::NonCoherentColorAttachmentReadEXT: return "NonCoherentColorAttachmentReadEXT";
+ case ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT";
+ case ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT";
+ case ExecutionMode::SubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlowKHR";
+ case ExecutionMode::PostDepthCoverage: return "PostDepthCoverage";
+ case ExecutionMode::DenormPreserve: return "DenormPreserve";
+ case ExecutionMode::DenormFlushToZero: return "DenormFlushToZero";
+ case ExecutionMode::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case ExecutionMode::RoundingModeRTE: return "RoundingModeRTE";
+ case ExecutionMode::RoundingModeRTZ: return "RoundingModeRTZ";
+ case ExecutionMode::NonCoherentTileAttachmentReadQCOM: return "NonCoherentTileAttachmentReadQCOM";
+ case ExecutionMode::TileShadingRateQCOM: return "TileShadingRateQCOM";
+ case ExecutionMode::EarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD";
+ case ExecutionMode::StencilRefReplacingEXT: return "StencilRefReplacingEXT";
+ case ExecutionMode::CoalescingAMDX: return "CoalescingAMDX";
+ case ExecutionMode::IsApiEntryAMDX: return "IsApiEntryAMDX";
+ case ExecutionMode::MaxNodeRecursionAMDX: return "MaxNodeRecursionAMDX";
+ case ExecutionMode::StaticNumWorkgroupsAMDX: return "StaticNumWorkgroupsAMDX";
+ case ExecutionMode::ShaderIndexAMDX: return "ShaderIndexAMDX";
+ case ExecutionMode::MaxNumWorkgroupsAMDX: return "MaxNumWorkgroupsAMDX";
+ case ExecutionMode::StencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD";
+ case ExecutionMode::StencilRefGreaterFrontAMD: return "StencilRefGreaterFrontAMD";
+ case ExecutionMode::StencilRefLessFrontAMD: return "StencilRefLessFrontAMD";
+ case ExecutionMode::StencilRefUnchangedBackAMD: return "StencilRefUnchangedBackAMD";
+ case ExecutionMode::StencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD";
+ case ExecutionMode::StencilRefLessBackAMD: return "StencilRefLessBackAMD";
+ case ExecutionMode::QuadDerivativesKHR: return "QuadDerivativesKHR";
+ case ExecutionMode::RequireFullQuadsKHR: return "RequireFullQuadsKHR";
+ case ExecutionMode::SharesInputWithAMDX: return "SharesInputWithAMDX";
+ case ExecutionMode::OutputLinesEXT: return "OutputLinesEXT";
+ case ExecutionMode::OutputPrimitivesEXT: return "OutputPrimitivesEXT";
+ case ExecutionMode::DerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR";
+ case ExecutionMode::DerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR";
+ case ExecutionMode::OutputTrianglesEXT: return "OutputTrianglesEXT";
+ case ExecutionMode::PixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT";
+ case ExecutionMode::PixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT";
+ case ExecutionMode::SampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT";
+ case ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT";
+ case ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT";
+ case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT";
+ case ExecutionMode::SharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL";
+ case ExecutionMode::RoundingModeRTPINTEL: return "RoundingModeRTPINTEL";
+ case ExecutionMode::RoundingModeRTNINTEL: return "RoundingModeRTNINTEL";
+ case ExecutionMode::FloatingPointModeALTINTEL: return "FloatingPointModeALTINTEL";
+ case ExecutionMode::FloatingPointModeIEEEINTEL: return "FloatingPointModeIEEEINTEL";
+ case ExecutionMode::MaxWorkgroupSizeINTEL: return "MaxWorkgroupSizeINTEL";
+ case ExecutionMode::MaxWorkDimINTEL: return "MaxWorkDimINTEL";
+ case ExecutionMode::NoGlobalOffsetINTEL: return "NoGlobalOffsetINTEL";
+ case ExecutionMode::NumSIMDWorkitemsINTEL: return "NumSIMDWorkitemsINTEL";
+ case ExecutionMode::SchedulerTargetFmaxMhzINTEL: return "SchedulerTargetFmaxMhzINTEL";
+ case ExecutionMode::MaximallyReconvergesKHR: return "MaximallyReconvergesKHR";
+ case ExecutionMode::FPFastMathDefault: return "FPFastMathDefault";
+ case ExecutionMode::StreamingInterfaceINTEL: return "StreamingInterfaceINTEL";
+ case ExecutionMode::RegisterMapInterfaceINTEL: return "RegisterMapInterfaceINTEL";
+ case ExecutionMode::NamedBarrierCountINTEL: return "NamedBarrierCountINTEL";
+ case ExecutionMode::MaximumRegistersINTEL: return "MaximumRegistersINTEL";
+ case ExecutionMode::MaximumRegistersIdINTEL: return "MaximumRegistersIdINTEL";
+ case ExecutionMode::NamedMaximumRegistersINTEL: return "NamedMaximumRegistersINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* StorageClassToString(StorageClass value) {
+ switch (value) {
+ case StorageClass::UniformConstant: return "UniformConstant";
+ case StorageClass::Input: return "Input";
+ case StorageClass::Uniform: return "Uniform";
+ case StorageClass::Output: return "Output";
+ case StorageClass::Workgroup: return "Workgroup";
+ case StorageClass::CrossWorkgroup: return "CrossWorkgroup";
+ case StorageClass::Private: return "Private";
+ case StorageClass::Function: return "Function";
+ case StorageClass::Generic: return "Generic";
+ case StorageClass::PushConstant: return "PushConstant";
+ case StorageClass::AtomicCounter: return "AtomicCounter";
+ case StorageClass::Image: return "Image";
+ case StorageClass::StorageBuffer: return "StorageBuffer";
+ case StorageClass::TileImageEXT: return "TileImageEXT";
+ case StorageClass::TileAttachmentQCOM: return "TileAttachmentQCOM";
+ case StorageClass::NodePayloadAMDX: return "NodePayloadAMDX";
+ case StorageClass::CallableDataKHR: return "CallableDataKHR";
+ case StorageClass::IncomingCallableDataKHR: return "IncomingCallableDataKHR";
+ case StorageClass::RayPayloadKHR: return "RayPayloadKHR";
+ case StorageClass::HitAttributeKHR: return "HitAttributeKHR";
+ case StorageClass::IncomingRayPayloadKHR: return "IncomingRayPayloadKHR";
+ case StorageClass::ShaderRecordBufferKHR: return "ShaderRecordBufferKHR";
+ case StorageClass::PhysicalStorageBuffer: return "PhysicalStorageBuffer";
+ case StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV";
+ case StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
+ case StorageClass::CodeSectionINTEL: return "CodeSectionINTEL";
+ case StorageClass::DeviceOnlyINTEL: return "DeviceOnlyINTEL";
+ case StorageClass::HostOnlyINTEL: return "HostOnlyINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* DimToString(Dim value) {
+ switch (value) {
+ case Dim::Dim1D: return "1D";
+ case Dim::Dim2D: return "2D";
+ case Dim::Dim3D: return "3D";
+ case Dim::Cube: return "Cube";
+ case Dim::Rect: return "Rect";
+ case Dim::Buffer: return "Buffer";
+ case Dim::SubpassData: return "SubpassData";
+ case Dim::TileImageDataEXT: return "TileImageDataEXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SamplerAddressingModeToString(SamplerAddressingMode value) {
+ switch (value) {
+ case SamplerAddressingMode::None: return "None";
+ case SamplerAddressingMode::ClampToEdge: return "ClampToEdge";
+ case SamplerAddressingMode::Clamp: return "Clamp";
+ case SamplerAddressingMode::Repeat: return "Repeat";
+ case SamplerAddressingMode::RepeatMirrored: return "RepeatMirrored";
+ default: return "Unknown";
+ }
+}
+
+inline const char* SamplerFilterModeToString(SamplerFilterMode value) {
+ switch (value) {
+ case SamplerFilterMode::Nearest: return "Nearest";
+ case SamplerFilterMode::Linear: return "Linear";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ImageFormatToString(ImageFormat value) {
+ switch (value) {
+ case ImageFormat::Unknown: return "Unknown";
+ case ImageFormat::Rgba32f: return "Rgba32f";
+ case ImageFormat::Rgba16f: return "Rgba16f";
+ case ImageFormat::R32f: return "R32f";
+ case ImageFormat::Rgba8: return "Rgba8";
+ case ImageFormat::Rgba8Snorm: return "Rgba8Snorm";
+ case ImageFormat::Rg32f: return "Rg32f";
+ case ImageFormat::Rg16f: return "Rg16f";
+ case ImageFormat::R11fG11fB10f: return "R11fG11fB10f";
+ case ImageFormat::R16f: return "R16f";
+ case ImageFormat::Rgba16: return "Rgba16";
+ case ImageFormat::Rgb10A2: return "Rgb10A2";
+ case ImageFormat::Rg16: return "Rg16";
+ case ImageFormat::Rg8: return "Rg8";
+ case ImageFormat::R16: return "R16";
+ case ImageFormat::R8: return "R8";
+ case ImageFormat::Rgba16Snorm: return "Rgba16Snorm";
+ case ImageFormat::Rg16Snorm: return "Rg16Snorm";
+ case ImageFormat::Rg8Snorm: return "Rg8Snorm";
+ case ImageFormat::R16Snorm: return "R16Snorm";
+ case ImageFormat::R8Snorm: return "R8Snorm";
+ case ImageFormat::Rgba32i: return "Rgba32i";
+ case ImageFormat::Rgba16i: return "Rgba16i";
+ case ImageFormat::Rgba8i: return "Rgba8i";
+ case ImageFormat::R32i: return "R32i";
+ case ImageFormat::Rg32i: return "Rg32i";
+ case ImageFormat::Rg16i: return "Rg16i";
+ case ImageFormat::Rg8i: return "Rg8i";
+ case ImageFormat::R16i: return "R16i";
+ case ImageFormat::R8i: return "R8i";
+ case ImageFormat::Rgba32ui: return "Rgba32ui";
+ case ImageFormat::Rgba16ui: return "Rgba16ui";
+ case ImageFormat::Rgba8ui: return "Rgba8ui";
+ case ImageFormat::R32ui: return "R32ui";
+ case ImageFormat::Rgb10a2ui: return "Rgb10a2ui";
+ case ImageFormat::Rg32ui: return "Rg32ui";
+ case ImageFormat::Rg16ui: return "Rg16ui";
+ case ImageFormat::Rg8ui: return "Rg8ui";
+ case ImageFormat::R16ui: return "R16ui";
+ case ImageFormat::R8ui: return "R8ui";
+ case ImageFormat::R64ui: return "R64ui";
+ case ImageFormat::R64i: return "R64i";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ImageChannelOrderToString(ImageChannelOrder value) {
+ switch (value) {
+ case ImageChannelOrder::R: return "R";
+ case ImageChannelOrder::A: return "A";
+ case ImageChannelOrder::RG: return "RG";
+ case ImageChannelOrder::RA: return "RA";
+ case ImageChannelOrder::RGB: return "RGB";
+ case ImageChannelOrder::RGBA: return "RGBA";
+ case ImageChannelOrder::BGRA: return "BGRA";
+ case ImageChannelOrder::ARGB: return "ARGB";
+ case ImageChannelOrder::Intensity: return "Intensity";
+ case ImageChannelOrder::Luminance: return "Luminance";
+ case ImageChannelOrder::Rx: return "Rx";
+ case ImageChannelOrder::RGx: return "RGx";
+ case ImageChannelOrder::RGBx: return "RGBx";
+ case ImageChannelOrder::Depth: return "Depth";
+ case ImageChannelOrder::DepthStencil: return "DepthStencil";
+ case ImageChannelOrder::sRGB: return "sRGB";
+ case ImageChannelOrder::sRGBx: return "sRGBx";
+ case ImageChannelOrder::sRGBA: return "sRGBA";
+ case ImageChannelOrder::sBGRA: return "sBGRA";
+ case ImageChannelOrder::ABGR: return "ABGR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ImageChannelDataTypeToString(ImageChannelDataType value) {
+ switch (value) {
+ case ImageChannelDataType::SnormInt8: return "SnormInt8";
+ case ImageChannelDataType::SnormInt16: return "SnormInt16";
+ case ImageChannelDataType::UnormInt8: return "UnormInt8";
+ case ImageChannelDataType::UnormInt16: return "UnormInt16";
+ case ImageChannelDataType::UnormShort565: return "UnormShort565";
+ case ImageChannelDataType::UnormShort555: return "UnormShort555";
+ case ImageChannelDataType::UnormInt101010: return "UnormInt101010";
+ case ImageChannelDataType::SignedInt8: return "SignedInt8";
+ case ImageChannelDataType::SignedInt16: return "SignedInt16";
+ case ImageChannelDataType::SignedInt32: return "SignedInt32";
+ case ImageChannelDataType::UnsignedInt8: return "UnsignedInt8";
+ case ImageChannelDataType::UnsignedInt16: return "UnsignedInt16";
+ case ImageChannelDataType::UnsignedInt32: return "UnsignedInt32";
+ case ImageChannelDataType::HalfFloat: return "HalfFloat";
+ case ImageChannelDataType::Float: return "Float";
+ case ImageChannelDataType::UnormInt24: return "UnormInt24";
+ case ImageChannelDataType::UnormInt101010_2: return "UnormInt101010_2";
+ case ImageChannelDataType::UnormInt10X6EXT: return "UnormInt10X6EXT";
+ case ImageChannelDataType::UnsignedIntRaw10EXT: return "UnsignedIntRaw10EXT";
+ case ImageChannelDataType::UnsignedIntRaw12EXT: return "UnsignedIntRaw12EXT";
+ case ImageChannelDataType::UnormInt2_101010EXT: return "UnormInt2_101010EXT";
+ case ImageChannelDataType::UnsignedInt10X6EXT: return "UnsignedInt10X6EXT";
+ case ImageChannelDataType::UnsignedInt12X4EXT: return "UnsignedInt12X4EXT";
+ case ImageChannelDataType::UnsignedInt14X2EXT: return "UnsignedInt14X2EXT";
+ case ImageChannelDataType::UnormInt12X4EXT: return "UnormInt12X4EXT";
+ case ImageChannelDataType::UnormInt14X2EXT: return "UnormInt14X2EXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPRoundingModeToString(FPRoundingMode value) {
+ switch (value) {
+ case FPRoundingMode::RTE: return "RTE";
+ case FPRoundingMode::RTZ: return "RTZ";
+ case FPRoundingMode::RTP: return "RTP";
+ case FPRoundingMode::RTN: return "RTN";
+ default: return "Unknown";
+ }
+}
+
+inline const char* LinkageTypeToString(LinkageType value) {
+ switch (value) {
+ case LinkageType::Export: return "Export";
+ case LinkageType::Import: return "Import";
+ case LinkageType::LinkOnceODR: return "LinkOnceODR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* AccessQualifierToString(AccessQualifier value) {
+ switch (value) {
+ case AccessQualifier::ReadOnly: return "ReadOnly";
+ case AccessQualifier::WriteOnly: return "WriteOnly";
+ case AccessQualifier::ReadWrite: return "ReadWrite";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FunctionParameterAttributeToString(FunctionParameterAttribute value) {
+ switch (value) {
+ case FunctionParameterAttribute::Zext: return "Zext";
+ case FunctionParameterAttribute::Sext: return "Sext";
+ case FunctionParameterAttribute::ByVal: return "ByVal";
+ case FunctionParameterAttribute::Sret: return "Sret";
+ case FunctionParameterAttribute::NoAlias: return "NoAlias";
+ case FunctionParameterAttribute::NoCapture: return "NoCapture";
+ case FunctionParameterAttribute::NoWrite: return "NoWrite";
+ case FunctionParameterAttribute::NoReadWrite: return "NoReadWrite";
+ case FunctionParameterAttribute::RuntimeAlignedINTEL: return "RuntimeAlignedINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* DecorationToString(Decoration value) {
+ switch (value) {
+ case Decoration::RelaxedPrecision: return "RelaxedPrecision";
+ case Decoration::SpecId: return "SpecId";
+ case Decoration::Block: return "Block";
+ case Decoration::BufferBlock: return "BufferBlock";
+ case Decoration::RowMajor: return "RowMajor";
+ case Decoration::ColMajor: return "ColMajor";
+ case Decoration::ArrayStride: return "ArrayStride";
+ case Decoration::MatrixStride: return "MatrixStride";
+ case Decoration::GLSLShared: return "GLSLShared";
+ case Decoration::GLSLPacked: return "GLSLPacked";
+ case Decoration::CPacked: return "CPacked";
+ case Decoration::BuiltIn: return "BuiltIn";
+ case Decoration::NoPerspective: return "NoPerspective";
+ case Decoration::Flat: return "Flat";
+ case Decoration::Patch: return "Patch";
+ case Decoration::Centroid: return "Centroid";
+ case Decoration::Sample: return "Sample";
+ case Decoration::Invariant: return "Invariant";
+ case Decoration::Restrict: return "Restrict";
+ case Decoration::Aliased: return "Aliased";
+ case Decoration::Volatile: return "Volatile";
+ case Decoration::Constant: return "Constant";
+ case Decoration::Coherent: return "Coherent";
+ case Decoration::NonWritable: return "NonWritable";
+ case Decoration::NonReadable: return "NonReadable";
+ case Decoration::Uniform: return "Uniform";
+ case Decoration::UniformId: return "UniformId";
+ case Decoration::SaturatedConversion: return "SaturatedConversion";
+ case Decoration::Stream: return "Stream";
+ case Decoration::Location: return "Location";
+ case Decoration::Component: return "Component";
+ case Decoration::Index: return "Index";
+ case Decoration::Binding: return "Binding";
+ case Decoration::DescriptorSet: return "DescriptorSet";
+ case Decoration::Offset: return "Offset";
+ case Decoration::XfbBuffer: return "XfbBuffer";
+ case Decoration::XfbStride: return "XfbStride";
+ case Decoration::FuncParamAttr: return "FuncParamAttr";
+ case Decoration::FPRoundingMode: return "FPRoundingMode";
+ case Decoration::FPFastMathMode: return "FPFastMathMode";
+ case Decoration::LinkageAttributes: return "LinkageAttributes";
+ case Decoration::NoContraction: return "NoContraction";
+ case Decoration::InputAttachmentIndex: return "InputAttachmentIndex";
+ case Decoration::Alignment: return "Alignment";
+ case Decoration::MaxByteOffset: return "MaxByteOffset";
+ case Decoration::AlignmentId: return "AlignmentId";
+ case Decoration::MaxByteOffsetId: return "MaxByteOffsetId";
+ case Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT";
+ case Decoration::NoSignedWrap: return "NoSignedWrap";
+ case Decoration::NoUnsignedWrap: return "NoUnsignedWrap";
+ case Decoration::WeightTextureQCOM: return "WeightTextureQCOM";
+ case Decoration::BlockMatchTextureQCOM: return "BlockMatchTextureQCOM";
+ case Decoration::BlockMatchSamplerQCOM: return "BlockMatchSamplerQCOM";
+ case Decoration::ExplicitInterpAMD: return "ExplicitInterpAMD";
+ case Decoration::NodeSharesPayloadLimitsWithAMDX: return "NodeSharesPayloadLimitsWithAMDX";
+ case Decoration::NodeMaxPayloadsAMDX: return "NodeMaxPayloadsAMDX";
+ case Decoration::TrackFinishWritingAMDX: return "TrackFinishWritingAMDX";
+ case Decoration::PayloadNodeNameAMDX: return "PayloadNodeNameAMDX";
+ case Decoration::PayloadNodeBaseIndexAMDX: return "PayloadNodeBaseIndexAMDX";
+ case Decoration::PayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX";
+ case Decoration::PayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX";
+ case Decoration::PayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX";
+ case Decoration::OverrideCoverageNV: return "OverrideCoverageNV";
+ case Decoration::PassthroughNV: return "PassthroughNV";
+ case Decoration::ViewportRelativeNV: return "ViewportRelativeNV";
+ case Decoration::SecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV";
+ case Decoration::PerPrimitiveEXT: return "PerPrimitiveEXT";
+ case Decoration::PerViewNV: return "PerViewNV";
+ case Decoration::PerTaskNV: return "PerTaskNV";
+ case Decoration::PerVertexKHR: return "PerVertexKHR";
+ case Decoration::NonUniform: return "NonUniform";
+ case Decoration::RestrictPointer: return "RestrictPointer";
+ case Decoration::AliasedPointer: return "AliasedPointer";
+ case Decoration::HitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV";
+ case Decoration::BindlessSamplerNV: return "BindlessSamplerNV";
+ case Decoration::BindlessImageNV: return "BindlessImageNV";
+ case Decoration::BoundSamplerNV: return "BoundSamplerNV";
+ case Decoration::BoundImageNV: return "BoundImageNV";
+ case Decoration::SIMTCallINTEL: return "SIMTCallINTEL";
+ case Decoration::ReferencedIndirectlyINTEL: return "ReferencedIndirectlyINTEL";
+ case Decoration::ClobberINTEL: return "ClobberINTEL";
+ case Decoration::SideEffectsINTEL: return "SideEffectsINTEL";
+ case Decoration::VectorComputeVariableINTEL: return "VectorComputeVariableINTEL";
+ case Decoration::FuncParamIOKindINTEL: return "FuncParamIOKindINTEL";
+ case Decoration::VectorComputeFunctionINTEL: return "VectorComputeFunctionINTEL";
+ case Decoration::StackCallINTEL: return "StackCallINTEL";
+ case Decoration::GlobalVariableOffsetINTEL: return "GlobalVariableOffsetINTEL";
+ case Decoration::CounterBuffer: return "CounterBuffer";
+ case Decoration::HlslSemanticGOOGLE: return "HlslSemanticGOOGLE";
+ case Decoration::UserTypeGOOGLE: return "UserTypeGOOGLE";
+ case Decoration::FunctionRoundingModeINTEL: return "FunctionRoundingModeINTEL";
+ case Decoration::FunctionDenormModeINTEL: return "FunctionDenormModeINTEL";
+ case Decoration::RegisterINTEL: return "RegisterINTEL";
+ case Decoration::MemoryINTEL: return "MemoryINTEL";
+ case Decoration::NumbanksINTEL: return "NumbanksINTEL";
+ case Decoration::BankwidthINTEL: return "BankwidthINTEL";
+ case Decoration::MaxPrivateCopiesINTEL: return "MaxPrivateCopiesINTEL";
+ case Decoration::SinglepumpINTEL: return "SinglepumpINTEL";
+ case Decoration::DoublepumpINTEL: return "DoublepumpINTEL";
+ case Decoration::MaxReplicatesINTEL: return "MaxReplicatesINTEL";
+ case Decoration::SimpleDualPortINTEL: return "SimpleDualPortINTEL";
+ case Decoration::MergeINTEL: return "MergeINTEL";
+ case Decoration::BankBitsINTEL: return "BankBitsINTEL";
+ case Decoration::ForcePow2DepthINTEL: return "ForcePow2DepthINTEL";
+ case Decoration::StridesizeINTEL: return "StridesizeINTEL";
+ case Decoration::WordsizeINTEL: return "WordsizeINTEL";
+ case Decoration::TrueDualPortINTEL: return "TrueDualPortINTEL";
+ case Decoration::BurstCoalesceINTEL: return "BurstCoalesceINTEL";
+ case Decoration::CacheSizeINTEL: return "CacheSizeINTEL";
+ case Decoration::DontStaticallyCoalesceINTEL: return "DontStaticallyCoalesceINTEL";
+ case Decoration::PrefetchINTEL: return "PrefetchINTEL";
+ case Decoration::StallEnableINTEL: return "StallEnableINTEL";
+ case Decoration::FuseLoopsInFunctionINTEL: return "FuseLoopsInFunctionINTEL";
+ case Decoration::MathOpDSPModeINTEL: return "MathOpDSPModeINTEL";
+ case Decoration::AliasScopeINTEL: return "AliasScopeINTEL";
+ case Decoration::NoAliasINTEL: return "NoAliasINTEL";
+ case Decoration::InitiationIntervalINTEL: return "InitiationIntervalINTEL";
+ case Decoration::MaxConcurrencyINTEL: return "MaxConcurrencyINTEL";
+ case Decoration::PipelineEnableINTEL: return "PipelineEnableINTEL";
+ case Decoration::BufferLocationINTEL: return "BufferLocationINTEL";
+ case Decoration::IOPipeStorageINTEL: return "IOPipeStorageINTEL";
+ case Decoration::FunctionFloatingPointModeINTEL: return "FunctionFloatingPointModeINTEL";
+ case Decoration::SingleElementVectorINTEL: return "SingleElementVectorINTEL";
+ case Decoration::VectorComputeCallableFunctionINTEL: return "VectorComputeCallableFunctionINTEL";
+ case Decoration::MediaBlockIOINTEL: return "MediaBlockIOINTEL";
+ case Decoration::StallFreeINTEL: return "StallFreeINTEL";
+ case Decoration::FPMaxErrorDecorationINTEL: return "FPMaxErrorDecorationINTEL";
+ case Decoration::LatencyControlLabelINTEL: return "LatencyControlLabelINTEL";
+ case Decoration::LatencyControlConstraintINTEL: return "LatencyControlConstraintINTEL";
+ case Decoration::ConduitKernelArgumentINTEL: return "ConduitKernelArgumentINTEL";
+ case Decoration::RegisterMapKernelArgumentINTEL: return "RegisterMapKernelArgumentINTEL";
+ case Decoration::MMHostInterfaceAddressWidthINTEL: return "MMHostInterfaceAddressWidthINTEL";
+ case Decoration::MMHostInterfaceDataWidthINTEL: return "MMHostInterfaceDataWidthINTEL";
+ case Decoration::MMHostInterfaceLatencyINTEL: return "MMHostInterfaceLatencyINTEL";
+ case Decoration::MMHostInterfaceReadWriteModeINTEL: return "MMHostInterfaceReadWriteModeINTEL";
+ case Decoration::MMHostInterfaceMaxBurstINTEL: return "MMHostInterfaceMaxBurstINTEL";
+ case Decoration::MMHostInterfaceWaitRequestINTEL: return "MMHostInterfaceWaitRequestINTEL";
+ case Decoration::StableKernelArgumentINTEL: return "StableKernelArgumentINTEL";
+ case Decoration::HostAccessINTEL: return "HostAccessINTEL";
+ case Decoration::InitModeINTEL: return "InitModeINTEL";
+ case Decoration::ImplementInRegisterMapINTEL: return "ImplementInRegisterMapINTEL";
+ case Decoration::ConditionalINTEL: return "ConditionalINTEL";
+ case Decoration::CacheControlLoadINTEL: return "CacheControlLoadINTEL";
+ case Decoration::CacheControlStoreINTEL: return "CacheControlStoreINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* BuiltInToString(BuiltIn value) {
+ switch (value) {
+ case BuiltIn::Position: return "Position";
+ case BuiltIn::PointSize: return "PointSize";
+ case BuiltIn::ClipDistance: return "ClipDistance";
+ case BuiltIn::CullDistance: return "CullDistance";
+ case BuiltIn::VertexId: return "VertexId";
+ case BuiltIn::InstanceId: return "InstanceId";
+ case BuiltIn::PrimitiveId: return "PrimitiveId";
+ case BuiltIn::InvocationId: return "InvocationId";
+ case BuiltIn::Layer: return "Layer";
+ case BuiltIn::ViewportIndex: return "ViewportIndex";
+ case BuiltIn::TessLevelOuter: return "TessLevelOuter";
+ case BuiltIn::TessLevelInner: return "TessLevelInner";
+ case BuiltIn::TessCoord: return "TessCoord";
+ case BuiltIn::PatchVertices: return "PatchVertices";
+ case BuiltIn::FragCoord: return "FragCoord";
+ case BuiltIn::PointCoord: return "PointCoord";
+ case BuiltIn::FrontFacing: return "FrontFacing";
+ case BuiltIn::SampleId: return "SampleId";
+ case BuiltIn::SamplePosition: return "SamplePosition";
+ case BuiltIn::SampleMask: return "SampleMask";
+ case BuiltIn::FragDepth: return "FragDepth";
+ case BuiltIn::HelperInvocation: return "HelperInvocation";
+ case BuiltIn::NumWorkgroups: return "NumWorkgroups";
+ case BuiltIn::WorkgroupSize: return "WorkgroupSize";
+ case BuiltIn::WorkgroupId: return "WorkgroupId";
+ case BuiltIn::LocalInvocationId: return "LocalInvocationId";
+ case BuiltIn::GlobalInvocationId: return "GlobalInvocationId";
+ case BuiltIn::LocalInvocationIndex: return "LocalInvocationIndex";
+ case BuiltIn::WorkDim: return "WorkDim";
+ case BuiltIn::GlobalSize: return "GlobalSize";
+ case BuiltIn::EnqueuedWorkgroupSize: return "EnqueuedWorkgroupSize";
+ case BuiltIn::GlobalOffset: return "GlobalOffset";
+ case BuiltIn::GlobalLinearId: return "GlobalLinearId";
+ case BuiltIn::SubgroupSize: return "SubgroupSize";
+ case BuiltIn::SubgroupMaxSize: return "SubgroupMaxSize";
+ case BuiltIn::NumSubgroups: return "NumSubgroups";
+ case BuiltIn::NumEnqueuedSubgroups: return "NumEnqueuedSubgroups";
+ case BuiltIn::SubgroupId: return "SubgroupId";
+ case BuiltIn::SubgroupLocalInvocationId: return "SubgroupLocalInvocationId";
+ case BuiltIn::VertexIndex: return "VertexIndex";
+ case BuiltIn::InstanceIndex: return "InstanceIndex";
+ case BuiltIn::CoreIDARM: return "CoreIDARM";
+ case BuiltIn::CoreCountARM: return "CoreCountARM";
+ case BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM";
+ case BuiltIn::WarpIDARM: return "WarpIDARM";
+ case BuiltIn::WarpMaxIDARM: return "WarpMaxIDARM";
+ case BuiltIn::SubgroupEqMask: return "SubgroupEqMask";
+ case BuiltIn::SubgroupGeMask: return "SubgroupGeMask";
+ case BuiltIn::SubgroupGtMask: return "SubgroupGtMask";
+ case BuiltIn::SubgroupLeMask: return "SubgroupLeMask";
+ case BuiltIn::SubgroupLtMask: return "SubgroupLtMask";
+ case BuiltIn::BaseVertex: return "BaseVertex";
+ case BuiltIn::BaseInstance: return "BaseInstance";
+ case BuiltIn::DrawIndex: return "DrawIndex";
+ case BuiltIn::PrimitiveShadingRateKHR: return "PrimitiveShadingRateKHR";
+ case BuiltIn::DeviceIndex: return "DeviceIndex";
+ case BuiltIn::ViewIndex: return "ViewIndex";
+ case BuiltIn::ShadingRateKHR: return "ShadingRateKHR";
+ case BuiltIn::TileOffsetQCOM: return "TileOffsetQCOM";
+ case BuiltIn::TileDimensionQCOM: return "TileDimensionQCOM";
+ case BuiltIn::TileApronSizeQCOM: return "TileApronSizeQCOM";
+ case BuiltIn::BaryCoordNoPerspAMD: return "BaryCoordNoPerspAMD";
+ case BuiltIn::BaryCoordNoPerspCentroidAMD: return "BaryCoordNoPerspCentroidAMD";
+ case BuiltIn::BaryCoordNoPerspSampleAMD: return "BaryCoordNoPerspSampleAMD";
+ case BuiltIn::BaryCoordSmoothAMD: return "BaryCoordSmoothAMD";
+ case BuiltIn::BaryCoordSmoothCentroidAMD: return "BaryCoordSmoothCentroidAMD";
+ case BuiltIn::BaryCoordSmoothSampleAMD: return "BaryCoordSmoothSampleAMD";
+ case BuiltIn::BaryCoordPullModelAMD: return "BaryCoordPullModelAMD";
+ case BuiltIn::FragStencilRefEXT: return "FragStencilRefEXT";
+ case BuiltIn::RemainingRecursionLevelsAMDX: return "RemainingRecursionLevelsAMDX";
+ case BuiltIn::ShaderIndexAMDX: return "ShaderIndexAMDX";
+ case BuiltIn::ViewportMaskNV: return "ViewportMaskNV";
+ case BuiltIn::SecondaryPositionNV: return "SecondaryPositionNV";
+ case BuiltIn::SecondaryViewportMaskNV: return "SecondaryViewportMaskNV";
+ case BuiltIn::PositionPerViewNV: return "PositionPerViewNV";
+ case BuiltIn::ViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
+ case BuiltIn::FullyCoveredEXT: return "FullyCoveredEXT";
+ case BuiltIn::TaskCountNV: return "TaskCountNV";
+ case BuiltIn::PrimitiveCountNV: return "PrimitiveCountNV";
+ case BuiltIn::PrimitiveIndicesNV: return "PrimitiveIndicesNV";
+ case BuiltIn::ClipDistancePerViewNV: return "ClipDistancePerViewNV";
+ case BuiltIn::CullDistancePerViewNV: return "CullDistancePerViewNV";
+ case BuiltIn::LayerPerViewNV: return "LayerPerViewNV";
+ case BuiltIn::MeshViewCountNV: return "MeshViewCountNV";
+ case BuiltIn::MeshViewIndicesNV: return "MeshViewIndicesNV";
+ case BuiltIn::BaryCoordKHR: return "BaryCoordKHR";
+ case BuiltIn::BaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR";
+ case BuiltIn::FragSizeEXT: return "FragSizeEXT";
+ case BuiltIn::FragInvocationCountEXT: return "FragInvocationCountEXT";
+ case BuiltIn::PrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT";
+ case BuiltIn::PrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
+ case BuiltIn::PrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
+ case BuiltIn::CullPrimitiveEXT: return "CullPrimitiveEXT";
+ case BuiltIn::LaunchIdKHR: return "LaunchIdKHR";
+ case BuiltIn::LaunchSizeKHR: return "LaunchSizeKHR";
+ case BuiltIn::WorldRayOriginKHR: return "WorldRayOriginKHR";
+ case BuiltIn::WorldRayDirectionKHR: return "WorldRayDirectionKHR";
+ case BuiltIn::ObjectRayOriginKHR: return "ObjectRayOriginKHR";
+ case BuiltIn::ObjectRayDirectionKHR: return "ObjectRayDirectionKHR";
+ case BuiltIn::RayTminKHR: return "RayTminKHR";
+ case BuiltIn::RayTmaxKHR: return "RayTmaxKHR";
+ case BuiltIn::InstanceCustomIndexKHR: return "InstanceCustomIndexKHR";
+ case BuiltIn::ObjectToWorldKHR: return "ObjectToWorldKHR";
+ case BuiltIn::WorldToObjectKHR: return "WorldToObjectKHR";
+ case BuiltIn::HitTNV: return "HitTNV";
+ case BuiltIn::HitKindKHR: return "HitKindKHR";
+ case BuiltIn::CurrentRayTimeNV: return "CurrentRayTimeNV";
+ case BuiltIn::HitTriangleVertexPositionsKHR: return "HitTriangleVertexPositionsKHR";
+ case BuiltIn::HitMicroTriangleVertexPositionsNV: return "HitMicroTriangleVertexPositionsNV";
+ case BuiltIn::HitMicroTriangleVertexBarycentricsNV: return "HitMicroTriangleVertexBarycentricsNV";
+ case BuiltIn::IncomingRayFlagsKHR: return "IncomingRayFlagsKHR";
+ case BuiltIn::RayGeometryIndexKHR: return "RayGeometryIndexKHR";
+ case BuiltIn::HitIsSphereNV: return "HitIsSphereNV";
+ case BuiltIn::HitIsLSSNV: return "HitIsLSSNV";
+ case BuiltIn::HitSpherePositionNV: return "HitSpherePositionNV";
+ case BuiltIn::WarpsPerSMNV: return "WarpsPerSMNV";
+ case BuiltIn::SMCountNV: return "SMCountNV";
+ case BuiltIn::WarpIDNV: return "WarpIDNV";
+ case BuiltIn::SMIDNV: return "SMIDNV";
+ case BuiltIn::HitLSSPositionsNV: return "HitLSSPositionsNV";
+ case BuiltIn::HitKindFrontFacingMicroTriangleNV: return "HitKindFrontFacingMicroTriangleNV";
+ case BuiltIn::HitKindBackFacingMicroTriangleNV: return "HitKindBackFacingMicroTriangleNV";
+ case BuiltIn::HitSphereRadiusNV: return "HitSphereRadiusNV";
+ case BuiltIn::HitLSSRadiiNV: return "HitLSSRadiiNV";
+ case BuiltIn::ClusterIDNV: return "ClusterIDNV";
+ case BuiltIn::CullMaskKHR: return "CullMaskKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ScopeToString(Scope value) {
+ switch (value) {
+ case Scope::CrossDevice: return "CrossDevice";
+ case Scope::Device: return "Device";
+ case Scope::Workgroup: return "Workgroup";
+ case Scope::Subgroup: return "Subgroup";
+ case Scope::Invocation: return "Invocation";
+ case Scope::QueueFamily: return "QueueFamily";
+ case Scope::ShaderCallKHR: return "ShaderCallKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* GroupOperationToString(GroupOperation value) {
+ switch (value) {
+ case GroupOperation::Reduce: return "Reduce";
+ case GroupOperation::InclusiveScan: return "InclusiveScan";
+ case GroupOperation::ExclusiveScan: return "ExclusiveScan";
+ case GroupOperation::ClusteredReduce: return "ClusteredReduce";
+ case GroupOperation::PartitionedReduceNV: return "PartitionedReduceNV";
+ case GroupOperation::PartitionedInclusiveScanNV: return "PartitionedInclusiveScanNV";
+ case GroupOperation::PartitionedExclusiveScanNV: return "PartitionedExclusiveScanNV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* KernelEnqueueFlagsToString(KernelEnqueueFlags value) {
+ switch (value) {
+ case KernelEnqueueFlags::NoWait: return "NoWait";
+ case KernelEnqueueFlags::WaitKernel: return "WaitKernel";
+ case KernelEnqueueFlags::WaitWorkGroup: return "WaitWorkGroup";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CapabilityToString(Capability value) {
+ switch (value) {
+ case Capability::Matrix: return "Matrix";
+ case Capability::Shader: return "Shader";
+ case Capability::Geometry: return "Geometry";
+ case Capability::Tessellation: return "Tessellation";
+ case Capability::Addresses: return "Addresses";
+ case Capability::Linkage: return "Linkage";
+ case Capability::Kernel: return "Kernel";
+ case Capability::Vector16: return "Vector16";
+ case Capability::Float16Buffer: return "Float16Buffer";
+ case Capability::Float16: return "Float16";
+ case Capability::Float64: return "Float64";
+ case Capability::Int64: return "Int64";
+ case Capability::Int64Atomics: return "Int64Atomics";
+ case Capability::ImageBasic: return "ImageBasic";
+ case Capability::ImageReadWrite: return "ImageReadWrite";
+ case Capability::ImageMipmap: return "ImageMipmap";
+ case Capability::Pipes: return "Pipes";
+ case Capability::Groups: return "Groups";
+ case Capability::DeviceEnqueue: return "DeviceEnqueue";
+ case Capability::LiteralSampler: return "LiteralSampler";
+ case Capability::AtomicStorage: return "AtomicStorage";
+ case Capability::Int16: return "Int16";
+ case Capability::TessellationPointSize: return "TessellationPointSize";
+ case Capability::GeometryPointSize: return "GeometryPointSize";
+ case Capability::ImageGatherExtended: return "ImageGatherExtended";
+ case Capability::StorageImageMultisample: return "StorageImageMultisample";
+ case Capability::UniformBufferArrayDynamicIndexing: return "UniformBufferArrayDynamicIndexing";
+ case Capability::SampledImageArrayDynamicIndexing: return "SampledImageArrayDynamicIndexing";
+ case Capability::StorageBufferArrayDynamicIndexing: return "StorageBufferArrayDynamicIndexing";
+ case Capability::StorageImageArrayDynamicIndexing: return "StorageImageArrayDynamicIndexing";
+ case Capability::ClipDistance: return "ClipDistance";
+ case Capability::CullDistance: return "CullDistance";
+ case Capability::ImageCubeArray: return "ImageCubeArray";
+ case Capability::SampleRateShading: return "SampleRateShading";
+ case Capability::ImageRect: return "ImageRect";
+ case Capability::SampledRect: return "SampledRect";
+ case Capability::GenericPointer: return "GenericPointer";
+ case Capability::Int8: return "Int8";
+ case Capability::InputAttachment: return "InputAttachment";
+ case Capability::SparseResidency: return "SparseResidency";
+ case Capability::MinLod: return "MinLod";
+ case Capability::Sampled1D: return "Sampled1D";
+ case Capability::Image1D: return "Image1D";
+ case Capability::SampledCubeArray: return "SampledCubeArray";
+ case Capability::SampledBuffer: return "SampledBuffer";
+ case Capability::ImageBuffer: return "ImageBuffer";
+ case Capability::ImageMSArray: return "ImageMSArray";
+ case Capability::StorageImageExtendedFormats: return "StorageImageExtendedFormats";
+ case Capability::ImageQuery: return "ImageQuery";
+ case Capability::DerivativeControl: return "DerivativeControl";
+ case Capability::InterpolationFunction: return "InterpolationFunction";
+ case Capability::TransformFeedback: return "TransformFeedback";
+ case Capability::GeometryStreams: return "GeometryStreams";
+ case Capability::StorageImageReadWithoutFormat: return "StorageImageReadWithoutFormat";
+ case Capability::StorageImageWriteWithoutFormat: return "StorageImageWriteWithoutFormat";
+ case Capability::MultiViewport: return "MultiViewport";
+ case Capability::SubgroupDispatch: return "SubgroupDispatch";
+ case Capability::NamedBarrier: return "NamedBarrier";
+ case Capability::PipeStorage: return "PipeStorage";
+ case Capability::GroupNonUniform: return "GroupNonUniform";
+ case Capability::GroupNonUniformVote: return "GroupNonUniformVote";
+ case Capability::GroupNonUniformArithmetic: return "GroupNonUniformArithmetic";
+ case Capability::GroupNonUniformBallot: return "GroupNonUniformBallot";
+ case Capability::GroupNonUniformShuffle: return "GroupNonUniformShuffle";
+ case Capability::GroupNonUniformShuffleRelative: return "GroupNonUniformShuffleRelative";
+ case Capability::GroupNonUniformClustered: return "GroupNonUniformClustered";
+ case Capability::GroupNonUniformQuad: return "GroupNonUniformQuad";
+ case Capability::ShaderLayer: return "ShaderLayer";
+ case Capability::ShaderViewportIndex: return "ShaderViewportIndex";
+ case Capability::UniformDecoration: return "UniformDecoration";
+ case Capability::CoreBuiltinsARM: return "CoreBuiltinsARM";
+ case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT";
+ case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT";
+ case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT";
+ case Capability::TensorsARM: return "TensorsARM";
+ case Capability::StorageTensorArrayDynamicIndexingARM: return "StorageTensorArrayDynamicIndexingARM";
+ case Capability::StorageTensorArrayNonUniformIndexingARM: return "StorageTensorArrayNonUniformIndexingARM";
+ case Capability::GraphARM: return "GraphARM";
+ case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM";
+ case Capability::Float8EXT: return "Float8EXT";
+ case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT";
+ case Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR";
+ case Capability::SubgroupBallotKHR: return "SubgroupBallotKHR";
+ case Capability::DrawParameters: return "DrawParameters";
+ case Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR";
+ case Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR";
+ case Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR";
+ case Capability::SubgroupVoteKHR: return "SubgroupVoteKHR";
+ case Capability::StorageBuffer16BitAccess: return "StorageBuffer16BitAccess";
+ case Capability::StorageUniform16: return "StorageUniform16";
+ case Capability::StoragePushConstant16: return "StoragePushConstant16";
+ case Capability::StorageInputOutput16: return "StorageInputOutput16";
+ case Capability::DeviceGroup: return "DeviceGroup";
+ case Capability::MultiView: return "MultiView";
+ case Capability::VariablePointersStorageBuffer: return "VariablePointersStorageBuffer";
+ case Capability::VariablePointers: return "VariablePointers";
+ case Capability::AtomicStorageOps: return "AtomicStorageOps";
+ case Capability::SampleMaskPostDepthCoverage: return "SampleMaskPostDepthCoverage";
+ case Capability::StorageBuffer8BitAccess: return "StorageBuffer8BitAccess";
+ case Capability::UniformAndStorageBuffer8BitAccess: return "UniformAndStorageBuffer8BitAccess";
+ case Capability::StoragePushConstant8: return "StoragePushConstant8";
+ case Capability::DenormPreserve: return "DenormPreserve";
+ case Capability::DenormFlushToZero: return "DenormFlushToZero";
+ case Capability::SignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case Capability::RoundingModeRTE: return "RoundingModeRTE";
+ case Capability::RoundingModeRTZ: return "RoundingModeRTZ";
+ case Capability::RayQueryProvisionalKHR: return "RayQueryProvisionalKHR";
+ case Capability::RayQueryKHR: return "RayQueryKHR";
+ case Capability::UntypedPointersKHR: return "UntypedPointersKHR";
+ case Capability::RayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR";
+ case Capability::RayTracingKHR: return "RayTracingKHR";
+ case Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM";
+ case Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM";
+ case Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM";
+ case Capability::TileShadingQCOM: return "TileShadingQCOM";
+ case Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM";
+ case Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM";
+ case Capability::Float16ImageAMD: return "Float16ImageAMD";
+ case Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD";
+ case Capability::FragmentMaskAMD: return "FragmentMaskAMD";
+ case Capability::StencilExportEXT: return "StencilExportEXT";
+ case Capability::ImageReadWriteLodAMD: return "ImageReadWriteLodAMD";
+ case Capability::Int64ImageEXT: return "Int64ImageEXT";
+ case Capability::ShaderClockKHR: return "ShaderClockKHR";
+ case Capability::ShaderEnqueueAMDX: return "ShaderEnqueueAMDX";
+ case Capability::QuadControlKHR: return "QuadControlKHR";
+ case Capability::Int4TypeINTEL: return "Int4TypeINTEL";
+ case Capability::Int4CooperativeMatrixINTEL: return "Int4CooperativeMatrixINTEL";
+ case Capability::BFloat16TypeKHR: return "BFloat16TypeKHR";
+ case Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR";
+ case Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR";
+ case Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV";
+ case Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV";
+ case Capability::ShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT";
+ case Capability::ShaderViewportMaskNV: return "ShaderViewportMaskNV";
+ case Capability::ShaderStereoViewNV: return "ShaderStereoViewNV";
+ case Capability::PerViewAttributesNV: return "PerViewAttributesNV";
+ case Capability::FragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";
+ case Capability::MeshShadingNV: return "MeshShadingNV";
+ case Capability::ImageFootprintNV: return "ImageFootprintNV";
+ case Capability::MeshShadingEXT: return "MeshShadingEXT";
+ case Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR";
+ case Capability::ComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR";
+ case Capability::FragmentDensityEXT: return "FragmentDensityEXT";
+ case Capability::GroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV";
+ case Capability::ShaderNonUniform: return "ShaderNonUniform";
+ case Capability::RuntimeDescriptorArray: return "RuntimeDescriptorArray";
+ case Capability::InputAttachmentArrayDynamicIndexing: return "InputAttachmentArrayDynamicIndexing";
+ case Capability::UniformTexelBufferArrayDynamicIndexing: return "UniformTexelBufferArrayDynamicIndexing";
+ case Capability::StorageTexelBufferArrayDynamicIndexing: return "StorageTexelBufferArrayDynamicIndexing";
+ case Capability::UniformBufferArrayNonUniformIndexing: return "UniformBufferArrayNonUniformIndexing";
+ case Capability::SampledImageArrayNonUniformIndexing: return "SampledImageArrayNonUniformIndexing";
+ case Capability::StorageBufferArrayNonUniformIndexing: return "StorageBufferArrayNonUniformIndexing";
+ case Capability::StorageImageArrayNonUniformIndexing: return "StorageImageArrayNonUniformIndexing";
+ case Capability::InputAttachmentArrayNonUniformIndexing: return "InputAttachmentArrayNonUniformIndexing";
+ case Capability::UniformTexelBufferArrayNonUniformIndexing: return "UniformTexelBufferArrayNonUniformIndexing";
+ case Capability::StorageTexelBufferArrayNonUniformIndexing: return "StorageTexelBufferArrayNonUniformIndexing";
+ case Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR";
+ case Capability::RayTracingNV: return "RayTracingNV";
+ case Capability::RayTracingMotionBlurNV: return "RayTracingMotionBlurNV";
+ case Capability::VulkanMemoryModel: return "VulkanMemoryModel";
+ case Capability::VulkanMemoryModelDeviceScope: return "VulkanMemoryModelDeviceScope";
+ case Capability::PhysicalStorageBufferAddresses: return "PhysicalStorageBufferAddresses";
+ case Capability::ComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR";
+ case Capability::RayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
+ case Capability::CooperativeMatrixNV: return "CooperativeMatrixNV";
+ case Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT";
+ case Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT";
+ case Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV";
+ case Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT";
+ case Capability::DemoteToHelperInvocation: return "DemoteToHelperInvocation";
+ case Capability::DisplacementMicromapNV: return "DisplacementMicromapNV";
+ case Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT";
+ case Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV";
+ case Capability::BindlessTextureNV: return "BindlessTextureNV";
+ case Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
+ case Capability::CooperativeVectorNV: return "CooperativeVectorNV";
+ case Capability::AtomicFloat16VectorNV: return "AtomicFloat16VectorNV";
+ case Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV";
+ case Capability::RawAccessChainsNV: return "RawAccessChainsNV";
+ case Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV";
+ case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV";
+ case Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV";
+ case Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV";
+ case Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV";
+ case Capability::CooperativeMatrixTensorAddressingNV: return "CooperativeMatrixTensorAddressingNV";
+ case Capability::CooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV";
+ case Capability::CooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV";
+ case Capability::RayTracingClusterAccelerationStructureNV: return "RayTracingClusterAccelerationStructureNV";
+ case Capability::TensorAddressingNV: return "TensorAddressingNV";
+ case Capability::SubgroupShuffleINTEL: return "SubgroupShuffleINTEL";
+ case Capability::SubgroupBufferBlockIOINTEL: return "SubgroupBufferBlockIOINTEL";
+ case Capability::SubgroupImageBlockIOINTEL: return "SubgroupImageBlockIOINTEL";
+ case Capability::SubgroupImageMediaBlockIOINTEL: return "SubgroupImageMediaBlockIOINTEL";
+ case Capability::RoundToInfinityINTEL: return "RoundToInfinityINTEL";
+ case Capability::FloatingPointModeINTEL: return "FloatingPointModeINTEL";
+ case Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL";
+ case Capability::FunctionPointersINTEL: return "FunctionPointersINTEL";
+ case Capability::IndirectReferencesINTEL: return "IndirectReferencesINTEL";
+ case Capability::AsmINTEL: return "AsmINTEL";
+ case Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT";
+ case Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT";
+ case Capability::AtomicFloat16MinMaxEXT: return "AtomicFloat16MinMaxEXT";
+ case Capability::VectorComputeINTEL: return "VectorComputeINTEL";
+ case Capability::VectorAnyINTEL: return "VectorAnyINTEL";
+ case Capability::ExpectAssumeKHR: return "ExpectAssumeKHR";
+ case Capability::SubgroupAvcMotionEstimationINTEL: return "SubgroupAvcMotionEstimationINTEL";
+ case Capability::SubgroupAvcMotionEstimationIntraINTEL: return "SubgroupAvcMotionEstimationIntraINTEL";
+ case Capability::SubgroupAvcMotionEstimationChromaINTEL: return "SubgroupAvcMotionEstimationChromaINTEL";
+ case Capability::VariableLengthArrayINTEL: return "VariableLengthArrayINTEL";
+ case Capability::FunctionFloatControlINTEL: return "FunctionFloatControlINTEL";
+ case Capability::FPGAMemoryAttributesINTEL: return "FPGAMemoryAttributesINTEL";
+ case Capability::FPFastMathModeINTEL: return "FPFastMathModeINTEL";
+ case Capability::ArbitraryPrecisionIntegersINTEL: return "ArbitraryPrecisionIntegersINTEL";
+ case Capability::ArbitraryPrecisionFloatingPointINTEL: return "ArbitraryPrecisionFloatingPointINTEL";
+ case Capability::UnstructuredLoopControlsINTEL: return "UnstructuredLoopControlsINTEL";
+ case Capability::FPGALoopControlsINTEL: return "FPGALoopControlsINTEL";
+ case Capability::KernelAttributesINTEL: return "KernelAttributesINTEL";
+ case Capability::FPGAKernelAttributesINTEL: return "FPGAKernelAttributesINTEL";
+ case Capability::FPGAMemoryAccessesINTEL: return "FPGAMemoryAccessesINTEL";
+ case Capability::FPGAClusterAttributesINTEL: return "FPGAClusterAttributesINTEL";
+ case Capability::LoopFuseINTEL: return "LoopFuseINTEL";
+ case Capability::FPGADSPControlINTEL: return "FPGADSPControlINTEL";
+ case Capability::MemoryAccessAliasingINTEL: return "MemoryAccessAliasingINTEL";
+ case Capability::FPGAInvocationPipeliningAttributesINTEL: return "FPGAInvocationPipeliningAttributesINTEL";
+ case Capability::FPGABufferLocationINTEL: return "FPGABufferLocationINTEL";
+ case Capability::ArbitraryPrecisionFixedPointINTEL: return "ArbitraryPrecisionFixedPointINTEL";
+ case Capability::USMStorageClassesINTEL: return "USMStorageClassesINTEL";
+ case Capability::RuntimeAlignedAttributeINTEL: return "RuntimeAlignedAttributeINTEL";
+ case Capability::IOPipesINTEL: return "IOPipesINTEL";
+ case Capability::BlockingPipesINTEL: return "BlockingPipesINTEL";
+ case Capability::FPGARegINTEL: return "FPGARegINTEL";
+ case Capability::DotProductInputAll: return "DotProductInputAll";
+ case Capability::DotProductInput4x8Bit: return "DotProductInput4x8Bit";
+ case Capability::DotProductInput4x8BitPacked: return "DotProductInput4x8BitPacked";
+ case Capability::DotProduct: return "DotProduct";
+ case Capability::RayCullMaskKHR: return "RayCullMaskKHR";
+ case Capability::CooperativeMatrixKHR: return "CooperativeMatrixKHR";
+ case Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT";
+ case Capability::BitInstructions: return "BitInstructions";
+ case Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR";
+ case Capability::FloatControls2: return "FloatControls2";
+ case Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT";
+ case Capability::AtomicFloat64AddEXT: return "AtomicFloat64AddEXT";
+ case Capability::LongCompositesINTEL: return "LongCompositesINTEL";
+ case Capability::OptNoneEXT: return "OptNoneEXT";
+ case Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT";
+ case Capability::DebugInfoModuleINTEL: return "DebugInfoModuleINTEL";
+ case Capability::BFloat16ConversionINTEL: return "BFloat16ConversionINTEL";
+ case Capability::SplitBarrierINTEL: return "SplitBarrierINTEL";
+ case Capability::ArithmeticFenceEXT: return "ArithmeticFenceEXT";
+ case Capability::FPGAClusterAttributesV2INTEL: return "FPGAClusterAttributesV2INTEL";
+ case Capability::FPGAKernelAttributesv2INTEL: return "FPGAKernelAttributesv2INTEL";
+ case Capability::TaskSequenceINTEL: return "TaskSequenceINTEL";
+ case Capability::FPMaxErrorINTEL: return "FPMaxErrorINTEL";
+ case Capability::FPGALatencyControlINTEL: return "FPGALatencyControlINTEL";
+ case Capability::FPGAArgumentInterfacesINTEL: return "FPGAArgumentInterfacesINTEL";
+ case Capability::GlobalVariableHostAccessINTEL: return "GlobalVariableHostAccessINTEL";
+ case Capability::GlobalVariableFPGADecorationsINTEL: return "GlobalVariableFPGADecorationsINTEL";
+ case Capability::SubgroupBufferPrefetchINTEL: return "SubgroupBufferPrefetchINTEL";
+ case Capability::Subgroup2DBlockIOINTEL: return "Subgroup2DBlockIOINTEL";
+ case Capability::Subgroup2DBlockTransformINTEL: return "Subgroup2DBlockTransformINTEL";
+ case Capability::Subgroup2DBlockTransposeINTEL: return "Subgroup2DBlockTransposeINTEL";
+ case Capability::SubgroupMatrixMultiplyAccumulateINTEL: return "SubgroupMatrixMultiplyAccumulateINTEL";
+ case Capability::TernaryBitwiseFunctionINTEL: return "TernaryBitwiseFunctionINTEL";
+ case Capability::SpecConditionalINTEL: return "SpecConditionalINTEL";
+ case Capability::FunctionVariantsINTEL: return "FunctionVariantsINTEL";
+ case Capability::GroupUniformArithmeticKHR: return "GroupUniformArithmeticKHR";
+ case Capability::TensorFloat32RoundingINTEL: return "TensorFloat32RoundingINTEL";
+ case Capability::MaskedGatherScatterINTEL: return "MaskedGatherScatterINTEL";
+ case Capability::CacheControlsINTEL: return "CacheControlsINTEL";
+ case Capability::RegisterLimitsINTEL: return "RegisterLimitsINTEL";
+ case Capability::BindlessImagesINTEL: return "BindlessImagesINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* RayQueryIntersectionToString(RayQueryIntersection value) {
+ switch (value) {
+ case RayQueryIntersection::RayQueryCandidateIntersectionKHR: return "RayQueryCandidateIntersectionKHR";
+ case RayQueryIntersection::RayQueryCommittedIntersectionKHR: return "RayQueryCommittedIntersectionKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* RayQueryCommittedIntersectionTypeToString(RayQueryCommittedIntersectionType value) {
+ switch (value) {
+ case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR: return "RayQueryCommittedIntersectionNoneKHR";
+ case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR: return "RayQueryCommittedIntersectionTriangleKHR";
+ case RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR: return "RayQueryCommittedIntersectionGeneratedKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* RayQueryCandidateIntersectionTypeToString(RayQueryCandidateIntersectionType value) {
+ switch (value) {
+ case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR: return "RayQueryCandidateIntersectionTriangleKHR";
+ case RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR: return "RayQueryCandidateIntersectionAABBKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPDenormModeToString(FPDenormMode value) {
+ switch (value) {
+ case FPDenormMode::Preserve: return "Preserve";
+ case FPDenormMode::FlushToZero: return "FlushToZero";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPOperationModeToString(FPOperationMode value) {
+ switch (value) {
+ case FPOperationMode::IEEE: return "IEEE";
+ case FPOperationMode::ALT: return "ALT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* QuantizationModesToString(QuantizationModes value) {
+ switch (value) {
+ case QuantizationModes::TRN: return "TRN";
+ case QuantizationModes::TRN_ZERO: return "TRN_ZERO";
+ case QuantizationModes::RND: return "RND";
+ case QuantizationModes::RND_ZERO: return "RND_ZERO";
+ case QuantizationModes::RND_INF: return "RND_INF";
+ case QuantizationModes::RND_MIN_INF: return "RND_MIN_INF";
+ case QuantizationModes::RND_CONV: return "RND_CONV";
+ case QuantizationModes::RND_CONV_ODD: return "RND_CONV_ODD";
+ default: return "Unknown";
+ }
+}
+
+inline const char* OverflowModesToString(OverflowModes value) {
+ switch (value) {
+ case OverflowModes::WRAP: return "WRAP";
+ case OverflowModes::SAT: return "SAT";
+ case OverflowModes::SAT_ZERO: return "SAT_ZERO";
+ case OverflowModes::SAT_SYM: return "SAT_SYM";
+ default: return "Unknown";
+ }
+}
+
+inline const char* PackedVectorFormatToString(PackedVectorFormat value) {
+ switch (value) {
+ case PackedVectorFormat::PackedVectorFormat4x8Bit: return "PackedVectorFormat4x8Bit";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CooperativeMatrixLayoutToString(CooperativeMatrixLayout value) {
+ switch (value) {
+ case CooperativeMatrixLayout::RowMajorKHR: return "RowMajorKHR";
+ case CooperativeMatrixLayout::ColumnMajorKHR: return "ColumnMajorKHR";
+ case CooperativeMatrixLayout::RowBlockedInterleavedARM: return "RowBlockedInterleavedARM";
+ case CooperativeMatrixLayout::ColumnBlockedInterleavedARM: return "ColumnBlockedInterleavedARM";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CooperativeMatrixUseToString(CooperativeMatrixUse value) {
+ switch (value) {
+ case CooperativeMatrixUse::MatrixAKHR: return "MatrixAKHR";
+ case CooperativeMatrixUse::MatrixBKHR: return "MatrixBKHR";
+ case CooperativeMatrixUse::MatrixAccumulatorKHR: return "MatrixAccumulatorKHR";
+ default: return "Unknown";
+ }
+}
+
+inline const char* TensorClampModeToString(TensorClampMode value) {
+ switch (value) {
+ case TensorClampMode::Undefined: return "Undefined";
+ case TensorClampMode::Constant: return "Constant";
+ case TensorClampMode::ClampToEdge: return "ClampToEdge";
+ case TensorClampMode::Repeat: return "Repeat";
+ case TensorClampMode::RepeatMirrored: return "RepeatMirrored";
+ default: return "Unknown";
+ }
+}
+
+inline const char* InitializationModeQualifierToString(InitializationModeQualifier value) {
+ switch (value) {
+ case InitializationModeQualifier::InitOnDeviceReprogramINTEL: return "InitOnDeviceReprogramINTEL";
+ case InitializationModeQualifier::InitOnDeviceResetINTEL: return "InitOnDeviceResetINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* HostAccessQualifierToString(HostAccessQualifier value) {
+ switch (value) {
+ case HostAccessQualifier::NoneINTEL: return "NoneINTEL";
+ case HostAccessQualifier::ReadINTEL: return "ReadINTEL";
+ case HostAccessQualifier::WriteINTEL: return "WriteINTEL";
+ case HostAccessQualifier::ReadWriteINTEL: return "ReadWriteINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* LoadCacheControlToString(LoadCacheControl value) {
+ switch (value) {
+ case LoadCacheControl::UncachedINTEL: return "UncachedINTEL";
+ case LoadCacheControl::CachedINTEL: return "CachedINTEL";
+ case LoadCacheControl::StreamingINTEL: return "StreamingINTEL";
+ case LoadCacheControl::InvalidateAfterReadINTEL: return "InvalidateAfterReadINTEL";
+ case LoadCacheControl::ConstCachedINTEL: return "ConstCachedINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* StoreCacheControlToString(StoreCacheControl value) {
+ switch (value) {
+ case StoreCacheControl::UncachedINTEL: return "UncachedINTEL";
+ case StoreCacheControl::WriteThroughINTEL: return "WriteThroughINTEL";
+ case StoreCacheControl::WriteBackINTEL: return "WriteBackINTEL";
+ case StoreCacheControl::StreamingINTEL: return "StreamingINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfRegisters value) {
+ switch (value) {
+ case NamedMaximumNumberOfRegisters::AutoINTEL: return "AutoINTEL";
+ default: return "Unknown";
+ }
+}
+
+inline const char* FPEncodingToString(FPEncoding value) {
+ switch (value) {
+ case FPEncoding::BFloat16KHR: return "BFloat16KHR";
+ case FPEncoding::Float8E4M3EXT: return "Float8E4M3EXT";
+ case FPEncoding::Float8E5M2EXT: return "Float8E5M2EXT";
+ default: return "Unknown";
+ }
+}
+
+inline const char* CooperativeVectorMatrixLayoutToString(CooperativeVectorMatrixLayout value) {
+ switch (value) {
+ case CooperativeVectorMatrixLayout::RowMajorNV: return "RowMajorNV";
+ case CooperativeVectorMatrixLayout::ColumnMajorNV: return "ColumnMajorNV";
+ case CooperativeVectorMatrixLayout::InferencingOptimalNV: return "InferencingOptimalNV";
+ case CooperativeVectorMatrixLayout::TrainingOptimalNV: return "TrainingOptimalNV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* ComponentTypeToString(ComponentType value) {
+ switch (value) {
+ case ComponentType::Float16NV: return "Float16NV";
+ case ComponentType::Float32NV: return "Float32NV";
+ case ComponentType::Float64NV: return "Float64NV";
+ case ComponentType::SignedInt8NV: return "SignedInt8NV";
+ case ComponentType::SignedInt16NV: return "SignedInt16NV";
+ case ComponentType::SignedInt32NV: return "SignedInt32NV";
+ case ComponentType::SignedInt64NV: return "SignedInt64NV";
+ case ComponentType::UnsignedInt8NV: return "UnsignedInt8NV";
+ case ComponentType::UnsignedInt16NV: return "UnsignedInt16NV";
+ case ComponentType::UnsignedInt32NV: return "UnsignedInt32NV";
+ case ComponentType::UnsignedInt64NV: return "UnsignedInt64NV";
+ case ComponentType::SignedInt8PackedNV: return "SignedInt8PackedNV";
+ case ComponentType::UnsignedInt8PackedNV: return "UnsignedInt8PackedNV";
+ case ComponentType::FloatE4M3NV: return "FloatE4M3NV";
+ case ComponentType::FloatE5M2NV: return "FloatE5M2NV";
+ default: return "Unknown";
+ }
+}
+
+inline const char* OpToString(Op value) {
+ switch (value) {
+ case Op::OpNop: return "OpNop";
+ case Op::OpUndef: return "OpUndef";
+ case Op::OpSourceContinued: return "OpSourceContinued";
+ case Op::OpSource: return "OpSource";
+ case Op::OpSourceExtension: return "OpSourceExtension";
+ case Op::OpName: return "OpName";
+ case Op::OpMemberName: return "OpMemberName";
+ case Op::OpString: return "OpString";
+ case Op::OpLine: return "OpLine";
+ case Op::OpExtension: return "OpExtension";
+ case Op::OpExtInstImport: return "OpExtInstImport";
+ case Op::OpExtInst: return "OpExtInst";
+ case Op::OpMemoryModel: return "OpMemoryModel";
+ case Op::OpEntryPoint: return "OpEntryPoint";
+ case Op::OpExecutionMode: return "OpExecutionMode";
+ case Op::OpCapability: return "OpCapability";
+ case Op::OpTypeVoid: return "OpTypeVoid";
+ case Op::OpTypeBool: return "OpTypeBool";
+ case Op::OpTypeInt: return "OpTypeInt";
+ case Op::OpTypeFloat: return "OpTypeFloat";
+ case Op::OpTypeVector: return "OpTypeVector";
+ case Op::OpTypeMatrix: return "OpTypeMatrix";
+ case Op::OpTypeImage: return "OpTypeImage";
+ case Op::OpTypeSampler: return "OpTypeSampler";
+ case Op::OpTypeSampledImage: return "OpTypeSampledImage";
+ case Op::OpTypeArray: return "OpTypeArray";
+ case Op::OpTypeRuntimeArray: return "OpTypeRuntimeArray";
+ case Op::OpTypeStruct: return "OpTypeStruct";
+ case Op::OpTypeOpaque: return "OpTypeOpaque";
+ case Op::OpTypePointer: return "OpTypePointer";
+ case Op::OpTypeFunction: return "OpTypeFunction";
+ case Op::OpTypeEvent: return "OpTypeEvent";
+ case Op::OpTypeDeviceEvent: return "OpTypeDeviceEvent";
+ case Op::OpTypeReserveId: return "OpTypeReserveId";
+ case Op::OpTypeQueue: return "OpTypeQueue";
+ case Op::OpTypePipe: return "OpTypePipe";
+ case Op::OpTypeForwardPointer: return "OpTypeForwardPointer";
+ case Op::OpConstantTrue: return "OpConstantTrue";
+ case Op::OpConstantFalse: return "OpConstantFalse";
+ case Op::OpConstant: return "OpConstant";
+ case Op::OpConstantComposite: return "OpConstantComposite";
+ case Op::OpConstantSampler: return "OpConstantSampler";
+ case Op::OpConstantNull: return "OpConstantNull";
+ case Op::OpSpecConstantTrue: return "OpSpecConstantTrue";
+ case Op::OpSpecConstantFalse: return "OpSpecConstantFalse";
+ case Op::OpSpecConstant: return "OpSpecConstant";
+ case Op::OpSpecConstantComposite: return "OpSpecConstantComposite";
+ case Op::OpSpecConstantOp: return "OpSpecConstantOp";
+ case Op::OpFunction: return "OpFunction";
+ case Op::OpFunctionParameter: return "OpFunctionParameter";
+ case Op::OpFunctionEnd: return "OpFunctionEnd";
+ case Op::OpFunctionCall: return "OpFunctionCall";
+ case Op::OpVariable: return "OpVariable";
+ case Op::OpImageTexelPointer: return "OpImageTexelPointer";
+ case Op::OpLoad: return "OpLoad";
+ case Op::OpStore: return "OpStore";
+ case Op::OpCopyMemory: return "OpCopyMemory";
+ case Op::OpCopyMemorySized: return "OpCopyMemorySized";
+ case Op::OpAccessChain: return "OpAccessChain";
+ case Op::OpInBoundsAccessChain: return "OpInBoundsAccessChain";
+ case Op::OpPtrAccessChain: return "OpPtrAccessChain";
+ case Op::OpArrayLength: return "OpArrayLength";
+ case Op::OpGenericPtrMemSemantics: return "OpGenericPtrMemSemantics";
+ case Op::OpInBoundsPtrAccessChain: return "OpInBoundsPtrAccessChain";
+ case Op::OpDecorate: return "OpDecorate";
+ case Op::OpMemberDecorate: return "OpMemberDecorate";
+ case Op::OpDecorationGroup: return "OpDecorationGroup";
+ case Op::OpGroupDecorate: return "OpGroupDecorate";
+ case Op::OpGroupMemberDecorate: return "OpGroupMemberDecorate";
+ case Op::OpVectorExtractDynamic: return "OpVectorExtractDynamic";
+ case Op::OpVectorInsertDynamic: return "OpVectorInsertDynamic";
+ case Op::OpVectorShuffle: return "OpVectorShuffle";
+ case Op::OpCompositeConstruct: return "OpCompositeConstruct";
+ case Op::OpCompositeExtract: return "OpCompositeExtract";
+ case Op::OpCompositeInsert: return "OpCompositeInsert";
+ case Op::OpCopyObject: return "OpCopyObject";
+ case Op::OpTranspose: return "OpTranspose";
+ case Op::OpSampledImage: return "OpSampledImage";
+ case Op::OpImageSampleImplicitLod: return "OpImageSampleImplicitLod";
+ case Op::OpImageSampleExplicitLod: return "OpImageSampleExplicitLod";
+ case Op::OpImageSampleDrefImplicitLod: return "OpImageSampleDrefImplicitLod";
+ case Op::OpImageSampleDrefExplicitLod: return "OpImageSampleDrefExplicitLod";
+ case Op::OpImageSampleProjImplicitLod: return "OpImageSampleProjImplicitLod";
+ case Op::OpImageSampleProjExplicitLod: return "OpImageSampleProjExplicitLod";
+ case Op::OpImageSampleProjDrefImplicitLod: return "OpImageSampleProjDrefImplicitLod";
+ case Op::OpImageSampleProjDrefExplicitLod: return "OpImageSampleProjDrefExplicitLod";
+ case Op::OpImageFetch: return "OpImageFetch";
+ case Op::OpImageGather: return "OpImageGather";
+ case Op::OpImageDrefGather: return "OpImageDrefGather";
+ case Op::OpImageRead: return "OpImageRead";
+ case Op::OpImageWrite: return "OpImageWrite";
+ case Op::OpImage: return "OpImage";
+ case Op::OpImageQueryFormat: return "OpImageQueryFormat";
+ case Op::OpImageQueryOrder: return "OpImageQueryOrder";
+ case Op::OpImageQuerySizeLod: return "OpImageQuerySizeLod";
+ case Op::OpImageQuerySize: return "OpImageQuerySize";
+ case Op::OpImageQueryLod: return "OpImageQueryLod";
+ case Op::OpImageQueryLevels: return "OpImageQueryLevels";
+ case Op::OpImageQuerySamples: return "OpImageQuerySamples";
+ case Op::OpConvertFToU: return "OpConvertFToU";
+ case Op::OpConvertFToS: return "OpConvertFToS";
+ case Op::OpConvertSToF: return "OpConvertSToF";
+ case Op::OpConvertUToF: return "OpConvertUToF";
+ case Op::OpUConvert: return "OpUConvert";
+ case Op::OpSConvert: return "OpSConvert";
+ case Op::OpFConvert: return "OpFConvert";
+ case Op::OpQuantizeToF16: return "OpQuantizeToF16";
+ case Op::OpConvertPtrToU: return "OpConvertPtrToU";
+ case Op::OpSatConvertSToU: return "OpSatConvertSToU";
+ case Op::OpSatConvertUToS: return "OpSatConvertUToS";
+ case Op::OpConvertUToPtr: return "OpConvertUToPtr";
+ case Op::OpPtrCastToGeneric: return "OpPtrCastToGeneric";
+ case Op::OpGenericCastToPtr: return "OpGenericCastToPtr";
+ case Op::OpGenericCastToPtrExplicit: return "OpGenericCastToPtrExplicit";
+ case Op::OpBitcast: return "OpBitcast";
+ case Op::OpSNegate: return "OpSNegate";
+ case Op::OpFNegate: return "OpFNegate";
+ case Op::OpIAdd: return "OpIAdd";
+ case Op::OpFAdd: return "OpFAdd";
+ case Op::OpISub: return "OpISub";
+ case Op::OpFSub: return "OpFSub";
+ case Op::OpIMul: return "OpIMul";
+ case Op::OpFMul: return "OpFMul";
+ case Op::OpUDiv: return "OpUDiv";
+ case Op::OpSDiv: return "OpSDiv";
+ case Op::OpFDiv: return "OpFDiv";
+ case Op::OpUMod: return "OpUMod";
+ case Op::OpSRem: return "OpSRem";
+ case Op::OpSMod: return "OpSMod";
+ case Op::OpFRem: return "OpFRem";
+ case Op::OpFMod: return "OpFMod";
+ case Op::OpVectorTimesScalar: return "OpVectorTimesScalar";
+ case Op::OpMatrixTimesScalar: return "OpMatrixTimesScalar";
+ case Op::OpVectorTimesMatrix: return "OpVectorTimesMatrix";
+ case Op::OpMatrixTimesVector: return "OpMatrixTimesVector";
+ case Op::OpMatrixTimesMatrix: return "OpMatrixTimesMatrix";
+ case Op::OpOuterProduct: return "OpOuterProduct";
+ case Op::OpDot: return "OpDot";
+ case Op::OpIAddCarry: return "OpIAddCarry";
+ case Op::OpISubBorrow: return "OpISubBorrow";
+ case Op::OpUMulExtended: return "OpUMulExtended";
+ case Op::OpSMulExtended: return "OpSMulExtended";
+ case Op::OpAny: return "OpAny";
+ case Op::OpAll: return "OpAll";
+ case Op::OpIsNan: return "OpIsNan";
+ case Op::OpIsInf: return "OpIsInf";
+ case Op::OpIsFinite: return "OpIsFinite";
+ case Op::OpIsNormal: return "OpIsNormal";
+ case Op::OpSignBitSet: return "OpSignBitSet";
+ case Op::OpLessOrGreater: return "OpLessOrGreater";
+ case Op::OpOrdered: return "OpOrdered";
+ case Op::OpUnordered: return "OpUnordered";
+ case Op::OpLogicalEqual: return "OpLogicalEqual";
+ case Op::OpLogicalNotEqual: return "OpLogicalNotEqual";
+ case Op::OpLogicalOr: return "OpLogicalOr";
+ case Op::OpLogicalAnd: return "OpLogicalAnd";
+ case Op::OpLogicalNot: return "OpLogicalNot";
+ case Op::OpSelect: return "OpSelect";
+ case Op::OpIEqual: return "OpIEqual";
+ case Op::OpINotEqual: return "OpINotEqual";
+ case Op::OpUGreaterThan: return "OpUGreaterThan";
+ case Op::OpSGreaterThan: return "OpSGreaterThan";
+ case Op::OpUGreaterThanEqual: return "OpUGreaterThanEqual";
+ case Op::OpSGreaterThanEqual: return "OpSGreaterThanEqual";
+ case Op::OpULessThan: return "OpULessThan";
+ case Op::OpSLessThan: return "OpSLessThan";
+ case Op::OpULessThanEqual: return "OpULessThanEqual";
+ case Op::OpSLessThanEqual: return "OpSLessThanEqual";
+ case Op::OpFOrdEqual: return "OpFOrdEqual";
+ case Op::OpFUnordEqual: return "OpFUnordEqual";
+ case Op::OpFOrdNotEqual: return "OpFOrdNotEqual";
+ case Op::OpFUnordNotEqual: return "OpFUnordNotEqual";
+ case Op::OpFOrdLessThan: return "OpFOrdLessThan";
+ case Op::OpFUnordLessThan: return "OpFUnordLessThan";
+ case Op::OpFOrdGreaterThan: return "OpFOrdGreaterThan";
+ case Op::OpFUnordGreaterThan: return "OpFUnordGreaterThan";
+ case Op::OpFOrdLessThanEqual: return "OpFOrdLessThanEqual";
+ case Op::OpFUnordLessThanEqual: return "OpFUnordLessThanEqual";
+ case Op::OpFOrdGreaterThanEqual: return "OpFOrdGreaterThanEqual";
+ case Op::OpFUnordGreaterThanEqual: return "OpFUnordGreaterThanEqual";
+ case Op::OpShiftRightLogical: return "OpShiftRightLogical";
+ case Op::OpShiftRightArithmetic: return "OpShiftRightArithmetic";
+ case Op::OpShiftLeftLogical: return "OpShiftLeftLogical";
+ case Op::OpBitwiseOr: return "OpBitwiseOr";
+ case Op::OpBitwiseXor: return "OpBitwiseXor";
+ case Op::OpBitwiseAnd: return "OpBitwiseAnd";
+ case Op::OpNot: return "OpNot";
+ case Op::OpBitFieldInsert: return "OpBitFieldInsert";
+ case Op::OpBitFieldSExtract: return "OpBitFieldSExtract";
+ case Op::OpBitFieldUExtract: return "OpBitFieldUExtract";
+ case Op::OpBitReverse: return "OpBitReverse";
+ case Op::OpBitCount: return "OpBitCount";
+ case Op::OpDPdx: return "OpDPdx";
+ case Op::OpDPdy: return "OpDPdy";
+ case Op::OpFwidth: return "OpFwidth";
+ case Op::OpDPdxFine: return "OpDPdxFine";
+ case Op::OpDPdyFine: return "OpDPdyFine";
+ case Op::OpFwidthFine: return "OpFwidthFine";
+ case Op::OpDPdxCoarse: return "OpDPdxCoarse";
+ case Op::OpDPdyCoarse: return "OpDPdyCoarse";
+ case Op::OpFwidthCoarse: return "OpFwidthCoarse";
+ case Op::OpEmitVertex: return "OpEmitVertex";
+ case Op::OpEndPrimitive: return "OpEndPrimitive";
+ case Op::OpEmitStreamVertex: return "OpEmitStreamVertex";
+ case Op::OpEndStreamPrimitive: return "OpEndStreamPrimitive";
+ case Op::OpControlBarrier: return "OpControlBarrier";
+ case Op::OpMemoryBarrier: return "OpMemoryBarrier";
+ case Op::OpAtomicLoad: return "OpAtomicLoad";
+ case Op::OpAtomicStore: return "OpAtomicStore";
+ case Op::OpAtomicExchange: return "OpAtomicExchange";
+ case Op::OpAtomicCompareExchange: return "OpAtomicCompareExchange";
+ case Op::OpAtomicCompareExchangeWeak: return "OpAtomicCompareExchangeWeak";
+ case Op::OpAtomicIIncrement: return "OpAtomicIIncrement";
+ case Op::OpAtomicIDecrement: return "OpAtomicIDecrement";
+ case Op::OpAtomicIAdd: return "OpAtomicIAdd";
+ case Op::OpAtomicISub: return "OpAtomicISub";
+ case Op::OpAtomicSMin: return "OpAtomicSMin";
+ case Op::OpAtomicUMin: return "OpAtomicUMin";
+ case Op::OpAtomicSMax: return "OpAtomicSMax";
+ case Op::OpAtomicUMax: return "OpAtomicUMax";
+ case Op::OpAtomicAnd: return "OpAtomicAnd";
+ case Op::OpAtomicOr: return "OpAtomicOr";
+ case Op::OpAtomicXor: return "OpAtomicXor";
+ case Op::OpPhi: return "OpPhi";
+ case Op::OpLoopMerge: return "OpLoopMerge";
+ case Op::OpSelectionMerge: return "OpSelectionMerge";
+ case Op::OpLabel: return "OpLabel";
+ case Op::OpBranch: return "OpBranch";
+ case Op::OpBranchConditional: return "OpBranchConditional";
+ case Op::OpSwitch: return "OpSwitch";
+ case Op::OpKill: return "OpKill";
+ case Op::OpReturn: return "OpReturn";
+ case Op::OpReturnValue: return "OpReturnValue";
+ case Op::OpUnreachable: return "OpUnreachable";
+ case Op::OpLifetimeStart: return "OpLifetimeStart";
+ case Op::OpLifetimeStop: return "OpLifetimeStop";
+ case Op::OpGroupAsyncCopy: return "OpGroupAsyncCopy";
+ case Op::OpGroupWaitEvents: return "OpGroupWaitEvents";
+ case Op::OpGroupAll: return "OpGroupAll";
+ case Op::OpGroupAny: return "OpGroupAny";
+ case Op::OpGroupBroadcast: return "OpGroupBroadcast";
+ case Op::OpGroupIAdd: return "OpGroupIAdd";
+ case Op::OpGroupFAdd: return "OpGroupFAdd";
+ case Op::OpGroupFMin: return "OpGroupFMin";
+ case Op::OpGroupUMin: return "OpGroupUMin";
+ case Op::OpGroupSMin: return "OpGroupSMin";
+ case Op::OpGroupFMax: return "OpGroupFMax";
+ case Op::OpGroupUMax: return "OpGroupUMax";
+ case Op::OpGroupSMax: return "OpGroupSMax";
+ case Op::OpReadPipe: return "OpReadPipe";
+ case Op::OpWritePipe: return "OpWritePipe";
+ case Op::OpReservedReadPipe: return "OpReservedReadPipe";
+ case Op::OpReservedWritePipe: return "OpReservedWritePipe";
+ case Op::OpReserveReadPipePackets: return "OpReserveReadPipePackets";
+ case Op::OpReserveWritePipePackets: return "OpReserveWritePipePackets";
+ case Op::OpCommitReadPipe: return "OpCommitReadPipe";
+ case Op::OpCommitWritePipe: return "OpCommitWritePipe";
+ case Op::OpIsValidReserveId: return "OpIsValidReserveId";
+ case Op::OpGetNumPipePackets: return "OpGetNumPipePackets";
+ case Op::OpGetMaxPipePackets: return "OpGetMaxPipePackets";
+ case Op::OpGroupReserveReadPipePackets: return "OpGroupReserveReadPipePackets";
+ case Op::OpGroupReserveWritePipePackets: return "OpGroupReserveWritePipePackets";
+ case Op::OpGroupCommitReadPipe: return "OpGroupCommitReadPipe";
+ case Op::OpGroupCommitWritePipe: return "OpGroupCommitWritePipe";
+ case Op::OpEnqueueMarker: return "OpEnqueueMarker";
+ case Op::OpEnqueueKernel: return "OpEnqueueKernel";
+ case Op::OpGetKernelNDrangeSubGroupCount: return "OpGetKernelNDrangeSubGroupCount";
+ case Op::OpGetKernelNDrangeMaxSubGroupSize: return "OpGetKernelNDrangeMaxSubGroupSize";
+ case Op::OpGetKernelWorkGroupSize: return "OpGetKernelWorkGroupSize";
+ case Op::OpGetKernelPreferredWorkGroupSizeMultiple: return "OpGetKernelPreferredWorkGroupSizeMultiple";
+ case Op::OpRetainEvent: return "OpRetainEvent";
+ case Op::OpReleaseEvent: return "OpReleaseEvent";
+ case Op::OpCreateUserEvent: return "OpCreateUserEvent";
+ case Op::OpIsValidEvent: return "OpIsValidEvent";
+ case Op::OpSetUserEventStatus: return "OpSetUserEventStatus";
+ case Op::OpCaptureEventProfilingInfo: return "OpCaptureEventProfilingInfo";
+ case Op::OpGetDefaultQueue: return "OpGetDefaultQueue";
+ case Op::OpBuildNDRange: return "OpBuildNDRange";
+ case Op::OpImageSparseSampleImplicitLod: return "OpImageSparseSampleImplicitLod";
+ case Op::OpImageSparseSampleExplicitLod: return "OpImageSparseSampleExplicitLod";
+ case Op::OpImageSparseSampleDrefImplicitLod: return "OpImageSparseSampleDrefImplicitLod";
+ case Op::OpImageSparseSampleDrefExplicitLod: return "OpImageSparseSampleDrefExplicitLod";
+ case Op::OpImageSparseSampleProjImplicitLod: return "OpImageSparseSampleProjImplicitLod";
+ case Op::OpImageSparseSampleProjExplicitLod: return "OpImageSparseSampleProjExplicitLod";
+ case Op::OpImageSparseSampleProjDrefImplicitLod: return "OpImageSparseSampleProjDrefImplicitLod";
+ case Op::OpImageSparseSampleProjDrefExplicitLod: return "OpImageSparseSampleProjDrefExplicitLod";
+ case Op::OpImageSparseFetch: return "OpImageSparseFetch";
+ case Op::OpImageSparseGather: return "OpImageSparseGather";
+ case Op::OpImageSparseDrefGather: return "OpImageSparseDrefGather";
+ case Op::OpImageSparseTexelsResident: return "OpImageSparseTexelsResident";
+ case Op::OpNoLine: return "OpNoLine";
+ case Op::OpAtomicFlagTestAndSet: return "OpAtomicFlagTestAndSet";
+ case Op::OpAtomicFlagClear: return "OpAtomicFlagClear";
+ case Op::OpImageSparseRead: return "OpImageSparseRead";
+ case Op::OpSizeOf: return "OpSizeOf";
+ case Op::OpTypePipeStorage: return "OpTypePipeStorage";
+ case Op::OpConstantPipeStorage: return "OpConstantPipeStorage";
+ case Op::OpCreatePipeFromPipeStorage: return "OpCreatePipeFromPipeStorage";
+ case Op::OpGetKernelLocalSizeForSubgroupCount: return "OpGetKernelLocalSizeForSubgroupCount";
+ case Op::OpGetKernelMaxNumSubgroups: return "OpGetKernelMaxNumSubgroups";
+ case Op::OpTypeNamedBarrier: return "OpTypeNamedBarrier";
+ case Op::OpNamedBarrierInitialize: return "OpNamedBarrierInitialize";
+ case Op::OpMemoryNamedBarrier: return "OpMemoryNamedBarrier";
+ case Op::OpModuleProcessed: return "OpModuleProcessed";
+ case Op::OpExecutionModeId: return "OpExecutionModeId";
+ case Op::OpDecorateId: return "OpDecorateId";
+ case Op::OpGroupNonUniformElect: return "OpGroupNonUniformElect";
+ case Op::OpGroupNonUniformAll: return "OpGroupNonUniformAll";
+ case Op::OpGroupNonUniformAny: return "OpGroupNonUniformAny";
+ case Op::OpGroupNonUniformAllEqual: return "OpGroupNonUniformAllEqual";
+ case Op::OpGroupNonUniformBroadcast: return "OpGroupNonUniformBroadcast";
+ case Op::OpGroupNonUniformBroadcastFirst: return "OpGroupNonUniformBroadcastFirst";
+ case Op::OpGroupNonUniformBallot: return "OpGroupNonUniformBallot";
+ case Op::OpGroupNonUniformInverseBallot: return "OpGroupNonUniformInverseBallot";
+ case Op::OpGroupNonUniformBallotBitExtract: return "OpGroupNonUniformBallotBitExtract";
+ case Op::OpGroupNonUniformBallotBitCount: return "OpGroupNonUniformBallotBitCount";
+ case Op::OpGroupNonUniformBallotFindLSB: return "OpGroupNonUniformBallotFindLSB";
+ case Op::OpGroupNonUniformBallotFindMSB: return "OpGroupNonUniformBallotFindMSB";
+ case Op::OpGroupNonUniformShuffle: return "OpGroupNonUniformShuffle";
+ case Op::OpGroupNonUniformShuffleXor: return "OpGroupNonUniformShuffleXor";
+ case Op::OpGroupNonUniformShuffleUp: return "OpGroupNonUniformShuffleUp";
+ case Op::OpGroupNonUniformShuffleDown: return "OpGroupNonUniformShuffleDown";
+ case Op::OpGroupNonUniformIAdd: return "OpGroupNonUniformIAdd";
+ case Op::OpGroupNonUniformFAdd: return "OpGroupNonUniformFAdd";
+ case Op::OpGroupNonUniformIMul: return "OpGroupNonUniformIMul";
+ case Op::OpGroupNonUniformFMul: return "OpGroupNonUniformFMul";
+ case Op::OpGroupNonUniformSMin: return "OpGroupNonUniformSMin";
+ case Op::OpGroupNonUniformUMin: return "OpGroupNonUniformUMin";
+ case Op::OpGroupNonUniformFMin: return "OpGroupNonUniformFMin";
+ case Op::OpGroupNonUniformSMax: return "OpGroupNonUniformSMax";
+ case Op::OpGroupNonUniformUMax: return "OpGroupNonUniformUMax";
+ case Op::OpGroupNonUniformFMax: return "OpGroupNonUniformFMax";
+ case Op::OpGroupNonUniformBitwiseAnd: return "OpGroupNonUniformBitwiseAnd";
+ case Op::OpGroupNonUniformBitwiseOr: return "OpGroupNonUniformBitwiseOr";
+ case Op::OpGroupNonUniformBitwiseXor: return "OpGroupNonUniformBitwiseXor";
+ case Op::OpGroupNonUniformLogicalAnd: return "OpGroupNonUniformLogicalAnd";
+ case Op::OpGroupNonUniformLogicalOr: return "OpGroupNonUniformLogicalOr";
+ case Op::OpGroupNonUniformLogicalXor: return "OpGroupNonUniformLogicalXor";
+ case Op::OpGroupNonUniformQuadBroadcast: return "OpGroupNonUniformQuadBroadcast";
+ case Op::OpGroupNonUniformQuadSwap: return "OpGroupNonUniformQuadSwap";
+ case Op::OpCopyLogical: return "OpCopyLogical";
+ case Op::OpPtrEqual: return "OpPtrEqual";
+ case Op::OpPtrNotEqual: return "OpPtrNotEqual";
+ case Op::OpPtrDiff: return "OpPtrDiff";
+ case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT";
+ case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT";
+ case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT";
+ case Op::OpTypeTensorARM: return "OpTypeTensorARM";
+ case Op::OpTensorReadARM: return "OpTensorReadARM";
+ case Op::OpTensorWriteARM: return "OpTensorWriteARM";
+ case Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM";
+ case Op::OpGraphConstantARM: return "OpGraphConstantARM";
+ case Op::OpGraphEntryPointARM: return "OpGraphEntryPointARM";
+ case Op::OpGraphARM: return "OpGraphARM";
+ case Op::OpGraphInputARM: return "OpGraphInputARM";
+ case Op::OpGraphSetOutputARM: return "OpGraphSetOutputARM";
+ case Op::OpGraphEndARM: return "OpGraphEndARM";
+ case Op::OpTypeGraphARM: return "OpTypeGraphARM";
+ case Op::OpTerminateInvocation: return "OpTerminateInvocation";
+ case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR";
+ case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR";
+ case Op::OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR";
+ case Op::OpUntypedInBoundsAccessChainKHR: return "OpUntypedInBoundsAccessChainKHR";
+ case Op::OpSubgroupBallotKHR: return "OpSubgroupBallotKHR";
+ case Op::OpSubgroupFirstInvocationKHR: return "OpSubgroupFirstInvocationKHR";
+ case Op::OpUntypedPtrAccessChainKHR: return "OpUntypedPtrAccessChainKHR";
+ case Op::OpUntypedInBoundsPtrAccessChainKHR: return "OpUntypedInBoundsPtrAccessChainKHR";
+ case Op::OpUntypedArrayLengthKHR: return "OpUntypedArrayLengthKHR";
+ case Op::OpUntypedPrefetchKHR: return "OpUntypedPrefetchKHR";
+ case Op::OpSubgroupAllKHR: return "OpSubgroupAllKHR";
+ case Op::OpSubgroupAnyKHR: return "OpSubgroupAnyKHR";
+ case Op::OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR";
+ case Op::OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR";
+ case Op::OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR";
+ case Op::OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR";
+ case Op::OpUntypedGroupAsyncCopyKHR: return "OpUntypedGroupAsyncCopyKHR";
+ case Op::OpTraceRayKHR: return "OpTraceRayKHR";
+ case Op::OpExecuteCallableKHR: return "OpExecuteCallableKHR";
+ case Op::OpConvertUToAccelerationStructureKHR: return "OpConvertUToAccelerationStructureKHR";
+ case Op::OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR";
+ case Op::OpTerminateRayKHR: return "OpTerminateRayKHR";
+ case Op::OpSDot: return "OpSDot";
+ case Op::OpUDot: return "OpUDot";
+ case Op::OpSUDot: return "OpSUDot";
+ case Op::OpSDotAccSat: return "OpSDotAccSat";
+ case Op::OpUDotAccSat: return "OpUDotAccSat";
+ case Op::OpSUDotAccSat: return "OpSUDotAccSat";
+ case Op::OpTypeCooperativeMatrixKHR: return "OpTypeCooperativeMatrixKHR";
+ case Op::OpCooperativeMatrixLoadKHR: return "OpCooperativeMatrixLoadKHR";
+ case Op::OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR";
+ case Op::OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR";
+ case Op::OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR";
+ case Op::OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT";
+ case Op::OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT";
+ case Op::OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT";
+ case Op::OpTypeRayQueryKHR: return "OpTypeRayQueryKHR";
+ case Op::OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR";
+ case Op::OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR";
+ case Op::OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR";
+ case Op::OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR";
+ case Op::OpRayQueryProceedKHR: return "OpRayQueryProceedKHR";
+ case Op::OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR";
+ case Op::OpImageSampleWeightedQCOM: return "OpImageSampleWeightedQCOM";
+ case Op::OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM";
+ case Op::OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM";
+ case Op::OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM";
+ case Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM";
+ case Op::OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM";
+ case Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM";
+ case Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM";
+ case Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM";
+ case Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM";
+ case Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM";
+ case Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM";
+ case Op::OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD";
+ case Op::OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD";
+ case Op::OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD";
+ case Op::OpGroupUMinNonUniformAMD: return "OpGroupUMinNonUniformAMD";
+ case Op::OpGroupSMinNonUniformAMD: return "OpGroupSMinNonUniformAMD";
+ case Op::OpGroupFMaxNonUniformAMD: return "OpGroupFMaxNonUniformAMD";
+ case Op::OpGroupUMaxNonUniformAMD: return "OpGroupUMaxNonUniformAMD";
+ case Op::OpGroupSMaxNonUniformAMD: return "OpGroupSMaxNonUniformAMD";
+ case Op::OpFragmentMaskFetchAMD: return "OpFragmentMaskFetchAMD";
+ case Op::OpFragmentFetchAMD: return "OpFragmentFetchAMD";
+ case Op::OpReadClockKHR: return "OpReadClockKHR";
+ case Op::OpAllocateNodePayloadsAMDX: return "OpAllocateNodePayloadsAMDX";
+ case Op::OpEnqueueNodePayloadsAMDX: return "OpEnqueueNodePayloadsAMDX";
+ case Op::OpTypeNodePayloadArrayAMDX: return "OpTypeNodePayloadArrayAMDX";
+ case Op::OpFinishWritingNodePayloadAMDX: return "OpFinishWritingNodePayloadAMDX";
+ case Op::OpNodePayloadArrayLengthAMDX: return "OpNodePayloadArrayLengthAMDX";
+ case Op::OpIsNodePayloadValidAMDX: return "OpIsNodePayloadValidAMDX";
+ case Op::OpConstantStringAMDX: return "OpConstantStringAMDX";
+ case Op::OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX";
+ case Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR";
+ case Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR";
+ case Op::OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV";
+ case Op::OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV";
+ case Op::OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV";
+ case Op::OpHitObjectGetWorldToObjectNV: return "OpHitObjectGetWorldToObjectNV";
+ case Op::OpHitObjectGetObjectToWorldNV: return "OpHitObjectGetObjectToWorldNV";
+ case Op::OpHitObjectGetObjectRayDirectionNV: return "OpHitObjectGetObjectRayDirectionNV";
+ case Op::OpHitObjectGetObjectRayOriginNV: return "OpHitObjectGetObjectRayOriginNV";
+ case Op::OpHitObjectTraceRayMotionNV: return "OpHitObjectTraceRayMotionNV";
+ case Op::OpHitObjectGetShaderRecordBufferHandleNV: return "OpHitObjectGetShaderRecordBufferHandleNV";
+ case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: return "OpHitObjectGetShaderBindingTableRecordIndexNV";
+ case Op::OpHitObjectRecordEmptyNV: return "OpHitObjectRecordEmptyNV";
+ case Op::OpHitObjectTraceRayNV: return "OpHitObjectTraceRayNV";
+ case Op::OpHitObjectRecordHitNV: return "OpHitObjectRecordHitNV";
+ case Op::OpHitObjectRecordHitWithIndexNV: return "OpHitObjectRecordHitWithIndexNV";
+ case Op::OpHitObjectRecordMissNV: return "OpHitObjectRecordMissNV";
+ case Op::OpHitObjectExecuteShaderNV: return "OpHitObjectExecuteShaderNV";
+ case Op::OpHitObjectGetCurrentTimeNV: return "OpHitObjectGetCurrentTimeNV";
+ case Op::OpHitObjectGetAttributesNV: return "OpHitObjectGetAttributesNV";
+ case Op::OpHitObjectGetHitKindNV: return "OpHitObjectGetHitKindNV";
+ case Op::OpHitObjectGetPrimitiveIndexNV: return "OpHitObjectGetPrimitiveIndexNV";
+ case Op::OpHitObjectGetGeometryIndexNV: return "OpHitObjectGetGeometryIndexNV";
+ case Op::OpHitObjectGetInstanceIdNV: return "OpHitObjectGetInstanceIdNV";
+ case Op::OpHitObjectGetInstanceCustomIndexNV: return "OpHitObjectGetInstanceCustomIndexNV";
+ case Op::OpHitObjectGetWorldRayDirectionNV: return "OpHitObjectGetWorldRayDirectionNV";
+ case Op::OpHitObjectGetWorldRayOriginNV: return "OpHitObjectGetWorldRayOriginNV";
+ case Op::OpHitObjectGetRayTMaxNV: return "OpHitObjectGetRayTMaxNV";
+ case Op::OpHitObjectGetRayTMinNV: return "OpHitObjectGetRayTMinNV";
+ case Op::OpHitObjectIsEmptyNV: return "OpHitObjectIsEmptyNV";
+ case Op::OpHitObjectIsHitNV: return "OpHitObjectIsHitNV";
+ case Op::OpHitObjectIsMissNV: return "OpHitObjectIsMissNV";
+ case Op::OpReorderThreadWithHitObjectNV: return "OpReorderThreadWithHitObjectNV";
+ case Op::OpReorderThreadWithHintNV: return "OpReorderThreadWithHintNV";
+ case Op::OpTypeHitObjectNV: return "OpTypeHitObjectNV";
+ case Op::OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
+ case Op::OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV";
+ case Op::OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV";
+ case Op::OpCooperativeVectorOuterProductAccumulateNV: return "OpCooperativeVectorOuterProductAccumulateNV";
+ case Op::OpCooperativeVectorReduceSumAccumulateNV: return "OpCooperativeVectorReduceSumAccumulateNV";
+ case Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV";
+ case Op::OpCooperativeMatrixConvertNV: return "OpCooperativeMatrixConvertNV";
+ case Op::OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT";
+ case Op::OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT";
+ case Op::OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
+ case Op::OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
+ case Op::OpFetchMicroTriangleVertexPositionNV: return "OpFetchMicroTriangleVertexPositionNV";
+ case Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV";
+ case Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV";
+ case Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV";
+ case Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR";
+ case Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
+ case Op::OpTerminateRayNV: return "OpTerminateRayNV";
+ case Op::OpTraceNV: return "OpTraceNV";
+ case Op::OpTraceMotionNV: return "OpTraceMotionNV";
+ case Op::OpTraceRayMotionNV: return "OpTraceRayMotionNV";
+ case Op::OpRayQueryGetIntersectionTriangleVertexPositionsKHR: return "OpRayQueryGetIntersectionTriangleVertexPositionsKHR";
+ case Op::OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR";
+ case Op::OpExecuteCallableNV: return "OpExecuteCallableNV";
+ case Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV";
+ case Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV";
+ case Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
+ case Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
+ case Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
+ case Op::OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
+ case Op::OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
+ case Op::OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT";
+ case Op::OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT";
+ case Op::OpCooperativeMatrixReduceNV: return "OpCooperativeMatrixReduceNV";
+ case Op::OpCooperativeMatrixLoadTensorNV: return "OpCooperativeMatrixLoadTensorNV";
+ case Op::OpCooperativeMatrixStoreTensorNV: return "OpCooperativeMatrixStoreTensorNV";
+ case Op::OpCooperativeMatrixPerElementOpNV: return "OpCooperativeMatrixPerElementOpNV";
+ case Op::OpTypeTensorLayoutNV: return "OpTypeTensorLayoutNV";
+ case Op::OpTypeTensorViewNV: return "OpTypeTensorViewNV";
+ case Op::OpCreateTensorLayoutNV: return "OpCreateTensorLayoutNV";
+ case Op::OpTensorLayoutSetDimensionNV: return "OpTensorLayoutSetDimensionNV";
+ case Op::OpTensorLayoutSetStrideNV: return "OpTensorLayoutSetStrideNV";
+ case Op::OpTensorLayoutSliceNV: return "OpTensorLayoutSliceNV";
+ case Op::OpTensorLayoutSetClampValueNV: return "OpTensorLayoutSetClampValueNV";
+ case Op::OpCreateTensorViewNV: return "OpCreateTensorViewNV";
+ case Op::OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV";
+ case Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV";
+ case Op::OpDemoteToHelperInvocation: return "OpDemoteToHelperInvocation";
+ case Op::OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT";
+ case Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV";
+ case Op::OpTensorLayoutSetBlockSizeNV: return "OpTensorLayoutSetBlockSizeNV";
+ case Op::OpCooperativeMatrixTransposeNV: return "OpCooperativeMatrixTransposeNV";
+ case Op::OpConvertUToImageNV: return "OpConvertUToImageNV";
+ case Op::OpConvertUToSamplerNV: return "OpConvertUToSamplerNV";
+ case Op::OpConvertImageToUNV: return "OpConvertImageToUNV";
+ case Op::OpConvertSamplerToUNV: return "OpConvertSamplerToUNV";
+ case Op::OpConvertUToSampledImageNV: return "OpConvertUToSampledImageNV";
+ case Op::OpConvertSampledImageToUNV: return "OpConvertSampledImageToUNV";
+ case Op::OpSamplerImageAddressingModeNV: return "OpSamplerImageAddressingModeNV";
+ case Op::OpRawAccessChainNV: return "OpRawAccessChainNV";
+ case Op::OpRayQueryGetIntersectionSpherePositionNV: return "OpRayQueryGetIntersectionSpherePositionNV";
+ case Op::OpRayQueryGetIntersectionSphereRadiusNV: return "OpRayQueryGetIntersectionSphereRadiusNV";
+ case Op::OpRayQueryGetIntersectionLSSPositionsNV: return "OpRayQueryGetIntersectionLSSPositionsNV";
+ case Op::OpRayQueryGetIntersectionLSSRadiiNV: return "OpRayQueryGetIntersectionLSSRadiiNV";
+ case Op::OpRayQueryGetIntersectionLSSHitValueNV: return "OpRayQueryGetIntersectionLSSHitValueNV";
+ case Op::OpHitObjectGetSpherePositionNV: return "OpHitObjectGetSpherePositionNV";
+ case Op::OpHitObjectGetSphereRadiusNV: return "OpHitObjectGetSphereRadiusNV";
+ case Op::OpHitObjectGetLSSPositionsNV: return "OpHitObjectGetLSSPositionsNV";
+ case Op::OpHitObjectGetLSSRadiiNV: return "OpHitObjectGetLSSRadiiNV";
+ case Op::OpHitObjectIsSphereHitNV: return "OpHitObjectIsSphereHitNV";
+ case Op::OpHitObjectIsLSSHitNV: return "OpHitObjectIsLSSHitNV";
+ case Op::OpRayQueryIsSphereHitNV: return "OpRayQueryIsSphereHitNV";
+ case Op::OpRayQueryIsLSSHitNV: return "OpRayQueryIsLSSHitNV";
+ case Op::OpSubgroupShuffleINTEL: return "OpSubgroupShuffleINTEL";
+ case Op::OpSubgroupShuffleDownINTEL: return "OpSubgroupShuffleDownINTEL";
+ case Op::OpSubgroupShuffleUpINTEL: return "OpSubgroupShuffleUpINTEL";
+ case Op::OpSubgroupShuffleXorINTEL: return "OpSubgroupShuffleXorINTEL";
+ case Op::OpSubgroupBlockReadINTEL: return "OpSubgroupBlockReadINTEL";
+ case Op::OpSubgroupBlockWriteINTEL: return "OpSubgroupBlockWriteINTEL";
+ case Op::OpSubgroupImageBlockReadINTEL: return "OpSubgroupImageBlockReadINTEL";
+ case Op::OpSubgroupImageBlockWriteINTEL: return "OpSubgroupImageBlockWriteINTEL";
+ case Op::OpSubgroupImageMediaBlockReadINTEL: return "OpSubgroupImageMediaBlockReadINTEL";
+ case Op::OpSubgroupImageMediaBlockWriteINTEL: return "OpSubgroupImageMediaBlockWriteINTEL";
+ case Op::OpUCountLeadingZerosINTEL: return "OpUCountLeadingZerosINTEL";
+ case Op::OpUCountTrailingZerosINTEL: return "OpUCountTrailingZerosINTEL";
+ case Op::OpAbsISubINTEL: return "OpAbsISubINTEL";
+ case Op::OpAbsUSubINTEL: return "OpAbsUSubINTEL";
+ case Op::OpIAddSatINTEL: return "OpIAddSatINTEL";
+ case Op::OpUAddSatINTEL: return "OpUAddSatINTEL";
+ case Op::OpIAverageINTEL: return "OpIAverageINTEL";
+ case Op::OpUAverageINTEL: return "OpUAverageINTEL";
+ case Op::OpIAverageRoundedINTEL: return "OpIAverageRoundedINTEL";
+ case Op::OpUAverageRoundedINTEL: return "OpUAverageRoundedINTEL";
+ case Op::OpISubSatINTEL: return "OpISubSatINTEL";
+ case Op::OpUSubSatINTEL: return "OpUSubSatINTEL";
+ case Op::OpIMul32x16INTEL: return "OpIMul32x16INTEL";
+ case Op::OpUMul32x16INTEL: return "OpUMul32x16INTEL";
+ case Op::OpConstantFunctionPointerINTEL: return "OpConstantFunctionPointerINTEL";
+ case Op::OpFunctionPointerCallINTEL: return "OpFunctionPointerCallINTEL";
+ case Op::OpAsmTargetINTEL: return "OpAsmTargetINTEL";
+ case Op::OpAsmINTEL: return "OpAsmINTEL";
+ case Op::OpAsmCallINTEL: return "OpAsmCallINTEL";
+ case Op::OpAtomicFMinEXT: return "OpAtomicFMinEXT";
+ case Op::OpAtomicFMaxEXT: return "OpAtomicFMaxEXT";
+ case Op::OpAssumeTrueKHR: return "OpAssumeTrueKHR";
+ case Op::OpExpectKHR: return "OpExpectKHR";
+ case Op::OpDecorateString: return "OpDecorateString";
+ case Op::OpMemberDecorateString: return "OpMemberDecorateString";
+ case Op::OpVmeImageINTEL: return "OpVmeImageINTEL";
+ case Op::OpTypeVmeImageINTEL: return "OpTypeVmeImageINTEL";
+ case Op::OpTypeAvcImePayloadINTEL: return "OpTypeAvcImePayloadINTEL";
+ case Op::OpTypeAvcRefPayloadINTEL: return "OpTypeAvcRefPayloadINTEL";
+ case Op::OpTypeAvcSicPayloadINTEL: return "OpTypeAvcSicPayloadINTEL";
+ case Op::OpTypeAvcMcePayloadINTEL: return "OpTypeAvcMcePayloadINTEL";
+ case Op::OpTypeAvcMceResultINTEL: return "OpTypeAvcMceResultINTEL";
+ case Op::OpTypeAvcImeResultINTEL: return "OpTypeAvcImeResultINTEL";
+ case Op::OpTypeAvcImeResultSingleReferenceStreamoutINTEL: return "OpTypeAvcImeResultSingleReferenceStreamoutINTEL";
+ case Op::OpTypeAvcImeResultDualReferenceStreamoutINTEL: return "OpTypeAvcImeResultDualReferenceStreamoutINTEL";
+ case Op::OpTypeAvcImeSingleReferenceStreaminINTEL: return "OpTypeAvcImeSingleReferenceStreaminINTEL";
+ case Op::OpTypeAvcImeDualReferenceStreaminINTEL: return "OpTypeAvcImeDualReferenceStreaminINTEL";
+ case Op::OpTypeAvcRefResultINTEL: return "OpTypeAvcRefResultINTEL";
+ case Op::OpTypeAvcSicResultINTEL: return "OpTypeAvcSicResultINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL";
+ case Op::OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: return "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL";
+ case Op::OpSubgroupAvcMceSetInterShapePenaltyINTEL: return "OpSubgroupAvcMceSetInterShapePenaltyINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL";
+ case Op::OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: return "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: return "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: return "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL";
+ case Op::OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: return "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: return "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL";
+ case Op::OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: return "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL";
+ case Op::OpSubgroupAvcMceSetAcOnlyHaarINTEL: return "OpSubgroupAvcMceSetAcOnlyHaarINTEL";
+ case Op::OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL";
+ case Op::OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: return "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL";
+ case Op::OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL";
+ case Op::OpSubgroupAvcMceConvertToImePayloadINTEL: return "OpSubgroupAvcMceConvertToImePayloadINTEL";
+ case Op::OpSubgroupAvcMceConvertToImeResultINTEL: return "OpSubgroupAvcMceConvertToImeResultINTEL";
+ case Op::OpSubgroupAvcMceConvertToRefPayloadINTEL: return "OpSubgroupAvcMceConvertToRefPayloadINTEL";
+ case Op::OpSubgroupAvcMceConvertToRefResultINTEL: return "OpSubgroupAvcMceConvertToRefResultINTEL";
+ case Op::OpSubgroupAvcMceConvertToSicPayloadINTEL: return "OpSubgroupAvcMceConvertToSicPayloadINTEL";
+ case Op::OpSubgroupAvcMceConvertToSicResultINTEL: return "OpSubgroupAvcMceConvertToSicResultINTEL";
+ case Op::OpSubgroupAvcMceGetMotionVectorsINTEL: return "OpSubgroupAvcMceGetMotionVectorsINTEL";
+ case Op::OpSubgroupAvcMceGetInterDistortionsINTEL: return "OpSubgroupAvcMceGetInterDistortionsINTEL";
+ case Op::OpSubgroupAvcMceGetBestInterDistortionsINTEL: return "OpSubgroupAvcMceGetBestInterDistortionsINTEL";
+ case Op::OpSubgroupAvcMceGetInterMajorShapeINTEL: return "OpSubgroupAvcMceGetInterMajorShapeINTEL";
+ case Op::OpSubgroupAvcMceGetInterMinorShapeINTEL: return "OpSubgroupAvcMceGetInterMinorShapeINTEL";
+ case Op::OpSubgroupAvcMceGetInterDirectionsINTEL: return "OpSubgroupAvcMceGetInterDirectionsINTEL";
+ case Op::OpSubgroupAvcMceGetInterMotionVectorCountINTEL: return "OpSubgroupAvcMceGetInterMotionVectorCountINTEL";
+ case Op::OpSubgroupAvcMceGetInterReferenceIdsINTEL: return "OpSubgroupAvcMceGetInterReferenceIdsINTEL";
+ case Op::OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: return "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL";
+ case Op::OpSubgroupAvcImeInitializeINTEL: return "OpSubgroupAvcImeInitializeINTEL";
+ case Op::OpSubgroupAvcImeSetSingleReferenceINTEL: return "OpSubgroupAvcImeSetSingleReferenceINTEL";
+ case Op::OpSubgroupAvcImeSetDualReferenceINTEL: return "OpSubgroupAvcImeSetDualReferenceINTEL";
+ case Op::OpSubgroupAvcImeRefWindowSizeINTEL: return "OpSubgroupAvcImeRefWindowSizeINTEL";
+ case Op::OpSubgroupAvcImeAdjustRefOffsetINTEL: return "OpSubgroupAvcImeAdjustRefOffsetINTEL";
+ case Op::OpSubgroupAvcImeConvertToMcePayloadINTEL: return "OpSubgroupAvcImeConvertToMcePayloadINTEL";
+ case Op::OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: return "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL";
+ case Op::OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: return "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL";
+ case Op::OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: return "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL";
+ case Op::OpSubgroupAvcImeSetWeightedSadINTEL: return "OpSubgroupAvcImeSetWeightedSadINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL";
+ case Op::OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: return "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL";
+ case Op::OpSubgroupAvcImeConvertToMceResultINTEL: return "OpSubgroupAvcImeConvertToMceResultINTEL";
+ case Op::OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: return "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL";
+ case Op::OpSubgroupAvcImeGetDualReferenceStreaminINTEL: return "OpSubgroupAvcImeGetDualReferenceStreaminINTEL";
+ case Op::OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL";
+ case Op::OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: return "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL";
+ case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL";
+ case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL";
+ case Op::OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL";
+ case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL";
+ case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL";
+ case Op::OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: return "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL";
+ case Op::OpSubgroupAvcImeGetBorderReachedINTEL: return "OpSubgroupAvcImeGetBorderReachedINTEL";
+ case Op::OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: return "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL";
+ case Op::OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: return "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL";
+ case Op::OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL";
+ case Op::OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: return "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL";
+ case Op::OpSubgroupAvcFmeInitializeINTEL: return "OpSubgroupAvcFmeInitializeINTEL";
+ case Op::OpSubgroupAvcBmeInitializeINTEL: return "OpSubgroupAvcBmeInitializeINTEL";
+ case Op::OpSubgroupAvcRefConvertToMcePayloadINTEL: return "OpSubgroupAvcRefConvertToMcePayloadINTEL";
+ case Op::OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: return "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL";
+ case Op::OpSubgroupAvcRefSetBilinearFilterEnableINTEL: return "OpSubgroupAvcRefSetBilinearFilterEnableINTEL";
+ case Op::OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL";
+ case Op::OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL";
+ case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL";
+ case Op::OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL";
+ case Op::OpSubgroupAvcRefConvertToMceResultINTEL: return "OpSubgroupAvcRefConvertToMceResultINTEL";
+ case Op::OpSubgroupAvcSicInitializeINTEL: return "OpSubgroupAvcSicInitializeINTEL";
+ case Op::OpSubgroupAvcSicConfigureSkcINTEL: return "OpSubgroupAvcSicConfigureSkcINTEL";
+ case Op::OpSubgroupAvcSicConfigureIpeLumaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaINTEL";
+ case Op::OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: return "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL";
+ case Op::OpSubgroupAvcSicGetMotionVectorMaskINTEL: return "OpSubgroupAvcSicGetMotionVectorMaskINTEL";
+ case Op::OpSubgroupAvcSicConvertToMcePayloadINTEL: return "OpSubgroupAvcSicConvertToMcePayloadINTEL";
+ case Op::OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: return "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL";
+ case Op::OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL";
+ case Op::OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: return "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL";
+ case Op::OpSubgroupAvcSicSetBilinearFilterEnableINTEL: return "OpSubgroupAvcSicSetBilinearFilterEnableINTEL";
+ case Op::OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: return "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL";
+ case Op::OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: return "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL";
+ case Op::OpSubgroupAvcSicEvaluateIpeINTEL: return "OpSubgroupAvcSicEvaluateIpeINTEL";
+ case Op::OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL";
+ case Op::OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL";
+ case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL";
+ case Op::OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: return "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL";
+ case Op::OpSubgroupAvcSicConvertToMceResultINTEL: return "OpSubgroupAvcSicConvertToMceResultINTEL";
+ case Op::OpSubgroupAvcSicGetIpeLumaShapeINTEL: return "OpSubgroupAvcSicGetIpeLumaShapeINTEL";
+ case Op::OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL";
+ case Op::OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: return "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL";
+ case Op::OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: return "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL";
+ case Op::OpSubgroupAvcSicGetIpeChromaModeINTEL: return "OpSubgroupAvcSicGetIpeChromaModeINTEL";
+ case Op::OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL";
+ case Op::OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: return "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL";
+ case Op::OpSubgroupAvcSicGetInterRawSadsINTEL: return "OpSubgroupAvcSicGetInterRawSadsINTEL";
+ case Op::OpVariableLengthArrayINTEL: return "OpVariableLengthArrayINTEL";
+ case Op::OpSaveMemoryINTEL: return "OpSaveMemoryINTEL";
+ case Op::OpRestoreMemoryINTEL: return "OpRestoreMemoryINTEL";
+ case Op::OpArbitraryFloatSinCosPiINTEL: return "OpArbitraryFloatSinCosPiINTEL";
+ case Op::OpArbitraryFloatCastINTEL: return "OpArbitraryFloatCastINTEL";
+ case Op::OpArbitraryFloatCastFromIntINTEL: return "OpArbitraryFloatCastFromIntINTEL";
+ case Op::OpArbitraryFloatCastToIntINTEL: return "OpArbitraryFloatCastToIntINTEL";
+ case Op::OpArbitraryFloatAddINTEL: return "OpArbitraryFloatAddINTEL";
+ case Op::OpArbitraryFloatSubINTEL: return "OpArbitraryFloatSubINTEL";
+ case Op::OpArbitraryFloatMulINTEL: return "OpArbitraryFloatMulINTEL";
+ case Op::OpArbitraryFloatDivINTEL: return "OpArbitraryFloatDivINTEL";
+ case Op::OpArbitraryFloatGTINTEL: return "OpArbitraryFloatGTINTEL";
+ case Op::OpArbitraryFloatGEINTEL: return "OpArbitraryFloatGEINTEL";
+ case Op::OpArbitraryFloatLTINTEL: return "OpArbitraryFloatLTINTEL";
+ case Op::OpArbitraryFloatLEINTEL: return "OpArbitraryFloatLEINTEL";
+ case Op::OpArbitraryFloatEQINTEL: return "OpArbitraryFloatEQINTEL";
+ case Op::OpArbitraryFloatRecipINTEL: return "OpArbitraryFloatRecipINTEL";
+ case Op::OpArbitraryFloatRSqrtINTEL: return "OpArbitraryFloatRSqrtINTEL";
+ case Op::OpArbitraryFloatCbrtINTEL: return "OpArbitraryFloatCbrtINTEL";
+ case Op::OpArbitraryFloatHypotINTEL: return "OpArbitraryFloatHypotINTEL";
+ case Op::OpArbitraryFloatSqrtINTEL: return "OpArbitraryFloatSqrtINTEL";
+ case Op::OpArbitraryFloatLogINTEL: return "OpArbitraryFloatLogINTEL";
+ case Op::OpArbitraryFloatLog2INTEL: return "OpArbitraryFloatLog2INTEL";
+ case Op::OpArbitraryFloatLog10INTEL: return "OpArbitraryFloatLog10INTEL";
+ case Op::OpArbitraryFloatLog1pINTEL: return "OpArbitraryFloatLog1pINTEL";
+ case Op::OpArbitraryFloatExpINTEL: return "OpArbitraryFloatExpINTEL";
+ case Op::OpArbitraryFloatExp2INTEL: return "OpArbitraryFloatExp2INTEL";
+ case Op::OpArbitraryFloatExp10INTEL: return "OpArbitraryFloatExp10INTEL";
+ case Op::OpArbitraryFloatExpm1INTEL: return "OpArbitraryFloatExpm1INTEL";
+ case Op::OpArbitraryFloatSinINTEL: return "OpArbitraryFloatSinINTEL";
+ case Op::OpArbitraryFloatCosINTEL: return "OpArbitraryFloatCosINTEL";
+ case Op::OpArbitraryFloatSinCosINTEL: return "OpArbitraryFloatSinCosINTEL";
+ case Op::OpArbitraryFloatSinPiINTEL: return "OpArbitraryFloatSinPiINTEL";
+ case Op::OpArbitraryFloatCosPiINTEL: return "OpArbitraryFloatCosPiINTEL";
+ case Op::OpArbitraryFloatASinINTEL: return "OpArbitraryFloatASinINTEL";
+ case Op::OpArbitraryFloatASinPiINTEL: return "OpArbitraryFloatASinPiINTEL";
+ case Op::OpArbitraryFloatACosINTEL: return "OpArbitraryFloatACosINTEL";
+ case Op::OpArbitraryFloatACosPiINTEL: return "OpArbitraryFloatACosPiINTEL";
+ case Op::OpArbitraryFloatATanINTEL: return "OpArbitraryFloatATanINTEL";
+ case Op::OpArbitraryFloatATanPiINTEL: return "OpArbitraryFloatATanPiINTEL";
+ case Op::OpArbitraryFloatATan2INTEL: return "OpArbitraryFloatATan2INTEL";
+ case Op::OpArbitraryFloatPowINTEL: return "OpArbitraryFloatPowINTEL";
+ case Op::OpArbitraryFloatPowRINTEL: return "OpArbitraryFloatPowRINTEL";
+ case Op::OpArbitraryFloatPowNINTEL: return "OpArbitraryFloatPowNINTEL";
+ case Op::OpLoopControlINTEL: return "OpLoopControlINTEL";
+ case Op::OpAliasDomainDeclINTEL: return "OpAliasDomainDeclINTEL";
+ case Op::OpAliasScopeDeclINTEL: return "OpAliasScopeDeclINTEL";
+ case Op::OpAliasScopeListDeclINTEL: return "OpAliasScopeListDeclINTEL";
+ case Op::OpFixedSqrtINTEL: return "OpFixedSqrtINTEL";
+ case Op::OpFixedRecipINTEL: return "OpFixedRecipINTEL";
+ case Op::OpFixedRsqrtINTEL: return "OpFixedRsqrtINTEL";
+ case Op::OpFixedSinINTEL: return "OpFixedSinINTEL";
+ case Op::OpFixedCosINTEL: return "OpFixedCosINTEL";
+ case Op::OpFixedSinCosINTEL: return "OpFixedSinCosINTEL";
+ case Op::OpFixedSinPiINTEL: return "OpFixedSinPiINTEL";
+ case Op::OpFixedCosPiINTEL: return "OpFixedCosPiINTEL";
+ case Op::OpFixedSinCosPiINTEL: return "OpFixedSinCosPiINTEL";
+ case Op::OpFixedLogINTEL: return "OpFixedLogINTEL";
+ case Op::OpFixedExpINTEL: return "OpFixedExpINTEL";
+ case Op::OpPtrCastToCrossWorkgroupINTEL: return "OpPtrCastToCrossWorkgroupINTEL";
+ case Op::OpCrossWorkgroupCastToPtrINTEL: return "OpCrossWorkgroupCastToPtrINTEL";
+ case Op::OpReadPipeBlockingINTEL: return "OpReadPipeBlockingINTEL";
+ case Op::OpWritePipeBlockingINTEL: return "OpWritePipeBlockingINTEL";
+ case Op::OpFPGARegINTEL: return "OpFPGARegINTEL";
+ case Op::OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR";
+ case Op::OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR";
+ case Op::OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR";
+ case Op::OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR";
+ case Op::OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR";
+ case Op::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR";
+ case Op::OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR";
+ case Op::OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR";
+ case Op::OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR";
+ case Op::OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR";
+ case Op::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR";
+ case Op::OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR";
+ case Op::OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR";
+ case Op::OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR";
+ case Op::OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR";
+ case Op::OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR";
+ case Op::OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR";
+ case Op::OpAtomicFAddEXT: return "OpAtomicFAddEXT";
+ case Op::OpTypeBufferSurfaceINTEL: return "OpTypeBufferSurfaceINTEL";
+ case Op::OpTypeStructContinuedINTEL: return "OpTypeStructContinuedINTEL";
+ case Op::OpConstantCompositeContinuedINTEL: return "OpConstantCompositeContinuedINTEL";
+ case Op::OpSpecConstantCompositeContinuedINTEL: return "OpSpecConstantCompositeContinuedINTEL";
+ case Op::OpCompositeConstructContinuedINTEL: return "OpCompositeConstructContinuedINTEL";
+ case Op::OpConvertFToBF16INTEL: return "OpConvertFToBF16INTEL";
+ case Op::OpConvertBF16ToFINTEL: return "OpConvertBF16ToFINTEL";
+ case Op::OpControlBarrierArriveINTEL: return "OpControlBarrierArriveINTEL";
+ case Op::OpControlBarrierWaitINTEL: return "OpControlBarrierWaitINTEL";
+ case Op::OpArithmeticFenceEXT: return "OpArithmeticFenceEXT";
+ case Op::OpTaskSequenceCreateINTEL: return "OpTaskSequenceCreateINTEL";
+ case Op::OpTaskSequenceAsyncINTEL: return "OpTaskSequenceAsyncINTEL";
+ case Op::OpTaskSequenceGetINTEL: return "OpTaskSequenceGetINTEL";
+ case Op::OpTaskSequenceReleaseINTEL: return "OpTaskSequenceReleaseINTEL";
+ case Op::OpTypeTaskSequenceINTEL: return "OpTypeTaskSequenceINTEL";
+ case Op::OpSubgroupBlockPrefetchINTEL: return "OpSubgroupBlockPrefetchINTEL";
+ case Op::OpSubgroup2DBlockLoadINTEL: return "OpSubgroup2DBlockLoadINTEL";
+ case Op::OpSubgroup2DBlockLoadTransformINTEL: return "OpSubgroup2DBlockLoadTransformINTEL";
+ case Op::OpSubgroup2DBlockLoadTransposeINTEL: return "OpSubgroup2DBlockLoadTransposeINTEL";
+ case Op::OpSubgroup2DBlockPrefetchINTEL: return "OpSubgroup2DBlockPrefetchINTEL";
+ case Op::OpSubgroup2DBlockStoreINTEL: return "OpSubgroup2DBlockStoreINTEL";
+ case Op::OpSubgroupMatrixMultiplyAccumulateINTEL: return "OpSubgroupMatrixMultiplyAccumulateINTEL";
+ case Op::OpBitwiseFunctionINTEL: return "OpBitwiseFunctionINTEL";
+ case Op::OpConditionalExtensionINTEL: return "OpConditionalExtensionINTEL";
+ case Op::OpConditionalEntryPointINTEL: return "OpConditionalEntryPointINTEL";
+ case Op::OpConditionalCapabilityINTEL: return "OpConditionalCapabilityINTEL";
+ case Op::OpSpecConstantTargetINTEL: return "OpSpecConstantTargetINTEL";
+ case Op::OpSpecConstantArchitectureINTEL: return "OpSpecConstantArchitectureINTEL";
+ case Op::OpSpecConstantCapabilitiesINTEL: return "OpSpecConstantCapabilitiesINTEL";
+ case Op::OpConditionalCopyObjectINTEL: return "OpConditionalCopyObjectINTEL";
+ case Op::OpGroupIMulKHR: return "OpGroupIMulKHR";
+ case Op::OpGroupFMulKHR: return "OpGroupFMulKHR";
+ case Op::OpGroupBitwiseAndKHR: return "OpGroupBitwiseAndKHR";
+ case Op::OpGroupBitwiseOrKHR: return "OpGroupBitwiseOrKHR";
+ case Op::OpGroupBitwiseXorKHR: return "OpGroupBitwiseXorKHR";
+ case Op::OpGroupLogicalAndKHR: return "OpGroupLogicalAndKHR";
+ case Op::OpGroupLogicalOrKHR: return "OpGroupLogicalOrKHR";
+ case Op::OpGroupLogicalXorKHR: return "OpGroupLogicalXorKHR";
+ case Op::OpRoundFToTF32INTEL: return "OpRoundFToTF32INTEL";
+ case Op::OpMaskedGatherINTEL: return "OpMaskedGatherINTEL";
+ case Op::OpMaskedScatterINTEL: return "OpMaskedScatterINTEL";
+ case Op::OpConvertHandleToImageINTEL: return "OpConvertHandleToImageINTEL";
+ case Op::OpConvertHandleToSamplerINTEL: return "OpConvertHandleToSamplerINTEL";
+ case Op::OpConvertHandleToSampledImageINTEL: return "OpConvertHandleToSampledImageINTEL";
+ default: return "Unknown";
+ }
+}
+
#endif /* SPV_ENABLE_UTILITY_CODE */
// Overload bitwise operators for mask bit combining
@@ -2932,6 +5304,22 @@
constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
+constexpr CooperativeMatrixReduceMask operator|(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) | unsigned(b)); }
+constexpr CooperativeMatrixReduceMask operator&(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) & unsigned(b)); }
+constexpr CooperativeMatrixReduceMask operator^(CooperativeMatrixReduceMask a, CooperativeMatrixReduceMask b) { return CooperativeMatrixReduceMask(unsigned(a) ^ unsigned(b)); }
+constexpr CooperativeMatrixReduceMask operator~(CooperativeMatrixReduceMask a) { return CooperativeMatrixReduceMask(~unsigned(a)); }
+constexpr TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) | unsigned(b)); }
+constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); }
+constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); }
+constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); }
+constexpr TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); }
+constexpr TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); }
+constexpr TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); }
+constexpr TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); }
+constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); }
+constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); }
+constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); }
+constexpr MatrixMultiplyAccumulateOperandsMask operator~(MatrixMultiplyAccumulateOperandsMask a) { return MatrixMultiplyAccumulateOperandsMask(~unsigned(a)); }
constexpr RawAccessChainOperandsMask operator|(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) | unsigned(b)); }
constexpr RawAccessChainOperandsMask operator&(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) & unsigned(b)); }
constexpr RawAccessChainOperandsMask operator^(RawAccessChainOperandsMask a, RawAccessChainOperandsMask b) { return RawAccessChainOperandsMask(unsigned(a) ^ unsigned(b)); }
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.json b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.json
index 204a9c5..539c1c2 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.json
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.json
@@ -6,29 +6,13 @@
"Comment":
[
[
- "Copyright (c) 2014-2024 The Khronos Group Inc.",
+ "Copyright: 2014-2024 The Khronos Group Inc.",
+ "License: MIT",
"",
- "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."
+ "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/"
],
[
"This header is automatically generated by the same tool that creates",
@@ -80,7 +64,8 @@
"NZSL": 9,
"WGSL": 10,
"Slang": 11,
- "Zig": 12
+ "Zig": 12,
+ "Rust": 13
}
},
{
@@ -190,9 +175,12 @@
"SignedZeroInfNanPreserve": 4461,
"RoundingModeRTE": 4462,
"RoundingModeRTZ": 4463,
+ "NonCoherentTileAttachmentReadQCOM": 4489,
+ "TileShadingRateQCOM": 4490,
"EarlyAndLateFragmentTestsAMD": 5017,
"StencilRefReplacingEXT": 5027,
"CoalescingAMDX": 5069,
+ "IsApiEntryAMDX": 5070,
"MaxNodeRecursionAMDX": 5071,
"StaticNumWorkgroupsAMDX": 5072,
"ShaderIndexAMDX": 5073,
@@ -205,11 +193,14 @@
"StencilRefLessBackAMD": 5084,
"QuadDerivativesKHR": 5088,
"RequireFullQuadsKHR": 5089,
+ "SharesInputWithAMDX": 5102,
"OutputLinesEXT": 5269,
"OutputLinesNV": 5269,
"OutputPrimitivesEXT": 5270,
"OutputPrimitivesNV": 5270,
+ "DerivativeGroupQuadsKHR": 5289,
"DerivativeGroupQuadsNV": 5289,
+ "DerivativeGroupLinearKHR": 5290,
"DerivativeGroupLinearNV": 5290,
"OutputTrianglesEXT": 5298,
"OutputTrianglesNV": 5298,
@@ -258,8 +249,8 @@
"Image": 11,
"StorageBuffer": 12,
"TileImageEXT": 4172,
+ "TileAttachmentQCOM": 4491,
"NodePayloadAMDX": 5068,
- "NodeOutputPayloadAMDX": 5076,
"CallableDataKHR": 5328,
"CallableDataNV": 5328,
"IncomingCallableDataKHR": 5329,
@@ -415,8 +406,15 @@
"Float": 14,
"UnormInt24": 15,
"UnormInt101010_2": 16,
+ "UnormInt10X6EXT": 17,
"UnsignedIntRaw10EXT": 19,
- "UnsignedIntRaw12EXT": 20
+ "UnsignedIntRaw12EXT": 20,
+ "UnormInt2_101010EXT": 21,
+ "UnsignedInt10X6EXT": 22,
+ "UnsignedInt12X4EXT": 23,
+ "UnsignedInt14X2EXT": 24,
+ "UnormInt12X4EXT": 25,
+ "UnormInt14X2EXT": 26
}
},
{
@@ -562,6 +560,7 @@
"MaxByteOffset": 45,
"AlignmentId": 46,
"MaxByteOffsetId": 47,
+ "SaturatedToLargestFloat8NormalConversionEXT": 4216,
"NoSignedWrap": 4469,
"NoUnsignedWrap": 4470,
"WeightTextureQCOM": 4487,
@@ -572,6 +571,10 @@
"NodeMaxPayloadsAMDX": 5020,
"TrackFinishWritingAMDX": 5078,
"PayloadNodeNameAMDX": 5091,
+ "PayloadNodeBaseIndexAMDX": 5098,
+ "PayloadNodeSparseArrayAMDX": 5099,
+ "PayloadNodeArraySizeAMDX": 5100,
+ "PayloadDispatchIndirectAMDX": 5105,
"OverrideCoverageNV": 5248,
"PassthroughNV": 5250,
"ViewportRelativeNV": 5252,
@@ -658,6 +661,7 @@
"HostAccessINTEL": 6188,
"InitModeINTEL": 6190,
"ImplementInRegisterMapINTEL": 6191,
+ "ConditionalINTEL": 6247,
"CacheControlLoadINTEL": 6442,
"CacheControlStoreINTEL": 6443
}
@@ -730,6 +734,9 @@
"DeviceIndex": 4438,
"ViewIndex": 4440,
"ShadingRateKHR": 4444,
+ "TileOffsetQCOM": 4492,
+ "TileDimensionQCOM": 4493,
+ "TileApronSizeQCOM": 4494,
"BaryCoordNoPerspAMD": 4992,
"BaryCoordNoPerspCentroidAMD": 4993,
"BaryCoordNoPerspSampleAMD": 4994,
@@ -738,7 +745,7 @@
"BaryCoordSmoothSampleAMD": 4997,
"BaryCoordPullModelAMD": 4998,
"FragStencilRefEXT": 5014,
- "CoalescedInputCountAMDX": 5021,
+ "RemainingRecursionLevelsAMDX": 5021,
"ShaderIndexAMDX": 5073,
"ViewportMaskNV": 5253,
"SecondaryPositionNV": 5257,
@@ -798,12 +805,19 @@
"IncomingRayFlagsKHR": 5351,
"IncomingRayFlagsNV": 5351,
"RayGeometryIndexKHR": 5352,
+ "HitIsSphereNV": 5359,
+ "HitIsLSSNV": 5360,
+ "HitSpherePositionNV": 5361,
"WarpsPerSMNV": 5374,
"SMCountNV": 5375,
"WarpIDNV": 5376,
"SMIDNV": 5377,
+ "HitLSSPositionsNV": 5396,
"HitKindFrontFacingMicroTriangleNV": 5405,
"HitKindBackFacingMicroTriangleNV": 5406,
+ "HitSphereRadiusNV": 5420,
+ "HitLSSRadiiNV": 5421,
+ "ClusterIDNV": 5436,
"CullMaskKHR": 6021
}
},
@@ -851,6 +865,7 @@
"DontInline": 1,
"Pure": 2,
"Const": 3,
+ "OptNoneEXT": 16,
"OptNoneINTEL": 16
}
},
@@ -1022,6 +1037,13 @@
"TileImageColorReadAccessEXT": 4166,
"TileImageDepthReadAccessEXT": 4167,
"TileImageStencilReadAccessEXT": 4168,
+ "TensorsARM": 4174,
+ "StorageTensorArrayDynamicIndexingARM": 4175,
+ "StorageTensorArrayNonUniformIndexingARM": 4176,
+ "GraphARM": 4191,
+ "CooperativeMatrixLayoutsARM": 4201,
+ "Float8EXT": 4212,
+ "Float8CooperativeMatrixEXT": 4213,
"FragmentShadingRateKHR": 4422,
"SubgroupBallotKHR": 4423,
"DrawParameters": 4427,
@@ -1051,11 +1073,14 @@
"RoundingModeRTZ": 4468,
"RayQueryProvisionalKHR": 4471,
"RayQueryKHR": 4472,
+ "UntypedPointersKHR": 4473,
"RayTraversalPrimitiveCullingKHR": 4478,
"RayTracingKHR": 4479,
"TextureSampleWeightedQCOM": 4484,
"TextureBoxFilterQCOM": 4485,
"TextureBlockMatchQCOM": 4486,
+ "TileShadingQCOM": 4495,
+ "CooperativeMatrixConversionQCOM": 4496,
"TextureBlockMatch2QCOM": 4498,
"Float16ImageAMD": 5008,
"ImageGatherBiasLodAMD": 5009,
@@ -1066,6 +1091,11 @@
"ShaderClockKHR": 5055,
"ShaderEnqueueAMDX": 5067,
"QuadControlKHR": 5087,
+ "Int4TypeINTEL": 5112,
+ "Int4CooperativeMatrixINTEL": 5114,
+ "BFloat16TypeKHR": 5116,
+ "BFloat16DotProductKHR": 5117,
+ "BFloat16CooperativeMatrixKHR": 5118,
"SampleMaskOverrideCoverageNV": 5249,
"GeometryShaderPassthroughNV": 5251,
"ShaderViewportIndexLayerEXT": 5254,
@@ -1079,6 +1109,7 @@
"MeshShadingEXT": 5283,
"FragmentBarycentricKHR": 5284,
"FragmentBarycentricNV": 5284,
+ "ComputeDerivativeGroupQuadsKHR": 5288,
"ComputeDerivativeGroupQuadsNV": 5288,
"FragmentDensityEXT": 5291,
"ShadingRateNV": 5291,
@@ -1116,6 +1147,7 @@
"VulkanMemoryModelDeviceScopeKHR": 5346,
"PhysicalStorageBufferAddresses": 5347,
"PhysicalStorageBufferAddressesEXT": 5347,
+ "ComputeDerivativeGroupLinearKHR": 5350,
"ComputeDerivativeGroupLinearNV": 5350,
"RayTracingProvisionalKHR": 5353,
"CooperativeMatrixNV": 5357,
@@ -1130,9 +1162,20 @@
"ShaderInvocationReorderNV": 5383,
"BindlessTextureNV": 5390,
"RayQueryPositionFetchKHR": 5391,
+ "CooperativeVectorNV": 5394,
"AtomicFloat16VectorNV": 5404,
"RayTracingDisplacementMicromapNV": 5409,
"RawAccessChainsNV": 5414,
+ "RayTracingSpheresGeometryNV": 5418,
+ "RayTracingLinearSweptSpheresGeometryNV": 5419,
+ "CooperativeMatrixReductionsNV": 5430,
+ "CooperativeMatrixConversionsNV": 5431,
+ "CooperativeMatrixPerElementOperationsNV": 5432,
+ "CooperativeMatrixTensorAddressingNV": 5433,
+ "CooperativeMatrixBlockLoadsNV": 5434,
+ "CooperativeVectorTrainingNV": 5435,
+ "RayTracingClusterAccelerationStructureNV": 5437,
+ "TensorAddressingNV": 5439,
"SubgroupShuffleINTEL": 5568,
"SubgroupBufferBlockIOINTEL": 5569,
"SubgroupImageBlockIOINTEL": 5570,
@@ -1185,28 +1228,42 @@
"DotProductKHR": 6019,
"RayCullMaskKHR": 6020,
"CooperativeMatrixKHR": 6022,
+ "ReplicatedCompositesEXT": 6024,
"BitInstructions": 6025,
"GroupNonUniformRotateKHR": 6026,
"FloatControls2": 6029,
"AtomicFloat32AddEXT": 6033,
"AtomicFloat64AddEXT": 6034,
"LongCompositesINTEL": 6089,
+ "OptNoneEXT": 6094,
"OptNoneINTEL": 6094,
"AtomicFloat16AddEXT": 6095,
"DebugInfoModuleINTEL": 6114,
"BFloat16ConversionINTEL": 6115,
"SplitBarrierINTEL": 6141,
+ "ArithmeticFenceEXT": 6144,
"FPGAClusterAttributesV2INTEL": 6150,
"FPGAKernelAttributesv2INTEL": 6161,
+ "TaskSequenceINTEL": 6162,
"FPMaxErrorINTEL": 6169,
"FPGALatencyControlINTEL": 6171,
"FPGAArgumentInterfacesINTEL": 6174,
"GlobalVariableHostAccessINTEL": 6187,
"GlobalVariableFPGADecorationsINTEL": 6189,
+ "SubgroupBufferPrefetchINTEL": 6220,
+ "Subgroup2DBlockIOINTEL": 6228,
+ "Subgroup2DBlockTransformINTEL": 6229,
+ "Subgroup2DBlockTransposeINTEL": 6230,
+ "SubgroupMatrixMultiplyAccumulateINTEL": 6236,
+ "TernaryBitwiseFunctionINTEL": 6241,
+ "SpecConditionalINTEL": 6245,
+ "FunctionVariantsINTEL": 6246,
"GroupUniformArithmeticKHR": 6400,
+ "TensorFloat32RoundingINTEL": 6425,
"MaskedGatherScatterINTEL": 6427,
"CacheControlsINTEL": 6441,
- "RegisterLimitsINTEL": 6460
+ "RegisterLimitsINTEL": 6460,
+ "BindlessImagesINTEL": 6528
}
},
{
@@ -1222,6 +1279,7 @@
"CullFrontFacingTrianglesKHR": 5,
"CullOpaqueKHR": 6,
"CullNoOpaqueKHR": 7,
+ "SkipBuiltinPrimitivesNV": 8,
"SkipTrianglesKHR": 8,
"SkipAABBsKHR": 9,
"ForceOpacityMicromap2StateEXT": 10
@@ -1337,7 +1395,9 @@
"Values":
{
"RowMajorKHR": 0,
- "ColumnMajorKHR": 1
+ "ColumnMajorKHR": 1,
+ "RowBlockedInterleavedARM": 4202,
+ "ColumnBlockedInterleavedARM": 4203
}
},
{
@@ -1351,6 +1411,49 @@
}
},
{
+ "Name": "CooperativeMatrixReduce",
+ "Type": "Bit",
+ "Values":
+ {
+ "Row": 0,
+ "Column": 1,
+ "CooperativeMatrixReduce2x2": 2
+ }
+ },
+ {
+ "Name": "TensorClampMode",
+ "Type": "Value",
+ "Values":
+ {
+ "Undefined": 0,
+ "Constant": 1,
+ "ClampToEdge": 2,
+ "Repeat": 3,
+ "RepeatMirrored": 4
+ }
+ },
+ {
+ "Name": "TensorAddressingOperands",
+ "Type": "Bit",
+ "Values":
+ {
+ "TensorView": 0,
+ "DecodeFunc": 1
+ }
+ },
+ {
+ "Name": "TensorOperands",
+ "Type": "Bit",
+ "Values":
+ {
+ "NontemporalARM": 0,
+ "OutOfBoundsValueARM": 1,
+ "MakeElementAvailableARM": 2,
+ "MakeElementVisibleARM": 3,
+ "NonPrivateElementARM": 4
+ }
+ },
+ {
"Name": "InitializationModeQualifier",
"Type": "Value",
"Values":
@@ -1402,6 +1505,27 @@
}
},
{
+ "Name": "MatrixMultiplyAccumulateOperands",
+ "Type": "Bit",
+ "Values":
+ {
+ "MatrixASignedComponentsINTEL": 0,
+ "MatrixBSignedComponentsINTEL": 1,
+ "MatrixCBFloat16INTEL": 2,
+ "MatrixResultBFloat16INTEL": 3,
+ "MatrixAPackedInt8INTEL": 4,
+ "MatrixBPackedInt8INTEL": 5,
+ "MatrixAPackedInt4INTEL": 6,
+ "MatrixBPackedInt4INTEL": 7,
+ "MatrixATF32INTEL": 8,
+ "MatrixBTF32INTEL": 9,
+ "MatrixAPackedFloat16INTEL": 10,
+ "MatrixBPackedFloat16INTEL": 11,
+ "MatrixAPackedBFloat16INTEL": 12,
+ "MatrixBPackedBFloat16INTEL": 13
+ }
+ },
+ {
"Name": "RawAccessChainOperands",
"Type": "Bit",
"Values":
@@ -1411,6 +1535,49 @@
}
},
{
+ "Name": "FPEncoding",
+ "Type": "Value",
+ "Values":
+ {
+ "BFloat16KHR": 0,
+ "Float8E4M3EXT": 4214,
+ "Float8E5M2EXT": 4215
+ }
+ },
+ {
+ "Name": "CooperativeVectorMatrixLayout",
+ "Type": "Value",
+ "Values":
+ {
+ "RowMajorNV": 0,
+ "ColumnMajorNV": 1,
+ "InferencingOptimalNV": 2,
+ "TrainingOptimalNV": 3
+ }
+ },
+ {
+ "Name": "ComponentType",
+ "Type": "Value",
+ "Values":
+ {
+ "Float16NV": 0,
+ "Float32NV": 1,
+ "Float64NV": 2,
+ "SignedInt8NV": 3,
+ "SignedInt16NV": 4,
+ "SignedInt32NV": 5,
+ "SignedInt64NV": 6,
+ "UnsignedInt8NV": 7,
+ "UnsignedInt16NV": 8,
+ "UnsignedInt32NV": 9,
+ "UnsignedInt64NV": 10,
+ "SignedInt8PackedNV": 1000491000,
+ "UnsignedInt8PackedNV": 1000491001,
+ "FloatE4M3NV": 1000491002,
+ "FloatE5M2NV": 1000491003
+ }
+ },
+ {
"Name": "Op",
"Type": "Value",
"Values":
@@ -1762,14 +1929,35 @@
"OpColorAttachmentReadEXT": 4160,
"OpDepthAttachmentReadEXT": 4161,
"OpStencilAttachmentReadEXT": 4162,
+ "OpTypeTensorARM": 4163,
+ "OpTensorReadARM": 4164,
+ "OpTensorWriteARM": 4165,
+ "OpTensorQuerySizeARM": 4166,
+ "OpGraphConstantARM": 4181,
+ "OpGraphEntryPointARM": 4182,
+ "OpGraphARM": 4183,
+ "OpGraphInputARM": 4184,
+ "OpGraphSetOutputARM": 4185,
+ "OpGraphEndARM": 4186,
+ "OpTypeGraphARM": 4190,
"OpTerminateInvocation": 4416,
+ "OpTypeUntypedPointerKHR": 4417,
+ "OpUntypedVariableKHR": 4418,
+ "OpUntypedAccessChainKHR": 4419,
+ "OpUntypedInBoundsAccessChainKHR": 4420,
"OpSubgroupBallotKHR": 4421,
"OpSubgroupFirstInvocationKHR": 4422,
+ "OpUntypedPtrAccessChainKHR": 4423,
+ "OpUntypedInBoundsPtrAccessChainKHR": 4424,
+ "OpUntypedArrayLengthKHR": 4425,
+ "OpUntypedPrefetchKHR": 4426,
"OpSubgroupAllKHR": 4428,
"OpSubgroupAnyKHR": 4429,
"OpSubgroupAllEqualKHR": 4430,
"OpGroupNonUniformRotateKHR": 4431,
"OpSubgroupReadInvocationKHR": 4432,
+ "OpExtInstWithForwardRefsKHR": 4433,
+ "OpUntypedGroupAsyncCopyKHR": 4434,
"OpTraceRayKHR": 4445,
"OpExecuteCallableKHR": 4446,
"OpConvertUToAccelerationStructureKHR": 4447,
@@ -1792,6 +1980,9 @@
"OpCooperativeMatrixStoreKHR": 4458,
"OpCooperativeMatrixMulAddKHR": 4459,
"OpCooperativeMatrixLengthKHR": 4460,
+ "OpConstantCompositeReplicateEXT": 4461,
+ "OpSpecConstantCompositeReplicateEXT": 4462,
+ "OpCompositeConstructReplicateEXT": 4463,
"OpTypeRayQueryKHR": 4472,
"OpRayQueryInitializeKHR": 4473,
"OpRayQueryTerminateKHR": 4474,
@@ -1803,10 +1994,14 @@
"OpImageBoxFilterQCOM": 4481,
"OpImageBlockMatchSSDQCOM": 4482,
"OpImageBlockMatchSADQCOM": 4483,
+ "OpBitCastArrayQCOM": 4497,
"OpImageBlockMatchWindowSSDQCOM": 4500,
"OpImageBlockMatchWindowSADQCOM": 4501,
"OpImageBlockMatchGatherSSDQCOM": 4502,
"OpImageBlockMatchGatherSADQCOM": 4503,
+ "OpCompositeConstructCoopMatQCOM": 4540,
+ "OpCompositeExtractCoopMatQCOM": 4541,
+ "OpExtractSubArrayQCOM": 4542,
"OpGroupIAddNonUniformAMD": 5000,
"OpGroupFAddNonUniformAMD": 5001,
"OpGroupFMinNonUniformAMD": 5002,
@@ -1818,9 +2013,14 @@
"OpFragmentMaskFetchAMD": 5011,
"OpFragmentFetchAMD": 5012,
"OpReadClockKHR": 5056,
- "OpFinalizeNodePayloadsAMDX": 5075,
+ "OpAllocateNodePayloadsAMDX": 5074,
+ "OpEnqueueNodePayloadsAMDX": 5075,
+ "OpTypeNodePayloadArrayAMDX": 5076,
"OpFinishWritingNodePayloadAMDX": 5078,
- "OpInitializeNodePayloadsAMDX": 5090,
+ "OpNodePayloadArrayLengthAMDX": 5090,
+ "OpIsNodePayloadValidAMDX": 5101,
+ "OpConstantStringAMDX": 5103,
+ "OpSpecConstantStringAMDX": 5104,
"OpGroupNonUniformQuadAllKHR": 5110,
"OpGroupNonUniformQuadAnyKHR": 5111,
"OpHitObjectRecordHitMotionNV": 5249,
@@ -1857,12 +2057,20 @@
"OpReorderThreadWithHintNV": 5280,
"OpTypeHitObjectNV": 5281,
"OpImageSampleFootprintNV": 5283,
+ "OpTypeCooperativeVectorNV": 5288,
+ "OpCooperativeVectorMatrixMulNV": 5289,
+ "OpCooperativeVectorOuterProductAccumulateNV": 5290,
+ "OpCooperativeVectorReduceSumAccumulateNV": 5291,
+ "OpCooperativeVectorMatrixMulAddNV": 5292,
+ "OpCooperativeMatrixConvertNV": 5293,
"OpEmitMeshTasksEXT": 5294,
"OpSetMeshOutputsEXT": 5295,
"OpGroupNonUniformPartitionNV": 5296,
"OpWritePackedPrimitiveIndices4x8NV": 5299,
"OpFetchMicroTriangleVertexPositionNV": 5300,
"OpFetchMicroTriangleVertexBarycentricNV": 5301,
+ "OpCooperativeVectorLoadNV": 5302,
+ "OpCooperativeVectorStoreNV": 5303,
"OpReportIntersectionKHR": 5334,
"OpReportIntersectionNV": 5334,
"OpIgnoreIntersectionNV": 5335,
@@ -1874,6 +2082,8 @@
"OpTypeAccelerationStructureKHR": 5341,
"OpTypeAccelerationStructureNV": 5341,
"OpExecuteCallableNV": 5344,
+ "OpRayQueryGetClusterIdNV": 5345,
+ "OpHitObjectGetClusterIdNV": 5346,
"OpTypeCooperativeMatrixNV": 5358,
"OpCooperativeMatrixLoadNV": 5359,
"OpCooperativeMatrixStoreNV": 5360,
@@ -1881,9 +2091,26 @@
"OpCooperativeMatrixLengthNV": 5362,
"OpBeginInvocationInterlockEXT": 5364,
"OpEndInvocationInterlockEXT": 5365,
+ "OpCooperativeMatrixReduceNV": 5366,
+ "OpCooperativeMatrixLoadTensorNV": 5367,
+ "OpCooperativeMatrixStoreTensorNV": 5368,
+ "OpCooperativeMatrixPerElementOpNV": 5369,
+ "OpTypeTensorLayoutNV": 5370,
+ "OpTypeTensorViewNV": 5371,
+ "OpCreateTensorLayoutNV": 5372,
+ "OpTensorLayoutSetDimensionNV": 5373,
+ "OpTensorLayoutSetStrideNV": 5374,
+ "OpTensorLayoutSliceNV": 5375,
+ "OpTensorLayoutSetClampValueNV": 5376,
+ "OpCreateTensorViewNV": 5377,
+ "OpTensorViewSetDimensionNV": 5378,
+ "OpTensorViewSetStrideNV": 5379,
"OpDemoteToHelperInvocation": 5380,
"OpDemoteToHelperInvocationEXT": 5380,
"OpIsHelperInvocationEXT": 5381,
+ "OpTensorViewSetClipNV": 5382,
+ "OpTensorLayoutSetBlockSizeNV": 5384,
+ "OpCooperativeMatrixTransposeNV": 5390,
"OpConvertUToImageNV": 5391,
"OpConvertUToSamplerNV": 5392,
"OpConvertImageToUNV": 5393,
@@ -1892,6 +2119,19 @@
"OpConvertSampledImageToUNV": 5396,
"OpSamplerImageAddressingModeNV": 5397,
"OpRawAccessChainNV": 5398,
+ "OpRayQueryGetIntersectionSpherePositionNV": 5427,
+ "OpRayQueryGetIntersectionSphereRadiusNV": 5428,
+ "OpRayQueryGetIntersectionLSSPositionsNV": 5429,
+ "OpRayQueryGetIntersectionLSSRadiiNV": 5430,
+ "OpRayQueryGetIntersectionLSSHitValueNV": 5431,
+ "OpHitObjectGetSpherePositionNV": 5432,
+ "OpHitObjectGetSphereRadiusNV": 5433,
+ "OpHitObjectGetLSSPositionsNV": 5434,
+ "OpHitObjectGetLSSRadiiNV": 5435,
+ "OpHitObjectIsSphereHitNV": 5436,
+ "OpHitObjectIsLSSHitNV": 5437,
+ "OpRayQueryIsSphereHitNV": 5438,
+ "OpRayQueryIsLSSHitNV": 5439,
"OpSubgroupShuffleINTEL": 5571,
"OpSubgroupShuffleDownINTEL": 5572,
"OpSubgroupShuffleUpINTEL": 5573,
@@ -2138,6 +2378,27 @@
"OpConvertBF16ToFINTEL": 6117,
"OpControlBarrierArriveINTEL": 6142,
"OpControlBarrierWaitINTEL": 6143,
+ "OpArithmeticFenceEXT": 6145,
+ "OpTaskSequenceCreateINTEL": 6163,
+ "OpTaskSequenceAsyncINTEL": 6164,
+ "OpTaskSequenceGetINTEL": 6165,
+ "OpTaskSequenceReleaseINTEL": 6166,
+ "OpTypeTaskSequenceINTEL": 6199,
+ "OpSubgroupBlockPrefetchINTEL": 6221,
+ "OpSubgroup2DBlockLoadINTEL": 6231,
+ "OpSubgroup2DBlockLoadTransformINTEL": 6232,
+ "OpSubgroup2DBlockLoadTransposeINTEL": 6233,
+ "OpSubgroup2DBlockPrefetchINTEL": 6234,
+ "OpSubgroup2DBlockStoreINTEL": 6235,
+ "OpSubgroupMatrixMultiplyAccumulateINTEL": 6237,
+ "OpBitwiseFunctionINTEL": 6242,
+ "OpConditionalExtensionINTEL": 6248,
+ "OpConditionalEntryPointINTEL": 6249,
+ "OpConditionalCapabilityINTEL": 6250,
+ "OpSpecConstantTargetINTEL": 6251,
+ "OpSpecConstantArchitectureINTEL": 6252,
+ "OpSpecConstantCapabilitiesINTEL": 6253,
+ "OpConditionalCopyObjectINTEL": 6254,
"OpGroupIMulKHR": 6401,
"OpGroupFMulKHR": 6402,
"OpGroupBitwiseAndKHR": 6403,
@@ -2146,8 +2407,12 @@
"OpGroupLogicalAndKHR": 6406,
"OpGroupLogicalOrKHR": 6407,
"OpGroupLogicalXorKHR": 6408,
+ "OpRoundFToTF32INTEL": 6426,
"OpMaskedGatherINTEL": 6428,
- "OpMaskedScatterINTEL": 6429
+ "OpMaskedScatterINTEL": 6429,
+ "OpConvertHandleToImageINTEL": 6529,
+ "OpConvertHandleToSamplerINTEL": 6530,
+ "OpConvertHandleToSampledImageINTEL": 6531
}
}
]
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.lua b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.lua
index 6dcd1b8..dec7f65 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.lua
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.lua
@@ -1,26 +1,10 @@
--- Copyright (c) 2014-2024 The Khronos Group Inc.
+-- Copyright: 2014-2024 The Khronos Group Inc.
+-- License: MIT
--
--- 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.
+-- 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/
-- This header is automatically generated by the same tool that creates
-- the Binary Section of the SPIR-V specification.
@@ -65,6 +49,8 @@
WGSL = 10,
Slang = 11,
Zig = 12,
+ Rust = 13,
+ Max = 0x7fffffff,
},
ExecutionModel = {
@@ -91,6 +77,7 @@
CallableNV = 5318,
TaskEXT = 5364,
MeshEXT = 5365,
+ Max = 0x7fffffff,
},
AddressingModel = {
@@ -99,6 +86,7 @@
Physical64 = 2,
PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348,
+ Max = 0x7fffffff,
},
MemoryModel = {
@@ -107,6 +95,7 @@
OpenCL = 2,
Vulkan = 3,
VulkanKHR = 3,
+ Max = 0x7fffffff,
},
ExecutionMode = {
@@ -158,9 +147,12 @@
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ NonCoherentTileAttachmentReadQCOM = 4489,
+ TileShadingRateQCOM = 4490,
EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
CoalescingAMDX = 5069,
+ IsApiEntryAMDX = 5070,
MaxNodeRecursionAMDX = 5071,
StaticNumWorkgroupsAMDX = 5072,
ShaderIndexAMDX = 5073,
@@ -173,11 +165,14 @@
StencilRefLessBackAMD = 5084,
QuadDerivativesKHR = 5088,
RequireFullQuadsKHR = 5089,
+ SharesInputWithAMDX = 5102,
OutputLinesEXT = 5269,
OutputLinesNV = 5269,
OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
+ DerivativeGroupQuadsKHR = 5289,
DerivativeGroupQuadsNV = 5289,
+ DerivativeGroupLinearKHR = 5290,
DerivativeGroupLinearNV = 5290,
OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
@@ -205,6 +200,7 @@
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
+ Max = 0x7fffffff,
},
StorageClass = {
@@ -222,8 +218,8 @@
Image = 11,
StorageBuffer = 12,
TileImageEXT = 4172,
+ TileAttachmentQCOM = 4491,
NodePayloadAMDX = 5068,
- NodeOutputPayloadAMDX = 5076,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
@@ -243,6 +239,7 @@
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
+ Max = 0x7fffffff,
},
Dim = {
@@ -254,6 +251,7 @@
Buffer = 5,
SubpassData = 6,
TileImageDataEXT = 4173,
+ Max = 0x7fffffff,
},
SamplerAddressingMode = {
@@ -262,11 +260,13 @@
Clamp = 2,
Repeat = 3,
RepeatMirrored = 4,
+ Max = 0x7fffffff,
},
SamplerFilterMode = {
Nearest = 0,
Linear = 1,
+ Max = 0x7fffffff,
},
ImageFormat = {
@@ -312,6 +312,7 @@
R8ui = 39,
R64ui = 40,
R64i = 41,
+ Max = 0x7fffffff,
},
ImageChannelOrder = {
@@ -335,6 +336,7 @@
sRGBA = 17,
sBGRA = 18,
ABGR = 19,
+ Max = 0x7fffffff,
},
ImageChannelDataType = {
@@ -355,8 +357,16 @@
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
+ UnormInt10X6EXT = 17,
UnsignedIntRaw10EXT = 19,
UnsignedIntRaw12EXT = 20,
+ UnormInt2_101010EXT = 21,
+ UnsignedInt10X6EXT = 22,
+ UnsignedInt12X4EXT = 23,
+ UnsignedInt14X2EXT = 24,
+ UnormInt12X4EXT = 25,
+ UnormInt14X2EXT = 26,
+ Max = 0x7fffffff,
},
ImageOperandsShift = {
@@ -380,6 +390,7 @@
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
+ Max = 0x7fffffff,
},
ImageOperandsMask = {
@@ -417,6 +428,7 @@
AllowReassoc = 17,
AllowReassocINTEL = 17,
AllowTransform = 18,
+ Max = 0x7fffffff,
},
FPFastMathModeMask = {
@@ -438,18 +450,21 @@
RTZ = 1,
RTP = 2,
RTN = 3,
+ Max = 0x7fffffff,
},
LinkageType = {
Export = 0,
Import = 1,
LinkOnceODR = 2,
+ Max = 0x7fffffff,
},
AccessQualifier = {
ReadOnly = 0,
WriteOnly = 1,
ReadWrite = 2,
+ Max = 0x7fffffff,
},
FunctionParameterAttribute = {
@@ -462,6 +477,7 @@
NoWrite = 6,
NoReadWrite = 7,
RuntimeAlignedINTEL = 5940,
+ Max = 0x7fffffff,
},
Decoration = {
@@ -512,6 +528,7 @@
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
+ SaturatedToLargestFloat8NormalConversionEXT = 4216,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
WeightTextureQCOM = 4487,
@@ -522,6 +539,10 @@
NodeMaxPayloadsAMDX = 5020,
TrackFinishWritingAMDX = 5078,
PayloadNodeNameAMDX = 5091,
+ PayloadNodeBaseIndexAMDX = 5098,
+ PayloadNodeSparseArrayAMDX = 5099,
+ PayloadNodeArraySizeAMDX = 5100,
+ PayloadDispatchIndirectAMDX = 5105,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
@@ -608,8 +629,10 @@
HostAccessINTEL = 6188,
InitModeINTEL = 6190,
ImplementInRegisterMapINTEL = 6191,
+ ConditionalINTEL = 6247,
CacheControlLoadINTEL = 6442,
CacheControlStoreINTEL = 6443,
+ Max = 0x7fffffff,
},
BuiltIn = {
@@ -676,6 +699,9 @@
DeviceIndex = 4438,
ViewIndex = 4440,
ShadingRateKHR = 4444,
+ TileOffsetQCOM = 4492,
+ TileDimensionQCOM = 4493,
+ TileApronSizeQCOM = 4494,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
@@ -684,7 +710,7 @@
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
- CoalescedInputCountAMDX = 5021,
+ RemainingRecursionLevelsAMDX = 5021,
ShaderIndexAMDX = 5073,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
@@ -744,18 +770,27 @@
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
+ HitIsSphereNV = 5359,
+ HitIsLSSNV = 5360,
+ HitSpherePositionNV = 5361,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
+ HitLSSPositionsNV = 5396,
HitKindFrontFacingMicroTriangleNV = 5405,
HitKindBackFacingMicroTriangleNV = 5406,
+ HitSphereRadiusNV = 5420,
+ HitLSSRadiiNV = 5421,
+ ClusterIDNV = 5436,
CullMaskKHR = 6021,
+ Max = 0x7fffffff,
},
SelectionControlShift = {
Flatten = 0,
DontFlatten = 1,
+ Max = 0x7fffffff,
},
SelectionControlMask = {
@@ -784,6 +819,7 @@
NoFusionINTEL = 23,
LoopCountINTEL = 24,
MaxReinvocationDelayINTEL = 25,
+ Max = 0x7fffffff,
},
LoopControlMask = {
@@ -814,7 +850,9 @@
DontInline = 1,
Pure = 2,
Const = 3,
+ OptNoneEXT = 16,
OptNoneINTEL = 16,
+ Max = 0x7fffffff,
},
FunctionControlMask = {
@@ -823,6 +861,7 @@
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
+ OptNoneEXT = 0x00010000,
OptNoneINTEL = 0x00010000,
},
@@ -844,6 +883,7 @@
MakeVisible = 14,
MakeVisibleKHR = 14,
Volatile = 15,
+ Max = 0x7fffffff,
},
MemorySemanticsMask = {
@@ -879,6 +919,7 @@
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
+ Max = 0x7fffffff,
},
MemoryAccessMask = {
@@ -905,6 +946,7 @@
QueueFamily = 5,
QueueFamilyKHR = 5,
ShaderCallKHR = 6,
+ Max = 0x7fffffff,
},
GroupOperation = {
@@ -915,16 +957,19 @@
PartitionedReduceNV = 6,
PartitionedInclusiveScanNV = 7,
PartitionedExclusiveScanNV = 8,
+ Max = 0x7fffffff,
},
KernelEnqueueFlags = {
NoWait = 0,
WaitKernel = 1,
WaitWorkGroup = 2,
+ Max = 0x7fffffff,
},
KernelProfilingInfoShift = {
CmdExecTime = 0,
+ Max = 0x7fffffff,
},
KernelProfilingInfoMask = {
@@ -1007,6 +1052,13 @@
TileImageColorReadAccessEXT = 4166,
TileImageDepthReadAccessEXT = 4167,
TileImageStencilReadAccessEXT = 4168,
+ TensorsARM = 4174,
+ StorageTensorArrayDynamicIndexingARM = 4175,
+ StorageTensorArrayNonUniformIndexingARM = 4176,
+ GraphARM = 4191,
+ CooperativeMatrixLayoutsARM = 4201,
+ Float8EXT = 4212,
+ Float8CooperativeMatrixEXT = 4213,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -1036,11 +1088,14 @@
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayQueryKHR = 4472,
+ UntypedPointersKHR = 4473,
RayTraversalPrimitiveCullingKHR = 4478,
RayTracingKHR = 4479,
TextureSampleWeightedQCOM = 4484,
TextureBoxFilterQCOM = 4485,
TextureBlockMatchQCOM = 4486,
+ TileShadingQCOM = 4495,
+ CooperativeMatrixConversionQCOM = 4496,
TextureBlockMatch2QCOM = 4498,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
@@ -1051,6 +1106,11 @@
ShaderClockKHR = 5055,
ShaderEnqueueAMDX = 5067,
QuadControlKHR = 5087,
+ Int4TypeINTEL = 5112,
+ Int4CooperativeMatrixINTEL = 5114,
+ BFloat16TypeKHR = 5116,
+ BFloat16DotProductKHR = 5117,
+ BFloat16CooperativeMatrixKHR = 5118,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
@@ -1064,6 +1124,7 @@
MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
+ ComputeDerivativeGroupQuadsKHR = 5288,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
@@ -1101,6 +1162,7 @@
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
+ ComputeDerivativeGroupLinearKHR = 5350,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
@@ -1115,9 +1177,20 @@
ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
RayQueryPositionFetchKHR = 5391,
+ CooperativeVectorNV = 5394,
AtomicFloat16VectorNV = 5404,
RayTracingDisplacementMicromapNV = 5409,
RawAccessChainsNV = 5414,
+ RayTracingSpheresGeometryNV = 5418,
+ RayTracingLinearSweptSpheresGeometryNV = 5419,
+ CooperativeMatrixReductionsNV = 5430,
+ CooperativeMatrixConversionsNV = 5431,
+ CooperativeMatrixPerElementOperationsNV = 5432,
+ CooperativeMatrixTensorAddressingNV = 5433,
+ CooperativeMatrixBlockLoadsNV = 5434,
+ CooperativeVectorTrainingNV = 5435,
+ RayTracingClusterAccelerationStructureNV = 5437,
+ TensorAddressingNV = 5439,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
@@ -1170,28 +1243,43 @@
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
CooperativeMatrixKHR = 6022,
+ ReplicatedCompositesEXT = 6024,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
FloatControls2 = 6029,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongCompositesINTEL = 6089,
+ OptNoneEXT = 6094,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
BFloat16ConversionINTEL = 6115,
SplitBarrierINTEL = 6141,
+ ArithmeticFenceEXT = 6144,
FPGAClusterAttributesV2INTEL = 6150,
FPGAKernelAttributesv2INTEL = 6161,
+ TaskSequenceINTEL = 6162,
FPMaxErrorINTEL = 6169,
FPGALatencyControlINTEL = 6171,
FPGAArgumentInterfacesINTEL = 6174,
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
+ SubgroupBufferPrefetchINTEL = 6220,
+ Subgroup2DBlockIOINTEL = 6228,
+ Subgroup2DBlockTransformINTEL = 6229,
+ Subgroup2DBlockTransposeINTEL = 6230,
+ SubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ TernaryBitwiseFunctionINTEL = 6241,
+ SpecConditionalINTEL = 6245,
+ FunctionVariantsINTEL = 6246,
GroupUniformArithmeticKHR = 6400,
+ TensorFloat32RoundingINTEL = 6425,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
+ BindlessImagesINTEL = 6528,
+ Max = 0x7fffffff,
},
RayFlagsShift = {
@@ -1203,9 +1291,11 @@
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
+ SkipBuiltinPrimitivesNV = 8,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
ForceOpacityMicromap2StateEXT = 10,
+ Max = 0x7fffffff,
},
RayFlagsMask = {
@@ -1218,6 +1308,7 @@
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
+ SkipBuiltinPrimitivesNV = 0x00000100,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
ForceOpacityMicromap2StateEXT = 0x00000400,
@@ -1226,17 +1317,20 @@
RayQueryIntersection = {
RayQueryCandidateIntersectionKHR = 0,
RayQueryCommittedIntersectionKHR = 1,
+ Max = 0x7fffffff,
},
RayQueryCommittedIntersectionType = {
RayQueryCommittedIntersectionNoneKHR = 0,
RayQueryCommittedIntersectionTriangleKHR = 1,
RayQueryCommittedIntersectionGeneratedKHR = 2,
+ Max = 0x7fffffff,
},
RayQueryCandidateIntersectionType = {
RayQueryCandidateIntersectionTriangleKHR = 0,
RayQueryCandidateIntersectionAABBKHR = 1,
+ Max = 0x7fffffff,
},
FragmentShadingRateShift = {
@@ -1244,6 +1338,7 @@
Vertical4Pixels = 1,
Horizontal2Pixels = 2,
Horizontal4Pixels = 3,
+ Max = 0x7fffffff,
},
FragmentShadingRateMask = {
@@ -1257,11 +1352,13 @@
FPDenormMode = {
Preserve = 0,
FlushToZero = 1,
+ Max = 0x7fffffff,
},
FPOperationMode = {
IEEE = 0,
ALT = 1,
+ Max = 0x7fffffff,
},
QuantizationModes = {
@@ -1273,6 +1370,7 @@
RND_MIN_INF = 5,
RND_CONV = 6,
RND_CONV_ODD = 7,
+ Max = 0x7fffffff,
},
OverflowModes = {
@@ -1280,11 +1378,13 @@
SAT = 1,
SAT_ZERO = 2,
SAT_SYM = 3,
+ Max = 0x7fffffff,
},
PackedVectorFormat = {
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
+ Max = 0x7fffffff,
},
CooperativeMatrixOperandsShift = {
@@ -1293,6 +1393,7 @@
MatrixCSignedComponentsKHR = 2,
MatrixResultSignedComponentsKHR = 3,
SaturatingAccumulationKHR = 4,
+ Max = 0x7fffffff,
},
CooperativeMatrixOperandsMask = {
@@ -1307,17 +1408,75 @@
CooperativeMatrixLayout = {
RowMajorKHR = 0,
ColumnMajorKHR = 1,
+ RowBlockedInterleavedARM = 4202,
+ ColumnBlockedInterleavedARM = 4203,
+ Max = 0x7fffffff,
},
CooperativeMatrixUse = {
MatrixAKHR = 0,
MatrixBKHR = 1,
MatrixAccumulatorKHR = 2,
+ Max = 0x7fffffff,
+ },
+
+ CooperativeMatrixReduceShift = {
+ Row = 0,
+ Column = 1,
+ CooperativeMatrixReduce2x2 = 2,
+ Max = 0x7fffffff,
+ },
+
+ CooperativeMatrixReduceMask = {
+ MaskNone = 0,
+ Row = 0x00000001,
+ Column = 0x00000002,
+ CooperativeMatrixReduce2x2 = 0x00000004,
+ },
+
+ TensorClampMode = {
+ Undefined = 0,
+ Constant = 1,
+ ClampToEdge = 2,
+ Repeat = 3,
+ RepeatMirrored = 4,
+ Max = 0x7fffffff,
+ },
+
+ TensorAddressingOperandsShift = {
+ TensorView = 0,
+ DecodeFunc = 1,
+ Max = 0x7fffffff,
+ },
+
+ TensorAddressingOperandsMask = {
+ MaskNone = 0,
+ TensorView = 0x00000001,
+ DecodeFunc = 0x00000002,
+ },
+
+ TensorOperandsShift = {
+ NontemporalARM = 0,
+ OutOfBoundsValueARM = 1,
+ MakeElementAvailableARM = 2,
+ MakeElementVisibleARM = 3,
+ NonPrivateElementARM = 4,
+ Max = 0x7fffffff,
+ },
+
+ TensorOperandsMask = {
+ MaskNone = 0,
+ NontemporalARM = 0x00000001,
+ OutOfBoundsValueARM = 0x00000002,
+ MakeElementAvailableARM = 0x00000004,
+ MakeElementVisibleARM = 0x00000008,
+ NonPrivateElementARM = 0x00000010,
},
InitializationModeQualifier = {
InitOnDeviceReprogramINTEL = 0,
InitOnDeviceResetINTEL = 1,
+ Max = 0x7fffffff,
},
HostAccessQualifier = {
@@ -1325,6 +1484,7 @@
ReadINTEL = 1,
WriteINTEL = 2,
ReadWriteINTEL = 3,
+ Max = 0x7fffffff,
},
LoadCacheControl = {
@@ -1333,6 +1493,7 @@
StreamingINTEL = 2,
InvalidateAfterReadINTEL = 3,
ConstCachedINTEL = 4,
+ Max = 0x7fffffff,
},
StoreCacheControl = {
@@ -1340,15 +1501,54 @@
WriteThroughINTEL = 1,
WriteBackINTEL = 2,
StreamingINTEL = 3,
+ Max = 0x7fffffff,
},
NamedMaximumNumberOfRegisters = {
AutoINTEL = 0,
+ Max = 0x7fffffff,
+ },
+
+ MatrixMultiplyAccumulateOperandsShift = {
+ MatrixASignedComponentsINTEL = 0,
+ MatrixBSignedComponentsINTEL = 1,
+ MatrixCBFloat16INTEL = 2,
+ MatrixResultBFloat16INTEL = 3,
+ MatrixAPackedInt8INTEL = 4,
+ MatrixBPackedInt8INTEL = 5,
+ MatrixAPackedInt4INTEL = 6,
+ MatrixBPackedInt4INTEL = 7,
+ MatrixATF32INTEL = 8,
+ MatrixBTF32INTEL = 9,
+ MatrixAPackedFloat16INTEL = 10,
+ MatrixBPackedFloat16INTEL = 11,
+ MatrixAPackedBFloat16INTEL = 12,
+ MatrixBPackedBFloat16INTEL = 13,
+ Max = 0x7fffffff,
+ },
+
+ MatrixMultiplyAccumulateOperandsMask = {
+ MaskNone = 0,
+ MatrixASignedComponentsINTEL = 0x00000001,
+ MatrixBSignedComponentsINTEL = 0x00000002,
+ MatrixCBFloat16INTEL = 0x00000004,
+ MatrixResultBFloat16INTEL = 0x00000008,
+ MatrixAPackedInt8INTEL = 0x00000010,
+ MatrixBPackedInt8INTEL = 0x00000020,
+ MatrixAPackedInt4INTEL = 0x00000040,
+ MatrixBPackedInt4INTEL = 0x00000080,
+ MatrixATF32INTEL = 0x00000100,
+ MatrixBTF32INTEL = 0x00000200,
+ MatrixAPackedFloat16INTEL = 0x00000400,
+ MatrixBPackedFloat16INTEL = 0x00000800,
+ MatrixAPackedBFloat16INTEL = 0x00001000,
+ MatrixBPackedBFloat16INTEL = 0x00002000,
},
RawAccessChainOperandsShift = {
RobustnessPerComponentNV = 0,
RobustnessPerElementNV = 1,
+ Max = 0x7fffffff,
},
RawAccessChainOperandsMask = {
@@ -1357,6 +1557,40 @@
RobustnessPerElementNV = 0x00000002,
},
+ FPEncoding = {
+ BFloat16KHR = 0,
+ Float8E4M3EXT = 4214,
+ Float8E5M2EXT = 4215,
+ Max = 0x7fffffff,
+ },
+
+ CooperativeVectorMatrixLayout = {
+ RowMajorNV = 0,
+ ColumnMajorNV = 1,
+ InferencingOptimalNV = 2,
+ TrainingOptimalNV = 3,
+ Max = 0x7fffffff,
+ },
+
+ ComponentType = {
+ Float16NV = 0,
+ Float32NV = 1,
+ Float64NV = 2,
+ SignedInt8NV = 3,
+ SignedInt16NV = 4,
+ SignedInt32NV = 5,
+ SignedInt64NV = 6,
+ UnsignedInt8NV = 7,
+ UnsignedInt16NV = 8,
+ UnsignedInt32NV = 9,
+ UnsignedInt64NV = 10,
+ SignedInt8PackedNV = 1000491000,
+ UnsignedInt8PackedNV = 1000491001,
+ FloatE4M3NV = 1000491002,
+ FloatE5M2NV = 1000491003,
+ Max = 0x7fffffff,
+ },
+
Op = {
OpNop = 0,
OpUndef = 1,
@@ -1705,14 +1939,35 @@
OpColorAttachmentReadEXT = 4160,
OpDepthAttachmentReadEXT = 4161,
OpStencilAttachmentReadEXT = 4162,
+ OpTypeTensorARM = 4163,
+ OpTensorReadARM = 4164,
+ OpTensorWriteARM = 4165,
+ OpTensorQuerySizeARM = 4166,
+ OpGraphConstantARM = 4181,
+ OpGraphEntryPointARM = 4182,
+ OpGraphARM = 4183,
+ OpGraphInputARM = 4184,
+ OpGraphSetOutputARM = 4185,
+ OpGraphEndARM = 4186,
+ OpTypeGraphARM = 4190,
OpTerminateInvocation = 4416,
+ OpTypeUntypedPointerKHR = 4417,
+ OpUntypedVariableKHR = 4418,
+ OpUntypedAccessChainKHR = 4419,
+ OpUntypedInBoundsAccessChainKHR = 4420,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
+ OpUntypedPtrAccessChainKHR = 4423,
+ OpUntypedInBoundsPtrAccessChainKHR = 4424,
+ OpUntypedArrayLengthKHR = 4425,
+ OpUntypedPrefetchKHR = 4426,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
+ OpExtInstWithForwardRefsKHR = 4433,
+ OpUntypedGroupAsyncCopyKHR = 4434,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
@@ -1735,6 +1990,9 @@
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
+ OpConstantCompositeReplicateEXT = 4461,
+ OpSpecConstantCompositeReplicateEXT = 4462,
+ OpCompositeConstructReplicateEXT = 4463,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@@ -1746,10 +2004,14 @@
OpImageBoxFilterQCOM = 4481,
OpImageBlockMatchSSDQCOM = 4482,
OpImageBlockMatchSADQCOM = 4483,
+ OpBitCastArrayQCOM = 4497,
OpImageBlockMatchWindowSSDQCOM = 4500,
OpImageBlockMatchWindowSADQCOM = 4501,
OpImageBlockMatchGatherSSDQCOM = 4502,
OpImageBlockMatchGatherSADQCOM = 4503,
+ OpCompositeConstructCoopMatQCOM = 4540,
+ OpCompositeExtractCoopMatQCOM = 4541,
+ OpExtractSubArrayQCOM = 4542,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@@ -1761,9 +2023,14 @@
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
- OpFinalizeNodePayloadsAMDX = 5075,
+ OpAllocateNodePayloadsAMDX = 5074,
+ OpEnqueueNodePayloadsAMDX = 5075,
+ OpTypeNodePayloadArrayAMDX = 5076,
OpFinishWritingNodePayloadAMDX = 5078,
- OpInitializeNodePayloadsAMDX = 5090,
+ OpNodePayloadArrayLengthAMDX = 5090,
+ OpIsNodePayloadValidAMDX = 5101,
+ OpConstantStringAMDX = 5103,
+ OpSpecConstantStringAMDX = 5104,
OpGroupNonUniformQuadAllKHR = 5110,
OpGroupNonUniformQuadAnyKHR = 5111,
OpHitObjectRecordHitMotionNV = 5249,
@@ -1800,12 +2067,20 @@
OpReorderThreadWithHintNV = 5280,
OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpTypeCooperativeVectorNV = 5288,
+ OpCooperativeVectorMatrixMulNV = 5289,
+ OpCooperativeVectorOuterProductAccumulateNV = 5290,
+ OpCooperativeVectorReduceSumAccumulateNV = 5291,
+ OpCooperativeVectorMatrixMulAddNV = 5292,
+ OpCooperativeMatrixConvertNV = 5293,
OpEmitMeshTasksEXT = 5294,
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
+ OpCooperativeVectorLoadNV = 5302,
+ OpCooperativeVectorStoreNV = 5303,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
@@ -1817,6 +2092,8 @@
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
+ OpRayQueryGetClusterIdNV = 5345,
+ OpHitObjectGetClusterIdNV = 5346,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
@@ -1824,9 +2101,26 @@
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
+ OpCooperativeMatrixReduceNV = 5366,
+ OpCooperativeMatrixLoadTensorNV = 5367,
+ OpCooperativeMatrixStoreTensorNV = 5368,
+ OpCooperativeMatrixPerElementOpNV = 5369,
+ OpTypeTensorLayoutNV = 5370,
+ OpTypeTensorViewNV = 5371,
+ OpCreateTensorLayoutNV = 5372,
+ OpTensorLayoutSetDimensionNV = 5373,
+ OpTensorLayoutSetStrideNV = 5374,
+ OpTensorLayoutSliceNV = 5375,
+ OpTensorLayoutSetClampValueNV = 5376,
+ OpCreateTensorViewNV = 5377,
+ OpTensorViewSetDimensionNV = 5378,
+ OpTensorViewSetStrideNV = 5379,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
+ OpTensorViewSetClipNV = 5382,
+ OpTensorLayoutSetBlockSizeNV = 5384,
+ OpCooperativeMatrixTransposeNV = 5390,
OpConvertUToImageNV = 5391,
OpConvertUToSamplerNV = 5392,
OpConvertImageToUNV = 5393,
@@ -1835,6 +2129,19 @@
OpConvertSampledImageToUNV = 5396,
OpSamplerImageAddressingModeNV = 5397,
OpRawAccessChainNV = 5398,
+ OpRayQueryGetIntersectionSpherePositionNV = 5427,
+ OpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ OpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ OpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ OpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ OpHitObjectGetSpherePositionNV = 5432,
+ OpHitObjectGetSphereRadiusNV = 5433,
+ OpHitObjectGetLSSPositionsNV = 5434,
+ OpHitObjectGetLSSRadiiNV = 5435,
+ OpHitObjectIsSphereHitNV = 5436,
+ OpHitObjectIsLSSHitNV = 5437,
+ OpRayQueryIsSphereHitNV = 5438,
+ OpRayQueryIsLSSHitNV = 5439,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -2081,6 +2388,27 @@
OpConvertBF16ToFINTEL = 6117,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
+ OpArithmeticFenceEXT = 6145,
+ OpTaskSequenceCreateINTEL = 6163,
+ OpTaskSequenceAsyncINTEL = 6164,
+ OpTaskSequenceGetINTEL = 6165,
+ OpTaskSequenceReleaseINTEL = 6166,
+ OpTypeTaskSequenceINTEL = 6199,
+ OpSubgroupBlockPrefetchINTEL = 6221,
+ OpSubgroup2DBlockLoadINTEL = 6231,
+ OpSubgroup2DBlockLoadTransformINTEL = 6232,
+ OpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ OpSubgroup2DBlockPrefetchINTEL = 6234,
+ OpSubgroup2DBlockStoreINTEL = 6235,
+ OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ OpBitwiseFunctionINTEL = 6242,
+ OpConditionalExtensionINTEL = 6248,
+ OpConditionalEntryPointINTEL = 6249,
+ OpConditionalCapabilityINTEL = 6250,
+ OpSpecConstantTargetINTEL = 6251,
+ OpSpecConstantArchitectureINTEL = 6252,
+ OpSpecConstantCapabilitiesINTEL = 6253,
+ OpConditionalCopyObjectINTEL = 6254,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
@@ -2089,8 +2417,13 @@
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
+ OpRoundFToTF32INTEL = 6426,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
+ OpConvertHandleToImageINTEL = 6529,
+ OpConvertHandleToSamplerINTEL = 6530,
+ OpConvertHandleToSampledImageINTEL = 6531,
+ Max = 0x7fffffff,
},
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.py b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.py
index 4b011cf..fc1aa98 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spirv.py
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spirv.py
@@ -1,26 +1,10 @@
-# Copyright (c) 2014-2024 The Khronos Group Inc.
+# Copyright: 2014-2024 The Khronos Group Inc.
+# License: MIT
#
-# 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.
+# 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/
# This header is automatically generated by the same tool that creates
# the Binary Section of the SPIR-V specification.
@@ -65,6 +49,7 @@
'WGSL' : 10,
'Slang' : 11,
'Zig' : 12,
+ 'Rust' : 13,
},
'ExecutionModel' : {
@@ -158,9 +143,12 @@
'SignedZeroInfNanPreserve' : 4461,
'RoundingModeRTE' : 4462,
'RoundingModeRTZ' : 4463,
+ 'NonCoherentTileAttachmentReadQCOM' : 4489,
+ 'TileShadingRateQCOM' : 4490,
'EarlyAndLateFragmentTestsAMD' : 5017,
'StencilRefReplacingEXT' : 5027,
'CoalescingAMDX' : 5069,
+ 'IsApiEntryAMDX' : 5070,
'MaxNodeRecursionAMDX' : 5071,
'StaticNumWorkgroupsAMDX' : 5072,
'ShaderIndexAMDX' : 5073,
@@ -173,11 +161,14 @@
'StencilRefLessBackAMD' : 5084,
'QuadDerivativesKHR' : 5088,
'RequireFullQuadsKHR' : 5089,
+ 'SharesInputWithAMDX' : 5102,
'OutputLinesEXT' : 5269,
'OutputLinesNV' : 5269,
'OutputPrimitivesEXT' : 5270,
'OutputPrimitivesNV' : 5270,
+ 'DerivativeGroupQuadsKHR' : 5289,
'DerivativeGroupQuadsNV' : 5289,
+ 'DerivativeGroupLinearKHR' : 5290,
'DerivativeGroupLinearNV' : 5290,
'OutputTrianglesEXT' : 5298,
'OutputTrianglesNV' : 5298,
@@ -222,8 +213,8 @@
'Image' : 11,
'StorageBuffer' : 12,
'TileImageEXT' : 4172,
+ 'TileAttachmentQCOM' : 4491,
'NodePayloadAMDX' : 5068,
- 'NodeOutputPayloadAMDX' : 5076,
'CallableDataKHR' : 5328,
'CallableDataNV' : 5328,
'IncomingCallableDataKHR' : 5329,
@@ -355,8 +346,15 @@
'Float' : 14,
'UnormInt24' : 15,
'UnormInt101010_2' : 16,
+ 'UnormInt10X6EXT' : 17,
'UnsignedIntRaw10EXT' : 19,
'UnsignedIntRaw12EXT' : 20,
+ 'UnormInt2_101010EXT' : 21,
+ 'UnsignedInt10X6EXT' : 22,
+ 'UnsignedInt12X4EXT' : 23,
+ 'UnsignedInt14X2EXT' : 24,
+ 'UnormInt12X4EXT' : 25,
+ 'UnormInt14X2EXT' : 26,
},
'ImageOperandsShift' : {
@@ -512,6 +510,7 @@
'MaxByteOffset' : 45,
'AlignmentId' : 46,
'MaxByteOffsetId' : 47,
+ 'SaturatedToLargestFloat8NormalConversionEXT' : 4216,
'NoSignedWrap' : 4469,
'NoUnsignedWrap' : 4470,
'WeightTextureQCOM' : 4487,
@@ -522,6 +521,10 @@
'NodeMaxPayloadsAMDX' : 5020,
'TrackFinishWritingAMDX' : 5078,
'PayloadNodeNameAMDX' : 5091,
+ 'PayloadNodeBaseIndexAMDX' : 5098,
+ 'PayloadNodeSparseArrayAMDX' : 5099,
+ 'PayloadNodeArraySizeAMDX' : 5100,
+ 'PayloadDispatchIndirectAMDX' : 5105,
'OverrideCoverageNV' : 5248,
'PassthroughNV' : 5250,
'ViewportRelativeNV' : 5252,
@@ -608,6 +611,7 @@
'HostAccessINTEL' : 6188,
'InitModeINTEL' : 6190,
'ImplementInRegisterMapINTEL' : 6191,
+ 'ConditionalINTEL' : 6247,
'CacheControlLoadINTEL' : 6442,
'CacheControlStoreINTEL' : 6443,
},
@@ -676,6 +680,9 @@
'DeviceIndex' : 4438,
'ViewIndex' : 4440,
'ShadingRateKHR' : 4444,
+ 'TileOffsetQCOM' : 4492,
+ 'TileDimensionQCOM' : 4493,
+ 'TileApronSizeQCOM' : 4494,
'BaryCoordNoPerspAMD' : 4992,
'BaryCoordNoPerspCentroidAMD' : 4993,
'BaryCoordNoPerspSampleAMD' : 4994,
@@ -684,7 +691,7 @@
'BaryCoordSmoothSampleAMD' : 4997,
'BaryCoordPullModelAMD' : 4998,
'FragStencilRefEXT' : 5014,
- 'CoalescedInputCountAMDX' : 5021,
+ 'RemainingRecursionLevelsAMDX' : 5021,
'ShaderIndexAMDX' : 5073,
'ViewportMaskNV' : 5253,
'SecondaryPositionNV' : 5257,
@@ -744,12 +751,19 @@
'IncomingRayFlagsKHR' : 5351,
'IncomingRayFlagsNV' : 5351,
'RayGeometryIndexKHR' : 5352,
+ 'HitIsSphereNV' : 5359,
+ 'HitIsLSSNV' : 5360,
+ 'HitSpherePositionNV' : 5361,
'WarpsPerSMNV' : 5374,
'SMCountNV' : 5375,
'WarpIDNV' : 5376,
'SMIDNV' : 5377,
+ 'HitLSSPositionsNV' : 5396,
'HitKindFrontFacingMicroTriangleNV' : 5405,
'HitKindBackFacingMicroTriangleNV' : 5406,
+ 'HitSphereRadiusNV' : 5420,
+ 'HitLSSRadiiNV' : 5421,
+ 'ClusterIDNV' : 5436,
'CullMaskKHR' : 6021,
},
@@ -814,6 +828,7 @@
'DontInline' : 1,
'Pure' : 2,
'Const' : 3,
+ 'OptNoneEXT' : 16,
'OptNoneINTEL' : 16,
},
@@ -823,6 +838,7 @@
'DontInline' : 0x00000002,
'Pure' : 0x00000004,
'Const' : 0x00000008,
+ 'OptNoneEXT' : 0x00010000,
'OptNoneINTEL' : 0x00010000,
},
@@ -1007,6 +1023,13 @@
'TileImageColorReadAccessEXT' : 4166,
'TileImageDepthReadAccessEXT' : 4167,
'TileImageStencilReadAccessEXT' : 4168,
+ 'TensorsARM' : 4174,
+ 'StorageTensorArrayDynamicIndexingARM' : 4175,
+ 'StorageTensorArrayNonUniformIndexingARM' : 4176,
+ 'GraphARM' : 4191,
+ 'CooperativeMatrixLayoutsARM' : 4201,
+ 'Float8EXT' : 4212,
+ 'Float8CooperativeMatrixEXT' : 4213,
'FragmentShadingRateKHR' : 4422,
'SubgroupBallotKHR' : 4423,
'DrawParameters' : 4427,
@@ -1036,11 +1059,14 @@
'RoundingModeRTZ' : 4468,
'RayQueryProvisionalKHR' : 4471,
'RayQueryKHR' : 4472,
+ 'UntypedPointersKHR' : 4473,
'RayTraversalPrimitiveCullingKHR' : 4478,
'RayTracingKHR' : 4479,
'TextureSampleWeightedQCOM' : 4484,
'TextureBoxFilterQCOM' : 4485,
'TextureBlockMatchQCOM' : 4486,
+ 'TileShadingQCOM' : 4495,
+ 'CooperativeMatrixConversionQCOM' : 4496,
'TextureBlockMatch2QCOM' : 4498,
'Float16ImageAMD' : 5008,
'ImageGatherBiasLodAMD' : 5009,
@@ -1051,6 +1077,11 @@
'ShaderClockKHR' : 5055,
'ShaderEnqueueAMDX' : 5067,
'QuadControlKHR' : 5087,
+ 'Int4TypeINTEL' : 5112,
+ 'Int4CooperativeMatrixINTEL' : 5114,
+ 'BFloat16TypeKHR' : 5116,
+ 'BFloat16DotProductKHR' : 5117,
+ 'BFloat16CooperativeMatrixKHR' : 5118,
'SampleMaskOverrideCoverageNV' : 5249,
'GeometryShaderPassthroughNV' : 5251,
'ShaderViewportIndexLayerEXT' : 5254,
@@ -1064,6 +1095,7 @@
'MeshShadingEXT' : 5283,
'FragmentBarycentricKHR' : 5284,
'FragmentBarycentricNV' : 5284,
+ 'ComputeDerivativeGroupQuadsKHR' : 5288,
'ComputeDerivativeGroupQuadsNV' : 5288,
'FragmentDensityEXT' : 5291,
'ShadingRateNV' : 5291,
@@ -1101,6 +1133,7 @@
'VulkanMemoryModelDeviceScopeKHR' : 5346,
'PhysicalStorageBufferAddresses' : 5347,
'PhysicalStorageBufferAddressesEXT' : 5347,
+ 'ComputeDerivativeGroupLinearKHR' : 5350,
'ComputeDerivativeGroupLinearNV' : 5350,
'RayTracingProvisionalKHR' : 5353,
'CooperativeMatrixNV' : 5357,
@@ -1115,9 +1148,20 @@
'ShaderInvocationReorderNV' : 5383,
'BindlessTextureNV' : 5390,
'RayQueryPositionFetchKHR' : 5391,
+ 'CooperativeVectorNV' : 5394,
'AtomicFloat16VectorNV' : 5404,
'RayTracingDisplacementMicromapNV' : 5409,
'RawAccessChainsNV' : 5414,
+ 'RayTracingSpheresGeometryNV' : 5418,
+ 'RayTracingLinearSweptSpheresGeometryNV' : 5419,
+ 'CooperativeMatrixReductionsNV' : 5430,
+ 'CooperativeMatrixConversionsNV' : 5431,
+ 'CooperativeMatrixPerElementOperationsNV' : 5432,
+ 'CooperativeMatrixTensorAddressingNV' : 5433,
+ 'CooperativeMatrixBlockLoadsNV' : 5434,
+ 'CooperativeVectorTrainingNV' : 5435,
+ 'RayTracingClusterAccelerationStructureNV' : 5437,
+ 'TensorAddressingNV' : 5439,
'SubgroupShuffleINTEL' : 5568,
'SubgroupBufferBlockIOINTEL' : 5569,
'SubgroupImageBlockIOINTEL' : 5570,
@@ -1170,28 +1214,42 @@
'DotProductKHR' : 6019,
'RayCullMaskKHR' : 6020,
'CooperativeMatrixKHR' : 6022,
+ 'ReplicatedCompositesEXT' : 6024,
'BitInstructions' : 6025,
'GroupNonUniformRotateKHR' : 6026,
'FloatControls2' : 6029,
'AtomicFloat32AddEXT' : 6033,
'AtomicFloat64AddEXT' : 6034,
'LongCompositesINTEL' : 6089,
+ 'OptNoneEXT' : 6094,
'OptNoneINTEL' : 6094,
'AtomicFloat16AddEXT' : 6095,
'DebugInfoModuleINTEL' : 6114,
'BFloat16ConversionINTEL' : 6115,
'SplitBarrierINTEL' : 6141,
+ 'ArithmeticFenceEXT' : 6144,
'FPGAClusterAttributesV2INTEL' : 6150,
'FPGAKernelAttributesv2INTEL' : 6161,
+ 'TaskSequenceINTEL' : 6162,
'FPMaxErrorINTEL' : 6169,
'FPGALatencyControlINTEL' : 6171,
'FPGAArgumentInterfacesINTEL' : 6174,
'GlobalVariableHostAccessINTEL' : 6187,
'GlobalVariableFPGADecorationsINTEL' : 6189,
+ 'SubgroupBufferPrefetchINTEL' : 6220,
+ 'Subgroup2DBlockIOINTEL' : 6228,
+ 'Subgroup2DBlockTransformINTEL' : 6229,
+ 'Subgroup2DBlockTransposeINTEL' : 6230,
+ 'SubgroupMatrixMultiplyAccumulateINTEL' : 6236,
+ 'TernaryBitwiseFunctionINTEL' : 6241,
+ 'SpecConditionalINTEL' : 6245,
+ 'FunctionVariantsINTEL' : 6246,
'GroupUniformArithmeticKHR' : 6400,
+ 'TensorFloat32RoundingINTEL' : 6425,
'MaskedGatherScatterINTEL' : 6427,
'CacheControlsINTEL' : 6441,
'RegisterLimitsINTEL' : 6460,
+ 'BindlessImagesINTEL' : 6528,
},
'RayFlagsShift' : {
@@ -1203,6 +1261,7 @@
'CullFrontFacingTrianglesKHR' : 5,
'CullOpaqueKHR' : 6,
'CullNoOpaqueKHR' : 7,
+ 'SkipBuiltinPrimitivesNV' : 8,
'SkipTrianglesKHR' : 8,
'SkipAABBsKHR' : 9,
'ForceOpacityMicromap2StateEXT' : 10,
@@ -1218,6 +1277,7 @@
'CullFrontFacingTrianglesKHR' : 0x00000020,
'CullOpaqueKHR' : 0x00000040,
'CullNoOpaqueKHR' : 0x00000080,
+ 'SkipBuiltinPrimitivesNV' : 0x00000100,
'SkipTrianglesKHR' : 0x00000100,
'SkipAABBsKHR' : 0x00000200,
'ForceOpacityMicromap2StateEXT' : 0x00000400,
@@ -1307,6 +1367,8 @@
'CooperativeMatrixLayout' : {
'RowMajorKHR' : 0,
'ColumnMajorKHR' : 1,
+ 'RowBlockedInterleavedARM' : 4202,
+ 'ColumnBlockedInterleavedARM' : 4203,
},
'CooperativeMatrixUse' : {
@@ -1315,6 +1377,55 @@
'MatrixAccumulatorKHR' : 2,
},
+ 'CooperativeMatrixReduceShift' : {
+ 'Row' : 0,
+ 'Column' : 1,
+ 'CooperativeMatrixReduce2x2' : 2,
+ },
+
+ 'CooperativeMatrixReduceMask' : {
+ 'MaskNone' : 0,
+ 'Row' : 0x00000001,
+ 'Column' : 0x00000002,
+ 'CooperativeMatrixReduce2x2' : 0x00000004,
+ },
+
+ 'TensorClampMode' : {
+ 'Undefined' : 0,
+ 'Constant' : 1,
+ 'ClampToEdge' : 2,
+ 'Repeat' : 3,
+ 'RepeatMirrored' : 4,
+ },
+
+ 'TensorAddressingOperandsShift' : {
+ 'TensorView' : 0,
+ 'DecodeFunc' : 1,
+ },
+
+ 'TensorAddressingOperandsMask' : {
+ 'MaskNone' : 0,
+ 'TensorView' : 0x00000001,
+ 'DecodeFunc' : 0x00000002,
+ },
+
+ 'TensorOperandsShift' : {
+ 'NontemporalARM' : 0,
+ 'OutOfBoundsValueARM' : 1,
+ 'MakeElementAvailableARM' : 2,
+ 'MakeElementVisibleARM' : 3,
+ 'NonPrivateElementARM' : 4,
+ },
+
+ 'TensorOperandsMask' : {
+ 'MaskNone' : 0,
+ 'NontemporalARM' : 0x00000001,
+ 'OutOfBoundsValueARM' : 0x00000002,
+ 'MakeElementAvailableARM' : 0x00000004,
+ 'MakeElementVisibleARM' : 0x00000008,
+ 'NonPrivateElementARM' : 0x00000010,
+ },
+
'InitializationModeQualifier' : {
'InitOnDeviceReprogramINTEL' : 0,
'InitOnDeviceResetINTEL' : 1,
@@ -1346,6 +1457,41 @@
'AutoINTEL' : 0,
},
+ 'MatrixMultiplyAccumulateOperandsShift' : {
+ 'MatrixASignedComponentsINTEL' : 0,
+ 'MatrixBSignedComponentsINTEL' : 1,
+ 'MatrixCBFloat16INTEL' : 2,
+ 'MatrixResultBFloat16INTEL' : 3,
+ 'MatrixAPackedInt8INTEL' : 4,
+ 'MatrixBPackedInt8INTEL' : 5,
+ 'MatrixAPackedInt4INTEL' : 6,
+ 'MatrixBPackedInt4INTEL' : 7,
+ 'MatrixATF32INTEL' : 8,
+ 'MatrixBTF32INTEL' : 9,
+ 'MatrixAPackedFloat16INTEL' : 10,
+ 'MatrixBPackedFloat16INTEL' : 11,
+ 'MatrixAPackedBFloat16INTEL' : 12,
+ 'MatrixBPackedBFloat16INTEL' : 13,
+ },
+
+ 'MatrixMultiplyAccumulateOperandsMask' : {
+ 'MaskNone' : 0,
+ 'MatrixASignedComponentsINTEL' : 0x00000001,
+ 'MatrixBSignedComponentsINTEL' : 0x00000002,
+ 'MatrixCBFloat16INTEL' : 0x00000004,
+ 'MatrixResultBFloat16INTEL' : 0x00000008,
+ 'MatrixAPackedInt8INTEL' : 0x00000010,
+ 'MatrixBPackedInt8INTEL' : 0x00000020,
+ 'MatrixAPackedInt4INTEL' : 0x00000040,
+ 'MatrixBPackedInt4INTEL' : 0x00000080,
+ 'MatrixATF32INTEL' : 0x00000100,
+ 'MatrixBTF32INTEL' : 0x00000200,
+ 'MatrixAPackedFloat16INTEL' : 0x00000400,
+ 'MatrixBPackedFloat16INTEL' : 0x00000800,
+ 'MatrixAPackedBFloat16INTEL' : 0x00001000,
+ 'MatrixBPackedBFloat16INTEL' : 0x00002000,
+ },
+
'RawAccessChainOperandsShift' : {
'RobustnessPerComponentNV' : 0,
'RobustnessPerElementNV' : 1,
@@ -1357,6 +1503,37 @@
'RobustnessPerElementNV' : 0x00000002,
},
+ 'FPEncoding' : {
+ 'BFloat16KHR' : 0,
+ 'Float8E4M3EXT' : 4214,
+ 'Float8E5M2EXT' : 4215,
+ },
+
+ 'CooperativeVectorMatrixLayout' : {
+ 'RowMajorNV' : 0,
+ 'ColumnMajorNV' : 1,
+ 'InferencingOptimalNV' : 2,
+ 'TrainingOptimalNV' : 3,
+ },
+
+ 'ComponentType' : {
+ 'Float16NV' : 0,
+ 'Float32NV' : 1,
+ 'Float64NV' : 2,
+ 'SignedInt8NV' : 3,
+ 'SignedInt16NV' : 4,
+ 'SignedInt32NV' : 5,
+ 'SignedInt64NV' : 6,
+ 'UnsignedInt8NV' : 7,
+ 'UnsignedInt16NV' : 8,
+ 'UnsignedInt32NV' : 9,
+ 'UnsignedInt64NV' : 10,
+ 'SignedInt8PackedNV' : 1000491000,
+ 'UnsignedInt8PackedNV' : 1000491001,
+ 'FloatE4M3NV' : 1000491002,
+ 'FloatE5M2NV' : 1000491003,
+ },
+
'Op' : {
'OpNop' : 0,
'OpUndef' : 1,
@@ -1705,14 +1882,35 @@
'OpColorAttachmentReadEXT' : 4160,
'OpDepthAttachmentReadEXT' : 4161,
'OpStencilAttachmentReadEXT' : 4162,
+ 'OpTypeTensorARM' : 4163,
+ 'OpTensorReadARM' : 4164,
+ 'OpTensorWriteARM' : 4165,
+ 'OpTensorQuerySizeARM' : 4166,
+ 'OpGraphConstantARM' : 4181,
+ 'OpGraphEntryPointARM' : 4182,
+ 'OpGraphARM' : 4183,
+ 'OpGraphInputARM' : 4184,
+ 'OpGraphSetOutputARM' : 4185,
+ 'OpGraphEndARM' : 4186,
+ 'OpTypeGraphARM' : 4190,
'OpTerminateInvocation' : 4416,
+ 'OpTypeUntypedPointerKHR' : 4417,
+ 'OpUntypedVariableKHR' : 4418,
+ 'OpUntypedAccessChainKHR' : 4419,
+ 'OpUntypedInBoundsAccessChainKHR' : 4420,
'OpSubgroupBallotKHR' : 4421,
'OpSubgroupFirstInvocationKHR' : 4422,
+ 'OpUntypedPtrAccessChainKHR' : 4423,
+ 'OpUntypedInBoundsPtrAccessChainKHR' : 4424,
+ 'OpUntypedArrayLengthKHR' : 4425,
+ 'OpUntypedPrefetchKHR' : 4426,
'OpSubgroupAllKHR' : 4428,
'OpSubgroupAnyKHR' : 4429,
'OpSubgroupAllEqualKHR' : 4430,
'OpGroupNonUniformRotateKHR' : 4431,
'OpSubgroupReadInvocationKHR' : 4432,
+ 'OpExtInstWithForwardRefsKHR' : 4433,
+ 'OpUntypedGroupAsyncCopyKHR' : 4434,
'OpTraceRayKHR' : 4445,
'OpExecuteCallableKHR' : 4446,
'OpConvertUToAccelerationStructureKHR' : 4447,
@@ -1735,6 +1933,9 @@
'OpCooperativeMatrixStoreKHR' : 4458,
'OpCooperativeMatrixMulAddKHR' : 4459,
'OpCooperativeMatrixLengthKHR' : 4460,
+ 'OpConstantCompositeReplicateEXT' : 4461,
+ 'OpSpecConstantCompositeReplicateEXT' : 4462,
+ 'OpCompositeConstructReplicateEXT' : 4463,
'OpTypeRayQueryKHR' : 4472,
'OpRayQueryInitializeKHR' : 4473,
'OpRayQueryTerminateKHR' : 4474,
@@ -1746,10 +1947,14 @@
'OpImageBoxFilterQCOM' : 4481,
'OpImageBlockMatchSSDQCOM' : 4482,
'OpImageBlockMatchSADQCOM' : 4483,
+ 'OpBitCastArrayQCOM' : 4497,
'OpImageBlockMatchWindowSSDQCOM' : 4500,
'OpImageBlockMatchWindowSADQCOM' : 4501,
'OpImageBlockMatchGatherSSDQCOM' : 4502,
'OpImageBlockMatchGatherSADQCOM' : 4503,
+ 'OpCompositeConstructCoopMatQCOM' : 4540,
+ 'OpCompositeExtractCoopMatQCOM' : 4541,
+ 'OpExtractSubArrayQCOM' : 4542,
'OpGroupIAddNonUniformAMD' : 5000,
'OpGroupFAddNonUniformAMD' : 5001,
'OpGroupFMinNonUniformAMD' : 5002,
@@ -1761,9 +1966,14 @@
'OpFragmentMaskFetchAMD' : 5011,
'OpFragmentFetchAMD' : 5012,
'OpReadClockKHR' : 5056,
- 'OpFinalizeNodePayloadsAMDX' : 5075,
+ 'OpAllocateNodePayloadsAMDX' : 5074,
+ 'OpEnqueueNodePayloadsAMDX' : 5075,
+ 'OpTypeNodePayloadArrayAMDX' : 5076,
'OpFinishWritingNodePayloadAMDX' : 5078,
- 'OpInitializeNodePayloadsAMDX' : 5090,
+ 'OpNodePayloadArrayLengthAMDX' : 5090,
+ 'OpIsNodePayloadValidAMDX' : 5101,
+ 'OpConstantStringAMDX' : 5103,
+ 'OpSpecConstantStringAMDX' : 5104,
'OpGroupNonUniformQuadAllKHR' : 5110,
'OpGroupNonUniformQuadAnyKHR' : 5111,
'OpHitObjectRecordHitMotionNV' : 5249,
@@ -1800,12 +2010,20 @@
'OpReorderThreadWithHintNV' : 5280,
'OpTypeHitObjectNV' : 5281,
'OpImageSampleFootprintNV' : 5283,
+ 'OpTypeCooperativeVectorNV' : 5288,
+ 'OpCooperativeVectorMatrixMulNV' : 5289,
+ 'OpCooperativeVectorOuterProductAccumulateNV' : 5290,
+ 'OpCooperativeVectorReduceSumAccumulateNV' : 5291,
+ 'OpCooperativeVectorMatrixMulAddNV' : 5292,
+ 'OpCooperativeMatrixConvertNV' : 5293,
'OpEmitMeshTasksEXT' : 5294,
'OpSetMeshOutputsEXT' : 5295,
'OpGroupNonUniformPartitionNV' : 5296,
'OpWritePackedPrimitiveIndices4x8NV' : 5299,
'OpFetchMicroTriangleVertexPositionNV' : 5300,
'OpFetchMicroTriangleVertexBarycentricNV' : 5301,
+ 'OpCooperativeVectorLoadNV' : 5302,
+ 'OpCooperativeVectorStoreNV' : 5303,
'OpReportIntersectionKHR' : 5334,
'OpReportIntersectionNV' : 5334,
'OpIgnoreIntersectionNV' : 5335,
@@ -1817,6 +2035,8 @@
'OpTypeAccelerationStructureKHR' : 5341,
'OpTypeAccelerationStructureNV' : 5341,
'OpExecuteCallableNV' : 5344,
+ 'OpRayQueryGetClusterIdNV' : 5345,
+ 'OpHitObjectGetClusterIdNV' : 5346,
'OpTypeCooperativeMatrixNV' : 5358,
'OpCooperativeMatrixLoadNV' : 5359,
'OpCooperativeMatrixStoreNV' : 5360,
@@ -1824,9 +2044,26 @@
'OpCooperativeMatrixLengthNV' : 5362,
'OpBeginInvocationInterlockEXT' : 5364,
'OpEndInvocationInterlockEXT' : 5365,
+ 'OpCooperativeMatrixReduceNV' : 5366,
+ 'OpCooperativeMatrixLoadTensorNV' : 5367,
+ 'OpCooperativeMatrixStoreTensorNV' : 5368,
+ 'OpCooperativeMatrixPerElementOpNV' : 5369,
+ 'OpTypeTensorLayoutNV' : 5370,
+ 'OpTypeTensorViewNV' : 5371,
+ 'OpCreateTensorLayoutNV' : 5372,
+ 'OpTensorLayoutSetDimensionNV' : 5373,
+ 'OpTensorLayoutSetStrideNV' : 5374,
+ 'OpTensorLayoutSliceNV' : 5375,
+ 'OpTensorLayoutSetClampValueNV' : 5376,
+ 'OpCreateTensorViewNV' : 5377,
+ 'OpTensorViewSetDimensionNV' : 5378,
+ 'OpTensorViewSetStrideNV' : 5379,
'OpDemoteToHelperInvocation' : 5380,
'OpDemoteToHelperInvocationEXT' : 5380,
'OpIsHelperInvocationEXT' : 5381,
+ 'OpTensorViewSetClipNV' : 5382,
+ 'OpTensorLayoutSetBlockSizeNV' : 5384,
+ 'OpCooperativeMatrixTransposeNV' : 5390,
'OpConvertUToImageNV' : 5391,
'OpConvertUToSamplerNV' : 5392,
'OpConvertImageToUNV' : 5393,
@@ -1835,6 +2072,19 @@
'OpConvertSampledImageToUNV' : 5396,
'OpSamplerImageAddressingModeNV' : 5397,
'OpRawAccessChainNV' : 5398,
+ 'OpRayQueryGetIntersectionSpherePositionNV' : 5427,
+ 'OpRayQueryGetIntersectionSphereRadiusNV' : 5428,
+ 'OpRayQueryGetIntersectionLSSPositionsNV' : 5429,
+ 'OpRayQueryGetIntersectionLSSRadiiNV' : 5430,
+ 'OpRayQueryGetIntersectionLSSHitValueNV' : 5431,
+ 'OpHitObjectGetSpherePositionNV' : 5432,
+ 'OpHitObjectGetSphereRadiusNV' : 5433,
+ 'OpHitObjectGetLSSPositionsNV' : 5434,
+ 'OpHitObjectGetLSSRadiiNV' : 5435,
+ 'OpHitObjectIsSphereHitNV' : 5436,
+ 'OpHitObjectIsLSSHitNV' : 5437,
+ 'OpRayQueryIsSphereHitNV' : 5438,
+ 'OpRayQueryIsLSSHitNV' : 5439,
'OpSubgroupShuffleINTEL' : 5571,
'OpSubgroupShuffleDownINTEL' : 5572,
'OpSubgroupShuffleUpINTEL' : 5573,
@@ -2081,6 +2331,27 @@
'OpConvertBF16ToFINTEL' : 6117,
'OpControlBarrierArriveINTEL' : 6142,
'OpControlBarrierWaitINTEL' : 6143,
+ 'OpArithmeticFenceEXT' : 6145,
+ 'OpTaskSequenceCreateINTEL' : 6163,
+ 'OpTaskSequenceAsyncINTEL' : 6164,
+ 'OpTaskSequenceGetINTEL' : 6165,
+ 'OpTaskSequenceReleaseINTEL' : 6166,
+ 'OpTypeTaskSequenceINTEL' : 6199,
+ 'OpSubgroupBlockPrefetchINTEL' : 6221,
+ 'OpSubgroup2DBlockLoadINTEL' : 6231,
+ 'OpSubgroup2DBlockLoadTransformINTEL' : 6232,
+ 'OpSubgroup2DBlockLoadTransposeINTEL' : 6233,
+ 'OpSubgroup2DBlockPrefetchINTEL' : 6234,
+ 'OpSubgroup2DBlockStoreINTEL' : 6235,
+ 'OpSubgroupMatrixMultiplyAccumulateINTEL' : 6237,
+ 'OpBitwiseFunctionINTEL' : 6242,
+ 'OpConditionalExtensionINTEL' : 6248,
+ 'OpConditionalEntryPointINTEL' : 6249,
+ 'OpConditionalCapabilityINTEL' : 6250,
+ 'OpSpecConstantTargetINTEL' : 6251,
+ 'OpSpecConstantArchitectureINTEL' : 6252,
+ 'OpSpecConstantCapabilitiesINTEL' : 6253,
+ 'OpConditionalCopyObjectINTEL' : 6254,
'OpGroupIMulKHR' : 6401,
'OpGroupFMulKHR' : 6402,
'OpGroupBitwiseAndKHR' : 6403,
@@ -2089,8 +2360,12 @@
'OpGroupLogicalAndKHR' : 6406,
'OpGroupLogicalOrKHR' : 6407,
'OpGroupLogicalXorKHR' : 6408,
+ 'OpRoundFToTF32INTEL' : 6426,
'OpMaskedGatherINTEL' : 6428,
'OpMaskedScatterINTEL' : 6429,
+ 'OpConvertHandleToImageINTEL' : 6529,
+ 'OpConvertHandleToSamplerINTEL' : 6530,
+ 'OpConvertHandleToSampledImageINTEL' : 6531,
},
}
diff --git a/third_party/SPIRV-Headers/include/spirv/unified1/spv.d b/third_party/SPIRV-Headers/include/spirv/unified1/spv.d
index 64c115e..1feb5e0 100644
--- a/third_party/SPIRV-Headers/include/spirv/unified1/spv.d
+++ b/third_party/SPIRV-Headers/include/spirv/unified1/spv.d
@@ -1,27 +1,11 @@
/+
- + Copyright (c) 2014-2024 The Khronos Group Inc.
+ + Copyright: 2014-2024 The Khronos Group Inc.
+ + License: MIT
+
- + 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.
+ + 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/
+/
/+
@@ -73,6 +57,8 @@
WGSL = 10,
Slang = 11,
Zig = 12,
+ Rust = 13,
+ Max = 0x7fffffff,
}
enum ExecutionModel : uint
@@ -100,6 +86,7 @@
CallableNV = 5318,
TaskEXT = 5364,
MeshEXT = 5365,
+ Max = 0x7fffffff,
}
enum AddressingModel : uint
@@ -109,6 +96,7 @@
Physical64 = 2,
PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348,
+ Max = 0x7fffffff,
}
enum MemoryModel : uint
@@ -118,6 +106,7 @@
OpenCL = 2,
Vulkan = 3,
VulkanKHR = 3,
+ Max = 0x7fffffff,
}
enum ExecutionMode : uint
@@ -170,9 +159,12 @@
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ NonCoherentTileAttachmentReadQCOM = 4489,
+ TileShadingRateQCOM = 4490,
EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
CoalescingAMDX = 5069,
+ IsApiEntryAMDX = 5070,
MaxNodeRecursionAMDX = 5071,
StaticNumWorkgroupsAMDX = 5072,
ShaderIndexAMDX = 5073,
@@ -185,11 +177,14 @@
StencilRefLessBackAMD = 5084,
QuadDerivativesKHR = 5088,
RequireFullQuadsKHR = 5089,
+ SharesInputWithAMDX = 5102,
OutputLinesEXT = 5269,
OutputLinesNV = 5269,
OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
+ DerivativeGroupQuadsKHR = 5289,
DerivativeGroupQuadsNV = 5289,
+ DerivativeGroupLinearKHR = 5290,
DerivativeGroupLinearNV = 5290,
OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
@@ -217,6 +212,7 @@
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
+ Max = 0x7fffffff,
}
enum StorageClass : uint
@@ -235,8 +231,8 @@
Image = 11,
StorageBuffer = 12,
TileImageEXT = 4172,
+ TileAttachmentQCOM = 4491,
NodePayloadAMDX = 5068,
- NodeOutputPayloadAMDX = 5076,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
@@ -256,6 +252,7 @@
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
+ Max = 0x7fffffff,
}
enum Dim : uint
@@ -268,6 +265,7 @@
Buffer = 5,
SubpassData = 6,
TileImageDataEXT = 4173,
+ Max = 0x7fffffff,
}
enum SamplerAddressingMode : uint
@@ -277,12 +275,14 @@
Clamp = 2,
Repeat = 3,
RepeatMirrored = 4,
+ Max = 0x7fffffff,
}
enum SamplerFilterMode : uint
{
Nearest = 0,
Linear = 1,
+ Max = 0x7fffffff,
}
enum ImageFormat : uint
@@ -329,6 +329,7 @@
R8ui = 39,
R64ui = 40,
R64i = 41,
+ Max = 0x7fffffff,
}
enum ImageChannelOrder : uint
@@ -353,6 +354,7 @@
sRGBA = 17,
sBGRA = 18,
ABGR = 19,
+ Max = 0x7fffffff,
}
enum ImageChannelDataType : uint
@@ -374,8 +376,16 @@
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
+ UnormInt10X6EXT = 17,
UnsignedIntRaw10EXT = 19,
UnsignedIntRaw12EXT = 20,
+ UnormInt2_101010EXT = 21,
+ UnsignedInt10X6EXT = 22,
+ UnsignedInt12X4EXT = 23,
+ UnsignedInt14X2EXT = 24,
+ UnormInt12X4EXT = 25,
+ UnormInt14X2EXT = 26,
+ Max = 0x7fffffff,
}
enum ImageOperandsShift : uint
@@ -400,6 +410,7 @@
ZeroExtend = 13,
Nontemporal = 14,
Offsets = 16,
+ Max = 0x7fffffff,
}
enum ImageOperandsMask : uint
@@ -439,6 +450,7 @@
AllowReassoc = 17,
AllowReassocINTEL = 17,
AllowTransform = 18,
+ Max = 0x7fffffff,
}
enum FPFastMathModeMask : uint
@@ -462,6 +474,7 @@
RTZ = 1,
RTP = 2,
RTN = 3,
+ Max = 0x7fffffff,
}
enum LinkageType : uint
@@ -469,6 +482,7 @@
Export = 0,
Import = 1,
LinkOnceODR = 2,
+ Max = 0x7fffffff,
}
enum AccessQualifier : uint
@@ -476,6 +490,7 @@
ReadOnly = 0,
WriteOnly = 1,
ReadWrite = 2,
+ Max = 0x7fffffff,
}
enum FunctionParameterAttribute : uint
@@ -489,6 +504,7 @@
NoWrite = 6,
NoReadWrite = 7,
RuntimeAlignedINTEL = 5940,
+ Max = 0x7fffffff,
}
enum Decoration : uint
@@ -540,6 +556,7 @@
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
+ SaturatedToLargestFloat8NormalConversionEXT = 4216,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
WeightTextureQCOM = 4487,
@@ -550,6 +567,10 @@
NodeMaxPayloadsAMDX = 5020,
TrackFinishWritingAMDX = 5078,
PayloadNodeNameAMDX = 5091,
+ PayloadNodeBaseIndexAMDX = 5098,
+ PayloadNodeSparseArrayAMDX = 5099,
+ PayloadNodeArraySizeAMDX = 5100,
+ PayloadDispatchIndirectAMDX = 5105,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
@@ -636,8 +657,10 @@
HostAccessINTEL = 6188,
InitModeINTEL = 6190,
ImplementInRegisterMapINTEL = 6191,
+ ConditionalINTEL = 6247,
CacheControlLoadINTEL = 6442,
CacheControlStoreINTEL = 6443,
+ Max = 0x7fffffff,
}
enum BuiltIn : uint
@@ -705,6 +728,9 @@
DeviceIndex = 4438,
ViewIndex = 4440,
ShadingRateKHR = 4444,
+ TileOffsetQCOM = 4492,
+ TileDimensionQCOM = 4493,
+ TileApronSizeQCOM = 4494,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
@@ -713,7 +739,7 @@
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
- CoalescedInputCountAMDX = 5021,
+ RemainingRecursionLevelsAMDX = 5021,
ShaderIndexAMDX = 5073,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
@@ -773,19 +799,28 @@
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
+ HitIsSphereNV = 5359,
+ HitIsLSSNV = 5360,
+ HitSpherePositionNV = 5361,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
+ HitLSSPositionsNV = 5396,
HitKindFrontFacingMicroTriangleNV = 5405,
HitKindBackFacingMicroTriangleNV = 5406,
+ HitSphereRadiusNV = 5420,
+ HitLSSRadiiNV = 5421,
+ ClusterIDNV = 5436,
CullMaskKHR = 6021,
+ Max = 0x7fffffff,
}
enum SelectionControlShift : uint
{
Flatten = 0,
DontFlatten = 1,
+ Max = 0x7fffffff,
}
enum SelectionControlMask : uint
@@ -816,6 +851,7 @@
NoFusionINTEL = 23,
LoopCountINTEL = 24,
MaxReinvocationDelayINTEL = 25,
+ Max = 0x7fffffff,
}
enum LoopControlMask : uint
@@ -848,7 +884,9 @@
DontInline = 1,
Pure = 2,
Const = 3,
+ OptNoneEXT = 16,
OptNoneINTEL = 16,
+ Max = 0x7fffffff,
}
enum FunctionControlMask : uint
@@ -858,6 +896,7 @@
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
+ OptNoneEXT = 0x00010000,
OptNoneINTEL = 0x00010000,
}
@@ -880,6 +919,7 @@
MakeVisible = 14,
MakeVisibleKHR = 14,
Volatile = 15,
+ Max = 0x7fffffff,
}
enum MemorySemanticsMask : uint
@@ -917,6 +957,7 @@
NonPrivatePointerKHR = 5,
AliasScopeINTELMask = 16,
NoAliasINTELMask = 17,
+ Max = 0x7fffffff,
}
enum MemoryAccessMask : uint
@@ -945,6 +986,7 @@
QueueFamily = 5,
QueueFamilyKHR = 5,
ShaderCallKHR = 6,
+ Max = 0x7fffffff,
}
enum GroupOperation : uint
@@ -956,6 +998,7 @@
PartitionedReduceNV = 6,
PartitionedInclusiveScanNV = 7,
PartitionedExclusiveScanNV = 8,
+ Max = 0x7fffffff,
}
enum KernelEnqueueFlags : uint
@@ -963,11 +1006,13 @@
NoWait = 0,
WaitKernel = 1,
WaitWorkGroup = 2,
+ Max = 0x7fffffff,
}
enum KernelProfilingInfoShift : uint
{
CmdExecTime = 0,
+ Max = 0x7fffffff,
}
enum KernelProfilingInfoMask : uint
@@ -1052,6 +1097,13 @@
TileImageColorReadAccessEXT = 4166,
TileImageDepthReadAccessEXT = 4167,
TileImageStencilReadAccessEXT = 4168,
+ TensorsARM = 4174,
+ StorageTensorArrayDynamicIndexingARM = 4175,
+ StorageTensorArrayNonUniformIndexingARM = 4176,
+ GraphARM = 4191,
+ CooperativeMatrixLayoutsARM = 4201,
+ Float8EXT = 4212,
+ Float8CooperativeMatrixEXT = 4213,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -1081,11 +1133,14 @@
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayQueryKHR = 4472,
+ UntypedPointersKHR = 4473,
RayTraversalPrimitiveCullingKHR = 4478,
RayTracingKHR = 4479,
TextureSampleWeightedQCOM = 4484,
TextureBoxFilterQCOM = 4485,
TextureBlockMatchQCOM = 4486,
+ TileShadingQCOM = 4495,
+ CooperativeMatrixConversionQCOM = 4496,
TextureBlockMatch2QCOM = 4498,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
@@ -1096,6 +1151,11 @@
ShaderClockKHR = 5055,
ShaderEnqueueAMDX = 5067,
QuadControlKHR = 5087,
+ Int4TypeINTEL = 5112,
+ Int4CooperativeMatrixINTEL = 5114,
+ BFloat16TypeKHR = 5116,
+ BFloat16DotProductKHR = 5117,
+ BFloat16CooperativeMatrixKHR = 5118,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
@@ -1109,6 +1169,7 @@
MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
+ ComputeDerivativeGroupQuadsKHR = 5288,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
@@ -1146,6 +1207,7 @@
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
+ ComputeDerivativeGroupLinearKHR = 5350,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
@@ -1160,9 +1222,20 @@
ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
RayQueryPositionFetchKHR = 5391,
+ CooperativeVectorNV = 5394,
AtomicFloat16VectorNV = 5404,
RayTracingDisplacementMicromapNV = 5409,
RawAccessChainsNV = 5414,
+ RayTracingSpheresGeometryNV = 5418,
+ RayTracingLinearSweptSpheresGeometryNV = 5419,
+ CooperativeMatrixReductionsNV = 5430,
+ CooperativeMatrixConversionsNV = 5431,
+ CooperativeMatrixPerElementOperationsNV = 5432,
+ CooperativeMatrixTensorAddressingNV = 5433,
+ CooperativeMatrixBlockLoadsNV = 5434,
+ CooperativeVectorTrainingNV = 5435,
+ RayTracingClusterAccelerationStructureNV = 5437,
+ TensorAddressingNV = 5439,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
@@ -1215,28 +1288,43 @@
DotProductKHR = 6019,
RayCullMaskKHR = 6020,
CooperativeMatrixKHR = 6022,
+ ReplicatedCompositesEXT = 6024,
BitInstructions = 6025,
GroupNonUniformRotateKHR = 6026,
FloatControls2 = 6029,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongCompositesINTEL = 6089,
+ OptNoneEXT = 6094,
OptNoneINTEL = 6094,
AtomicFloat16AddEXT = 6095,
DebugInfoModuleINTEL = 6114,
BFloat16ConversionINTEL = 6115,
SplitBarrierINTEL = 6141,
+ ArithmeticFenceEXT = 6144,
FPGAClusterAttributesV2INTEL = 6150,
FPGAKernelAttributesv2INTEL = 6161,
+ TaskSequenceINTEL = 6162,
FPMaxErrorINTEL = 6169,
FPGALatencyControlINTEL = 6171,
FPGAArgumentInterfacesINTEL = 6174,
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
+ SubgroupBufferPrefetchINTEL = 6220,
+ Subgroup2DBlockIOINTEL = 6228,
+ Subgroup2DBlockTransformINTEL = 6229,
+ Subgroup2DBlockTransposeINTEL = 6230,
+ SubgroupMatrixMultiplyAccumulateINTEL = 6236,
+ TernaryBitwiseFunctionINTEL = 6241,
+ SpecConditionalINTEL = 6245,
+ FunctionVariantsINTEL = 6246,
GroupUniformArithmeticKHR = 6400,
+ TensorFloat32RoundingINTEL = 6425,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
+ BindlessImagesINTEL = 6528,
+ Max = 0x7fffffff,
}
enum RayFlagsShift : uint
@@ -1249,9 +1337,11 @@
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
+ SkipBuiltinPrimitivesNV = 8,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
ForceOpacityMicromap2StateEXT = 10,
+ Max = 0x7fffffff,
}
enum RayFlagsMask : uint
@@ -1265,6 +1355,7 @@
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
+ SkipBuiltinPrimitivesNV = 0x00000100,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
ForceOpacityMicromap2StateEXT = 0x00000400,
@@ -1274,6 +1365,7 @@
{
RayQueryCandidateIntersectionKHR = 0,
RayQueryCommittedIntersectionKHR = 1,
+ Max = 0x7fffffff,
}
enum RayQueryCommittedIntersectionType : uint
@@ -1281,12 +1373,14 @@
RayQueryCommittedIntersectionNoneKHR = 0,
RayQueryCommittedIntersectionTriangleKHR = 1,
RayQueryCommittedIntersectionGeneratedKHR = 2,
+ Max = 0x7fffffff,
}
enum RayQueryCandidateIntersectionType : uint
{
RayQueryCandidateIntersectionTriangleKHR = 0,
RayQueryCandidateIntersectionAABBKHR = 1,
+ Max = 0x7fffffff,
}
enum FragmentShadingRateShift : uint
@@ -1295,6 +1389,7 @@
Vertical4Pixels = 1,
Horizontal2Pixels = 2,
Horizontal4Pixels = 3,
+ Max = 0x7fffffff,
}
enum FragmentShadingRateMask : uint
@@ -1310,12 +1405,14 @@
{
Preserve = 0,
FlushToZero = 1,
+ Max = 0x7fffffff,
}
enum FPOperationMode : uint
{
IEEE = 0,
ALT = 1,
+ Max = 0x7fffffff,
}
enum QuantizationModes : uint
@@ -1328,6 +1425,7 @@
RND_MIN_INF = 5,
RND_CONV = 6,
RND_CONV_ODD = 7,
+ Max = 0x7fffffff,
}
enum OverflowModes : uint
@@ -1336,12 +1434,14 @@
SAT = 1,
SAT_ZERO = 2,
SAT_SYM = 3,
+ Max = 0x7fffffff,
}
enum PackedVectorFormat : uint
{
PackedVectorFormat4x8Bit = 0,
PackedVectorFormat4x8BitKHR = 0,
+ Max = 0x7fffffff,
}
enum CooperativeMatrixOperandsShift : uint
@@ -1351,6 +1451,7 @@
MatrixCSignedComponentsKHR = 2,
MatrixResultSignedComponentsKHR = 3,
SaturatingAccumulationKHR = 4,
+ Max = 0x7fffffff,
}
enum CooperativeMatrixOperandsMask : uint
@@ -1367,6 +1468,9 @@
{
RowMajorKHR = 0,
ColumnMajorKHR = 1,
+ RowBlockedInterleavedARM = 4202,
+ ColumnBlockedInterleavedARM = 4203,
+ Max = 0x7fffffff,
}
enum CooperativeMatrixUse : uint
@@ -1374,12 +1478,74 @@
MatrixAKHR = 0,
MatrixBKHR = 1,
MatrixAccumulatorKHR = 2,
+ Max = 0x7fffffff,
+}
+
+enum CooperativeMatrixReduceShift : uint
+{
+ Row = 0,
+ Column = 1,
+ _2x2 = 2,
+ Max = 0x7fffffff,
+}
+
+enum CooperativeMatrixReduceMask : uint
+{
+ MaskNone = 0,
+ Row = 0x00000001,
+ Column = 0x00000002,
+ _2x2 = 0x00000004,
+}
+
+enum TensorClampMode : uint
+{
+ Undefined = 0,
+ Constant = 1,
+ ClampToEdge = 2,
+ Repeat = 3,
+ RepeatMirrored = 4,
+ Max = 0x7fffffff,
+}
+
+enum TensorAddressingOperandsShift : uint
+{
+ TensorView = 0,
+ DecodeFunc = 1,
+ Max = 0x7fffffff,
+}
+
+enum TensorAddressingOperandsMask : uint
+{
+ MaskNone = 0,
+ TensorView = 0x00000001,
+ DecodeFunc = 0x00000002,
+}
+
+enum TensorOperandsShift : uint
+{
+ NontemporalARM = 0,
+ OutOfBoundsValueARM = 1,
+ MakeElementAvailableARM = 2,
+ MakeElementVisibleARM = 3,
+ NonPrivateElementARM = 4,
+ Max = 0x7fffffff,
+}
+
+enum TensorOperandsMask : uint
+{
+ MaskNone = 0,
+ NontemporalARM = 0x00000001,
+ OutOfBoundsValueARM = 0x00000002,
+ MakeElementAvailableARM = 0x00000004,
+ MakeElementVisibleARM = 0x00000008,
+ NonPrivateElementARM = 0x00000010,
}
enum InitializationModeQualifier : uint
{
InitOnDeviceReprogramINTEL = 0,
InitOnDeviceResetINTEL = 1,
+ Max = 0x7fffffff,
}
enum HostAccessQualifier : uint
@@ -1388,6 +1554,7 @@
ReadINTEL = 1,
WriteINTEL = 2,
ReadWriteINTEL = 3,
+ Max = 0x7fffffff,
}
enum LoadCacheControl : uint
@@ -1397,6 +1564,7 @@
StreamingINTEL = 2,
InvalidateAfterReadINTEL = 3,
ConstCachedINTEL = 4,
+ Max = 0x7fffffff,
}
enum StoreCacheControl : uint
@@ -1405,17 +1573,58 @@
WriteThroughINTEL = 1,
WriteBackINTEL = 2,
StreamingINTEL = 3,
+ Max = 0x7fffffff,
}
enum NamedMaximumNumberOfRegisters : uint
{
AutoINTEL = 0,
+ Max = 0x7fffffff,
+}
+
+enum MatrixMultiplyAccumulateOperandsShift : uint
+{
+ MatrixASignedComponentsINTEL = 0,
+ MatrixBSignedComponentsINTEL = 1,
+ MatrixCBFloat16INTEL = 2,
+ MatrixResultBFloat16INTEL = 3,
+ MatrixAPackedInt8INTEL = 4,
+ MatrixBPackedInt8INTEL = 5,
+ MatrixAPackedInt4INTEL = 6,
+ MatrixBPackedInt4INTEL = 7,
+ MatrixATF32INTEL = 8,
+ MatrixBTF32INTEL = 9,
+ MatrixAPackedFloat16INTEL = 10,
+ MatrixBPackedFloat16INTEL = 11,
+ MatrixAPackedBFloat16INTEL = 12,
+ MatrixBPackedBFloat16INTEL = 13,
+ Max = 0x7fffffff,
+}
+
+enum MatrixMultiplyAccumulateOperandsMask : uint
+{
+ MaskNone = 0,
+ MatrixASignedComponentsINTEL = 0x00000001,
+ MatrixBSignedComponentsINTEL = 0x00000002,
+ MatrixCBFloat16INTEL = 0x00000004,
+ MatrixResultBFloat16INTEL = 0x00000008,
+ MatrixAPackedInt8INTEL = 0x00000010,
+ MatrixBPackedInt8INTEL = 0x00000020,
+ MatrixAPackedInt4INTEL = 0x00000040,
+ MatrixBPackedInt4INTEL = 0x00000080,
+ MatrixATF32INTEL = 0x00000100,
+ MatrixBTF32INTEL = 0x00000200,
+ MatrixAPackedFloat16INTEL = 0x00000400,
+ MatrixBPackedFloat16INTEL = 0x00000800,
+ MatrixAPackedBFloat16INTEL = 0x00001000,
+ MatrixBPackedBFloat16INTEL = 0x00002000,
}
enum RawAccessChainOperandsShift : uint
{
RobustnessPerComponentNV = 0,
RobustnessPerElementNV = 1,
+ Max = 0x7fffffff,
}
enum RawAccessChainOperandsMask : uint
@@ -1425,6 +1634,43 @@
RobustnessPerElementNV = 0x00000002,
}
+enum FPEncoding : uint
+{
+ BFloat16KHR = 0,
+ Float8E4M3EXT = 4214,
+ Float8E5M2EXT = 4215,
+ Max = 0x7fffffff,
+}
+
+enum CooperativeVectorMatrixLayout : uint
+{
+ RowMajorNV = 0,
+ ColumnMajorNV = 1,
+ InferencingOptimalNV = 2,
+ TrainingOptimalNV = 3,
+ Max = 0x7fffffff,
+}
+
+enum ComponentType : uint
+{
+ Float16NV = 0,
+ Float32NV = 1,
+ Float64NV = 2,
+ SignedInt8NV = 3,
+ SignedInt16NV = 4,
+ SignedInt32NV = 5,
+ SignedInt64NV = 6,
+ UnsignedInt8NV = 7,
+ UnsignedInt16NV = 8,
+ UnsignedInt32NV = 9,
+ UnsignedInt64NV = 10,
+ SignedInt8PackedNV = 1000491000,
+ UnsignedInt8PackedNV = 1000491001,
+ FloatE4M3NV = 1000491002,
+ FloatE5M2NV = 1000491003,
+ Max = 0x7fffffff,
+}
+
enum Op : uint
{
OpNop = 0,
@@ -1774,14 +2020,35 @@
OpColorAttachmentReadEXT = 4160,
OpDepthAttachmentReadEXT = 4161,
OpStencilAttachmentReadEXT = 4162,
+ OpTypeTensorARM = 4163,
+ OpTensorReadARM = 4164,
+ OpTensorWriteARM = 4165,
+ OpTensorQuerySizeARM = 4166,
+ OpGraphConstantARM = 4181,
+ OpGraphEntryPointARM = 4182,
+ OpGraphARM = 4183,
+ OpGraphInputARM = 4184,
+ OpGraphSetOutputARM = 4185,
+ OpGraphEndARM = 4186,
+ OpTypeGraphARM = 4190,
OpTerminateInvocation = 4416,
+ OpTypeUntypedPointerKHR = 4417,
+ OpUntypedVariableKHR = 4418,
+ OpUntypedAccessChainKHR = 4419,
+ OpUntypedInBoundsAccessChainKHR = 4420,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
+ OpUntypedPtrAccessChainKHR = 4423,
+ OpUntypedInBoundsPtrAccessChainKHR = 4424,
+ OpUntypedArrayLengthKHR = 4425,
+ OpUntypedPrefetchKHR = 4426,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpGroupNonUniformRotateKHR = 4431,
OpSubgroupReadInvocationKHR = 4432,
+ OpExtInstWithForwardRefsKHR = 4433,
+ OpUntypedGroupAsyncCopyKHR = 4434,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
@@ -1804,6 +2071,9 @@
OpCooperativeMatrixStoreKHR = 4458,
OpCooperativeMatrixMulAddKHR = 4459,
OpCooperativeMatrixLengthKHR = 4460,
+ OpConstantCompositeReplicateEXT = 4461,
+ OpSpecConstantCompositeReplicateEXT = 4462,
+ OpCompositeConstructReplicateEXT = 4463,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
@@ -1815,10 +2085,14 @@
OpImageBoxFilterQCOM = 4481,
OpImageBlockMatchSSDQCOM = 4482,
OpImageBlockMatchSADQCOM = 4483,
+ OpBitCastArrayQCOM = 4497,
OpImageBlockMatchWindowSSDQCOM = 4500,
OpImageBlockMatchWindowSADQCOM = 4501,
OpImageBlockMatchGatherSSDQCOM = 4502,
OpImageBlockMatchGatherSADQCOM = 4503,
+ OpCompositeConstructCoopMatQCOM = 4540,
+ OpCompositeExtractCoopMatQCOM = 4541,
+ OpExtractSubArrayQCOM = 4542,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@@ -1830,9 +2104,14 @@
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
- OpFinalizeNodePayloadsAMDX = 5075,
+ OpAllocateNodePayloadsAMDX = 5074,
+ OpEnqueueNodePayloadsAMDX = 5075,
+ OpTypeNodePayloadArrayAMDX = 5076,
OpFinishWritingNodePayloadAMDX = 5078,
- OpInitializeNodePayloadsAMDX = 5090,
+ OpNodePayloadArrayLengthAMDX = 5090,
+ OpIsNodePayloadValidAMDX = 5101,
+ OpConstantStringAMDX = 5103,
+ OpSpecConstantStringAMDX = 5104,
OpGroupNonUniformQuadAllKHR = 5110,
OpGroupNonUniformQuadAnyKHR = 5111,
OpHitObjectRecordHitMotionNV = 5249,
@@ -1869,12 +2148,20 @@
OpReorderThreadWithHintNV = 5280,
OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpTypeCooperativeVectorNV = 5288,
+ OpCooperativeVectorMatrixMulNV = 5289,
+ OpCooperativeVectorOuterProductAccumulateNV = 5290,
+ OpCooperativeVectorReduceSumAccumulateNV = 5291,
+ OpCooperativeVectorMatrixMulAddNV = 5292,
+ OpCooperativeMatrixConvertNV = 5293,
OpEmitMeshTasksEXT = 5294,
OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpFetchMicroTriangleVertexPositionNV = 5300,
OpFetchMicroTriangleVertexBarycentricNV = 5301,
+ OpCooperativeVectorLoadNV = 5302,
+ OpCooperativeVectorStoreNV = 5303,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
@@ -1886,6 +2173,8 @@
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
+ OpRayQueryGetClusterIdNV = 5345,
+ OpHitObjectGetClusterIdNV = 5346,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
@@ -1893,9 +2182,26 @@
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
+ OpCooperativeMatrixReduceNV = 5366,
+ OpCooperativeMatrixLoadTensorNV = 5367,
+ OpCooperativeMatrixStoreTensorNV = 5368,
+ OpCooperativeMatrixPerElementOpNV = 5369,
+ OpTypeTensorLayoutNV = 5370,
+ OpTypeTensorViewNV = 5371,
+ OpCreateTensorLayoutNV = 5372,
+ OpTensorLayoutSetDimensionNV = 5373,
+ OpTensorLayoutSetStrideNV = 5374,
+ OpTensorLayoutSliceNV = 5375,
+ OpTensorLayoutSetClampValueNV = 5376,
+ OpCreateTensorViewNV = 5377,
+ OpTensorViewSetDimensionNV = 5378,
+ OpTensorViewSetStrideNV = 5379,
OpDemoteToHelperInvocation = 5380,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
+ OpTensorViewSetClipNV = 5382,
+ OpTensorLayoutSetBlockSizeNV = 5384,
+ OpCooperativeMatrixTransposeNV = 5390,
OpConvertUToImageNV = 5391,
OpConvertUToSamplerNV = 5392,
OpConvertImageToUNV = 5393,
@@ -1904,6 +2210,19 @@
OpConvertSampledImageToUNV = 5396,
OpSamplerImageAddressingModeNV = 5397,
OpRawAccessChainNV = 5398,
+ OpRayQueryGetIntersectionSpherePositionNV = 5427,
+ OpRayQueryGetIntersectionSphereRadiusNV = 5428,
+ OpRayQueryGetIntersectionLSSPositionsNV = 5429,
+ OpRayQueryGetIntersectionLSSRadiiNV = 5430,
+ OpRayQueryGetIntersectionLSSHitValueNV = 5431,
+ OpHitObjectGetSpherePositionNV = 5432,
+ OpHitObjectGetSphereRadiusNV = 5433,
+ OpHitObjectGetLSSPositionsNV = 5434,
+ OpHitObjectGetLSSRadiiNV = 5435,
+ OpHitObjectIsSphereHitNV = 5436,
+ OpHitObjectIsLSSHitNV = 5437,
+ OpRayQueryIsSphereHitNV = 5438,
+ OpRayQueryIsLSSHitNV = 5439,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -2150,6 +2469,27 @@
OpConvertBF16ToFINTEL = 6117,
OpControlBarrierArriveINTEL = 6142,
OpControlBarrierWaitINTEL = 6143,
+ OpArithmeticFenceEXT = 6145,
+ OpTaskSequenceCreateINTEL = 6163,
+ OpTaskSequenceAsyncINTEL = 6164,
+ OpTaskSequenceGetINTEL = 6165,
+ OpTaskSequenceReleaseINTEL = 6166,
+ OpTypeTaskSequenceINTEL = 6199,
+ OpSubgroupBlockPrefetchINTEL = 6221,
+ OpSubgroup2DBlockLoadINTEL = 6231,
+ OpSubgroup2DBlockLoadTransformINTEL = 6232,
+ OpSubgroup2DBlockLoadTransposeINTEL = 6233,
+ OpSubgroup2DBlockPrefetchINTEL = 6234,
+ OpSubgroup2DBlockStoreINTEL = 6235,
+ OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
+ OpBitwiseFunctionINTEL = 6242,
+ OpConditionalExtensionINTEL = 6248,
+ OpConditionalEntryPointINTEL = 6249,
+ OpConditionalCapabilityINTEL = 6250,
+ OpSpecConstantTargetINTEL = 6251,
+ OpSpecConstantArchitectureINTEL = 6252,
+ OpSpecConstantCapabilitiesINTEL = 6253,
+ OpConditionalCopyObjectINTEL = 6254,
OpGroupIMulKHR = 6401,
OpGroupFMulKHR = 6402,
OpGroupBitwiseAndKHR = 6403,
@@ -2158,8 +2498,13 @@
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
+ OpRoundFToTF32INTEL = 6426,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
+ OpConvertHandleToImageINTEL = 6529,
+ OpConvertHandleToSamplerINTEL = 6530,
+ OpConvertHandleToSampledImageINTEL = 6531,
+ Max = 0x7fffffff,
}
diff --git a/third_party/SPIRV-Headers/tests/CMakeLists.txt b/third_party/SPIRV-Headers/tests/CMakeLists.txt
index ebf7e12..ad7da99 100644
--- a/third_party/SPIRV-Headers/tests/CMakeLists.txt
+++ b/third_party/SPIRV-Headers/tests/CMakeLists.txt
@@ -1,38 +1,27 @@
# Copyright (c) 2015-2024 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.
+# SPDX-License-Identifier: MIT
#
# 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.
-add_library(spirv_headers_simple_test STATIC)
+add_executable(spirv_headers_simple_test example.cpp)
+target_compile_definitions(spirv_headers_simple_test PRIVATE SPV_ENABLE_UTILITY_CODE)
+target_link_libraries(spirv_headers_simple_test PRIVATE SPIRV-Headers::SPIRV-Headers)
+add_test(NAME spirv_headers_simple_test COMMAND spirv_headers_simple_test)
-target_sources(spirv_headers_simple_test PRIVATE
- example.cpp
-)
+add_executable(spirv_headers_simple_test_cpp11 example11.cpp)
+target_compile_definitions(spirv_headers_simple_test_cpp11 PRIVATE SPV_ENABLE_UTILITY_CODE)
+target_link_libraries(spirv_headers_simple_test_cpp11 PRIVATE SPIRV-Headers::SPIRV-Headers)
+set_target_properties(spirv_headers_simple_test_cpp11 PROPERTIES CXX_STANDARD 11)
+add_test(NAME spirv_headers_simple_test_cpp11 COMMAND spirv_headers_simple_test_cpp11)
-target_link_libraries(spirv_headers_simple_test PRIVATE
- SPIRV-Headers::SPIRV-Headers
-)
+add_executable(spirv_headers_simple_test_c example.c)
+target_compile_definitions(spirv_headers_simple_test_c PRIVATE SPV_ENABLE_UTILITY_CODE)
+target_link_libraries(spirv_headers_simple_test_c PRIVATE SPIRV-Headers::SPIRV-Headers)
+set_target_properties(spirv_headers_simple_test_c PROPERTIES C_STANDARD 99 LINKER_LANGUAGE C)
+add_test(NAME spirv_headers_simple_test_c COMMAND spirv_headers_simple_test_c)
if (NOT TARGET SPIRV-Headers)
message(FATAL_ERROR "SPIRV-Headers target not defined!")
diff --git a/third_party/SPIRV-Headers/tests/example.c b/third_party/SPIRV-Headers/tests/example.c
new file mode 100644
index 0000000..59a99d4
--- /dev/null
+++ b/third_party/SPIRV-Headers/tests/example.c
@@ -0,0 +1,19 @@
+// Copyright (c) 2016-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
+//
+// 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/
+
+#include <spirv/unified1/GLSL.std.450.h>
+#include <spirv/unified1/OpenCL.std.h>
+#include <spirv/unified1/spirv.h>
+
+const enum GLSLstd450 kSin = GLSLstd450Sin;
+const enum OpenCLstd_Entrypoints kNative_cos = OpenCLstd_Native_cos;
+const SpvOp kNop = SpvOpNop;
+
+int main() {
+ return 0;
+}
diff --git a/third_party/SPIRV-Headers/tests/example.cpp b/third_party/SPIRV-Headers/tests/example.cpp
index 1920e80..daf5267 100644
--- a/third_party/SPIRV-Headers/tests/example.cpp
+++ b/third_party/SPIRV-Headers/tests/example.cpp
@@ -1,28 +1,10 @@
// Copyright (c) 2016-2024 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.
-//
+// SPDX-License-Identifier: MIT
+//
// 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.
#include <spirv/unified1/GLSL.std.450.h>
#include <spirv/unified1/OpenCL.std.h>
@@ -35,3 +17,7 @@
const spv::Op kNop = spv::OpNop;
} // anonymous namespace
+
+int main() {
+ return 0;
+}
diff --git a/third_party/SPIRV-Headers/tests/example11.cpp b/third_party/SPIRV-Headers/tests/example11.cpp
new file mode 100644
index 0000000..b679e92
--- /dev/null
+++ b/third_party/SPIRV-Headers/tests/example11.cpp
@@ -0,0 +1,23 @@
+// Copyright (c) 2016-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
+//
+// 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/
+
+#include <spirv/unified1/GLSL.std.450.h>
+#include <spirv/unified1/OpenCL.std.h>
+#include <spirv/unified1/spirv.hpp11>
+
+namespace {
+
+const GLSLstd450 kSin = GLSLstd450Sin;
+const OpenCLLIB::Entrypoints kNative_cos = OpenCLLIB::Native_cos;
+const spv::Op kNop = spv::Op::OpNop;
+
+} // anonymous namespace
+
+int main() {
+ return 0;
+}
diff --git a/third_party/SPIRV-Headers/tests/find_package/CMakeLists.txt b/third_party/SPIRV-Headers/tests/find_package/CMakeLists.txt
index 4735db5..8e23c1e 100644
--- a/third_party/SPIRV-Headers/tests/find_package/CMakeLists.txt
+++ b/third_party/SPIRV-Headers/tests/find_package/CMakeLists.txt
@@ -1,4 +1,7 @@
-cmake_minimum_required(VERSION 3.0)
+# Copyright (c) 2015-2024 The Khronos Group Inc.
+# SPDX-License-Identifier: MIT
+
+cmake_minimum_required(VERSION 3.14)
project(TEST_FIND_PACKAGE LANGUAGES CXX)
diff --git a/third_party/SPIRV-Headers/tests/pkg_config/CMakeLists.txt b/third_party/SPIRV-Headers/tests/pkg_config/CMakeLists.txt
index b2897e2..a478b86 100644
--- a/third_party/SPIRV-Headers/tests/pkg_config/CMakeLists.txt
+++ b/third_party/SPIRV-Headers/tests/pkg_config/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (c) 2015-2024 The Khronos Group Inc.
+# SPDX-License-Identifier: MIT
+
cmake_minimum_required(VERSION 3.14)
project(TEST_PKGCONFIG LANGUAGES CXX)
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/CMakeLists.txt b/third_party/SPIRV-Headers/tools/buildHeaders/CMakeLists.txt
index fa7ef50..3f86c3e 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/CMakeLists.txt
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.14)
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix" FORCE)
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py b/third_party/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py
index ccd843b..0c5bc82 100755
--- a/third_party/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/bin/generate_language_headers.py
@@ -1,29 +1,11 @@
#!/usr/bin/env python3
-# Copyright (c) 2017-2024 Google LLC
-#
-# 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.
-#
+# Copyright: 2017-2024 Google LLC
+# SPDX-License-Identifier: MIT
+#
# 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.
"""Generates a C language headers from a SPIR-V JSON grammar file"""
@@ -32,31 +14,14 @@
import os.path
import re
-DEFAULT_COPYRIGHT="""Copyright (c) 2020-2024 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.
+DEFAULT_COPYRIGHT="""SPDX-FileCopyrightText: 2020-2024 The Khronos Group Inc.
+SPDX-License-Identifier: MIT
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.
""".split('\n')
def make_path_to_file(f):
@@ -78,8 +43,9 @@
class ExtInstGrammar:
"""The grammar for an extended instruction set"""
- def __init__(self, name, copyright, instructions, operand_kinds, version = None, revision = None):
+ def __init__(self, name, guard_name, copyright, instructions, operand_kinds, version = None, revision = None):
self.name = name
+ self.guard_name = guard_name
self.copyright = copyright
self.instructions = instructions
self.operand_kinds = operand_kinds
@@ -125,7 +91,7 @@
parts.extend(["{}{}".format(self.comment_prefix(), f) for f in grammar.copyright])
parts.append('')
- guard = 'SPIRV_UNIFIED1_{}_H_'.format(grammar.name)
+ guard = 'SPIRV_UNIFIED1_{}_H_'.format(grammar.guard_name)
if self.uses_guards:
parts.append('#ifndef {}'.format(guard))
parts.append('#define {}'.format(guard))
@@ -227,7 +193,10 @@
else:
operand_kinds = []
+ sanitized_guard_name = args.extinst_output_base.replace('.', '_')
+
grammar = ExtInstGrammar(name = args.extinst_name,
+ guard_name = sanitized_guard_name,
copyright = copyright,
instructions = grammar_json['instructions'],
operand_kinds = operand_kinds,
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py b/third_party/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py
index 96ce008..6a3e3f8 100755
--- a/third_party/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/bin/makeExtinstHeaders.py
@@ -7,15 +7,16 @@
# Assume we are running from the tools/buildHeaders directory
os.chdir('../../include/spirv/unified1')
-def mk_extinst(name, grammar_file):
+def mk_extinst(name, grammar_file, header_basename=None):
"""Generate one C header from a grammar"""
script = '../../../tools/buildHeaders/bin/generate_language_headers.py'
+ header_basename = header_basename if header_basename else name
subprocess.check_call(['python3',
script,
'--extinst-name=' + name,
'--extinst-grammar=' + grammar_file,
- '--extinst-output-base=' + name])
- subprocess.check_call(['dos2unix', name + '.h'])
+ '--extinst-output-base=' + header_basename])
+ subprocess.check_call(['dos2unix', header_basename + '.h'])
mk_extinst('DebugInfo', 'extinst.debuginfo.grammar.json')
@@ -28,3 +29,4 @@
mk_extinst('NonSemanticClspvReflection', 'extinst.nonsemantic.clspvreflection.grammar.json')
mk_extinst('NonSemanticDebugBreak', 'extinst.nonsemantic.debugbreak.grammar.json')
mk_extinst('NonSemanticVkspReflection', 'extinst.nonsemantic.vkspreflection.grammar.json')
+mk_extinst('TOSA', 'extinst.tosa.001000.1.grammar.json', 'TOSA.001000.1')
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/header.cpp b/third_party/SPIRV-Headers/tools/buildHeaders/header.cpp
index d125a79..54a2d6e 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/header.cpp
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/header.cpp
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 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.
+// SPDX-FileCopyrightText: 2014-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
+//
+// 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/
//
// Print headers for SPIR-V in several languages.
@@ -98,7 +82,7 @@
virtual void printEpilogue(std::ostream&) const { }
virtual void printMeta(std::ostream&) const;
virtual void printTypes(std::ostream&) const { }
- virtual void printHasResultType(std::ostream&) const { };
+ virtual void printUtility(std::ostream&) const { };
virtual std::string escapeComment(const std::string& s) const;
@@ -119,9 +103,9 @@
enumStyle_t, bool isLast = false) const {
return "";
}
- virtual std::string maxEnumFmt(const std::string&, const valpair_t&,
- enumStyle_t) const {
- return "";
+ virtual std::string maxEnumFmt(const std::string& s, const valpair_t& v,
+ enumStyle_t style) const {
+ return enumFmt(s, v, style, true);
}
virtual std::string fmtConstInt(unsigned val, const std::string& name,
@@ -169,30 +153,13 @@
}
const std::string TPrinter::DocCopyright =
-R"(Copyright (c) 2014-2024 The Khronos Group Inc.
+R"(Copyright: 2014-2024 The Khronos Group Inc.
+License: MIT
-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.
-)";
+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/)";
const std::string TPrinter::DocComment1 =
"This header is automatically generated by the same tool that creates\n"
@@ -243,6 +210,10 @@
for (auto& enumRow : enumSet) {
std::string name = enumRow.name;
enums[e - spv::OperandSource]["Values"][name] = enumRow.value;
+ // Add aliases
+ for (auto& alias : enumRow.aliases) {
+ enums[e - spv::OperandSource]["Values"][alias] = enumRow.value;
+ }
}
enums[e - spv::OperandSource]["Type"] = mask ? "Bit" : "Value";
@@ -255,6 +226,10 @@
for (auto& enumRow : spv::InstructionDesc) {
std::string name = enumRow.name;
entry["Values"][name] = enumRow.value;
+ // Add aliases
+ for (auto& alias : enumRow.aliases) {
+ entry["Values"][alias] = enumRow.value;
+ }
}
entry["Type"] = "Value";
entry["Name"] = "Op";
@@ -369,7 +344,7 @@
printTypes(out);
printMeta(out);
printDefs(out);
- printHasResultType(out);
+ printUtility(out);
printEpilogue(out);
}
@@ -464,6 +439,10 @@
return indent(5) + '"' + prependIfDigit(s, v.second) + "\": " + fmtNum("%d", v.first) +
(isLast ? "\n" : ",\n");
}
+ std::string maxEnumFmt(const std::string& s, const valpair_t& v,
+ enumStyle_t style) const override {
+ return "";
+ }
};
// base for C and C++
@@ -501,10 +480,22 @@
virtual std::string pre() const { return ""; } // C name prefix
virtual std::string headerGuardSuffix() const = 0;
- virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return pre() + name; }
+ virtual std::string fmtEnumUse(const std::string &opPrefix, const std::string &opEnum, const std::string &name) const { return pre() + opPrefix + name; }
- virtual void printHasResultType(std::ostream& out) const override
+ void printUtility(std::ostream& out) const override
{
+ out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl;
+ out << "#ifndef __cplusplus" << std::endl;
+ out << "#include <stdbool.h>" << std::endl;
+ out << "#endif" << std::endl;
+
+ printHasResultType(out);
+ printStringFunctions(out);
+
+ out << "#endif /* SPV_ENABLE_UTILITY_CODE */" << std::endl << std::endl;
+ }
+
+ void printHasResultType(std::ostream& out) const {
const Json::Value& enums = spvRoot["spv"]["enum"];
std::set<unsigned> seenValues;
@@ -515,10 +506,7 @@
continue;
}
- out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl;
- out << "#ifndef __cplusplus" << std::endl;
- out << "#include <stdbool.h>" << std::endl;
- out << "#endif" << std::endl;
+
out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl;
out << " *hasResult = *hasResultType = false;" << std::endl;
out << " switch (opcode) {" << std::endl;
@@ -534,12 +522,50 @@
seenValues.insert(inst.value);
std::string name = inst.name;
- out << " case " << fmtEnumUse("Op", name) << ": *hasResult = " << (inst.hasResult() ? "true" : "false") << "; *hasResultType = " << (inst.hasType() ? "true" : "false") << "; break;" << std::endl;
+ out << " case " << fmtEnumUse("", "Op", name) << ": *hasResult = " << (inst.hasResult() ? "true" : "false") << "; *hasResultType = " << (inst.hasType() ? "true" : "false") << "; break;" << std::endl;
}
out << " }" << std::endl;
out << "}" << std::endl;
- out << "#endif /* SPV_ENABLE_UTILITY_CODE */" << std::endl << std::endl;
+ }
+ }
+
+ void printStringFunctions(std::ostream& out) const {
+ const Json::Value& enums = spvRoot["spv"]["enum"];
+
+ for (auto it = enums.begin(); it != enums.end(); ++it) {
+ const auto type = (*it)["Type"].asString();
+ // Skip bitmasks
+ if (type == "Bit") {
+ continue;
+ }
+ const auto name = (*it)["Name"].asString();
+ const auto sorted = getSortedVals((*it)["Values"]);
+
+ std::set<unsigned> seenValues;
+ std::string fullName = pre() + name;
+
+ out << "inline const char* " << fullName << "ToString(" << fullName << " value) {" << std::endl;
+ out << " switch (value) {" << std::endl;
+ for (const auto& v : sorted) {
+ // Filter out duplicate enum values, which would break the switch statement.
+ // These are probably just extension enums promoted to core.
+ if (seenValues.count(v.first)) {
+ continue;
+ }
+ seenValues.insert(v.first);
+
+ out << " " << "case ";
+ if (name == "Op") {
+ out << fmtEnumUse("", name, v.second);
+ }
+ else
+ out << fmtEnumUse(name, name, v.second);
+ out << ": return " << "\"" << v.second << "\";" << std::endl;
+ }
+ out << " default: return \"Unknown\";" << std::endl;
+ out << " }" << std::endl;
+ out << "}" << std::endl << std::endl;
}
}
};
@@ -564,11 +590,6 @@
return indent() + pre() + s + v.second + styleStr(style) + " = " + fmtStyleVal(v.first, style) + ",\n";
}
- std::string maxEnumFmt(const std::string& s, const valpair_t& v,
- enumStyle_t style) const override {
- return enumFmt(s, v, style, true);
- }
-
std::string pre() const override { return "Spv"; } // C name prefix
std::string headerGuardSuffix() const override { return "H"; }
};
@@ -631,11 +652,6 @@
return indent() + s + v.second + styleStr(style) + " = " + fmtStyleVal(v.first, style) + ",\n";
}
- virtual std::string maxEnumFmt(const std::string& s, const valpair_t& v,
- enumStyle_t style) const override {
- return enumFmt(s, v, style, true);
- }
-
// The C++ and C++11 headers define types with the same name. So they
// should use the same header guard.
std::string headerGuardSuffix() const override { return "HPP"; }
@@ -660,13 +676,8 @@
return indent() + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n";
}
- std::string maxEnumFmt(const std::string& s, const valpair_t& v,
- enumStyle_t style) const override {
- return enumFmt(s, v, style, true);
- }
-
// Add type prefix for scoped enum
- virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const override { return opPrefix + "::" + name; }
+ std::string fmtEnumUse(const std::string& opPrefix, const std::string& opEnum, const std::string& name) const override { return opEnum + "::" + prependIfDigit(opEnum, name); }
std::string headerGuardSuffix() const override { return "HPP"; }
};
@@ -721,7 +732,10 @@
enumStyle_t style, bool isLast) const override {
return indent(2) + "'" + prependIfDigit(s, v.second) + "'" + " : " + fmtStyleVal(v.first, style) + ",\n";
}
-
+ std::string maxEnumFmt(const std::string& s, const valpair_t& v,
+ enumStyle_t style) const override {
+ return "";
+ }
std::string fmtConstInt(unsigned val, const std::string& name,
const char* fmt, bool isLast) const override
{
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/header.h b/third_party/SPIRV-Headers/tools/buildHeaders/header.h
index 6854f80..f5624f3 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/header.h
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/header.h
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 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.
+// SPDX-FileCopyrightText: 2014-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
+//
+// 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/
//
// Print headers for SPIR-V in several languages.
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.cpp b/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.cpp
index 34e0972..cc55723 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.cpp
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.cpp
@@ -1,33 +1,15 @@
-// Copyright (c) 2014-2024 The Khronos Group Inc.
+// SPDX-FileCopyrightText: 2014-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
-// 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.
+// 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/
#include <assert.h>
#include <string.h>
-#include <algorithm>
#include <cstdlib>
#include <iostream>
-#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <fstream>
@@ -268,12 +250,20 @@
EnumValues CooperativeMatrixOperandsParams;
EnumValues CooperativeMatrixLayoutParams;
EnumValues CooperativeMatrixUseParams;
+EnumValues CooperativeMatrixReduceParams;
+EnumValues TensorClampModeParams;
+EnumValues TensorAddressingOperandsParams;
+EnumValues TensorOperandsParams;
EnumValues InitializationModeQualifierParams;
EnumValues HostAccessQualifierParams;
EnumValues LoadCacheControlParams;
EnumValues StoreCacheControlParams;
EnumValues NamedMaximumNumberOfRegistersParams;
+EnumValues MatrixMultiplyAccumulateOperandsParams;
EnumValues RawAccessChainOperandsParams;
+EnumValues FPEncodingParams;
+EnumValues CooperativeVectorMatrixLayoutParams;
+EnumValues ComponentTypeParams;
std::pair<bool, std::string> ReadFile(const std::string& path)
{
@@ -424,10 +414,18 @@
type = OperandPackedVectorFormat;
} else if (operandKind == "CooperativeMatrixOperands") {
type = OperandCooperativeMatrixOperands;
+ } else if (operandKind == "TensorAddressingOperands") {
+ type = OperandTensorAddressingOperands;
} else if (operandKind == "CooperativeMatrixLayout") {
type = OperandCooperativeMatrixLayout;
} else if (operandKind == "CooperativeMatrixUse") {
type = OperandCooperativeMatrixUse;
+ } else if (operandKind == "CooperativeMatrixReduce") {
+ type = OperandCooperativeMatrixReduce;
+ } else if (operandKind == "TensorClampMode") {
+ type = OperandTensorClampMode;
+ } else if (operandKind == "TensorOperands") {
+ type = OperandTensorOperands;
} else if (operandKind == "InitializationModeQualifier") {
type = OperandInitializationModeQualifier;
} else if (operandKind == "HostAccessQualifier") {
@@ -438,8 +436,16 @@
type = OperandStoreCacheControl;
} else if (operandKind == "NamedMaximumNumberOfRegisters") {
type = OperandNamedMaximumNumberOfRegisters;
+ } else if (operandKind == "MatrixMultiplyAccumulateOperands") {
+ type = OperandMatrixMultiplyAccumulateOperands;
} else if (operandKind == "RawAccessChainOperands") {
type = OperandRawAccessChainOperands;
+ } else if (operandKind == "FPEncoding") {
+ type = OperandFPEncoding;
+ } else if (operandKind == "CooperativeVectorMatrixLayout") {
+ type = OperandCooperativeVectorMatrixLayout;
+ } else if (operandKind == "ComponentType") {
+ type = OperandComponentType;
}
if (type == OperandNone) {
@@ -528,6 +534,18 @@
return result;
};
+ const auto getAliases = [](const Json::Value& object) {
+ Aliases result;
+ const auto& aliases = object["aliases"];
+ if (!aliases.empty()) {
+ assert(aliases.isArray());
+ for (const auto& alias : aliases) {
+ result.emplace_back(alias.asString());
+ }
+ }
+ return result;
+ };
+
// set up the printing classes
std::unordered_set<std::string> tags; // short-lived local for error checking below
const Json::Value printingClasses = root["instruction_printing_class"];
@@ -547,6 +565,8 @@
// process the instructions
const Json::Value insts = root["instructions"];
unsigned maxOpcode = 0;
+ std::string maxName = "";
+ bool maxCore = false;
bool firstOpcode = true;
for (const auto& inst : insts) {
const auto printingClass = inst["class"].asString();
@@ -565,8 +585,11 @@
}
const auto opcode = inst["opcode"].asUInt();
const std::string name = inst["opname"].asString();
+ std::string version = inst["version"].asString();
if (firstOpcode) {
maxOpcode = opcode;
+ maxName = name;
+ maxCore = version != "None";
firstOpcode = false;
} else {
if (maxOpcode > opcode) {
@@ -574,12 +597,18 @@
<< " is out of order. It follows the instruction with opcode " << maxOpcode
<< std::endl;
std::exit(1);
+ } else if (maxOpcode == opcode) {
+ std::cerr << "Error: " << name << " is an alias of " << maxName
+ << ". Use \"aliases\" instead." << std::endl;
+ std::exit(1);
} else {
maxOpcode = opcode;
+ maxName = name;
+ maxCore = version != "None";
}
}
+ Aliases aliases = getAliases(inst);
EnumCaps caps = getCaps(inst);
- std::string version = inst["version"].asString();
std::string lastVersion = inst["lastVersion"].asString();
Extensions exts = getExts(inst);
OperandParameters operands;
@@ -595,7 +624,7 @@
}
}
InstructionDesc.emplace_back(
- std::move(EnumValue(opcode, name,
+ std::move(EnumValue(opcode, name, std::move(aliases),
std::move(caps), std::move(version), std::move(lastVersion), std::move(exts),
std::move(operands))),
printingClass, defTypeId, defResultId);
@@ -607,7 +636,7 @@
// Specific additional context-dependent operands
// Populate dest with EnumValue objects constructed from source.
- const auto populateEnumValues = [&getCaps,&getExts,&errorCount](EnumValues* dest, const Json::Value& source, bool bitEnum) {
+ const auto populateEnumValues = [&getCaps,&getAliases,&getExts,&errorCount](EnumValues* dest, const Json::Value& source, bool bitEnum) {
// A lambda for determining the numeric value to be used for a given
// enumerant in JSON form, and whether that value is a 0 in a bitfield.
auto getValue = [&bitEnum](const Json::Value& enumerant) {
@@ -625,28 +654,40 @@
};
unsigned maxValue = 0;
+ std::string maxName = "";
+ bool maxCore = false;
bool firstValue = true;
for (const auto& enumerant : source["enumerants"]) {
unsigned value;
bool skip_zero_in_bitfield;
std::tie(value, skip_zero_in_bitfield) = getValue(enumerant);
+ std::string name = enumerant["enumerant"].asString();
+ std::string version = enumerant["version"].asString();
if (skip_zero_in_bitfield)
continue;
if (firstValue) {
maxValue = value;
+ maxName = name;
+ maxCore = version != "None";
firstValue = false;
} else {
if (maxValue > value) {
- std::cerr << "Error: " << source["kind"] << " enumerant " << enumerant["enumerant"]
+ std::cerr << "Error: " << source["kind"] << " enumerant " << name
<< " is out of order. It has value " << value
<< " but follows the enumerant with value " << maxValue << std::endl;
std::exit(1);
+ } else if (maxValue == value ) {
+ std::cerr << "Error: " << source["kind"] << " enumerant " << name
+ << " is an alias of " << maxName << ". Use \"aliases\" instead." << std::endl;
+ std::exit(1);
} else {
maxValue = value;
+ maxName = name;
+ maxCore = version != "None";
}
}
+ Aliases aliases = getAliases(enumerant);
EnumCaps caps(getCaps(enumerant));
- std::string version = enumerant["version"].asString();
std::string lastVersion = enumerant["lastVersion"].asString();
Extensions exts(getExts(enumerant));
OperandParameters params;
@@ -661,7 +702,7 @@
}
}
dest->emplace_back(
- value, enumerant["enumerant"].asString(),
+ value, enumerant["enumerant"].asString(), std::move(aliases),
std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), std::move(params));
}
};
@@ -771,10 +812,18 @@
establishOperandClass(enumName, OperandPackedVectorFormat, &PackedVectorFormatParams, operandEnum, category);
} else if (enumName == "CooperativeMatrixOperands") {
establishOperandClass(enumName, OperandCooperativeMatrixOperands, &CooperativeMatrixOperandsParams, operandEnum, category);
+ } else if (enumName == "TensorAddressingOperands") {
+ establishOperandClass(enumName, OperandTensorAddressingOperands, &TensorAddressingOperandsParams, operandEnum, category);
} else if (enumName == "CooperativeMatrixLayout") {
establishOperandClass(enumName, OperandCooperativeMatrixLayout, &CooperativeMatrixLayoutParams, operandEnum, category);
} else if (enumName == "CooperativeMatrixUse") {
establishOperandClass(enumName, OperandCooperativeMatrixUse, &CooperativeMatrixUseParams, operandEnum, category);
+ } else if (enumName == "CooperativeMatrixReduce") {
+ establishOperandClass(enumName, OperandCooperativeMatrixReduce, &CooperativeMatrixReduceParams, operandEnum, category);
+ } else if (enumName == "TensorClampMode") {
+ establishOperandClass(enumName, OperandTensorClampMode, &TensorClampModeParams, operandEnum, category);
+ } else if (enumName == "TensorOperands") {
+ establishOperandClass(enumName, OperandTensorOperands, &TensorOperandsParams, operandEnum, category);
} else if (enumName == "InitializationModeQualifier") {
establishOperandClass(enumName, OperandInitializationModeQualifier, &InitializationModeQualifierParams, operandEnum, category);
} else if (enumName == "HostAccessQualifier") {
@@ -785,8 +834,16 @@
establishOperandClass(enumName, OperandStoreCacheControl, &StoreCacheControlParams, operandEnum, category);
} else if (enumName == "NamedMaximumNumberOfRegisters") {
establishOperandClass(enumName, OperandNamedMaximumNumberOfRegisters, &NamedMaximumNumberOfRegistersParams, operandEnum, category);
+ } else if (enumName == "MatrixMultiplyAccumulateOperands") {
+ establishOperandClass(enumName, OperandMatrixMultiplyAccumulateOperands, &MatrixMultiplyAccumulateOperandsParams, operandEnum, category);
} else if (enumName == "RawAccessChainOperands") {
establishOperandClass(enumName, OperandRawAccessChainOperands, &RawAccessChainOperandsParams, operandEnum, category);
+ } else if (enumName == "FPEncoding") {
+ establishOperandClass(enumName, OperandFPEncoding, &FPEncodingParams, operandEnum, category);
+ } else if (enumName == "CooperativeVectorMatrixLayout") {
+ establishOperandClass(enumName, OperandCooperativeVectorMatrixLayout, &CooperativeVectorMatrixLayoutParams, operandEnum, category);
+ } else if (enumName == "ComponentType") {
+ establishOperandClass(enumName, OperandComponentType, &ComponentTypeParams, operandEnum, category);
}
}
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.h b/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.h
index c8de68f..629af66 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.h
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/jsonToSpirv.h
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 The Khronos Group Inc.
+// SPDX-FileCopyrightText: 2014-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
//
-// 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.
+// 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/
#pragma once
#ifndef JSON_TO_SPIRV
@@ -99,12 +83,20 @@
OperandCooperativeMatrixOperands,
OperandCooperativeMatrixLayout,
OperandCooperativeMatrixUse,
+ OperandCooperativeMatrixReduce,
+ OperandTensorClampMode,
+ OperandTensorAddressingOperands,
+ OperandTensorOperands,
OperandInitializationModeQualifier,
OperandHostAccessQualifier,
OperandLoadCacheControl,
OperandStoreCacheControl,
OperandNamedMaximumNumberOfRegisters,
+ OperandMatrixMultiplyAccumulateOperands,
OperandRawAccessChainOperands,
+ OperandFPEncoding,
+ OperandCooperativeVectorMatrixLayout,
+ OperandComponentType,
OperandOpcode,
@@ -124,6 +116,9 @@
// A set of extensions.
typedef std::vector<std::string> Extensions;
+// A set of aliases.
+typedef std::vector<std::string> Aliases;
+
// Parameterize a set of operands with their OperandClass(es) and descriptions.
class OperandParameters {
public:
@@ -137,6 +132,7 @@
void setOptional();
OperandClass getClass(int op) const { return opClass[op]; }
const char* getDesc(int op) const { return desc[op].c_str(); }
+ void setDesc(int op, const std::string& d) { desc[op] = d; }
bool isOptional(int op) const { return optional[op]; }
int getNum() const { return (int)opClass.size(); }
@@ -204,18 +200,21 @@
class EnumValue {
public:
EnumValue() : value(0), desc(nullptr) {}
- EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps,
+ EnumValue(unsigned int the_value, const std::string& the_name, Aliases&& the_aliases, EnumCaps&& the_caps,
const std::string& the_firstVersion, const std::string& the_lastVersion,
Extensions&& the_extensions, OperandParameters&& the_operands) :
- value(the_value), name(the_name), capabilities(std::move(the_caps)),
+ value(the_value), name(the_name), aliases(std::move(the_aliases)), capabilities(std::move(the_caps)),
firstVersion(std::move(the_firstVersion)), lastVersion(std::move(the_lastVersion)),
extensions(std::move(the_extensions)), operands(std::move(the_operands)), desc(nullptr) { }
+ bool hasAliases() const { return !aliases.empty(); }
+
// For ValueEnum, the value from the JSON file.
// For BitEnum, the index of the bit position represented by this mask.
// (That is, what you shift 1 by to get the mask.)
unsigned value;
std::string name;
+ Aliases aliases;
EnumCaps capabilities;
std::string firstVersion;
std::string lastVersion;
@@ -275,21 +274,16 @@
InstructionValue(EnumValue&& e, const std::string& printClass, bool has_type, bool has_result)
: EnumValue(std::move(e)),
printingClass(printClass),
- opDesc("TBD"),
+ opDesc("TBD."),
typePresent(has_type),
- resultPresent(has_result),
- alias(this) { }
+ resultPresent(has_result) { }
InstructionValue(const InstructionValue& v)
{
*this = v;
- alias = this;
}
bool hasResult() const { return resultPresent != 0; }
bool hasType() const { return typePresent != 0; }
- void setAlias(const InstructionValue& a) { alias = &a; }
- const InstructionValue& getAlias() const { return *alias; }
- bool isAlias() const { return alias != this; }
std::string printingClass;
const char* opDesc;
@@ -297,7 +291,6 @@
protected:
int typePresent : 1;
int resultPresent : 1;
- const InstructionValue* alias; // correct only after discovering the aliases; otherwise points to this
};
using InstructionValues = EnumValuesContainer<InstructionValue>;
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h b/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h
index ccbdb2b..901bc06 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json-forwards.h
@@ -7,28 +7,28 @@
// //////////////////////////////////////////////////////////////////////
/*
-The JsonCpp library's source code, including accompanying documentation,
+The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all
-jurisdictions which recognize such a disclaimer. In such jurisdictions,
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
released under the terms of the MIT License (see below).
-In jurisdictions which recognize Public Domain property, the user of this
-software may choose to accept it either as 1) Public Domain, 2) under the
-conditions of the MIT License (see below), or 3) under the terms of dual
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
Public Domain/MIT License conditions described here, as they choose.
The MIT License is about as close to Public Domain as a license can get, and is
described in clear, concise terms at:
http://en.wikipedia.org/wiki/MIT_License
-
+
The full text of the MIT License follows:
========================================================================
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json.h b/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json.h
index e01991e..7145b1a 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json.h
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json/json.h
@@ -6,28 +6,28 @@
// //////////////////////////////////////////////////////////////////////
/*
-The JsonCpp library's source code, including accompanying documentation,
+The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all
-jurisdictions which recognize such a disclaimer. In such jurisdictions,
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
released under the terms of the MIT License (see below).
-In jurisdictions which recognize Public Domain property, the user of this
-software may choose to accept it either as 1) Public Domain, 2) under the
-conditions of the MIT License (see below), or 3) under the terms of dual
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
Public Domain/MIT License conditions described here, as they choose.
The MIT License is about as close to Public Domain as a license can get, and is
described in clear, concise terms at:
http://en.wikipedia.org/wiki/MIT_License
-
+
The full text of the MIT License follows:
========================================================================
@@ -398,14 +398,14 @@
/** Exceptions which the user cannot easily avoid.
*
* E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
- *
+ *
* \remark derived from Json::Exception
*/
class JSON_API RuntimeError;
/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
*
* These are precondition-violations (user bugs) and internal errors (our bugs).
- *
+ *
* \remark derived from Json::Exception
*/
class JSON_API LogicError;
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp b/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp
index 1304914..49569f9 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp
@@ -6,28 +6,28 @@
// //////////////////////////////////////////////////////////////////////
/*
-The JsonCpp library's source code, including accompanying documentation,
+The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all
-jurisdictions which recognize such a disclaimer. In such jurisdictions,
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
released under the terms of the MIT License (see below).
-In jurisdictions which recognize Public Domain property, the user of this
-software may choose to accept it either as 1) Public Domain, 2) under the
-conditions of the MIT License (see below), or 3) under the terms of dual
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
Public Domain/MIT License conditions described here, as they choose.
The MIT License is about as close to Public Domain as a license can get, and is
described in clear, concise terms at:
http://en.wikipedia.org/wiki/MIT_License
-
+
The full text of the MIT License follows:
========================================================================
@@ -3971,7 +3971,7 @@
#define snprintf std::snprintf
#endif
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__)
#include <float.h>
#define isfinite _finite
#define snprintf _snprintf
diff --git a/third_party/SPIRV-Headers/tools/buildHeaders/main.cpp b/third_party/SPIRV-Headers/tools/buildHeaders/main.cpp
index 6e6a03b..e9a1e92 100644
--- a/third_party/SPIRV-Headers/tools/buildHeaders/main.cpp
+++ b/third_party/SPIRV-Headers/tools/buildHeaders/main.cpp
@@ -1,26 +1,10 @@
-// Copyright (c) 2014-2024 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.
+// SPDX-FileCopyrightText: 2014-2024 The Khronos Group Inc.
+// SPDX-License-Identifier: MIT
+//
+// 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/
//#include <fstream>
#include <string>
diff --git a/third_party/SPIRV-Tools/.github/workflows/autoroll.yml b/third_party/SPIRV-Tools/.github/workflows/autoroll.yml
index ed33622..eb0b0fe 100644
--- a/third_party/SPIRV-Tools/.github/workflows/autoroll.yml
+++ b/third_party/SPIRV-Tools/.github/workflows/autoroll.yml
@@ -16,7 +16,7 @@
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Checkout the depot tools they are needed by roll_deps.sh
- name: Checkout depot tools
diff --git a/third_party/SPIRV-Tools/.github/workflows/bazel.yml b/third_party/SPIRV-Tools/.github/workflows/bazel.yml
index 43c99d6..0377b13 100644
--- a/third_party/SPIRV-Tools/.github/workflows/bazel.yml
+++ b/third_party/SPIRV-Tools/.github/workflows/bazel.yml
@@ -7,28 +7,53 @@
branches:
- 'main'
pull_request:
+ types: [opened, synchronize, reopened, unlabeled]
jobs:
build:
+ if: github.event.action != 'unlabeled' || github.event.label.name == 'kokoro:run'
timeout-minutes: 120
strategy:
matrix:
- os: [ubuntu-latest, macos-latest, windows-2019]
+ os: [ubuntu-latest, windows-2025]
runs-on: ${{matrix.os}}
steps:
- - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
- name: Download dependencies
run: python3 utils/git-sync-deps
- name: Mount Bazel cache
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.bazel/cache
key: bazel-cache-${{ runner.os }}
- name: Build All
run: bazel --output_user_root=~/.bazel/cache build //...
- name: Test All
- run: bazel --output_user_root=~/.bazel/cache test //...
+ run: bazel --output_user_root=~/.bazel/cache test --test_output=errors //...
+
+ # iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed
+ # The steps are unfortunately duplicated because github actions requires 2 jobs for a dependency
+ build-macos:
+ needs: build
+ timeout-minutes: 120
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ fetch-depth: '0'
+ - name: Download dependencies
+ run: python3 utils/git-sync-deps
+ - name: Mount Bazel cache
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+ with:
+ path: ~/.bazel/cache
+ key: bazel-cache-${{ runner.os }}
+ - name: Build All
+ run: bazel --output_user_root=~/.bazel/cache build //...
+ - name: Test All
+ run: bazel --output_user_root=~/.bazel/cache test --test_output=errors //...
diff --git a/third_party/SPIRV-Tools/.github/workflows/ios.yml b/third_party/SPIRV-Tools/.github/workflows/ios.yml
index feb64a7..aece8de 100644
--- a/third_party/SPIRV-Tools/.github/workflows/ios.yml
+++ b/third_party/SPIRV-Tools/.github/workflows/ios.yml
@@ -2,17 +2,20 @@
permissions:
contents: read
-on: [push, pull_request, workflow_dispatch]
+on:
+ workflow_run:
+ # iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed
+ workflows: ["Wasm Build"]
+ types:
+ - completed
jobs:
build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ macos-12, macos-13 ]
+ runs-on: macos-latest
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- - uses: lukka/get-cmake@4931ab1fc1604964c055eb330edb3f6b26ba0cfa # v3.29.2
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: lukka/get-cmake@6b3e96a9bc9976b8b546346fdd102effedae0ca8 # v4.02
- name: Download dependencies
run: python3 utils/git-sync-deps
# NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
diff --git a/third_party/SPIRV-Tools/.github/workflows/release.yml b/third_party/SPIRV-Tools/.github/workflows/release.yml
index 583c8f1..1e0d865 100644
--- a/third_party/SPIRV-Tools/.github/workflows/release.yml
+++ b/third_party/SPIRV-Tools/.github/workflows/release.yml
@@ -13,7 +13,7 @@
prepare-release-job:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare CHANGELOG for version
run: |
python utils/generate_changelog.py CHANGES "${{ github.ref_name }}" VERSION_CHANGELOG
diff --git a/third_party/SPIRV-Tools/.github/workflows/scorecard.yml b/third_party/SPIRV-Tools/.github/workflows/scorecard.yml
index adcfa76..079dcf0 100644
--- a/third_party/SPIRV-Tools/.github/workflows/scorecard.yml
+++ b/third_party/SPIRV-Tools/.github/workflows/scorecard.yml
@@ -23,12 +23,12 @@
steps:
- name: "Checkout code"
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
+ uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
with:
results_file: results.sarif
results_format: sarif
@@ -40,7 +40,7 @@
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
- uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
@@ -48,6 +48,6 @@
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1
+ uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
with:
sarif_file: results.sarif
diff --git a/third_party/SPIRV-Tools/.github/workflows/wasm.yml b/third_party/SPIRV-Tools/.github/workflows/wasm.yml
index 6807b3d..fd74357 100644
--- a/third_party/SPIRV-Tools/.github/workflows/wasm.yml
+++ b/third_party/SPIRV-Tools/.github/workflows/wasm.yml
@@ -2,17 +2,23 @@
permissions:
contents: read
-on: [push, pull_request]
+on:
+ push:
+ branches:
+ - 'main'
+ pull_request:
+ types: [opened, synchronize, reopened, unlabeled]
jobs:
build:
+ if: github.event.action != 'unlabeled' || github.event.label.name == 'kokoro:run'
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
- name: Build web
- run: docker-compose -f source/wasm/docker-compose.yml --project-directory . up
+ run: docker compose -f source/wasm/docker-compose.yml --project-directory . up
- name: Run tests
run: node test/wasm/test.js
diff --git a/third_party/SPIRV-Tools/.gitignore b/third_party/SPIRV-Tools/.gitignore
index e85cea9..042becf 100644
--- a/third_party/SPIRV-Tools/.gitignore
+++ b/third_party/SPIRV-Tools/.gitignore
@@ -11,6 +11,7 @@
/external/effcee
/external/re2
/external/protobuf
+/external/mimalloc
/out
/TAGS
/third_party/llvm-build/
diff --git a/third_party/SPIRV-Tools/BUILD.bazel b/third_party/SPIRV-Tools/BUILD.bazel
index 48a688e..979c233 100644
--- a/third_party/SPIRV-Tools/BUILD.bazel
+++ b/third_party/SPIRV-Tools/BUILD.bazel
@@ -5,12 +5,9 @@
"DEBUGINFO_GRAMMAR_JSON_FILE",
"SHDEBUGINFO100_GRAMMAR_JSON_FILE",
"TEST_COPTS",
- "generate_core_tables",
- "generate_enum_string_mapping",
+ "create_grammar_tables_target",
+ "ExtInst",
"generate_extinst_lang_headers",
- "generate_glsl_tables",
- "generate_opencl_tables",
- "generate_vendor_tables",
"incompatible_with",
)
@@ -29,8 +26,18 @@
])
py_binary(
- name = "generate_grammar_tables",
- srcs = ["utils/generate_grammar_tables.py"],
+ # The script that generates compressed grammar tables for
+ # instructions and operands.
+ name = "ggt",
+ main = "utils/ggt.py", # The file found by $(location :ggt)
+ srcs = [
+ "utils/ggt.py",
+ "utils/Table/__init__.py",
+ "utils/Table/Context.py",
+ "utils/Table/IndexRange.py",
+ "utils/Table/Operand.py",
+ "utils/Table/StringList.py",
+ ],
)
py_binary(
@@ -38,36 +45,24 @@
srcs = ["utils/generate_language_headers.py"],
)
-generate_core_tables(version = "unified1")
-
-generate_enum_string_mapping(version = "unified1")
-
-generate_opencl_tables(version = "unified1")
-
-generate_glsl_tables(version = "unified1")
-
-generate_vendor_tables(extension = "spv-amd-shader-explicit-vertex-parameter")
-
-generate_vendor_tables(extension = "spv-amd-shader-trinary-minmax")
-
-generate_vendor_tables(extension = "spv-amd-gcn-shader")
-
-generate_vendor_tables(extension = "spv-amd-shader-ballot")
-
-generate_vendor_tables(extension = "debuginfo")
-
-generate_vendor_tables(extension = "nonsemantic.clspvreflection")
-
-generate_vendor_tables(extension = "nonsemantic.vkspreflection")
-
-generate_vendor_tables(
- extension = "opencl.debuginfo.100",
- operand_kind_prefix = "CLDEBUG100_",
-)
-
-generate_vendor_tables(
- extension = "nonsemantic.shader.debuginfo.100",
- operand_kind_prefix = "SHDEBUG100_",
+create_grammar_tables_target(
+ name="core", # unused
+ extinsts = [
+ ExtInst("glsl.std.450", target="spirv_glsl_grammar_unified1"),
+ ExtInst("opencl.std.100", target="spirv_opencl_grammar_unified1"),
+ ExtInst("opencl.debuginfo.100", prefix="CLDEBUG100_"),
+ ExtInst("nonsemantic.shader.debuginfo.100", prefix="SHDEBUG100_"),
+ ExtInst("tosa.001000.1", target="spirv_ext_inst_tosa_001000_1", prefix="TOSA_"),
+ ] + [ExtInst(e) for e in [
+ "spv-amd-shader-explicit-vertex-parameter",
+ "spv-amd-shader-trinary-minmax",
+ "spv-amd-gcn-shader",
+ "spv-amd-shader-ballot",
+ "debuginfo",
+ "nonsemantic.clspvreflection",
+ "nonsemantic.vkspreflection",
+ ]
+ ]
)
generate_extinst_lang_headers(
@@ -110,7 +105,6 @@
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)",
- local = True,
tools = [":update_build_version"],
)
@@ -137,24 +131,14 @@
"source/*.cpp",
"source/util/*.cpp",
"source/val/*.cpp",
+ ], exclude = [
+ "source/mimalloc.cpp"
]) + [
":build_version_inc",
- ":gen_core_tables_unified1",
- ":gen_enum_string_mapping",
+ ":gen_compressed_tables",
":gen_extinst_lang_headers_DebugInfo",
":gen_extinst_lang_headers_NonSemanticShaderDebugInfo100",
":gen_extinst_lang_headers_OpenCLDebugInfo100",
- ":gen_glsl_tables_unified1",
- ":gen_opencl_tables_unified1",
- ":gen_vendor_tables_debuginfo",
- ":gen_vendor_tables_nonsemantic_clspvreflection",
- ":gen_vendor_tables_nonsemantic_vkspreflection",
- ":gen_vendor_tables_nonsemantic_shader_debuginfo_100",
- ":gen_vendor_tables_opencl_debuginfo_100",
- ":gen_vendor_tables_spv_amd_gcn_shader",
- ":gen_vendor_tables_spv_amd_shader_ballot",
- ":gen_vendor_tables_spv_amd_shader_explicit_vertex_parameter",
- ":gen_vendor_tables_spv_amd_shader_trinary_minmax",
":generators_inc",
],
hdrs = [
@@ -179,7 +163,6 @@
cc_library(
name = "spirv_tools_opt",
hdrs = [
- "include/spirv-tools/instrument.hpp",
"include/spirv-tools/optimizer.hpp",
],
copts = COMMON_COPTS,
@@ -193,17 +176,15 @@
cc_library(
name = "spirv_tools_opt_internal",
- srcs = glob(["source/opt/*.cpp"]) + [
- ":gen_vendor_tables_spv_amd_shader_ballot",
- ],
+ srcs = glob(["source/opt/*.cpp"]),
hdrs = glob(["source/opt/*.h"]) + [
- "include/spirv-tools/instrument.hpp",
"include/spirv-tools/optimizer.hpp",
],
copts = COMMON_COPTS,
deps = [
":spirv_tools_internal",
"@spirv_headers//:spirv_common_headers",
+ "@spirv_headers//:spirv_c_headers",
],
)
@@ -272,6 +253,7 @@
cc_library(
name = "tools_io",
hdrs = ["tools/io.h"],
+ srcs = ["tools/io.cpp"],
copts = COMMON_COPTS,
)
@@ -449,8 +431,10 @@
"tools_util",
":spirv_tools_internal",
":test_lib",
+ ":tools_io",
"@googletest//:gtest",
"@googletest//:gtest_main",
+ "@spirv_headers//:spirv_common_headers",
],
) for f in glob(
[
@@ -498,8 +482,8 @@
":spirv_tools_internal",
":spirv_tools_link",
":test_lib",
- "@com_google_effcee//:effcee",
- "@com_googlesource_code_re2//:re2",
+ "@effcee//:effcee",
+ "@re2//:re2",
],
)
@@ -552,7 +536,7 @@
deps = [
":spirv_tools_internal",
":spirv_tools_opt_internal",
- "@com_google_effcee//:effcee",
+ "@effcee//:effcee",
"@googletest//:gtest",
],
)
@@ -568,7 +552,7 @@
":spirv_tools_internal",
":spirv_tools_opt_internal",
":test_lib",
- "@com_google_effcee//:effcee",
+ "@effcee//:effcee",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
@@ -601,7 +585,7 @@
":opt_test_lib",
":spirv_tools",
":spirv_tools_opt_internal",
- "@com_google_effcee//:effcee",
+ "@effcee//:effcee",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
diff --git a/third_party/SPIRV-Tools/BUILD.gn b/third_party/SPIRV-Tools/BUILD.gn
index 4848fdd..40e1fbb 100644
--- a/third_party/SPIRV-Tools/BUILD.gn
+++ b/third_party/SPIRV-Tools/BUILD.gn
@@ -22,8 +22,11 @@
# SPIRV-Tools may be part of multiple projects in the Chromium tree.
# Only enable building executables if this is the main copy.
abspath = get_path_info(".", "abspath")
-spvtools_chromium_third_party = (abspath == "//third_party/vulkan-deps/spirv-tools/src/")
-spvtools_build_executables = build_with_chromium && spvtools_chromium_third_party
+spvtools_chromium_third_party =
+ abspath == "//third_party/vulkan-deps/spirv-tools/src/"
+spvtools_build_executables =
+ build_with_chromium && spvtools_chromium_third_party
+
# Fuchsia also requires building the executables.
# TODO(b/158002593): Avoid the use of dependent-specific variables.
if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
@@ -36,169 +39,84 @@
spirv_headers = "../SPIRV-Headers"
spirv_is_winuwp = is_win && target_os == "winuwp"
-template("spvtools_core_tables") {
- assert(defined(invoker.version), "Need version in $target_name generation.")
+action("spvtools_core_tables") {
+ script = "utils/ggt.py"
- action("spvtools_core_tables_" + target_name) {
- script = "utils/generate_grammar_tables.py"
+ core_tables_body_file = "${target_gen_dir}/core_tables_body.inc"
+ core_tables_header_file = "${target_gen_dir}/core_tables_header.inc"
- version = invoker.version
+ # Extended instruction set grammar files
+ grammar_dir = "${spirv_headers}/include/spirv/unified1"
+ f0 = rebase_path("${grammar_dir}/extinst.debuginfo.grammar.json",
+ root_build_dir)
+ f1 = rebase_path("${grammar_dir}/extinst.glsl.std.450.grammar.json",
+ root_build_dir)
+ f2 = rebase_path(
+ "${grammar_dir}/extinst.nonsemantic.clspvreflection.grammar.json",
+ root_build_dir)
+ f3 = rebase_path(
+ "${grammar_dir}/extinst.nonsemantic.shader.debuginfo.100.grammar.json",
+ root_build_dir)
+ f4 = rebase_path(
+ "${grammar_dir}/extinst.nonsemantic.vkspreflection.grammar.json",
+ root_build_dir)
+ f5 = rebase_path("${grammar_dir}/extinst.opencl.debuginfo.100.grammar.json",
+ root_build_dir)
+ f6 = rebase_path("${grammar_dir}/extinst.opencl.std.100.grammar.json",
+ root_build_dir)
+ f7 = rebase_path("${grammar_dir}/extinst.spv-amd-gcn-shader.grammar.json",
+ root_build_dir)
+ f8 = rebase_path("${grammar_dir}/extinst.spv-amd-shader-ballot.grammar.json",
+ root_build_dir)
+ f9 = rebase_path(
+ "${grammar_dir}/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json",
+ root_build_dir)
+ f10 = rebase_path(
+ "${grammar_dir}/extinst.spv-amd-shader-trinary-minmax.grammar.json",
+ root_build_dir)
- core_json_file =
- "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
- core_insts_file = "${target_gen_dir}/core.insts-$version.inc"
- operand_kinds_file = "${target_gen_dir}/operand.kinds-$version.inc"
- debuginfo_insts_file =
- "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
- cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
-
- sources = [
- cldebuginfo100_insts_file,
- core_json_file,
- debuginfo_insts_file,
- ]
- outputs = [
- core_insts_file,
- operand_kinds_file,
- ]
- args = [
- "--spirv-core-grammar",
- rebase_path(core_json_file, root_build_dir),
- "--core-insts-output",
- rebase_path(core_insts_file, root_build_dir),
- "--extinst-debuginfo-grammar",
- rebase_path(debuginfo_insts_file, root_build_dir),
- "--extinst-cldebuginfo100-grammar",
- rebase_path(cldebuginfo100_insts_file, root_build_dir),
- "--operand-kinds-output",
- rebase_path(operand_kinds_file, root_build_dir),
- "--output-language",
- "c++"
- ]
- }
-}
-
-template("spvtools_core_enums") {
- assert(defined(invoker.version), "Need version in $target_name generation.")
-
- action("spvtools_core_enums_" + target_name) {
- script = "utils/generate_grammar_tables.py"
-
- version = invoker.version
-
- core_json_file =
- "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
- debuginfo_insts_file =
- "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
- cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
-
- extension_enum_file = "${target_gen_dir}/extension_enum.inc"
- extension_map_file = "${target_gen_dir}/enum_string_mapping.inc"
-
- args = [
- "--spirv-core-grammar",
- rebase_path(core_json_file, root_build_dir),
- "--extinst-debuginfo-grammar",
- rebase_path(debuginfo_insts_file, root_build_dir),
- "--extinst-cldebuginfo100-grammar",
- rebase_path(cldebuginfo100_insts_file, root_build_dir),
- "--extension-enum-output",
- 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,
- debuginfo_insts_file,
- cldebuginfo100_insts_file,
- ]
- outputs = [
- extension_enum_file,
- extension_map_file,
- ]
- }
-}
-
-template("spvtools_glsl_tables") {
- assert(defined(invoker.version), "Need version in $target_name generation.")
-
- action("spvtools_glsl_tables_" + target_name) {
- script = "utils/generate_grammar_tables.py"
-
- version = invoker.version
-
- core_json_file =
- "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
- glsl_json_file = "${spirv_headers}/include/spirv/${version}/extinst.glsl.std.450.grammar.json"
- debuginfo_insts_file =
- "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
- cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
-
- glsl_insts_file = "${target_gen_dir}/glsl.std.450.insts.inc"
-
- args = [
- "--spirv-core-grammar",
- rebase_path(core_json_file, root_build_dir),
- "--extinst-debuginfo-grammar",
- rebase_path(debuginfo_insts_file, root_build_dir),
- "--extinst-cldebuginfo100-grammar",
- rebase_path(cldebuginfo100_insts_file, root_build_dir),
- "--extinst-glsl-grammar",
- 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,
- glsl_json_file,
- debuginfo_insts_file,
- cldebuginfo100_insts_file,
- ]
- outputs = [ glsl_insts_file ]
- }
-}
-
-template("spvtools_opencl_tables") {
- assert(defined(invoker.version), "Need version in $target_name generation.")
-
- action("spvtools_opencl_tables_" + target_name) {
- script = "utils/generate_grammar_tables.py"
-
- version = invoker.version
-
- core_json_file =
- "${spirv_headers}/include/spirv/$version/spirv.core.grammar.json"
- opencl_json_file = "${spirv_headers}/include/spirv/${version}/extinst.opencl.std.100.grammar.json"
- debuginfo_insts_file =
- "${spirv_headers}/include/spirv/unified1/extinst.debuginfo.grammar.json"
- cldebuginfo100_insts_file = "${spirv_headers}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
-
- opencl_insts_file = "${target_gen_dir}/opencl.std.insts.inc"
-
- args = [
- "--spirv-core-grammar",
- rebase_path(core_json_file, root_build_dir),
- "--extinst-debuginfo-grammar",
- rebase_path(debuginfo_insts_file, root_build_dir),
- "--extinst-cldebuginfo100-grammar",
- rebase_path(cldebuginfo100_insts_file, root_build_dir),
- "--extinst-opencl-grammar",
- rebase_path(opencl_json_file, root_build_dir),
- "--opencl-insts-output",
- rebase_path(opencl_insts_file, root_build_dir),
- ]
- inputs = [
- core_json_file,
- opencl_json_file,
- debuginfo_insts_file,
- cldebuginfo100_insts_file,
- ]
- outputs = [ opencl_insts_file ]
- }
+ sources = [
+ "${grammar_dir}/extinst.debuginfo.grammar.json",
+ "${grammar_dir}/extinst.glsl.std.450.grammar.json",
+ "${grammar_dir}/extinst.nonsemantic.clspvreflection.grammar.json",
+ "${grammar_dir}/extinst.nonsemantic.shader.debuginfo.100.grammar.json",
+ "${grammar_dir}/extinst.nonsemantic.vkspreflection.grammar.json",
+ "${grammar_dir}/extinst.opencl.debuginfo.100.grammar.json",
+ "${grammar_dir}/extinst.opencl.std.100.grammar.json",
+ "${grammar_dir}/extinst.spv-amd-gcn-shader.grammar.json",
+ "${grammar_dir}/extinst.spv-amd-shader-ballot.grammar.json",
+ "${grammar_dir}/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json",
+ "${grammar_dir}/extinst.spv-amd-shader-trinary-minmax.grammar.json",
+ "${grammar_dir}/spirv.core.grammar.json",
+ "utils/Table/Context.py",
+ "utils/Table/IndexRange.py",
+ "utils/Table/Operand.py",
+ "utils/Table/StringList.py",
+ "utils/Table/__init__.py",
+ ]
+ outputs = [
+ core_tables_body_file,
+ core_tables_header_file,
+ ]
+ args = [
+ "--spirv-core-grammar",
+ rebase_path("${grammar_dir}/spirv.core.grammar.json", root_build_dir),
+ "--extinst=,${f0}",
+ "--extinst=,${f1}",
+ "--extinst=,${f2}",
+ "--extinst=SHDEBUG100_,${f3}",
+ "--extinst=,${f4}",
+ "--extinst=CLDEBUG100_,${f5}",
+ "--extinst=,${f6}",
+ "--extinst=,${f7}",
+ "--extinst=,${f8}",
+ "--extinst=,${f9}",
+ "--extinst=,${f10}",
+ "--core-tables-body-output",
+ rebase_path(core_tables_body_file, root_build_dir),
+ "--core-tables-header-output",
+ rebase_path(core_tables_header_file, root_build_dir),
+ ]
}
template("spvtools_language_header") {
@@ -221,30 +139,6 @@
}
}
-template("spvtools_vendor_table") {
- assert(defined(invoker.name), "Need name in $target_name generation.")
-
- action("spvtools_vendor_tables_" + target_name) {
- script = "utils/generate_grammar_tables.py"
-
- name = invoker.name
- extinst_vendor_grammar =
- "${spirv_headers}/include/spirv/unified1/extinst.${name}.grammar.json"
- extinst_file = "${target_gen_dir}/${name}.insts.inc"
-
- args = [
- "--extinst-vendor-grammar",
- rebase_path(extinst_vendor_grammar, root_build_dir),
- "--vendor-insts-output",
- rebase_path(extinst_file, root_build_dir),
- "--vendor-operand-kind-prefix",
- invoker.operand_kind_prefix,
- ]
- inputs = [ extinst_vendor_grammar ]
- outputs = [ extinst_file ]
- }
-}
-
action("spvtools_generators_inc") {
script = "utils/generate_registry_tables.py"
@@ -275,18 +169,6 @@
]
}
-spvtools_core_tables("unified1") {
- version = "unified1"
-}
-spvtools_core_enums("unified1") {
- version = "unified1"
-}
-spvtools_glsl_tables("glsl1-0") {
- version = "1.0"
-}
-spvtools_opencl_tables("opencl1-0") {
- version = "1.0"
-}
spvtools_language_header("debuginfo") {
name = "DebugInfo"
grammar_file =
@@ -301,52 +183,6 @@
grammar_file = "${spirv_headers}/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json"
}
-spvtools_vendor_tables = [
- [
- "spv-amd-shader-explicit-vertex-parameter",
- "...nil...",
- ],
- [
- "spv-amd-shader-trinary-minmax",
- "...nil...",
- ],
- [
- "spv-amd-gcn-shader",
- "...nil...",
- ],
- [
- "spv-amd-shader-ballot",
- "...nil...",
- ],
- [
- "debuginfo",
- "...nil...",
- ],
- [
- "opencl.debuginfo.100",
- "CLDEBUG100_",
- ],
- [
- "nonsemantic.clspvreflection",
- "...nil...",
- ],
- [
- "nonsemantic.vkspreflection",
- "...nil...",
- ],
- [
- "nonsemantic.shader.debuginfo.100",
- "SHDEBUG100_",
- ],
-]
-
-foreach(table_def, spvtools_vendor_tables) {
- spvtools_vendor_table(table_def[0]) {
- name = table_def[0]
- operand_kind_prefix = table_def[1]
- }
-}
-
config("spvtools_public_config") {
include_dirs = [ "include" ]
}
@@ -391,7 +227,6 @@
source_set("spvtools_headers") {
sources = [
- "include/spirv-tools/instrument.hpp",
"include/spirv-tools/libspirv.h",
"include/spirv-tools/libspirv.hpp",
"include/spirv-tools/linker.hpp",
@@ -411,18 +246,12 @@
static_library("spvtools") {
deps = [
- ":spvtools_core_tables_unified1",
+ ":spvtools_core_tables",
":spvtools_generators_inc",
- ":spvtools_glsl_tables_glsl1-0",
":spvtools_language_header_cldebuginfo100",
":spvtools_language_header_debuginfo",
":spvtools_language_header_vkdebuginfo100",
- ":spvtools_opencl_tables_opencl1-0",
]
- foreach(table_def, spvtools_vendor_tables) {
- target_name = table_def[0]
- deps += [ ":spvtools_vendor_tables_$target_name" ]
- }
sources = [
"source/assembly_grammar.cpp",
@@ -436,8 +265,6 @@
"source/disassemble.cpp",
"source/disassemble.h",
"source/enum_set.h",
- "source/enum_string_mapping.cpp",
- "source/enum_string_mapping.h",
"source/ext_inst.cpp",
"source/ext_inst.h",
"source/extensions.cpp",
@@ -474,10 +301,14 @@
"source/spirv_validator_options.h",
"source/table.cpp",
"source/table.h",
+ "source/table2.cpp",
+ "source/table2.h",
"source/text.cpp",
"source/text.h",
"source/text_handler.cpp",
"source/text_handler.h",
+ "source/to_string.cpp",
+ "source/to_string.h",
"source/util/bit_vector.cpp",
"source/util/bit_vector.h",
"source/util/bitutils.h",
@@ -485,10 +316,12 @@
"source/util/hex_float.h",
"source/util/ilist.h",
"source/util/ilist_node.h",
+ "source/util/index_range.h",
"source/util/make_unique.h",
"source/util/parse_number.cpp",
"source/util/parse_number.h",
"source/util/small_vector.h",
+ "source/util/span.h",
"source/util/string_utils.cpp",
"source/util/string_utils.h",
"source/util/timer.cpp",
@@ -496,7 +329,6 @@
]
public_deps = [
- ":spvtools_core_enums_unified1",
":spvtools_headers",
"${spirv_headers}:spv_headers",
]
@@ -542,6 +374,7 @@
"source/val/validate_image.cpp",
"source/val/validate_instruction.cpp",
"source/val/validate_interfaces.cpp",
+ "source/val/validate_invalid_type.cpp",
"source/val/validate_layout.cpp",
"source/val/validate_literals.cpp",
"source/val/validate_logicals.cpp",
@@ -559,6 +392,8 @@
"source/val/validate_scopes.cpp",
"source/val/validate_scopes.h",
"source/val/validate_small_type_uses.cpp",
+ "source/val/validate_tensor.cpp",
+ "source/val/validate_tensor_layout.cpp",
"source/val/validate_type.cpp",
"source/val/validation_state.cpp",
"source/val/validation_state.h",
@@ -595,6 +430,8 @@
"source/opt/block_merge_util.h",
"source/opt/build_module.cpp",
"source/opt/build_module.h",
+ "source/opt/canonicalize_ids_pass.cpp",
+ "source/opt/canonicalize_ids_pass.h",
"source/opt/ccp_pass.cpp",
"source/opt/ccp_pass.h",
"source/opt/cfg.cpp",
@@ -684,18 +521,10 @@
"source/opt/inline_opaque_pass.h",
"source/opt/inline_pass.cpp",
"source/opt/inline_pass.h",
- "source/opt/inst_bindless_check_pass.cpp",
- "source/opt/inst_bindless_check_pass.h",
- "source/opt/inst_buff_addr_check_pass.cpp",
- "source/opt/inst_buff_addr_check_pass.h",
- "source/opt/inst_debug_printf_pass.cpp",
- "source/opt/inst_debug_printf_pass.h",
"source/opt/instruction.cpp",
"source/opt/instruction.h",
"source/opt/instruction_list.cpp",
"source/opt/instruction_list.h",
- "source/opt/instrument_pass.cpp",
- "source/opt/instrument_pass.h",
"source/opt/interface_var_sroa.cpp",
"source/opt/interface_var_sroa.h",
"source/opt/interp_fixup_pass.cpp",
@@ -749,6 +578,8 @@
"source/opt/module.cpp",
"source/opt/module.h",
"source/opt/null_pass.h",
+ "source/opt/opextinst_forward_ref_fixup_pass.cpp",
+ "source/opt/opextinst_forward_ref_fixup_pass.h",
"source/opt/optimizer.cpp",
"source/opt/pass.cpp",
"source/opt/pass.h",
@@ -778,6 +609,8 @@
"source/opt/replace_desc_array_access_using_var_index.h",
"source/opt/replace_invalid_opc.cpp",
"source/opt/replace_invalid_opc.h",
+ "source/opt/resolve_binding_conflicts_pass.cpp",
+ "source/opt/resolve_binding_conflicts_pass.h",
"source/opt/scalar_analysis.cpp",
"source/opt/scalar_analysis.h",
"source/opt/scalar_analysis_nodes.h",
@@ -788,6 +621,8 @@
"source/opt/set_spec_constant_default_value_pass.h",
"source/opt/simplification_pass.cpp",
"source/opt/simplification_pass.h",
+ "source/opt/split_combined_image_sampler_pass.cpp",
+ "source/opt/split_combined_image_sampler_pass.h",
"source/opt/spread_volatile_semantics.cpp",
"source/opt/spread_volatile_semantics.h",
"source/opt/ssa_rewrite_pass.cpp",
@@ -800,6 +635,8 @@
"source/opt/strip_nonsemantic_info_pass.h",
"source/opt/struct_cfg_analysis.cpp",
"source/opt/struct_cfg_analysis.h",
+ "source/opt/struct_packing_pass.cpp",
+ "source/opt/struct_packing_pass.h",
"source/opt/switch_descriptorset_pass.cpp",
"source/opt/switch_descriptorset_pass.h",
"source/opt/tree_iterator.h",
@@ -826,7 +663,6 @@
deps = [
":spvtools",
":spvtools_language_header_debuginfo",
- ":spvtools_vendor_tables_spv-amd-shader-ballot",
]
public_deps = [
":spvtools_headers",
@@ -1382,10 +1218,12 @@
"test/fix_word_test.cpp",
"test/generator_magic_number_test.cpp",
"test/hex_float_test.cpp",
+ "test/hex_to_text_test.cpp",
"test/immediate_int_test.cpp",
"test/libspirv_macros_test.cpp",
"test/name_mapper_test.cpp",
"test/named_id_test.cpp",
+ "test/op_unknown_test.cpp",
"test/opcode_make_test.cpp",
"test/opcode_require_capabilities_test.cpp",
"test/opcode_split_test.cpp",
@@ -1419,6 +1257,7 @@
"test/text_to_binary.type_declaration_test.cpp",
"test/text_to_binary_test.cpp",
"test/text_word_get_test.cpp",
+ "test/to_string_test.cpp",
"test/unit_spirv.cpp",
"test/unit_spirv.h",
]
@@ -1428,6 +1267,7 @@
":spvtools_language_header_cldebuginfo100",
":spvtools_language_header_debuginfo",
":spvtools_language_header_vkdebuginfo100",
+ ":spvtools_tools_io",
":spvtools_val",
"//testing/gmock",
"//testing/gtest",
@@ -1462,9 +1302,18 @@
source_set("spvtools_tools_util") {
sources = [
- "tools/util/flags.cpp",
"tools/util/cli_consumer.cpp",
"tools/util/cli_consumer.h",
+ "tools/util/flags.cpp",
+ ]
+ deps = [ ":spvtools_headers" ]
+ configs += [ ":spvtools_internal_config" ]
+}
+
+source_set("spvtools_tools_io") {
+ sources = [
+ "tools/io.cpp",
+ "tools/io.h",
]
deps = [ ":spvtools_headers" ]
configs += [ ":spvtools_internal_config" ]
@@ -1476,6 +1325,7 @@
deps = [
":spvtools",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
]
configs += [ ":spvtools_internal_config" ]
@@ -1486,6 +1336,7 @@
deps = [
":spvtools",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
]
configs += [ ":spvtools_internal_config" ]
@@ -1496,6 +1347,7 @@
deps = [
":spvtools",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
":spvtools_val",
]
@@ -1511,6 +1363,7 @@
deps = [
":spvtools",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
]
configs += [ ":spvtools_internal_config" ]
@@ -1522,6 +1375,7 @@
":spvtools",
":spvtools_opt",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
":spvtools_val",
]
@@ -1535,6 +1389,7 @@
":spvtools_link",
":spvtools_opt",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
":spvtools_val",
]
@@ -1542,7 +1397,8 @@
}
}
-if (!is_ios && !spirv_is_winuwp && build_with_chromium && spvtools_build_executables) {
+if (!is_ios && !spirv_is_winuwp && build_with_chromium &&
+ spvtools_build_executables) {
# iOS and UWP do not allow std::system calls which spirv-fuzz
# requires. Additionally, spirv-fuzz is only built when in a
# Chromium checkout due to its dependency on protobuf.
@@ -1555,6 +1411,7 @@
":spvtools_opt",
":spvtools_reduce",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
":spvtools_val",
"//third_party/protobuf:protobuf_full",
@@ -1574,6 +1431,7 @@
":spvtools_opt",
":spvtools_reduce",
":spvtools_software_version",
+ ":spvtools_tools_io",
":spvtools_tools_util",
":spvtools_val",
]
@@ -1581,7 +1439,7 @@
}
}
-if (spvtools_build_executables){
+if (spvtools_build_executables) {
group("all_spirv_tools") {
deps = [
":spirv-as",
diff --git a/third_party/SPIRV-Tools/CHANGES b/third_party/SPIRV-Tools/CHANGES
index 102703a..9d14bf9 100644
--- a/third_party/SPIRV-Tools/CHANGES
+++ b/third_party/SPIRV-Tools/CHANGES
@@ -1,5 +1,138 @@
Revision history for SPIRV-Tools
+v2025.3 2025-06-23
+ - General
+ - Add mimalloc to improve multithreaded performance (#6188)
+ - python: Use type annotations compatible with python 3.8 (#6119)
+ - fix clang-20 build issue (#6103)
+ - Optimizer
+ - Add --canonicalize-ids pass (#6174)
+ - Keep instructions used by the DebugBuildIdentifier (#6189)
+ - opt: Pass DebugDeclare scope to DebugValue (#6178)
+ - Add SPV_NV_linear_swept_spheres to allow list. (#6168)
+ - Add initial support for SPV_EXT_float8 (#6170)
+ - Keep DebugBuildIdentifier during dce (#6166)
+ - Add SPV_NV_cluster_acceleration_structure to allow lists (#6163)
+ - [OPT] prevent private_to_local_pass optimizing double pointer (#6161)
+ - [OPT] Use conservative default case for `GetPtr` (#6158)
+ - [OPT] Set the BB for the debug instruction when moved. (#6153)
+ - Add support for SPV_ARM_tensors (#6134)
+ - [opt] Move debug instruction when neccessary in copy prop arrays. (#6142)
+ - [OPT] Remove recursion from redundancy_elimination (#6141)
+ - opt: add SPV_NV_shader_invocation_reorder to allowlist (#6122)
+ - Validator
+ - spirv-val: tidy up validation of type constraints for IDs (#6185)
+ - Add validation support for MeshEXT based on the spec update PR https://github.com/KhronosGroup/Vulkan-Docs/pull/2475 (#6171)
+ - spirv-val: Label maintenance9 new VUID (#6176)
+ - spirv-val: add positive test for FP8 cooperative matrices (#6175)
+ - spirv-val: Give hints when user is forgetting feature bit (#6164)
+ - val: Fix CullPrimitiveEXT array of bool (#6155)
+ - [spirv-val] Add the validation checks for SPV_QCOM_tile_shading (#6130)
+ - spirv-val: allow Float16 in OpenCL environments (#6110)
+ - spirv-val: Update 1.4.312 VUID churn (#6082)
+ - Assembler
+ - Add minimal as/dis support for TOSA.001000.1 extended instruction set (#6183)
+ - Disassembler
+ - spirv-dis: Set a hard limit on last_instruction_comment_alignment_ (#6149)
+
+v2025.2 2025-04-22
+ - General
+ - Add SPV_KHR_bfloat16 support (#6057)
+ - Optimizer
+ - Fold bitwise operator and arithmetic with 0 (#6013)
+ - Support scalar replacement of large structs (#6019)
+ - Support optimization of OpCopyLogical (#6016)
+ - add pass to split combined image samplers (#6035)
+ - value numbering: preserve loads of image, sampler, sampled image (#6059)
+ - Delete decoration for OpPhi when unrolling (#6064)
+ - Add QuadControlKHR to trim pass and allow lists (#6068)
+ - In copy propagate arrays, debug instructions are not stores. (#6078)
+ - Minimal opt support for SPV_KHR_untyped_pointers (#6087)
+ - Validator
+ - Add validation for invalid layout decoration usage (#6012, #6020)
+ - Add Vulkan Aligned PowerOfTwo check (#6027)
+ - Validate PhysicalStorageBuffer Stage Interface (#6000)
+ - Update location/component conflict validation (#5993)
+ - add resolve-binding-conflicts pass (#6044)
+ - Check that layouts match runtime array requirement (#6048)
+ - Validation for relaxed control barrier with storage class semantics (#5984)
+ - Validate version requirement for Vulkan Memory Model (#6042)
+ - Add support for pointer types in vector when using extension SPV_INTEL_masked_gather_scatter (#6041)
+ - Restrict VUID 09557 to Vulkan environments (#6080)
+ - Add Vulkan 1.3 and 1.4 capability checks (#6063)
+ - Assembler
+ - Add OpUnknown pseudo-instruction (#6024)
+ - Diff
+ - Try to pair functions by their complete type. (#6021)
+
+v2025.1 2025-02-28
+ - General
+ - diff: Fix crash in OpString matching (#5988)
+ - Add SPV_AMDX_shader_enqueue version 2 support (#5838)
+ - add support for SPV_INTEL_subgroup_matrix_multiply_accumulate (#5928)
+ - update cmake_minimum_required to 3.22.1 (#5925)
+ - Add OpImageSampleFootprintNV to IsAllowedSampledImageOperand (#5914)
+ - assembler: ensure progress when seeking the version string (#5910)
+ - Optimizer
+ - opt: keep all OpSource instructions (#5901)
+ - [opt] Fix bug opt::InstructionBuilder::AddVariable (#6007)
+ - [OPT] Add SPV_KHR_ray_tracing to allow list (#5941)
+ - opt: keep all OpSource instructions (#5901)
+ - Validator
+ - spirv-val: Add AllowVulkan32BitBitwise option (#6001)
+ - Fix untyped pointer comparison validation (#6004)
+ - spirv-val: Update VUIDs for 308 header (#5990)
+ - spirv-val: fix env parsing for vk1.1spv1.4 (#5985)
+ - Add validation for SPV_NV_linear_swept_spheres. (#5975)
+ - Add validation SPV_NV_cluster_acceleration_structure. (#5974)
+ - Improve the instruction diagnostic for some access chain errors (#5978)
+ - Update physical storage buffer validation to match SPIR-V 1.6.5 (#5977)
+ - Validate SPV_NV_cooperative_vector (#5972)
+ - Fix layout checks with untyped pointers (#5970)
+ - spirv-val: Update mislabeled VUIDs (#5964)
+ - More explicit layout validation (#5958)
+ - spirv-val: Add VK_KHR_maintenance8 support (#5951)
+ - Add EXT_mesh_shader validation support (#5640)
+ - spirv-val: Remove OpenCL ivec3 req (#5940)
+ - spirv-val: Validate zero product workgroup size (#5407)
+ - Relax DebugLine validation (#5916)
+ - Linker
+ - linker: remove LinkOnceODR decorations when linking executables (#5979)
+ - fix: handle LinkOnceODR correctly (#5938)
+
+v2024.4 2024-12-04
+ - General
+ - Add FPEncoding operand type. (#5726)
+ - Support SPV_KHR_untyped_pointers (#5736)
+ - add support for SPV_INTEL_global_variable_host_access (#5786)
+ - Add support for SPV_KHR_compute_shader_derivative (#5817)
+ - Accept hex representation as binary input (#5870)
+ - Vulkan 1.4 support (#5899)
+ - Optimizer
+ - Add knowledge of cooperative matrices (#5720)
+ - Add struct-packing pass and unit test. (#5778)
+ - Validator
+ - Validate presence of Stride operand to OpCooperativeMatrix{Load,Store}KHR (#5777)
+ - Update sampled image validation (#5789)
+ - Disallow stores according to VUID 06924 (#5368)
+ - Add validation for SPV_NV_tensor_addressing and SPV_NV_cooperative_matrix2 (#5865)
+ - Linker
+ - allow linking functions with different pointer arguments (#5534)
+
+v2024.3 2024-06-20
+ - General
+ - Optimizer
+ - Do not fold mul and adds to generate fmas (#5682)
+ - add OpExtInst forward ref fixup pass (#5708)
+ - Validator
+ - Separate Location check for tess patch (#5654)
+ - Validate MemoryAccessMask of OpCooperativeMatrixStoreKHR (#5668)
+ - OpSampledImage extra validation (#5695)
+ - add support for OpExtInstWithForwardRefs (#5698)A
+ - Disassembler
+ - add decorations to comments (#5675)
+ - Add --nested-indent and --reorder-blocks (#5671)
+
v2024.2 2024-04-22
- General
- Add SPIRV_TOOLS_EXPORT to public C++ API (#5591)
diff --git a/third_party/SPIRV-Tools/CMakeLists.txt b/third_party/SPIRV-Tools/CMakeLists.txt
index 0ba173f..8c6fe41 100644
--- a/third_party/SPIRV-Tools/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required(VERSION 3.17.2)
+cmake_minimum_required(VERSION 3.22.1)
project(spirv-tools)
@@ -49,37 +49,13 @@
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- add_definitions(-DSPIRV_LINUX)
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
- add_definitions(-DSPIRV_EMSCRIPTEN)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
add_definitions(-DSPIRV_WINDOWS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
add_definitions(-DSPIRV_WINDOWS)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
- add_definitions(-DSPIRV_MAC)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS")
- add_definitions(-DSPIRV_IOS)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "tvOS")
- add_definitions(-DSPIRV_TVOS)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "visionOS")
- add_definitions(-DSPIRV_VISIONOS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
- add_definitions(-DSPIRV_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)
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "QNX")
- add_definitions(-DSPIRV_QNX)
-else()
- message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!")
endif()
if (${SPIRV_TIMER_ENABLED})
@@ -264,6 +240,20 @@
# Tests require Python3
find_host_package(Python3 REQUIRED)
+# Check type annotations in Perl code. Assumes mypy.
+add_custom_target(spirv-tools-check-python-types
+ COMMAND mypy Table
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils
+)
+set_target_properties(spirv-tools-check-python-types
+ PROPERTIES EXCLUDE_FROM_ALL ON)
+
+# Run Python unit tests
+add_custom_target(spirv-tools-check-python-tests
+ COMMAND Python3::Interpreter -m unittest discover -v -p "*test.py"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils
+)
+
# Check for symbol exports on Linux.
# At the moment, this check will fail on the OSX build machines for the Android NDK.
# It appears they don't have objdump.
@@ -371,7 +361,6 @@
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/optimizer.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/linker.hpp
- ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/instrument.hpp
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/spirv-tools/)
endif(ENABLE_SPIRV_TOOLS_INSTALL)
diff --git a/third_party/SPIRV-Tools/DEPS b/third_party/SPIRV-Tools/DEPS
index 8413d1b..a229115 100644
--- a/third_party/SPIRV-Tools/DEPS
+++ b/third_party/SPIRV-Tools/DEPS
@@ -3,17 +3,20 @@
vars = {
'github': 'https://github.com',
- 'abseil_revision': '79ca5d7aad63973c83a4962a66ab07cd623131ea',
+ 'abseil_revision': '56945519b5d17dcec0982ac6cdf4b6420f03c9c3',
- 'effcee_revision': '19b4aa87af25cb4ee779a071409732f34bfc305c',
+ 'effcee_revision': '8ce15c424e61a94ee27b5be0ec0ed036b158e6e3',
- 'googletest_revision': '5a37b517ad4ab6738556f0284c256cae1466c5b4',
+ 'googletest_revision': '373af2e3df71599b87a40ce0e37164523849166b',
# Use protobufs before they gained the dependency on abseil
'protobuf_revision': 'v21.12',
- 're2_revision': '917047f3606d3ba9e2de0d383c3cd80c94ed732c',
- 'spirv_headers_revision': '4f7b471f1a66b6d06462cd4ba57628cc0cd087d7',
+ 're2_revision': '66a656e6d9f8b78806c76201eb03038e85103e28',
+
+ 'spirv_headers_revision': '97e96f9e9defeb4bba3cfbd034dec516671dd7a3',
+
+ 'mimalloc_revision': '09a27098aa6e9286518bd9c74e6ffa7199c3f04e',
}
deps = {
@@ -35,5 +38,8 @@
'external/spirv-headers':
Var('github') + '/KhronosGroup/SPIRV-Headers.git@' +
Var('spirv_headers_revision'),
+
+ 'external/mimalloc':
+ Var('github') + '/microsoft/mimalloc.git@' + Var('mimalloc_revision'),
}
diff --git a/third_party/SPIRV-Tools/MODULE.bazel b/third_party/SPIRV-Tools/MODULE.bazel
index c36fe45..979541e 100644
--- a/third_party/SPIRV-Tools/MODULE.bazel
+++ b/third_party/SPIRV-Tools/MODULE.bazel
@@ -5,3 +5,31 @@
module_name = "googletest",
path = "external/googletest",
)
+
+bazel_dep(name = "re2", dev_dependency = True)
+local_path_override(
+ module_name = "re2",
+ path = "external/re2",
+)
+
+bazel_dep(name = "effcee", dev_dependency = True)
+local_path_override(
+ module_name = "effcee",
+ path = "external/effcee",
+)
+
+bazel_dep(name = "rules_python",
+ version = "0.34.0")
+
+# https://rules-python.readthedocs.io/en/stable/toolchains.html#library-modules-with-dev-only-python-usage
+python = use_extension(
+ "@rules_python//python/extensions:python.bzl",
+ "python",
+ dev_dependency = True
+)
+
+python.toolchain(python_version = "3.12",
+ is_default = True,
+ ignore_root_user_error = True)
+
+bazel_dep(name = "rules_cc", version = "0.1.1")
diff --git a/third_party/SPIRV-Tools/README.md b/third_party/SPIRV-Tools/README.md
index 7db5bd4..248191b 100644
--- a/third_party/SPIRV-Tools/README.md
+++ b/third_party/SPIRV-Tools/README.md
@@ -33,7 +33,7 @@
<img alt="Linux" src="kokoro/img/linux.png" width="20px" height="20px" hspace="2px"/>[](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_release.html)
<img alt="MacOS" src="kokoro/img/macos.png" width="20px" height="20px" hspace="2px"/>[](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html)
-<img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>[](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2019_release.html)
+<img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>[](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2022_release.html)
[More downloads](docs/downloads.md)
@@ -80,6 +80,8 @@
* Assembler only does basic syntax checking. No cross validation of
IDs or types is performed, except to check literal arguments to
`OpConstant`, `OpSpecConstant`, and `OpSwitch`.
+* Where tools expect binary input, a hex stream may be provided instead. See
+ `spirv-dis --help`.
See [`docs/syntax.md`](docs/syntax.md) for the assembly language syntax.
@@ -144,6 +146,7 @@
decorations.
* Normalization
* Compact IDs
+ * Canonicalize IDs
* CFG cleanup
* Flatten decorations
* Merge returns
@@ -298,6 +301,7 @@
git clone https://github.com/google/effcee.git spirv-tools/external/effcee
git clone https://github.com/google/re2.git spirv-tools/external/re2
git clone https://github.com/abseil/abseil-cpp.git spirv-tools/external/abseil_cpp
+ git clone https://github.com/microsoft/mimalloc.git spirv-tools/external/mimalloc
#### Dependency on Effcee
@@ -310,6 +314,23 @@
RE2 sources to appear in `external/re2`, and Abseil sources to appear in
`external/abseil_cpp`.
+#### Dependency on mimalloc
+
+SPIRV-Tools may be configured to use the [mimalloc][mimalloc] library to improve memory
+allocation performance. In order to avoid unexpectedly changing allocation behavior of
+applications that link SPIRV-Tools libraries statically, this option has no effect on
+the static libraries.
+
+In the CMake build, usage of mimalloc is controlled by the `SPIRV_TOOLS_USE_MIMALLOC`
+option. This variable defaults on `ON` when building for Windows and `OFF` when building
+for other platforms. Enabling this option on non-Windows platforms is supported and is
+expected to work normally, but this has not been tested as thoroughly and extensively as
+the Windows version. In the future, the `SPIRV_TOOLS_USE_MIMALLOC` option may default to
+`ON` for non-Windows platforms as well.
+
+*Note*: mimalloc is currently only supported when building with CMake. When using Bazel,
+mimalloc is not used.
+
### Source code organization
* `example`: demo code of using SPIRV-Tools APIs
@@ -323,6 +344,7 @@
* `external/abseil_cpp`: Location of [Abseil][abseil-cpp] sources, if Abseil is
not already configured by an enclosing project.
(The RE2 project already requires Abseil.)
+* `external/mimalloc`: Intended location for [mimalloc][mimalloc] sources, not provided
* `include/`: API clients should add this directory to the include search path
* `external/spirv-headers`: Intended location for
[SPIR-V headers][spirv-headers], not provided
@@ -438,20 +460,17 @@
SPIRV-Tools is regularly tested with the following compilers:
On Linux
-- GCC version 9.3
+- GCC version 9.4
- Clang version 10.0
On MacOS
-- AppleClang 11.0
+- AppleClang 15.0
On Windows
-- Visual Studio 2017
- Visual Studio 2019
- Visual Studio 2022
-Note: Visual Studio 2017 has incomplete c++17 support. We might stop
-testing it soon. Other compilers or later versions may work, but they are not
-tested.
+Note: Other compilers or later versions may work, but they are not tested.
### CMake options
@@ -802,6 +821,7 @@
[effcee]: https://github.com/google/effcee
[re2]: https://github.com/google/re2
[abseil-cpp]: https://github.com/abseil/abseil-cpp
+[mimalloc]: https://github.com/microsoft/mimalloc
[CMake]: https://cmake.org/
[cpp-style-guide]: https://google.github.io/styleguide/cppguide.html
[clang-sanitizers]: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
diff --git a/third_party/SPIRV-Tools/WORKSPACE b/third_party/SPIRV-Tools/WORKSPACE
index 6e78059..054960a 100644
--- a/third_party/SPIRV-Tools/WORKSPACE
+++ b/third_party/SPIRV-Tools/WORKSPACE
@@ -4,16 +4,6 @@
)
local_repository(
- name = "com_googlesource_code_re2",
- path = "external/re2",
-)
-
-local_repository(
- name = "com_google_effcee",
- path = "external/effcee",
-)
-
-local_repository(
name = "abseil-cpp",
path = "external/abseil_cpp",
)
diff --git a/third_party/SPIRV-Tools/build_defs.bzl b/third_party/SPIRV-Tools/build_defs.bzl
index 76bf3e7..1f7cacd 100644
--- a/third_party/SPIRV-Tools/build_defs.bzl
+++ b/third_party/SPIRV-Tools/build_defs.bzl
@@ -47,6 +47,7 @@
for constraint in incompatible_constraints
}]))
+SPIRV_CORE_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_core_grammar_unified1"
DEBUGINFO_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_debuginfo_grammar_unified1"
CLDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_opencl_debuginfo_100_grammar_unified1"
SHDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_nonsemantic_shader_debuginfo_100_grammar_unified1"
@@ -57,161 +58,87 @@
merged.update(d)
return merged
-def generate_core_tables(version):
- if not version:
- fail("Must specify version", "version")
+def ExtInst(name, target = "", prefix =""):
+ """
+ Returns a dictionary specifying the info needed to
+ process an extended instruction set.
+
+ Args:
+ name: The extension name; forms part of the .json grammar file.
+ target: if non-empty, the name of the bazel target in spirv-headers
+ that names the JSON grammar file for the extended instrution set.
+ If empty, the target name is derived from 'name'.
+ prefix: The optional prefix for names of operand enums.
+
+ Returns a dictionary with keys 'name', 'target', 'prefix' and the
+ corresponding values.
+ """
+ return {'name':name, 'target':target, 'prefix':prefix}
+
+
+def _extinst_grammar_target(e):
+ """
+ Args: e, as returned from extinst
+ Returns the SPIRV-Headers target for the given extended instruction set spec.
+ """
+ target = e['target']
+ name = e['name']
+ if len(target) > 0:
+ return "@spirv_headers//:{}".format(target)
+ name_part = name.replace("-", "_").replace(".", "_")
+ return "@spirv_headers//:spirv_ext_inst_{}_grammar_unified1".format(name_part)
+
+
+def create_grammar_tables_target(name, extinsts):
+ """
+ Creates a ":gen_compressed_tables" target for SPIR-V instruction
+ set grammar tables.
+
+ Args:
+ name: unused. Required by convention.
+ extinsts: list of extended instruction specs.
+ Each spec is a dictionary, as returned from 'extinst'.
+ """
grammars = dict(
- core_grammar = "@spirv_headers//:spirv_core_grammar_{}".format(version),
- debuginfo_grammar = DEBUGINFO_GRAMMAR_JSON_FILE,
- cldebuginfo_grammar = CLDEBUGINFO100_GRAMMAR_JSON_FILE,
+ core_grammar = SPIRV_CORE_GRAMMAR_JSON_FILE,
)
-
outs = dict(
- core_insts_output = "core.insts-{}.inc".format(version),
- operand_kinds_output = "operand.kinds-{}.inc".format(version),
+ core_tables_header_output = "core_tables_header.inc",
+ core_tables_body_output = "core_tables_body.inc",
)
+ extinst_args = []
+ for e in extinsts:
+ extinst_args.append('--extinst={},$(location {})'.format(e['prefix'],_extinst_grammar_target(e)))
cmd = (
- "$(location :generate_grammar_tables)" +
+ "$(location :ggt)" +
" --spirv-core-grammar=$(location {core_grammar})" +
- " --extinst-debuginfo-grammar=$(location {debuginfo_grammar})" +
- " --extinst-cldebuginfo100-grammar=$(location {cldebuginfo_grammar})" +
- " --core-insts-output=$(location {core_insts_output})" +
- " --operand-kinds-output=$(location {operand_kinds_output})" +
- " --output-language=c++"
+ " --core-tables-body-output=$(location {core_tables_body_output})" +
+ " --core-tables-header-output=$(location {core_tables_header_output})" +
+ " " + " ".join(extinst_args)
).format(**_merge_dicts([grammars, outs]))
native.genrule(
- name = "gen_core_tables_" + version,
- srcs = grammars.values(),
+ name = "gen_compressed_tables",
+ srcs = grammars.values() + [_extinst_grammar_target(e) for e in extinsts],
outs = outs.values(),
cmd = cmd,
cmd_bat = cmd,
- tools = [":generate_grammar_tables"],
- visibility = ["//visibility:private"],
- )
-
-def generate_enum_string_mapping(version):
- if not version:
- fail("Must specify version", "version")
-
- grammars = dict(
- core_grammar = "@spirv_headers//:spirv_core_grammar_{}".format(version),
- debuginfo_grammar = DEBUGINFO_GRAMMAR_JSON_FILE,
- cldebuginfo_grammar = CLDEBUGINFO100_GRAMMAR_JSON_FILE,
- )
-
- outs = dict(
- extension_enum_ouput = "extension_enum.inc",
- enum_string_mapping_output = "enum_string_mapping.inc",
- )
-
- cmd = (
- "$(location :generate_grammar_tables)" +
- " --spirv-core-grammar=$(location {core_grammar})" +
- " --extinst-debuginfo-grammar=$(location {debuginfo_grammar})" +
- " --extinst-cldebuginfo100-grammar=$(location {cldebuginfo_grammar})" +
- " --extension-enum-output=$(location {extension_enum_ouput})" +
- " --enum-string-mapping-output=$(location {enum_string_mapping_output})" +
- " --output-language=c++"
- ).format(**_merge_dicts([grammars, outs]))
-
- native.genrule(
- name = "gen_enum_string_mapping",
- srcs = grammars.values(),
- outs = outs.values(),
- cmd = cmd,
- cmd_bat = cmd,
- tools = [":generate_grammar_tables"],
- visibility = ["//visibility:private"],
- )
-
-def generate_opencl_tables(version):
- if not version:
- fail("Must specify version", "version")
-
- grammars = dict(
- opencl_grammar = "@spirv_headers//:spirv_opencl_grammar_{}".format(version),
- )
-
- outs = dict(
- opencl_insts_output = "opencl.std.insts.inc",
- )
-
- cmd = (
- "$(location :generate_grammar_tables)" +
- " --extinst-opencl-grammar=$(location {opencl_grammar})" +
- " --opencl-insts-output=$(location {opencl_insts_output})"
- ).format(**_merge_dicts([grammars, outs]))
-
- native.genrule(
- name = "gen_opencl_tables_" + version,
- srcs = grammars.values(),
- outs = outs.values(),
- cmd = cmd,
- cmd_bat = cmd,
- tools = [":generate_grammar_tables"],
- visibility = ["//visibility:private"],
- )
-
-def generate_glsl_tables(version):
- if not version:
- fail("Must specify version", "version")
-
- grammars = dict(
- gsls_grammar = "@spirv_headers//:spirv_glsl_grammar_{}".format(version),
- )
- outs = dict(
- gsls_insts_outs = "glsl.std.450.insts.inc",
- )
-
- cmd = (
- "$(location :generate_grammar_tables)" +
- " --extinst-glsl-grammar=$(location {gsls_grammar})" +
- " --glsl-insts-output=$(location {gsls_insts_outs})" +
- " --output-language=c++"
- ).format(**_merge_dicts([grammars, outs]))
-
- native.genrule(
- name = "gen_glsl_tables_" + version,
- srcs = grammars.values(),
- outs = outs.values(),
- cmd = cmd,
- cmd_bat = cmd,
- tools = [":generate_grammar_tables"],
- visibility = ["//visibility:private"],
- )
-
-def generate_vendor_tables(extension, operand_kind_prefix = ""):
- if not extension:
- fail("Must specify extension", "extension")
-
- extension_rule = extension.replace("-", "_").replace(".", "_")
- grammars = dict(
- vendor_grammar = "@spirv_headers//:spirv_ext_inst_{}_grammar_unified1".format(extension_rule),
- )
- outs = dict(
- vendor_insts_output = "{}.insts.inc".format(extension),
- )
- cmd = (
- "$(location :generate_grammar_tables)" +
- " --extinst-vendor-grammar=$(location {vendor_grammar})" +
- " --vendor-insts-output=$(location {vendor_insts_output})" +
- " --vendor-operand-kind-prefix={operand_kind_prefix}"
- ).format(operand_kind_prefix = operand_kind_prefix, **_merge_dicts([grammars, outs]))
-
- native.genrule(
- name = "gen_vendor_tables_" + extension_rule,
- srcs = grammars.values(),
- outs = outs.values(),
- cmd = cmd,
- cmd_bat = cmd,
- tools = [":generate_grammar_tables"],
+ tools = [":ggt"],
visibility = ["//visibility:private"],
)
def generate_extinst_lang_headers(name, grammar = None):
+ """
+ Creates a :gen_extinst_lang_headers_* target for a C++ header
+ the enums in a SPIR-V extended instruction set.
+
+ Args:
+ name: the basename of the emitted header file.
+ grammar: the path to the JSON grammar file for the extended
+ instruction set.
+ """
if not grammar:
fail("Must specify grammar", "grammar")
outs = dict(
diff --git a/third_party/SPIRV-Tools/docs/downloads.md b/third_party/SPIRV-Tools/docs/downloads.md
index 0454b9e..853c2be 100644
--- a/third_party/SPIRV-Tools/docs/downloads.md
+++ b/third_party/SPIRV-Tools/docs/downloads.md
@@ -20,14 +20,12 @@
Download the latest builds of the [main](https://github.com/KhronosGroup/SPIRV-Tools/tree/main) branch.
-### Release build
-| Windows | Linux | MacOS |
-| --- | --- | --- |
-| [MSVC 2017](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_release.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_release.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html) |
-| | [gcc](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_gcc_release.html) | |
+| Platform | Processor | Compiler | Release build | Debug build |
+| --- | --- | --- | --- | --- |
+| Windows | x86-64 | VisualStudio 2022 (MSVC v143) | Download: <a href="https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2022_release.html"> <img src="https://storage.googleapis.com/spirv-tools/badges/build_status_windows_vs2022_release.svg" alt="status of VS 2022 release build"></a> | Download: <a href="https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2022_debug.html"> <img src="https://storage.googleapis.com/spirv-tools/badges/build_status_windows_vs2022_debug.svg" alt="status of VS 2022 debug build"></a> |
+| Linux | x86-64 | GCC 9.4 | Download: <a href="https://storage.googleapis.com/spirv-tools/badges/build_link_linux_gcc_release.html"> <img src="https://storage.googleapis.com/spirv-tools/badges/build_status_linux_gcc_release.svg" alt="status of Linux GCC build"></a> | Download: <a href="https://storage.googleapis.com/spirv-tools/badges/build_link_linux_gcc_debug.html"> <img src="https://storage.googleapis.com/spirv-tools/badges/build_status_linux_gcc_debug.svg" alt="status of Linux GCC debug build"></a> |
+| macOS | x86-64 | Clang 15 | Download: <a href="https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html"> <img src="https://storage.googleapis.com/spirv-tools/badges/build_status_macos_clang_release.svg" alt="status of macOS Clang build"></a> | Download: <a href="https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_debug.html"> <img src="https://storage.googleapis.com/spirv-tools/badges/build_status_macos_clang_debug.svg" alt="status of macOS Clang build"></a> |
-### Debug build
-| Windows | Linux | MacOS |
-| --- | --- | --- |
-| [MSVC 2017](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_debug.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_debug.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_debug.html) |
-| | [gcc](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_gcc_debug.html) | |
+Note: If you suspect something is wrong with the compiler versions mentioned,
+check the scripts and configurations in the [kokoro](../kokoro) source tree,
+or the results of the checks on the latest commits on the `main` branch.
diff --git a/third_party/SPIRV-Tools/docs/syntax.md b/third_party/SPIRV-Tools/docs/syntax.md
index c135d01..705f344 100644
--- a/third_party/SPIRV-Tools/docs/syntax.md
+++ b/third_party/SPIRV-Tools/docs/syntax.md
@@ -215,6 +215,50 @@
that named ID being output. This may be valid SPIR-V, contrary to the
presumed intention of the writer.
+## OpUnknown
+<a name="op-unknown"></a>
+
+HLSL has a feature that allows users to specify an exact SPIR-V type using [the
+`SpirvType` template](https://github.com/microsoft/hlsl-specs/blob/main/proposals/0011-inline-spirv.md#types).
+This feature allows the user to specify a type opcode that the compiler does
+not know. In this case, it will be unable to generate assembly using the
+correct mnemonic.
+
+In order to represent unknown opcodes in assembly format, the `OpUnknown`
+pseudo-instruction may be used. The syntax is:
+
+```
+OpUnknown(<enumerant>, <WordCount>) <operand 1> ...
+```
+
+`enumerant` is the opcode enumerant, and `WordCount` is the number of words in
+the instruction. These will be assembled into a single word representing the
+opcode. Operands will be parsed according to the alternate parsing mode
+described in [Arbitrary Integers](#op-unknown). Named enumerated values cannot
+be handled by this mode and must be represented using the arbitrary integer
+syntax.
+
+It must be used at the beginning of a new instruction, and if there is a result
+ID it must explicitly be passed in as an operand. This is because the physical
+layout of a SPIR-V instruction may include a result type operand before the
+result ID operand, but it depends on the opcode and cannot be inferred for an
+unknown operand.
+
+For example, a 32-bit signed integer type could be represented like this:
+
+```
+OpUnknown(21, 4) %int_t 32 1
+```
+
+An OpStore instruction could be represented as:
+
+```
+OpUnknown(62, 3) %9 %12
+```
+
+The enumerant and word count must be decimal integers.
+
+
## Notes
* Some enumerants cannot be used by name, because the target instruction
diff --git a/third_party/SPIRV-Tools/external/CMakeLists.txt b/third_party/SPIRV-Tools/external/CMakeLists.txt
index 5d8a3da..d8c7266 100644
--- a/third_party/SPIRV-Tools/external/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/external/CMakeLists.txt
@@ -26,6 +26,46 @@
set(${var} ${val} PARENT_SCOPE)
endfunction()
+if (DEFINED mimalloc_SOURCE_DIR)
+ # This allows flexible position of the mimalloc repo.
+ set(MIMALLOC_DIR ${mimalloc_SOURCE_DIR})
+else()
+ if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mimalloc)
+ set(MIMALLOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mimalloc)
+ endif()
+endif()
+
+# Used on Windows by default, but allow opt-in on other platforms
+if (WIN32)
+ set(SPIRV_TOOLS_USE_MIMALLOC_DEFAULT_VALUE ON)
+else()
+ set(SPIRV_TOOLS_USE_MIMALLOC_DEFAULT_VALUE OFF)
+endif()
+
+# To avoid unexpected side effects on users of the static library, mimalloc
+# may only be used when building executables and shared libraries.
+include(CMakeDependentOption)
+cmake_dependent_option(SPIRV_TOOLS_USE_MIMALLOC
+ "Executables and shared libraries use mimalloc instead of the default allocator"
+ ${SPIRV_TOOLS_USE_MIMALLOC_DEFAULT_VALUE} "MIMALLOC_DIR" OFF)
+
+if (SPIRV_TOOLS_USE_MIMALLOC)
+ if (NOT WIN32)
+ push_variable(MI_OVERRIDE 0)
+ endif()
+ push_variable(MI_BUILD_TESTS 0)
+
+ add_subdirectory(${MIMALLOC_DIR} ${CMAKE_BINARY_DIR}/external/mimalloc EXCLUDE_FROM_ALL)
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
+ target_compile_options(mimalloc-static PRIVATE -Wno-int-conversion)
+ endif()
+
+ if (NOT WIN32)
+ pop_variable(MI_OVERRIDE)
+ endif()
+ pop_variable(MI_BUILD_TESTS)
+endif()
+
if (DEFINED SPIRV-Headers_SOURCE_DIR)
# This allows flexible position of the SPIRV-Headers repo.
set(SPIRV_HEADER_DIR ${SPIRV-Headers_SOURCE_DIR})
@@ -45,7 +85,7 @@
endif()
else()
message(FATAL_ERROR
- "SPIRV-Headers was not found - please checkout a copy under external/.")
+ "SPIRV-Headers was not found - please checkout a copy at external/spirv-headers.")
endif()
if (NOT ${SPIRV_SKIP_TESTS})
diff --git a/third_party/SPIRV-Tools/include/spirv-tools/instrument.hpp b/third_party/SPIRV-Tools/include/spirv-tools/instrument.hpp
deleted file mode 100644
index 0a6e630..0000000
--- a/third_party/SPIRV-Tools/include/spirv-tools/instrument.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2018 The Khronos Group Inc.
-// Copyright (c) 2018 Valve Corporation
-// Copyright (c) 2018 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_
-#define INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_
-
-// Shader Instrumentation Interface
-//
-// This file provides an external interface for applications that wish to
-// communicate with shaders instrumented by passes created by:
-//
-// CreateInstBindlessCheckPass
-// CreateInstBuffAddrCheckPass
-// CreateInstDebugPrintfPass
-//
-// More detailed documentation of these routines can be found in optimizer.hpp
-
-namespace spvtools {
-
-// Stream Output Buffer Offsets
-//
-// The following values provide offsets into the output buffer struct
-// generated by InstrumentPass::GenDebugStreamWrite. This method is utilized
-// by InstBindlessCheckPass, InstBuffAddrCheckPass, and InstDebugPrintfPass.
-//
-// 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 = 1;
-
-// 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 = 2;
-
-// Common Stream Record Offsets
-//
-// The following are offsets to fields which are common to all records written
-// to the output stream.
-//
-// Each record first contains the size of the record in 32-bit words, including
-// the size word.
-static const int kInstCommonOutSize = 0;
-
-// This is the shader id passed by the layer when the instrumentation pass is
-// created.
-static const int kInstCommonOutShaderId = 1;
-
-// This is the ordinal position of the instruction within the SPIR-V shader
-// which generated the validation error.
-static const int kInstCommonOutInstructionIdx = 2;
-
-// Debug Buffer Bindings
-//
-// These are the bindings for the different buffers which are
-// read or written by the instrumentation passes.
-//
-// This is the output buffer written by InstDebugPrintfPass.
-static const int kDebugOutputPrintfStream = 3;
-
-} // namespace spvtools
-
-#endif // INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_
diff --git a/third_party/SPIRV-Tools/include/spirv-tools/libspirv.h b/third_party/SPIRV-Tools/include/spirv-tools/libspirv.h
index 83b1a8e..2a604e9 100644
--- a/third_party/SPIRV-Tools/include/spirv-tools/libspirv.h
+++ b/third_party/SPIRV-Tools/include/spirv-tools/libspirv.h
@@ -175,6 +175,7 @@
SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS, // SPIR-V Sec 3.29
SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO, // SPIR-V Sec 3.30
SPV_OPERAND_TYPE_CAPABILITY, // SPIR-V Sec 3.31
+ SPV_OPERAND_TYPE_FPENCODING, // SPIR-V Sec 3.51
// NOTE: New concrete enum values should be added at the end.
@@ -188,36 +189,24 @@
SPV_OPERAND_TYPE_MEMORY_ACCESS, // SPIR-V Sec 3.26
SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE, // SPIR-V Sec 3.FSR
-// NOTE: New concrete enum values should be added at the end.
+ // NOTE: New concrete enum values should be added at the end.
-// The "optional" and "variable" operand types are only used internally by
-// the assembler and the binary parser.
-// There are two categories:
-// Optional : expands to 0 or 1 operand, like ? in regular expressions.
-// Variable : expands to 0, 1 or many operands or pairs of operands.
-// This is similar to * in regular expressions.
+ // The "optional" and "variable" operand types are only used internally by
+ // the assembler and the binary parser.
+ // There are two categories:
+ // Optional : expands to 0 or 1 operand, like ? in regular expressions.
+ // Variable : expands to 0, 1 or many operands or pairs of operands.
+ // This is similar to * in regular expressions.
-// NOTE: These FIRST_* and LAST_* enum values are DEPRECATED.
-// The concept of "optional" and "variable" operand types are only intended
-// for use as an implementation detail of parsing SPIR-V, either in text or
-// binary form. Instead of using enum ranges, use characteristic function
-// spvOperandIsConcrete.
-// The use of enum value ranges in a public API makes it difficult to insert
-// new values into a range without also breaking binary compatibility.
-//
-// Macros for defining bounds on optional and variable operand types.
-// Any variable operand type is also optional.
-// TODO(dneto): Remove SPV_OPERAND_TYPE_FIRST_* and SPV_OPERAND_TYPE_LAST_*
-#define FIRST_OPTIONAL(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_OPTIONAL_TYPE = ENUM
-#define FIRST_VARIABLE(ENUM) ENUM, SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE = ENUM
-#define LAST_VARIABLE(ENUM) \
- ENUM, SPV_OPERAND_TYPE_LAST_VARIABLE_TYPE = ENUM, \
- SPV_OPERAND_TYPE_LAST_OPTIONAL_TYPE = ENUM
+ // Use characteristic function spvOperandIsConcrete to classify the
+ // operand types; when it returns false, the operand is optional or variable.
+ //
+ // Any variable operand type is also optional.
// An optional operand represents zero or one logical operands.
// In an instruction definition, this may only appear at the end of the
// operand types.
- FIRST_OPTIONAL(SPV_OPERAND_TYPE_OPTIONAL_ID),
+ SPV_OPERAND_TYPE_OPTIONAL_ID,
// An optional image operand type.
SPV_OPERAND_TYPE_OPTIONAL_IMAGE,
// An optional memory access type.
@@ -236,11 +225,13 @@
// assemble regardless of where they occur -- literals, IDs, immediate
// integers, etc.
SPV_OPERAND_TYPE_OPTIONAL_CIV,
+ // An optional floating point encoding enum
+ SPV_OPERAND_TYPE_OPTIONAL_FPENCODING,
// A variable operand represents zero or more logical operands.
// In an instruction definition, this may only appear at the end of the
// operand types.
- FIRST_VARIABLE(SPV_OPERAND_TYPE_VARIABLE_ID),
+ SPV_OPERAND_TYPE_VARIABLE_ID,
SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER,
// A sequence of zero or more pairs of (typed literal integer, Id).
// Expands to zero or more:
@@ -248,7 +239,7 @@
// where the literal number must always be an integer of some sort.
SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID,
// A sequence of zero or more pairs of (Id, Literal integer)
- LAST_VARIABLE(SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER),
+ SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER,
// The following are concrete enum types from the DebugInfo extended
// instruction set.
@@ -311,6 +302,38 @@
SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS,
// Optional enum type from SPV_NV_raw_access_chains
SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS,
+ // Enum type from SPV_NV_tensor_addressing
+ SPV_OPERAND_TYPE_TENSOR_CLAMP_MODE,
+ // Enum type from SPV_NV_cooperative_matrix2
+ SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_REDUCE,
+ // Enum type from SPV_NV_cooperative_matrix2
+ SPV_OPERAND_TYPE_TENSOR_ADDRESSING_OPERANDS,
+ // Optional types from SPV_INTEL_subgroup_matrix_multiply_accumulate
+ SPV_OPERAND_TYPE_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS,
+ SPV_OPERAND_TYPE_OPTIONAL_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS,
+
+ SPV_OPERAND_TYPE_COOPERATIVE_VECTOR_MATRIX_LAYOUT,
+ SPV_OPERAND_TYPE_COMPONENT_TYPE,
+
+ // From nonesmantic.clspvreflection
+ SPV_OPERAND_TYPE_KERNEL_PROPERTY_FLAGS,
+
+ // From nonesmantic.shader.debuginfo.100
+ SPV_OPERAND_TYPE_SHDEBUG100_BUILD_IDENTIFIER_FLAGS,
+ SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING,
+ SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_COMPOSITE_TYPE,
+ SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_IMPORTED_ENTITY,
+ SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_INFO_FLAGS,
+ SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_OPERATION,
+ SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_TYPE_QUALIFIER,
+
+ // SPV_ARM_tensors
+ SPV_OPERAND_TYPE_TENSOR_OPERANDS,
+ SPV_OPERAND_TYPE_OPTIONAL_TENSOR_OPERANDS,
+
+ // SPV_INTEL_function_variants
+ SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY,
+ SPV_OPERAND_TYPE_VARIABLE_CAPABILITY,
// This is a sentinel value, and does not represent an operand type.
// It should come last.
@@ -338,6 +361,7 @@
SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION,
SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100,
SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION,
+ SPV_EXT_INST_TYPE_TOSA_001000_1,
// Multiple distinct extended instruction set types could return this
// value, if they are prefixed with NonSemantic. and are otherwise
@@ -359,6 +383,18 @@
SPV_NUMBER_FLOATING,
} spv_number_kind_t;
+// Represent the encoding of floating point values
+typedef enum spv_fp_encoding_t {
+ SPV_FP_ENCODING_UNKNOWN =
+ 0, // The encoding is not specified. Has to be deduced from bitwidth
+ SPV_FP_ENCODING_IEEE754_BINARY16, // half float
+ SPV_FP_ENCODING_IEEE754_BINARY32, // single float
+ SPV_FP_ENCODING_IEEE754_BINARY64, // double float
+ SPV_FP_ENCODING_BFLOAT16,
+ SPV_FP_ENCODING_FLOAT8_E4M3,
+ SPV_FP_ENCODING_FLOAT8_E5M2,
+} spv_fp_encoding_t;
+
typedef enum spv_text_to_binary_options_t {
SPV_TEXT_TO_BINARY_OPTION_NONE = SPV_BIT(0),
// Numeric IDs in the binary will have the same values as in the source.
@@ -382,6 +418,11 @@
SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES = SPV_BIT(6),
// Add some comments to the generated assembly
SPV_BINARY_TO_TEXT_OPTION_COMMENT = SPV_BIT(7),
+ // Use nested indentation for more readable SPIR-V
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT = SPV_BIT(8),
+ // Reorder blocks to match the structured control flow of SPIR-V to increase
+ // readability.
+ SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS = SPV_BIT(9),
SPV_FORCE_32_BIT_ENUM(spv_binary_to_text_options_t)
} spv_binary_to_text_options_t;
@@ -409,6 +450,8 @@
spv_number_kind_t number_kind;
// The number of bits for a literal number type.
uint32_t number_bit_width;
+ // The encoding used for floating point values
+ spv_fp_encoding_t fp_encoding;
} spv_parsed_operand_t;
// An instruction parsed from a binary SPIR-V module.
@@ -526,6 +569,7 @@
// SPV_ENV_VULKAN_1_1_SPIRV_1_4 -> SPIR-V 1.4
// SPV_ENV_VULKAN_1_2 -> SPIR-V 1.5
// SPV_ENV_VULKAN_1_3 -> SPIR-V 1.6
+// SPV_ENV_VULKAN_1_4 -> SPIR-V 1.6
// Consult the description of API entry points for specific rules.
typedef enum {
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions.
@@ -563,6 +607,7 @@
SPV_ENV_UNIVERSAL_1_6, // SPIR-V 1.6 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_3, // Vulkan 1.3 latest revision.
+ SPV_ENV_VULKAN_1_4, // Vulkan 1.4 latest revision.
SPV_ENV_MAX // Keep this as the last enum value.
} spv_target_env;
@@ -713,6 +758,16 @@
SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetAllowLocalSizeId(
spv_validator_options options, bool val);
+// Allow Offset (in addition to ConstOffset) for texture operations.
+// Was added for VK_KHR_maintenance8
+SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetAllowOffsetTextureOperand(
+ spv_validator_options options, bool val);
+
+// Allow base operands of some bit operations to be non-32-bit wide.
+// Was added for VK_KHR_maintenance9
+SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetAllowVulkan32BitBitwise(
+ 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);
diff --git a/third_party/SPIRV-Tools/include/spirv-tools/libspirv.hpp b/third_party/SPIRV-Tools/include/spirv-tools/libspirv.hpp
index 59ff82b..1b3ed86 100644
--- a/third_party/SPIRV-Tools/include/spirv-tools/libspirv.hpp
+++ b/third_party/SPIRV-Tools/include/spirv-tools/libspirv.hpp
@@ -20,7 +20,7 @@
#include <string>
#include <vector>
-#include "spirv-tools/libspirv.h"
+#include "libspirv.h"
namespace spvtools {
@@ -126,6 +126,18 @@
spvValidatorOptionsSetAllowLocalSizeId(options_, val);
}
+ // Allow Offset (in addition to ConstOffset) for texture
+ // operations. Was added for VK_KHR_maintenance8
+ void SetAllowOffsetTextureOperand(bool val) {
+ spvValidatorOptionsSetAllowOffsetTextureOperand(options_, val);
+ }
+
+ // Allow base operands of some bit operations to be non-32-bit wide.
+ // Was added for VK_KHR_maintenance9
+ void SetAllowVulkan32BitBitwise(bool val) {
+ spvValidatorOptionsSetAllowVulkan32BitBitwise(options_, val);
+ }
+
// Records whether or not the validator should relax the rules on pointer
// usage in logical addressing mode.
//
diff --git a/third_party/SPIRV-Tools/include/spirv-tools/linker.hpp b/third_party/SPIRV-Tools/include/spirv-tools/linker.hpp
index 6ba6e96..9037b94 100644
--- a/third_party/SPIRV-Tools/include/spirv-tools/linker.hpp
+++ b/third_party/SPIRV-Tools/include/spirv-tools/linker.hpp
@@ -16,7 +16,6 @@
#define INCLUDE_SPIRV_TOOLS_LINKER_HPP_
#include <cstdint>
-
#include <memory>
#include <vector>
@@ -63,11 +62,17 @@
use_highest_version_ = use_highest_vers;
}
+ bool GetAllowPtrTypeMismatch() const { return allow_ptr_type_mismatch_; }
+ void SetAllowPtrTypeMismatch(bool allow_ptr_type_mismatch) {
+ allow_ptr_type_mismatch_ = allow_ptr_type_mismatch;
+ }
+
private:
bool create_library_{false};
bool verify_ids_{false};
bool allow_partial_linkage_{false};
bool use_highest_version_{false};
+ bool allow_ptr_type_mismatch_{false};
};
// Links one or more SPIR-V modules into a new SPIR-V module. That is, combine
diff --git a/third_party/SPIRV-Tools/include/spirv-tools/optimizer.hpp b/third_party/SPIRV-Tools/include/spirv-tools/optimizer.hpp
index a3119d9..b25ad47 100644
--- a/third_party/SPIRV-Tools/include/spirv-tools/optimizer.hpp
+++ b/third_party/SPIRV-Tools/include/spirv-tools/optimizer.hpp
@@ -240,7 +240,7 @@
private:
struct SPIRV_TOOLS_LOCAL Impl; // Opaque struct for holding internal data.
- std::unique_ptr<Impl> impl_; // Unique pointer to internal data.
+ std::unique_ptr<Impl> impl_; // Unique pointer to internal data.
};
// Creates a null pass.
@@ -655,7 +655,7 @@
// element if those elements are accessed individually. The parameter is a
// limit on the number of members in the composite variable that the pass will
// consider replacing.
-Optimizer::PassToken CreateScalarReplacementPass(uint32_t size_limit = 100);
+Optimizer::PassToken CreateScalarReplacementPass(uint32_t size_limit = 0);
// Create a private to local pass.
// This pass looks for variables declared in the private storage class that are
@@ -747,65 +747,6 @@
// them into a single instruction where possible.
Optimizer::PassToken CreateCombineAccessChainsPass();
-// Create a pass to instrument bindless descriptor checking
-// This pass instruments all bindless references to check that descriptor
-// array indices are inbounds, and if the descriptor indexing extension is
-// enabled, that the descriptor has been initialized. If the reference is
-// invalid, a record is written to the debug output buffer (if space allows)
-// and a null value is returned. This pass is designed to support bindless
-// validation in the Vulkan validation layers.
-//
-// TODO(greg-lunarg): Add support for buffer references. Currently only does
-// checking for image references.
-//
-// Dead code elimination should be run after this pass as the original,
-// potentially invalid code is not removed and could cause undefined behavior,
-// including crashes. It may also be beneficial to run Simplification
-// (ie Constant Propagation), DeadBranchElim and BlockMerge after this pass to
-// optimize instrument code involving the testing of compile-time constants.
-// It is also generally recommended that this pass (and all
-// instrumentation passes) be run after any legalization and optimization
-// passes. This will give better analysis for the instrumentation and avoid
-// potentially de-optimizing the instrument code, for example, inlining
-// the debug record output function throughout the module.
-//
-// The instrumentation will write |shader_id| in each output record
-// to identify the shader module which generated the record.
-Optimizer::PassToken CreateInstBindlessCheckPass(uint32_t shader_id);
-
-// Create a pass to instrument physical buffer address checking
-// This pass instruments all physical buffer address references to check that
-// all referenced bytes fall in a valid buffer. If the reference is
-// invalid, a record is written to the debug output buffer (if space allows)
-// and a null value is returned. This pass is designed to support buffer
-// address validation in the Vulkan validation layers.
-//
-// Dead code elimination should be run after this pass as the original,
-// potentially invalid code is not removed and could cause undefined behavior,
-// including crashes. Instruction simplification would likely also be
-// beneficial. It is also generally recommended that this pass (and all
-// instrumentation passes) be run after any legalization and optimization
-// passes. This will give better analysis for the instrumentation and avoid
-// potentially de-optimizing the instrument code, for example, inlining
-// the debug record output function throughout the module.
-//
-// The instrumentation will read and write buffers in debug
-// descriptor set |desc_set|. It will write |shader_id| in each output record
-// to identify the shader module which generated the record.
-Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t shader_id);
-
-// Create a pass to instrument OpDebugPrintf instructions.
-// This pass replaces all OpDebugPrintf instructions with instructions to write
-// a record containing the string id and the all specified values into a special
-// printf output buffer (if space allows). This pass is designed to support
-// the printf validation in the Vulkan validation layers.
-//
-// The instrumentation will write buffers in debug descriptor set |desc_set|.
-// It will write |shader_id| in each output record to identify the shader
-// module which generated the record.
-Optimizer::PassToken CreateInstDebugPrintfPass(uint32_t desc_set,
- uint32_t shader_id);
-
// Create a pass to upgrade to the VulkanKHR memory model.
// This pass upgrades the Logical GLSL450 memory model to Logical VulkanKHR.
// Additionally, it modifies memory, image, atomic and barrier operations to
@@ -874,14 +815,19 @@
// Create descriptor scalar replacement pass.
// This pass replaces every array variable |desc| that has a DescriptorSet and
-// Binding decorations with a new variable for each element of the array.
-// Suppose |desc| was bound at binding |b|. Then the variable corresponding to
-// |desc[i]| will have binding |b+i|. The descriptor set will be the same. It
-// is assumed that no other variable already has a binding that will used by one
-// of the new variables. If not, the pass will generate invalid Spir-V. All
-// accesses to |desc| must be OpAccessChain instructions with a literal index
-// for the first index.
+// Binding decorations with a new variable for each element of the
+// array/composite. Suppose |desc| was bound at binding |b|. Then the variable
+// corresponding to |desc[i]| will have binding |b+i|. The descriptor set will
+// be the same. It is assumed that no other variable already has a binding that
+// will used by one of the new variables. If not, the pass will generate
+// invalid Spir-V. All accesses to |desc| must be OpAccessChain instructions
+// with a literal index for the first index. This variant flattens both
+// composites and arrays.
Optimizer::PassToken CreateDescriptorScalarReplacementPass();
+// This variant flattens only composites.
+Optimizer::PassToken CreateDescriptorCompositeScalarReplacementPass();
+// This variant flattens only arrays.
+Optimizer::PassToken CreateDescriptorArrayScalarReplacementPass();
// Create a pass to replace each OpKill instruction with a function call to a
// function that has a single OpKill. Also replace each OpTerminateInvocation
@@ -903,6 +849,12 @@
// propagated into their final positions.
Optimizer::PassToken CreateInterpolateFixupPass();
+// Replace OpExtInst instructions with OpExtInstWithForwardRefsKHR when
+// the instruction contains a forward reference to another debug instuction.
+// Replace OpExtInstWithForwardRefsKHR with OpExtInst when there are no forward
+// reference to another debug instruction.
+Optimizer::PassToken CreateOpExtInstWithForwardReferenceFixupPass();
+
// Removes unused components from composite input variables. Current
// implementation just removes trailing unused components from input arrays
// and structs. The pass performs best after maximizing dead code removal.
@@ -992,6 +944,15 @@
// the unknown capability interacts with one of the trimmed capabilities.
Optimizer::PassToken CreateTrimCapabilitiesPass();
+// Creates a struct-packing pass.
+// This pass re-assigns all offset layout decorators to tightly pack
+// the struct with OpName matching `structToPack` according to the given packing
+// rule. Accepted packing rules are: std140, std140EnhancedLayout, std430,
+// std430EnhancedLayout, hlslCbuffer, hlslCbufferPackOffset, scalar,
+// scalarEnhancedLayout.
+Optimizer::PassToken CreateStructPackingPass(const char* structToPack,
+ const char* packingRule);
+
// Creates a switch-descriptorset pass.
// This pass changes any DescriptorSet decorations with the value |ds_from| to
// use the new value |ds_to|.
@@ -1007,6 +968,70 @@
// Creates a pass to add/remove maximal reconvergence execution mode.
// This pass either adds or removes maximal reconvergence from all entry points.
Optimizer::PassToken CreateModifyMaximalReconvergencePass(bool add);
+
+// Creates a pass to split combined image+sampler variables and function
+// parameters into separate image and sampler parts. Binding numbers and
+// other decorations are copied.
+Optimizer::PassToken CreateSplitCombinedImageSamplerPass();
+
+// Creates a pass to remap bindings to avoid conflicts, assuming the module
+// is valid for Vulkan. A conflict exits when an entry point uses two distinct
+// variables with the same descriptor set and binding. Vulkan allows one kind
+// of conflict: when one varible is an image (or array of images), and the
+// other is a sampler (or an array of samplers).
+
+// Conflicts are eliminated by incrementing the binding number of the sampler
+// part, and then propagating that increment through variables with
+// higher-numbered bindings until no conflict remains. This handles the case
+// when multiple shaders may share the same resource variables; this can
+// introduce holes in binding slots.
+//
+// Here's an example where shaders Alpha, Beta, Gamma, Delta collectively use
+// resource variables %100, %101, %102, %103, %104 all with the same
+// DescriptorSet and with Bindings as in the following table:
+//
+// Before:
+//
+// Binding: 0 1 2 3
+// Alpha: %100,%101
+// Beta: %100 %102
+// Gamma: %102 %103
+// Delta: %103 %104
+//
+// The Alpha shader has a conflict where variables %100, %101 have the same
+// descriptor set and binding. If %100 is a sampler resource variable, then
+// the conflict is resolved by incrementing the binding number on %100 from 0
+// to 1. But this causes a new confict for shader Beta because it now uses
+// both %100 and %102 with binding number 1. That conflict is resolved by
+// incrementing the binding number on its variable that originally appeared
+// second (i.e. %102), so %102 gets binding 2. This now produces a conflict
+// for Gamma between %102 and %103 using binding number 2. Since %103 originally
+// appeared second (in the view from Gamma), the algorithm bumps %103 to binding
+// number %103. Now Delta has a conflict between %103 and %104, resulting in
+// %104 getting the next binding number, 4. The picture afterward is:
+//
+// After:
+//
+// Binding: 0 1 2 3 4
+// Alpha: %101 %100
+// Beta: %100 %102
+// Gamma: %102 %103
+// Delta: %103 %104
+//
+//
+// This pass assumes binding numbers are not applid via decoration groups
+// (OpDecorationGroup).
+Optimizer::PassToken CreateResolveBindingConflictsPass();
+
+// Create a pass to canonicalize IDs to improve compression of SPIR-V binary
+// files. The resulting modules have an increased ID range (IDs are not as
+// tightly packed around zero), but will compress better when multiple modules
+// are compressed together, since the compressor's dictionary can find better
+// cross module commonality. This pass should be run after most optimization
+// passes except for
+// --strip-debug because this pass will use OpName to canonicalize IDs. i.e. Run
+// --strip-debug after this pass.
+Optimizer::PassToken CreateCanonicalizeIdsPass();
} // namespace spvtools
#endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_
diff --git a/third_party/SPIRV-Tools/kokoro/check-format/build-docker.sh b/third_party/SPIRV-Tools/kokoro/check-format/build-docker.sh
new file mode 100755
index 0000000..b7af9ee
--- /dev/null
+++ b/third_party/SPIRV-Tools/kokoro/check-format/build-docker.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# Copyright (c) 2025 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.
+
+# Fail on any error.
+set -e
+
+# This is required to run any git command in the docker since owner will
+# have changed between the clone environment, and the docker container.
+# Marking the root of the repo as safe for ownership changes.
+git config --global --add safe.directory "$PWD"
+
+echo $(date): Check formatting...
+./utils/check_code_format.sh ${1:-main}
+echo $(date): check completed.
diff --git a/third_party/SPIRV-Tools/kokoro/check-format/build.sh b/third_party/SPIRV-Tools/kokoro/check-format/build.sh
old mode 100644
new mode 100755
index 96603e4..6f073c6
--- a/third_party/SPIRV-Tools/kokoro/check-format/build.sh
+++ b/third_party/SPIRV-Tools/kokoro/check-format/build.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2018 Google LLC.
+# Copyright (c) 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,37 +12,16 @@
# 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.
-#
-# Android Build Script.
# Fail on any error.
set -e
-# Display commands being run.
-set -x
-BUILD_ROOT=$PWD
-SRC=$PWD/github/SPIRV-Tools
+SCRIPT_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
+SRC_ROOT="$( cd "${SCRIPT_DIR}/../.." >/dev/null 2>&1 && pwd )"
+TARGET_BRANCH="${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH-main}"
-# This is required to run any git command in the docker since owner will
-# have changed between the clone environment, and the docker container.
-# Marking the root of the repo as safe for ownership changes.
-git config --global --add safe.directory $SRC
-
-# Get clang-format-5.0.0.
-# Once kokoro upgrades the Ubuntu VMs, we can use 'apt-get install clang-format'
-curl -L http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04.tar.xz -o clang-llvm.tar.xz
-tar xf clang-llvm.tar.xz
-export PATH=$PWD/clang+llvm-5.0.0-linux-x86_64-ubuntu14.04/bin:$PATH
-
-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
-# The --fail flag causes the command to fail on HTTP error response codes, like 404.
-curl -L --fail https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py
-
-echo $(date): Check formatting...
-./utils/check_code_format.sh;
-echo $(date): check completed.
+docker run --rm -i \
+ --volume "${SRC_ROOT}:${SRC_ROOT}" \
+ --workdir "${SRC_ROOT}" \
+ "us-east4-docker.pkg.dev/shaderc-build/radial-docker/ubuntu-24.04-amd64/formatter" \
+ "${SCRIPT_DIR}/build-docker.sh" "${TARGET_BRANCH}"
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/continuous.cfg b/third_party/SPIRV-Tools/kokoro/dxc-smoketest/build.sh
old mode 100644
new mode 100755
similarity index 68%
rename from third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/continuous.cfg
rename to third_party/SPIRV-Tools/kokoro/dxc-smoketest/build.sh
index a9ac6ec..0428f38
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/continuous.cfg
+++ b/third_party/SPIRV-Tools/kokoro/dxc-smoketest/build.sh
@@ -1,10 +1,11 @@
+#!/bin/bash
# Copyright (c) 2018 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# 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,
@@ -12,11 +13,10 @@
# 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/build.bat"
+# Fail on any error.
+set -e
+# Display commands being run.
+set -x
-action {
- define_artifacts {
- regex: "install.zip"
- }
-}
+SCRIPT_DIR=`dirname "$BASH_SOURCE"`
+source $SCRIPT_DIR/../scripts/linux/build.sh RELEASE gcc cmake-dxc-smoketest
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg b/third_party/SPIRV-Tools/kokoro/dxc-smoketest/continuous.cfg
similarity index 84%
copy from third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg
copy to third_party/SPIRV-Tools/kokoro/dxc-smoketest/continuous.cfg
index 5efd429..c52c216 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg
+++ b/third_party/SPIRV-Tools/kokoro/dxc-smoketest/continuous.cfg
@@ -12,5 +12,6 @@
# 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/build.bat"
+# Continuous build configuration.
+build_file: "SPIRV-Tools/kokoro/dxc-smoketest/build.sh"
+
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg b/third_party/SPIRV-Tools/kokoro/dxc-smoketest/presubmit.cfg
similarity index 89%
rename from third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg
rename to third_party/SPIRV-Tools/kokoro/dxc-smoketest/presubmit.cfg
index 5efd429..6e0c861 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg
+++ b/third_party/SPIRV-Tools/kokoro/dxc-smoketest/presubmit.cfg
@@ -13,4 +13,5 @@
# limitations under the License.
# Presubmit build configuration.
-build_file: "SPIRV-Tools/kokoro/windows-msvc-2017-release/build.bat"
+build_file: "SPIRV-Tools/kokoro/dxc-smoketest/build.sh"
+
diff --git a/third_party/SPIRV-Tools/kokoro/scripts/linux/build-docker.sh b/third_party/SPIRV-Tools/kokoro/scripts/linux/build-docker.sh
index e47037d..b81c8de 100755
--- a/third_party/SPIRV-Tools/kokoro/scripts/linux/build-docker.sh
+++ b/third_party/SPIRV-Tools/kokoro/scripts/linux/build-docker.sh
@@ -27,10 +27,12 @@
. /bin/using.sh # Declare the bash `using` function for configuring toolchains.
+using python-3.12
+
if [ $COMPILER = "clang" ]; then
- using clang-10.0.0
+ using clang-13.0.1
elif [ $COMPILER = "gcc" ]; then
- using gcc-9
+ using gcc-13
fi
cd $ROOT_DIR
@@ -43,13 +45,13 @@
mkdir "$dir"
}
-if [ $TOOL != "cmake-smoketest" ]; then
+if [ $TOOL != "cmake-shaderc-smoketest" ] && [ $TOOL != "cmake-dxc-smoketest" ]; then
# Get source for dependencies, as specified in the DEPS file
/usr/bin/python3 utils/git-sync-deps --treeless
fi
if [ $TOOL = "cmake" ]; then
- using cmake-3.17.2
+ using cmake-3.31.2
using ninja-1.10.0
# Possible configurations are:
@@ -113,8 +115,8 @@
ninja install
cd $KOKORO_ARTIFACTS_DIR
tar czf install.tgz install
-elif [ $TOOL = "cmake-smoketest" ]; then
- using cmake-3.17.2
+elif [ $TOOL = "cmake-shaderc-smoketest" ]; then
+ using cmake-3.31.2
using ninja-1.10.0
# Get shaderc.
@@ -154,9 +156,46 @@
echo $(date): Starting ctest...
ctest --output-on-failure -j4
echo $(date): ctest completed.
+elif [ $TOOL = "cmake-dxc-smoketest" ]; then
+ using cmake-3.31.2
+ using ninja-1.10.0
+
+ # Get shaderc.
+ DXC_DIR=/tmp/dxc
+ clean_dir "$DXC_DIR"
+ cd $DXC_DIR
+ git clone https://github.com/microsoft/DirectXShaderCompiler.git .
+ cd $DXC_DIR/external
+
+ # Get DXC dependencies. Link the appropriate SPIRV-Tools.
+ git submodule update --init DirectX-Headers
+ rm -rf SPIRV-Tools
+ ln -s $ROOT_DIR SPIRV-Tools
+ git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Headers
+
+ cd $DXC_DIR
+ mkdir build
+ cd $DXC_DIR/build
+
+ # Invoke the build.
+ echo $(date): Configuring build...
+ cmake $DXC_DIR \
+ -C $DXC_DIR/cmake/caches/PredefinedParams.cmake \
+ -DCMAKE_BUILD_TYPE="Release" \
+ -G Ninja
+
+ echo $(date): Building ClangSPIRVTests...
+ ninja ClangSPIRVTests
+
+ echo $(date): Testing ClangSPIRVTests...
+ tools/clang/unittests/SPIRV/ClangSPIRVTests
+
+ echo $(date): Testing check-clang-codegenspirv...
+ ninja check-clang-codegenspirv
+
elif [ $TOOL = "cmake-android-ndk" ]; then
- using cmake-3.17.2
- using ndk-r25c
+ using cmake-3.31.2
+ using ndk-r27c
using ninja-1.10.0
clean_dir "$ROOT_DIR/build"
@@ -176,7 +215,7 @@
ninja
echo $(date): Build completed.
elif [ $TOOL = "android-ndk-build" ]; then
- using ndk-r25c
+ using ndk-r27c
clean_dir "$ROOT_DIR/build"
cd "$ROOT_DIR/build"
diff --git a/third_party/SPIRV-Tools/kokoro/scripts/linux/build.sh b/third_party/SPIRV-Tools/kokoro/scripts/linux/build.sh
index 688ba79..cb6cf58 100644
--- a/third_party/SPIRV-Tools/kokoro/scripts/linux/build.sh
+++ b/third_party/SPIRV-Tools/kokoro/scripts/linux/build.sh
@@ -52,7 +52,7 @@
--env KOKORO_ARTIFACTS_DIR="${KOKORO_ARTIFACTS_DIR}" \
--env BUILD_SHA="${BUILD_SHA}" \
--entrypoint "${SCRIPT_DIR}/build-docker.sh" \
- "gcr.io/shaderc-build/radial-build:latest"
+ us-east4-docker.pkg.dev/shaderc-build/radial-docker/ubuntu-24.04-amd64/cpp-builder
RESULT=$?
# This is important. If the permissions are not fixed, kokoro will fail
diff --git a/third_party/SPIRV-Tools/kokoro/scripts/windows/build.bat b/third_party/SPIRV-Tools/kokoro/scripts/windows/build.bat
index fe15f2d..6e6c157 100644
--- a/third_party/SPIRV-Tools/kokoro/scripts/windows/build.bat
+++ b/third_party/SPIRV-Tools/kokoro/scripts/windows/build.bat
@@ -21,21 +21,18 @@
set BUILD_TYPE=%1
set VS_VERSION=%2
-:: Force usage of python 3.6
-set PATH=C:\python36;"C:\Program Files\cmake-3.23.1-windows-x86_64\bin";%PATH%
+:: Force usage of python 3.12, cmake 3.31.2
+set PATH=C:\python312;c:\cmake-3.31.2\bin;%PATH%
:: #########################################
:: set up msvc build env
:: #########################################
-if %VS_VERSION% == 2017 (
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- echo "Using VS 2017..."
-
- :: RE2 does not support VS2017, we we must disable tests.
- set BUILD_TESTS=NO
-) else if %VS_VERSION% == 2019 (
+if %VS_VERSION% == 2019 (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
echo "Using VS 2019..."
+) else if %VS_VERSION% == 2022 (
+ call "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64
+ echo "Using VS 2022..."
)
cd %SRC%
@@ -63,6 +60,7 @@
set CMAKE_FLAGS=-DSPIRV_SKIP_TESTS=ON %CMAKE_FLAGS%
)
+cmake --version
cmake %CMAKE_FLAGS% ..
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
diff --git a/third_party/SPIRV-Tools/kokoro/shaderc-smoketest/build.sh b/third_party/SPIRV-Tools/kokoro/shaderc-smoketest/build.sh
index 60c816d..5756e21 100755
--- a/third_party/SPIRV-Tools/kokoro/shaderc-smoketest/build.sh
+++ b/third_party/SPIRV-Tools/kokoro/shaderc-smoketest/build.sh
@@ -19,4 +19,4 @@
set -x
SCRIPT_DIR=`dirname "$BASH_SOURCE"`
-source $SCRIPT_DIR/../scripts/linux/build.sh RELEASE gcc cmake-smoketest
+source $SCRIPT_DIR/../scripts/linux/build.sh RELEASE gcc cmake-shaderc-smoketest
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/build.bat b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/build.bat
similarity index 100%
rename from third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/build.bat
rename to third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/build.bat
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/continuous.cfg b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/continuous.cfg
similarity index 91%
rename from third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/continuous.cfg
rename to third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/continuous.cfg
index e3a7863..5514fab 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/continuous.cfg
+++ b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/continuous.cfg
@@ -13,7 +13,7 @@
# limitations under the License.
# Continuous build configuration.
-build_file: "SPIRV-Tools/kokoro/windows-msvc-2019-debug/build.bat"
+build_file: "SPIRV-Tools/kokoro/windows-msvc-2022-debug/build.bat"
action {
define_artifacts {
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/presubmit.cfg b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/presubmit.cfg
similarity index 90%
rename from third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/presubmit.cfg
rename to third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/presubmit.cfg
index 0ed3594..ced91a3 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/presubmit.cfg
+++ b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-debug/presubmit.cfg
@@ -13,4 +13,4 @@
# limitations under the License.
# Presubmit build configuration.
-build_file: "SPIRV-Tools/kokoro/windows-msvc-2019-debug/build.bat"
+build_file: "SPIRV-Tools/kokoro/windows-msvc-2022-debug/build.bat"
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/build.bat b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/build.bat
similarity index 95%
rename from third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/build.bat
rename to third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/build.bat
index 899fcbc..5294a90 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/build.bat
+++ b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/build.bat
@@ -1,4 +1,4 @@
-:: Copyright (c) 2018 Google LLC.
+:: Copyright (c) 2025 Google LLC
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
@@ -20,5 +20,5 @@
set SCRIPT_DIR=%~dp0
:: Call with correct parameter
-call %SCRIPT_DIR%\..\scripts\windows\build.bat RelWithDebInfo 2017
+call %SCRIPT_DIR%\..\scripts\windows\build.bat RelWithDebInfo 2022
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/continuous.cfg b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/continuous.cfg
similarity index 86%
copy from third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/continuous.cfg
copy to third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/continuous.cfg
index e3a7863..7c37605 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/continuous.cfg
+++ b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/continuous.cfg
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 Google LLC
+# Copyright (c) 2025 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
# limitations under the License.
# Continuous build configuration.
-build_file: "SPIRV-Tools/kokoro/windows-msvc-2019-debug/build.bat"
+build_file: "SPIRV-Tools/kokoro/windows-msvc-2022-release/build.bat"
action {
define_artifacts {
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/presubmit.cfg
similarity index 85%
copy from third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg
copy to third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/presubmit.cfg
index 5efd429..94c9144 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2017-release/presubmit.cfg
+++ b/third_party/SPIRV-Tools/kokoro/windows-msvc-2022-release/presubmit.cfg
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Google LLC.
+# Copyright (c) 2025 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,4 +13,4 @@
# limitations under the License.
# Presubmit build configuration.
-build_file: "SPIRV-Tools/kokoro/windows-msvc-2017-release/build.bat"
+build_file: "SPIRV-Tools/kokoro/windows-msvc-2022-release/build.bat"
diff --git a/third_party/SPIRV-Tools/source/CMakeLists.txt b/third_party/SPIRV-Tools/source/CMakeLists.txt
index d0454c6c..fd2d963 100644
--- a/third_party/SPIRV-Tools/source/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/source/CMakeLists.txt
@@ -12,62 +12,62 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set(GRAMMAR_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_grammar_tables.py")
-set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_vim_syntax.py")
+set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/vim/generate_syntax.py")
set(XML_REGISTRY_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_registry_tables.py")
set(LANG_HEADER_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_language_headers.py")
+set(GGT_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/ggt.py")
# Pull in grammar files that have migrated to SPIRV-Headers
-set(DEBUGINFO_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.debuginfo.grammar.json")
-set(CLDEBUGINFO100_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json")
-set(VKDEBUGINFO100_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json")
+set(GRAMMAR_DIR "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1")
+set(SPIRV_CORE_GRAMMAR_JSON_FILE "${GRAMMAR_DIR}/spirv.core.grammar.json")
+set(EI_debuginfo "${GRAMMAR_DIR}/extinst.debuginfo.grammar.json")
+set(EI_cldebuginfo "${GRAMMAR_DIR}/extinst.opencl.debuginfo.100.grammar.json")
+set(EI_glsl "${GRAMMAR_DIR}/extinst.glsl.std.450.grammar.json")
+set(EI_opencl "${GRAMMAR_DIR}/extinst.opencl.std.100.grammar.json")
+set(EI_amd_evp "${GRAMMAR_DIR}/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json")
+set(EI_amd_trimm "${GRAMMAR_DIR}/extinst.spv-amd-shader-trinary-minmax.grammar.json")
+set(EI_amd_gcn "${GRAMMAR_DIR}/extinst.spv-amd-gcn-shader.grammar.json")
+set(EI_amd_ballot "${GRAMMAR_DIR}/extinst.spv-amd-shader-ballot.grammar.json")
+set(EI_ns_debuginfo "${GRAMMAR_DIR}/extinst.nonsemantic.shader.debuginfo.100.grammar.json")
+set(EI_ns_clspvreflect "${GRAMMAR_DIR}/extinst.nonsemantic.clspvreflection.grammar.json")
+set(EI_ns_vkspreflect "${GRAMMAR_DIR}/extinst.nonsemantic.vkspreflection.grammar.json")
+set(EI_tosa_001000_1 "${GRAMMAR_DIR}/extinst.tosa.001000.1.grammar.json")
-# macro() definitions are used in the following because we need to append .inc
-# file paths into some global lists (*_CPP_DEPENDS). And those global lists are
-# later used by set_source_files_properties() calls.
-# function() definitions are not suitable because they create new scopes.
-macro(spvtools_core_tables CONFIG_VERSION)
- set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/spirv.core.grammar.json")
- set(GRAMMAR_INSTS_INC_FILE "${spirv-tools_BINARY_DIR}/core.insts-${CONFIG_VERSION}.inc")
- set(GRAMMAR_KINDS_INC_FILE "${spirv-tools_BINARY_DIR}/operand.kinds-${CONFIG_VERSION}.inc")
- add_custom_command(OUTPUT ${GRAMMAR_INSTS_INC_FILE} ${GRAMMAR_KINDS_INC_FILE}
- COMMAND Python3::Interpreter ${GRAMMAR_PROCESSING_SCRIPT}
- --spirv-core-grammar=${GRAMMAR_JSON_FILE}
- --extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE}
- --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}
- ${CLDEBUGINFO100_GRAMMAR_JSON_FILE}
- COMMENT "Generate info tables for SPIR-V v${CONFIG_VERSION} core instructions and operands.")
- list(APPEND OPCODE_CPP_DEPENDS ${GRAMMAR_INSTS_INC_FILE})
- list(APPEND OPERAND_CPP_DEPENDS ${GRAMMAR_KINDS_INC_FILE})
-endmacro(spvtools_core_tables)
-
-macro(spvtools_enum_string_mapping CONFIG_VERSION)
- set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/spirv.core.grammar.json")
- set(GRAMMAR_EXTENSION_ENUM_INC_FILE "${spirv-tools_BINARY_DIR}/extension_enum.inc")
- set(GRAMMAR_ENUM_STRING_MAPPING_INC_FILE "${spirv-tools_BINARY_DIR}/enum_string_mapping.inc")
- add_custom_command(OUTPUT ${GRAMMAR_EXTENSION_ENUM_INC_FILE}
- ${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE}
- COMMAND Python3::Interpreter ${GRAMMAR_PROCESSING_SCRIPT}
- --spirv-core-grammar=${GRAMMAR_JSON_FILE}
- --extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE}
- --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}
- ${CLDEBUGINFO100_GRAMMAR_JSON_FILE}
- COMMENT "Generate enum-string mapping for SPIR-V v${CONFIG_VERSION}.")
- list(APPEND EXTENSION_H_DEPENDS ${GRAMMAR_EXTENSION_ENUM_INC_FILE})
- list(APPEND ENUM_STRING_MAPPING_CPP_DEPENDS ${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE})
-endmacro(spvtools_enum_string_mapping)
+set(CORE_TABLES_BODY_INC_FILE ${spirv-tools_BINARY_DIR}/core_tables_body.inc)
+set(CORE_TABLES_HEADER_INC_FILE ${spirv-tools_BINARY_DIR}/core_tables_header.inc)
+add_custom_command(OUTPUT ${CORE_TABLES_BODY_INC_FILE} ${CORE_TABLES_HEADER_INC_FILE}
+ COMMAND Python3::Interpreter ${GGT_SCRIPT}
+ --core-tables-body-output=${CORE_TABLES_BODY_INC_FILE}
+ --core-tables-header-output=${CORE_TABLES_HEADER_INC_FILE}
+ --spirv-core-grammar=${SPIRV_CORE_GRAMMAR_JSON_FILE}
+ --extinst=,${EI_glsl}
+ --extinst=,${EI_opencl}
+ --extinst=CLDEBUG100_,${EI_cldebuginfo}
+ --extinst=SHDEBUG100_,${EI_ns_debuginfo}
+ --extinst=,${EI_amd_evp}
+ --extinst=,${EI_amd_trimm}
+ --extinst=,${EI_amd_gcn}
+ --extinst=,${EI_amd_ballot}
+ --extinst=,${EI_debuginfo}
+ --extinst=,${EI_ns_clspvreflect}
+ --extinst=,${EI_ns_vkspreflect}
+ --extinst=TOSA_,${EI_tosa_001000_1}
+ DEPENDS ${GGT_SCRIPT}
+ ${SPIRV_CORE_GRAMMAR_JSON_FILE}
+ ${EI_glsl}
+ ${EI_opencl}
+ ${EI_cldebuginfo}
+ ${EI_ns_debuginfo}
+ ${EI_amd_evp}
+ ${EI_amd_trimm}
+ ${EI_amd_gcn}
+ ${EI_amd_ballot}
+ ${EI_debuginfo}
+ ${EI_ns_clspvreflect}
+ ${EI_ns_vkspreflect}
+ ${EI_tosa_001000_1}
+ COMMENT "Generate grammar tables")
+add_custom_target(spirv-tools-tables DEPENDS ${CORE_TABLES_BODY_INC_FILE} ${CORE_TABLES_HEADER_INC_FILE})
macro(spvtools_vimsyntax CONFIG_VERSION CLVERSION)
set(GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/spirv.core.grammar.json")
@@ -77,60 +77,15 @@
add_custom_command(OUTPUT ${VIMSYNTAX_FILE}
COMMAND Python3::Interpreter ${VIMSYNTAX_PROCESSING_SCRIPT}
--spirv-core-grammar=${GRAMMAR_JSON_FILE}
- --extinst-debuginfo-grammar=${DEBUGINFO_GRAMMAR_JSON_FILE}
+ --extinst-debuginfo-grammar=${EI_debuginfo}
--extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE}
--extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE}
>${VIMSYNTAX_FILE}
DEPENDS ${VIMSYNTAX_PROCESSING_SCRIPT} ${GRAMMAR_JSON_FILE}
- ${GLSL_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE} ${DEBUGINFO_GRAMMAR_JSON_FILE}
+ ${GLSL_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE} ${EI_debuinfo}
COMMENT "Generate spvasm.vim: Vim syntax file for SPIR-V assembly.")
endmacro(spvtools_vimsyntax)
-macro(spvtools_glsl_tables CONFIG_VERSION)
- set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/spirv.core.grammar.json")
- set(GLSL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/extinst.glsl.std.450.grammar.json")
- set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/glsl.std.450.insts.inc")
- add_custom_command(OUTPUT ${GRAMMAR_INC_FILE}
- COMMAND Python3::Interpreter ${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})
-endmacro(spvtools_glsl_tables)
-
-macro(spvtools_opencl_tables CONFIG_VERSION)
- set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/spirv.core.grammar.json")
- set(OPENCL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${CONFIG_VERSION}/extinst.opencl.std.100.grammar.json")
- set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/opencl.std.insts.inc")
- add_custom_command(OUTPUT ${GRAMMAR_INC_FILE}
- COMMAND Python3::Interpreter ${GRAMMAR_PROCESSING_SCRIPT}
- --extinst-opencl-grammar=${OPENCL_GRAMMAR_JSON_FILE}
- --opencl-insts-output=${GRAMMAR_INC_FILE}
- DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${CORE_GRAMMAR_JSON_FILE} ${OPENCL_GRAMMAR_JSON_FILE}
- COMMENT "Generate info tables for OpenCL extended instructions and operands v${CONFIG_VERSION}.")
- list(APPEND EXTINST_CPP_DEPENDS ${GRAMMAR_INC_FILE})
-endmacro(spvtools_opencl_tables)
-
-macro(spvtools_vendor_tables VENDOR_TABLE SHORT_NAME OPERAND_KIND_PREFIX)
- set(INSTS_FILE "${spirv-tools_BINARY_DIR}/${VENDOR_TABLE}.insts.inc")
- set(GRAMMAR_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.${VENDOR_TABLE}.grammar.json")
- if(NOT EXISTS ${GRAMMAR_FILE})
- set(GRAMMAR_FILE "${spirv-tools_SOURCE_DIR}/source/extinst.${VENDOR_TABLE}.grammar.json")
- endif()
- add_custom_command(OUTPUT ${INSTS_FILE}
- COMMAND Python3::Interpreter ${GRAMMAR_PROCESSING_SCRIPT}
- --extinst-vendor-grammar=${GRAMMAR_FILE}
- --vendor-insts-output=${INSTS_FILE}
- --vendor-operand-kind-prefix=${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 "SPIRV-Tools build")
- list(APPEND EXTINST_CPP_DEPENDS spv-tools-${SHORT_NAME})
-endmacro(spvtools_vendor_tables)
-
macro(spvtools_extinst_lang_headers NAME GRAMMAR_FILE)
set(OUT_H ${spirv-tools_BINARY_DIR}/${NAME}.h)
add_custom_command(OUTPUT ${OUT_H}
@@ -144,22 +99,9 @@
list(APPEND EXTINST_CPP_DEPENDS spirv-tools-header-${NAME})
endmacro(spvtools_extinst_lang_headers)
-spvtools_core_tables("unified1")
-spvtools_enum_string_mapping("unified1")
-spvtools_opencl_tables("unified1")
-spvtools_glsl_tables("unified1")
-spvtools_vendor_tables("spv-amd-shader-explicit-vertex-parameter" "spv-amd-sevp" "")
-spvtools_vendor_tables("spv-amd-shader-trinary-minmax" "spv-amd-stm" "")
-spvtools_vendor_tables("spv-amd-gcn-shader" "spv-amd-gs" "")
-spvtools_vendor_tables("spv-amd-shader-ballot" "spv-amd-sb" "")
-spvtools_vendor_tables("debuginfo" "debuginfo" "")
-spvtools_vendor_tables("opencl.debuginfo.100" "cldi100" "CLDEBUG100_")
-spvtools_vendor_tables("nonsemantic.shader.debuginfo.100" "shdi100" "SHDEBUG100_")
-spvtools_vendor_tables("nonsemantic.clspvreflection" "clspvreflection" "")
-spvtools_vendor_tables("nonsemantic.vkspreflection" "vkspreflection" "")
-spvtools_extinst_lang_headers("DebugInfo" ${DEBUGINFO_GRAMMAR_JSON_FILE})
-spvtools_extinst_lang_headers("OpenCLDebugInfo100" ${CLDEBUGINFO100_GRAMMAR_JSON_FILE})
-spvtools_extinst_lang_headers("NonSemanticShaderDebugInfo100" ${VKDEBUGINFO100_GRAMMAR_JSON_FILE})
+spvtools_extinst_lang_headers("DebugInfo" ${EI_debuginfo})
+spvtools_extinst_lang_headers("OpenCLDebugInfo100" ${EI_cldebuginfo})
+spvtools_extinst_lang_headers("NonSemanticShaderDebugInfo100" ${EI_ns_debuginfo})
spvtools_vimsyntax("unified1" "1.0")
add_custom_target(spirv-tools-vimsyntax DEPENDS ${VIMSYNTAX_FILE})
@@ -182,9 +124,9 @@
# We need to wrap the .inc files with a custom target to avoid problems when
# multiple targets depend on the same custom command.
add_custom_target(core_tables
- DEPENDS ${OPCODE_CPP_DEPENDS} ${OPERAND_CPP_DEPENDS})
-add_custom_target(enum_string_mapping
- DEPENDS ${EXTENSION_H_DEPENDS} ${ENUM_STRING_MAPPING_CPP_DEPENDS})
+ DEPENDS ${OPCODE_CPP_DEPENDS}
+ ${CORE_TABLES_BODY_INC_FILE}
+ ${CORE_TABLES_HEADER_INC_FILE})
add_custom_target(extinst_tables
DEPENDS ${EXTINST_CPP_DEPENDS})
@@ -211,7 +153,11 @@
DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC})
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})
+list(APPEND PCH_DEPENDS
+ ${CORE_TABLES_HEADER_INC_FILE}
+ ${OPCODE_CPP_DEPENDS}
+ ${EXTINST_CPP_DEPENDS}
+ ${SPIRV_TOOLS_BUILD_VERSION_INC})
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/pch_source.cpp
PROPERTIES OBJECT_DEPENDS "${PCH_DEPENDS}")
@@ -242,7 +188,6 @@
${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.h
${CMAKE_CURRENT_SOURCE_DIR}/disassemble.h
${CMAKE_CURRENT_SOURCE_DIR}/enum_set.h
- ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.h
${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.h
${CMAKE_CURRENT_SOURCE_DIR}/extensions.h
${CMAKE_CURRENT_SOURCE_DIR}/instruction.h
@@ -264,8 +209,10 @@
${CMAKE_CURRENT_SOURCE_DIR}/spirv_target_env.h
${CMAKE_CURRENT_SOURCE_DIR}/spirv_validator_options.h
${CMAKE_CURRENT_SOURCE_DIR}/table.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/table2.h
${CMAKE_CURRENT_SOURCE_DIR}/text.h
${CMAKE_CURRENT_SOURCE_DIR}/text_handler.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/to_string.h
${CMAKE_CURRENT_SOURCE_DIR}/val/validate.h
${CMAKE_CURRENT_SOURCE_DIR}/util/bit_vector.cpp
@@ -275,7 +222,6 @@
${CMAKE_CURRENT_SOURCE_DIR}/binary.cpp
${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/disassemble.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/enum_string_mapping.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext_inst.cpp
${CMAKE_CURRENT_SOURCE_DIR}/extensions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libspirv.cpp
@@ -292,8 +238,10 @@
${CMAKE_CURRENT_SOURCE_DIR}/spirv_target_env.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_validator_options.cpp
${CMAKE_CURRENT_SOURCE_DIR}/table.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/table2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/text.cpp
${CMAKE_CURRENT_SOURCE_DIR}/text_handler.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/to_string.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_adjacency.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_annotation.cpp
@@ -332,7 +280,10 @@
${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_tensor_layout.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/val/validate_tensor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_type.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/val/validate_invalid_type.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/decoration.h
${CMAKE_CURRENT_SOURCE_DIR}/val/basic_block.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/construct.cpp
@@ -346,6 +297,12 @@
${CMAKE_CURRENT_SOURCE_DIR}/util/timer.cpp)
endif()
+if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ set(SPIRV_SOURCES
+ ${SPIRV_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/mimalloc.cpp)
+endif()
+
# The software_version.cpp file includes build-version.inc.
# Rebuild the software_version.cpp object file if it is older than
# build-version.inc or whenever build-version.inc itself is out of
@@ -376,12 +333,15 @@
)
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)
+ add_dependencies(${target} spirv-tools-build-version core_tables extinst_tables)
endfunction()
# Always build ${SPIRV_TOOLS}-shared. This is expected distro packages, and
# unlike the other SPIRV_TOOLS target, defaults to hidden symbol visibility.
add_library(${SPIRV_TOOLS}-shared SHARED ${SPIRV_SOURCES})
+if (SPIRV_TOOLS_USE_MIMALLOC)
+ target_link_libraries(${SPIRV_TOOLS}-shared PRIVATE mimalloc-static)
+endif()
spirv_tools_default_target_options(${SPIRV_TOOLS}-shared)
set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${SPIRV_TOOLS}-shared
@@ -406,6 +366,9 @@
set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-static ${SPIRV_TOOLS}-shared)
else()
add_library(${SPIRV_TOOLS} ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_SOURCES})
+ if (SPIRV_TOOLS_USE_MIMALLOC)
+ target_link_libraries(${SPIRV_TOOLS} PRIVATE mimalloc-static)
+ endif()
spirv_tools_default_target_options(${SPIRV_TOOLS})
set(SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared)
endif()
@@ -414,12 +377,15 @@
find_library(LIBRT rt)
if(LIBRT)
foreach(target ${SPIRV_TOOLS_TARGETS})
- target_link_libraries(${target} rt)
+ target_link_libraries(${target} PUBLIC rt)
endforeach()
endif()
endif()
if(ENABLE_SPIRV_TOOLS_INSTALL)
+ if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV_TOOLS_TARGETS mimalloc-static)
+ endif()
install(TARGETS ${SPIRV_TOOLS_TARGETS} EXPORT ${SPIRV_TOOLS}Targets)
export(EXPORT ${SPIRV_TOOLS}Targets FILE ${SPIRV_TOOLS}Target.cmake)
diff --git a/third_party/SPIRV-Tools/source/assembly_grammar.cpp b/third_party/SPIRV-Tools/source/assembly_grammar.cpp
index 0092d01..4886ee6 100644
--- a/third_party/SPIRV-Tools/source/assembly_grammar.cpp
+++ b/third_party/SPIRV-Tools/source/assembly_grammar.cpp
@@ -23,6 +23,7 @@
#include "source/operand.h"
#include "source/spirv_target_env.h"
#include "source/table.h"
+#include "source/table2.h"
namespace spvtools {
namespace {
@@ -35,15 +36,12 @@
///
/// On success, the value is written to pValue.
///
-/// @param[in] operandTable operand lookup table
/// @param[in] type of the operand
/// @param[in] textValue word of text to be parsed
/// @param[out] pValue where the resulting value is written
///
/// @return result code
-spv_result_t spvTextParseMaskOperand(spv_target_env env,
- const spv_operand_table operandTable,
- const spv_operand_type_t type,
+spv_result_t spvTextParseMaskOperand(const spv_operand_type_t type,
const char* textValue, uint32_t* pValue) {
if (textValue == nullptr) return SPV_ERROR_INVALID_TEXT;
size_t text_length = strlen(textValue);
@@ -62,9 +60,9 @@
do {
end = std::find(begin, text_end, separator);
- spv_operand_desc entry = nullptr;
- if (auto error = spvOperandTableNameLookup(env, operandTable, type, begin,
- end - begin, &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (auto error =
+ spvtools::LookupOperand(type, begin, end - begin, &entry)) {
return error;
}
value |= entry->value;
@@ -170,23 +168,20 @@
} // namespace
-bool AssemblyGrammar::isValid() const {
- return operandTable_ && opcodeTable_ && extInstTable_;
-}
-
CapabilitySet AssemblyGrammar::filterCapsAgainstTargetEnv(
const spv::Capability* cap_array, uint32_t count) const {
CapabilitySet cap_set;
const auto version = spvVersionForTargetEnv(target_env_);
for (uint32_t i = 0; i < count; ++i) {
- spv_operand_desc entry = {};
- if (SPV_SUCCESS == lookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
- static_cast<uint32_t>(cap_array[i]),
- &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (SPV_SUCCESS ==
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
+ static_cast<uint32_t>(cap_array[i]), &entry)) {
// This token is visible in this environment if it's in an appropriate
// core version, or it is enabled by a capability or an extension.
if ((version >= entry->minVersion && version <= entry->lastVersion) ||
- entry->numExtensions > 0u || entry->numCapabilities > 0u) {
+ entry->extensions_range.count() > 0u ||
+ entry->capabilities_range.count() > 0u) {
cap_set.insert(cap_array[i]);
}
}
@@ -194,28 +189,13 @@
return cap_set;
}
-spv_result_t AssemblyGrammar::lookupOpcode(const char* name,
- spv_opcode_desc* desc) const {
- return spvOpcodeTableNameLookup(target_env_, opcodeTable_, name, desc);
-}
-
-spv_result_t AssemblyGrammar::lookupOpcode(spv::Op opcode,
- spv_opcode_desc* desc) const {
- return spvOpcodeTableValueLookup(target_env_, opcodeTable_, opcode, desc);
-}
-
-spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type,
- const char* name, size_t name_len,
- spv_operand_desc* desc) const {
- return spvOperandTableNameLookup(target_env_, operandTable_, type, name,
- name_len, desc);
-}
-
-spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type,
- uint32_t operand,
- spv_operand_desc* desc) const {
- return spvOperandTableValueLookup(target_env_, operandTable_, type, operand,
- desc);
+const char* AssemblyGrammar::lookupOperandName(spv_operand_type_t type,
+ uint32_t operand) const {
+ const spvtools::OperandDesc* desc = nullptr;
+ if (spvtools::LookupOperand(type, operand, &desc) != SPV_SUCCESS || !desc) {
+ return "Unknown";
+ }
+ return desc->name().data();
}
spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name,
@@ -245,25 +225,13 @@
spv_result_t AssemblyGrammar::parseMaskOperand(const spv_operand_type_t type,
const char* textValue,
uint32_t* pValue) const {
- return spvTextParseMaskOperand(target_env_, operandTable_, type, textValue,
- pValue);
-}
-spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type,
- const char* textValue,
- spv_ext_inst_desc* extInst) const {
- return spvExtInstTableNameLookup(extInstTable_, type, textValue, extInst);
-}
-
-spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type,
- uint32_t firstWord,
- spv_ext_inst_desc* extInst) const {
- return spvExtInstTableValueLookup(extInstTable_, type, firstWord, extInst);
+ return spvTextParseMaskOperand(type, textValue, pValue);
}
void AssemblyGrammar::pushOperandTypesForMask(
const spv_operand_type_t type, const uint32_t mask,
spv_operand_pattern_t* pattern) const {
- spvPushOperandTypesForMask(target_env_, operandTable_, type, mask, pattern);
+ spvPushOperandTypesForMask(type, mask, pattern);
}
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/assembly_grammar.h b/third_party/SPIRV-Tools/source/assembly_grammar.h
index 36fdd08..08e10e7 100644
--- a/third_party/SPIRV-Tools/source/assembly_grammar.h
+++ b/third_party/SPIRV-Tools/source/assembly_grammar.h
@@ -19,6 +19,7 @@
#include "source/latest_version_spirv_header.h"
#include "source/operand.h"
#include "source/table.h"
+#include "source/util/span.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
@@ -28,54 +29,28 @@
class AssemblyGrammar {
public:
explicit AssemblyGrammar(const spv_const_context context)
- : target_env_(context->target_env),
- operandTable_(context->operand_table),
- opcodeTable_(context->opcode_table),
- extInstTable_(context->ext_inst_table) {}
-
- // Returns true if the internal tables have been initialized with valid data.
- bool isValid() const;
+ : target_env_(context->target_env) {}
// Returns the SPIR-V target environment.
spv_target_env target_env() const { return target_env_; }
// Removes capabilities not available in the current target environment and
// returns the rest.
+ // TODO(crbug.com/266223071) Remove this.
CapabilitySet filterCapsAgainstTargetEnv(const spv::Capability* cap_array,
uint32_t count) const;
-
- // Fills in the desc parameter with the information about the opcode
- // of the given name. Returns SPV_SUCCESS if the opcode was found, and
- // SPV_ERROR_INVALID_LOOKUP if the opcode does not exist.
- spv_result_t lookupOpcode(const char* name, spv_opcode_desc* desc) const;
-
- // 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(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
- // SPV_ERROR_INVALID_LOOKUP otherwise.
- spv_result_t lookupOperand(spv_operand_type_t type, const char* name,
- size_t name_len, spv_operand_desc* desc) const;
-
- // Fills in the desc parameter with the information about the given
- // operand. Returns SPV_SUCCESS if the operand was found, and
- // SPV_ERROR_INVALID_LOOKUP otherwise.
- spv_result_t lookupOperand(spv_operand_type_t type, uint32_t operand,
- spv_operand_desc* desc) const;
+ // Removes capabilities not available in the current target environment and
+ // returns the rest.
+ CapabilitySet filterCapsAgainstTargetEnv(
+ const spvtools::utils::Span<const spv::Capability>& caps) const {
+ return filterCapsAgainstTargetEnv(caps.begin(),
+ static_cast<uint32_t>(caps.size()));
+ }
// Finds operand entry in the grammar table and returns its name.
// Returns "Unknown" if not found.
const char* lookupOperandName(spv_operand_type_t type,
- uint32_t operand) const {
- spv_operand_desc desc = nullptr;
- if (lookupOperand(type, operand, &desc) != SPV_SUCCESS || !desc) {
- return "Unknown";
- }
- return desc->name;
- }
+ uint32_t operand) const;
// Finds the opcode for the given OpSpecConstantOp opcode name. The name
// should not have the "Op" prefix. For example, "IAdd" corresponds to
@@ -101,18 +76,6 @@
spv_result_t parseMaskOperand(const spv_operand_type_t type,
const char* textValue, uint32_t* pValue) const;
- // Writes the extended operand with the given type and text to the *extInst
- // parameter.
- // Returns SPV_SUCCESS if the value could be found.
- spv_result_t lookupExtInst(spv_ext_inst_type_t type, const char* textValue,
- spv_ext_inst_desc* extInst) const;
-
- // Writes the extended operand with the given type and first encoded word
- // to the *extInst parameter.
- // Returns SPV_SUCCESS if the value could be found.
- spv_result_t lookupExtInst(spv_ext_inst_type_t type, uint32_t firstWord,
- spv_ext_inst_desc* extInst) const;
-
// Inserts the operands expected after the given typed mask onto the end
// of the given pattern.
//
@@ -129,9 +92,6 @@
private:
const spv_target_env target_env_;
- const spv_operand_table operandTable_;
- const spv_opcode_table opcodeTable_;
- const spv_ext_inst_table extInstTable_;
};
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/binary.cpp b/third_party/SPIRV-Tools/source/binary.cpp
index cf1f0b7..997a30c 100644
--- a/third_party/SPIRV-Tools/source/binary.cpp
+++ b/third_party/SPIRV-Tools/source/binary.cpp
@@ -33,6 +33,7 @@
#include "source/operand.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
+#include "source/table2.h"
#include "source/util/string_utils.h"
spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
@@ -189,6 +190,7 @@
struct NumberType {
spv_number_kind_t type;
uint32_t bit_width;
+ spv_fp_encoding_t encoding;
};
// The state used to parse a single SPIR-V binary module.
@@ -317,8 +319,8 @@
return diagnostic() << "Invalid instruction word count: "
<< inst_word_count;
}
- spv_opcode_desc opcode_desc;
- if (grammar_.lookupOpcode(static_cast<spv::Op>(inst.opcode), &opcode_desc))
+ const spvtools::InstructionDesc* opcode_desc = nullptr;
+ if (spvtools::LookupOpcode(static_cast<spv::Op>(inst.opcode), &opcode_desc))
return diagnostic() << "Invalid opcode: " << inst.opcode;
// Advance past the opcode word. But remember the of the start
@@ -334,16 +336,15 @@
// ExecutionMode), or for extended instructions that may have their
// own operands depending on the selected extended instruction.
_.expected_operands.clear();
- for (auto i = 0; i < opcode_desc->numTypes; i++)
- _.expected_operands.push_back(
- opcode_desc->operandTypes[opcode_desc->numTypes - i - 1]);
+
+ spvPushOperandTypes(opcode_desc->operands(), &_.expected_operands);
while (_.word_index < inst_offset + inst_word_count) {
const uint16_t inst_word_index = uint16_t(_.word_index - inst_offset);
if (_.expected_operands.empty()) {
- return diagnostic() << "Invalid instruction Op" << opcode_desc->name
- << " starting at word " << inst_offset
- << ": expected no more operands after "
+ return diagnostic() << "Invalid instruction Op"
+ << opcode_desc->name().data() << " starting at word "
+ << inst_offset << ": expected no more operands after "
<< inst_word_index
<< " words, but stated word count is "
<< inst_word_count << ".";
@@ -362,15 +363,15 @@
if (!_.expected_operands.empty() &&
!spvOperandIsOptional(_.expected_operands.back())) {
return diagnostic() << "End of input reached while decoding Op"
- << opcode_desc->name << " starting at word "
+ << opcode_desc->name().data() << " starting at word "
<< inst_offset << ": expected more operands after "
<< inst_word_count << " words.";
}
if ((inst_offset + inst_word_count) != _.word_index) {
- return diagnostic() << "Invalid word count: Op" << opcode_desc->name
- << " starting at word " << inst_offset
- << " says it has " << inst_word_count
+ return diagnostic() << "Invalid word count: Op"
+ << opcode_desc->name().data() << " starting at word "
+ << inst_offset << " says it has " << inst_word_count
<< " words, but found " << _.word_index - inst_offset
<< " words instead.";
}
@@ -385,8 +386,6 @@
assert(_.requires_endian_conversion ||
(_.endian_converted_words.size() == 1));
- recordNumberType(inst_offset, &inst);
-
if (_.requires_endian_conversion) {
// We must wait until here to set this pointer, because the vector might
// have been be resized while we accumulated its elements.
@@ -398,6 +397,8 @@
}
inst.num_words = inst_word_count;
+ recordNumberType(inst_offset, &inst);
+
// We must wait until here to set this pointer, because the vector might
// have been be resized while we accumulated its elements.
inst.operands = _.operands.data();
@@ -473,7 +474,7 @@
if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0";
parsed_operand.type = SPV_OPERAND_TYPE_ID;
- if (opcode == spv::Op::OpExtInst && parsed_operand.offset == 3) {
+ if (spvIsExtendedInstruction(opcode) && 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,13 +495,14 @@
break;
case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: {
- assert(spv::Op::OpExtInst == opcode);
+ assert(spvIsExtendedInstruction(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) ==
+
+ const spvtools::ExtInstDesc* desc = nullptr;
+ if (spvtools::LookupExtInst(inst->ext_inst_type, word, &desc) ==
SPV_SUCCESS) {
// if we know about this ext inst, push the expected operands
- spvPushOperandTypes(ext_inst->operandTypes, expected_operands);
+ spvPushOperandTypes(desc->operands(), expected_operands);
} else {
// if we don't know this extended instruction and the set isn't
// non-semantic, we cannot process further
@@ -522,8 +524,8 @@
return diagnostic()
<< "Invalid " << spvOperandTypeStr(type) << ": " << word;
}
- spv_opcode_desc opcode_entry = nullptr;
- if (grammar_.lookupOpcode(spv::Op(word), &opcode_entry)) {
+ const spvtools::InstructionDesc* opcode_entry = nullptr;
+ if (spvtools::LookupOpcode(spv::Op(word), &opcode_entry)) {
return diagnostic(SPV_ERROR_INTERNAL)
<< "OpSpecConstant opcode table out of sync";
}
@@ -532,8 +534,9 @@
// operants for the opcode.
assert(opcode_entry->hasType);
assert(opcode_entry->hasResult);
- assert(opcode_entry->numTypes >= 2);
- spvPushOperandTypes(opcode_entry->operandTypes + 2, expected_operands);
+ assert(opcode_entry->operands().size() >= 2);
+ spvPushOperandTypes(opcode_entry->operands().subspan(2),
+ expected_operands);
} break;
case SPV_OPERAND_TYPE_LITERAL_INTEGER:
@@ -633,6 +636,7 @@
} break;
case SPV_OPERAND_TYPE_CAPABILITY:
+ case SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY:
case SPV_OPERAND_TYPE_EXECUTION_MODEL:
case SPV_OPERAND_TYPE_ADDRESSING_MODEL:
case SPV_OPERAND_TYPE_MEMORY_MODEL:
@@ -671,6 +675,11 @@
case SPV_OPERAND_TYPE_OVERFLOW_MODES:
case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT:
case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT:
+ case SPV_OPERAND_TYPE_FPENCODING:
+ case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING:
+ case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER:
+ case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL:
+ case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL:
case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS: {
// A single word that is a plain enum value.
@@ -679,30 +688,34 @@
parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER;
if (type == SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT)
parsed_operand.type = SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT;
+ if (type == SPV_OPERAND_TYPE_OPTIONAL_FPENCODING)
+ parsed_operand.type = SPV_OPERAND_TYPE_FPENCODING;
+ if (type == SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY)
+ parsed_operand.type = SPV_OPERAND_TYPE_CAPABILITY;
- spv_operand_desc entry;
- if (grammar_.lookupOperand(type, word, &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(type, word, &entry)) {
return diagnostic()
<< "Invalid " << spvOperandTypeStr(parsed_operand.type)
<< " operand: " << word;
}
// Prepare to accept operands to this operand, if needed.
- spvPushOperandTypes(entry->operandTypes, expected_operands);
+ spvPushOperandTypes(entry->operands(), expected_operands);
} break;
case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: {
- spv_operand_desc entry;
- if (grammar_.lookupOperand(type, word, &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(type, word, &entry)) {
return diagnostic()
<< "Invalid " << spvOperandTypeStr(parsed_operand.type)
<< " operand: " << word
<< ", if you are creating a new source language please use "
"value 0 "
"(Unknown) and when ready, add your source language to "
- "SPRIV-Headers";
+ "SPIRV-Headers";
}
// Prepare to accept operands to this operand, if needed.
- spvPushOperandTypes(entry->operandTypes, expected_operands);
+ spvPushOperandTypes(entry->operands(), expected_operands);
} break;
case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE:
@@ -710,13 +723,20 @@
case SPV_OPERAND_TYPE_LOOP_CONTROL:
case SPV_OPERAND_TYPE_IMAGE:
case SPV_OPERAND_TYPE_OPTIONAL_IMAGE:
+ case SPV_OPERAND_TYPE_MEMORY_ACCESS:
+ case SPV_OPERAND_TYPE_TENSOR_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_TENSOR_OPERANDS:
case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS:
case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS:
case SPV_OPERAND_TYPE_SELECTION_CONTROL:
case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_OPERANDS:
- case SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS: {
+ case SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS:
+ case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_REDUCE:
+ case SPV_OPERAND_TYPE_TENSOR_ADDRESSING_OPERANDS:
+ case SPV_OPERAND_TYPE_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS: {
// This operand is a mask.
// Map an optional operand type to its corresponding concrete type.
@@ -728,6 +748,11 @@
parsed_operand.type = SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_OPERANDS;
if (type == SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS)
parsed_operand.type = SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS;
+ if (type == SPV_OPERAND_TYPE_OPTIONAL_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS)
+ parsed_operand.type =
+ SPV_OPERAND_TYPE_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS;
+ if (type == SPV_OPERAND_TYPE_OPTIONAL_TENSOR_OPERANDS)
+ parsed_operand.type = SPV_OPERAND_TYPE_TENSOR_OPERANDS;
// Check validity of set mask bits. Also prepare for operands for those
// masks if they have any. To get operand order correct, scan from
@@ -738,23 +763,23 @@
uint32_t remaining_word = word;
for (uint32_t mask = (1u << 31); remaining_word; mask >>= 1) {
if (remaining_word & mask) {
- spv_operand_desc entry;
- if (grammar_.lookupOperand(type, mask, &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(type, mask, &entry)) {
return diagnostic()
<< "Invalid " << spvOperandTypeStr(parsed_operand.type)
<< " operand: " << word << " has invalid mask component "
<< mask;
}
remaining_word ^= mask;
- spvPushOperandTypes(entry->operandTypes, expected_operands);
+ spvPushOperandTypes(entry->operands(), expected_operands);
}
}
if (word == 0) {
// An all-zeroes mask *might* also be valid.
- spv_operand_desc entry;
- if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(type, 0, &entry)) {
// Prepare for its operands, if any.
- spvPushOperandTypes(entry->operandTypes, expected_operands);
+ spvPushOperandTypes(entry->operands(), expected_operands);
}
}
} break;
@@ -812,6 +837,7 @@
parsed_operand->number_kind = info.type;
parsed_operand->number_bit_width = info.bit_width;
+ parsed_operand->fp_encoding = info.encoding;
// Round up the word count.
parsed_operand->num_words = static_cast<uint16_t>((info.bit_width + 31) / 32);
return SPV_SUCCESS;
@@ -829,6 +855,17 @@
} else if (spv::Op::OpTypeFloat == opcode) {
info.type = SPV_NUMBER_FLOATING;
info.bit_width = peekAt(inst_offset + 2);
+ if (inst->num_words >= 4) {
+ const spvtools::OperandDesc* desc = nullptr;
+ spv_result_t status = spvtools::LookupOperand(
+ SPV_OPERAND_TYPE_FPENCODING, peekAt(inst_offset + 3), &desc);
+ if (status == SPV_SUCCESS) {
+ info.encoding = spvFPEncodingFromOperandFPEncoding(
+ static_cast<spv::FPEncoding>(desc->value));
+ } else {
+ info.encoding = SPV_FP_ENCODING_UNKNOWN;
+ }
+ }
}
// The *result* Id of a type generating instruction is the type Id.
_.type_id_to_number_type_info[inst->result_id] = info;
diff --git a/third_party/SPIRV-Tools/source/diff/CMakeLists.txt b/third_party/SPIRV-Tools/source/diff/CMakeLists.txt
index 52f18f2..d288261 100644
--- a/third_party/SPIRV-Tools/source/diff/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/source/diff/CMakeLists.txt
@@ -18,8 +18,16 @@
diff.cpp
)
+if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV_TOOLS_DIFF_SOURCES ${spirv-tools_SOURCE_DIR}/source/mimalloc.cpp)
+endif()
+
add_library(SPIRV-Tools-diff ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_DIFF_SOURCES})
+if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ target_link_libraries(SPIRV-Tools-diff PRIVATE mimalloc-static)
+endif()
+
spvtools_default_compile_options(SPIRV-Tools-diff)
target_include_directories(SPIRV-Tools-diff
PUBLIC
@@ -39,7 +47,13 @@
spvtools_check_symbol_exports(SPIRV-Tools-diff)
if(ENABLE_SPIRV_TOOLS_INSTALL)
- install(TARGETS SPIRV-Tools-diff EXPORT SPIRV-Tools-diffTargets)
+ set(SPIRV-Tools-diff-InstallTargets SPIRV-Tools-diff)
+
+ if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV-Tools-diff-InstallTargets mimalloc-static)
+ endif()
+
+ install(TARGETS ${SPIRV-Tools-diff-InstallTargets} EXPORT SPIRV-Tools-diffTargets)
export(EXPORT SPIRV-Tools-diffTargets FILE SPIRV-Tools-diffTargets.cmake)
spvtools_config_package_dir(SPIRV-Tools-diff PACKAGE_DIR)
diff --git a/third_party/SPIRV-Tools/source/diff/diff.cpp b/third_party/SPIRV-Tools/source/diff/diff.cpp
index 6269af5..7fd21f3 100644
--- a/third_party/SPIRV-Tools/source/diff/diff.cpp
+++ b/third_party/SPIRV-Tools/source/diff/diff.cpp
@@ -67,7 +67,9 @@
ids.resize(write_index);
}
-// A mapping between src and dst ids.
+// A mapping from ids in one module to ids in the other.
+//
+// Differ contains two of these, for src->dst and dst->src.
class IdMap {
public:
IdMap(size_t id_bound) { id_map_.resize(id_bound, 0); }
@@ -190,6 +192,7 @@
IdMap dst_to_src_;
};
+// Mappings from ids to instructions and metadata, for a single module's ids.
struct IdInstructions {
IdInstructions(const opt::Module* module)
: inst_map_(module->IdBound(), nullptr),
@@ -198,6 +201,10 @@
forward_pointer_map_(module->IdBound()) {
// Map ids from all sections to instructions that define them.
MapIdsToInstruction(module->ext_inst_imports());
+ MapIdsToInstruction(module->debugs1());
+ MapIdsToInstruction(module->debugs2());
+ MapIdsToInstruction(module->debugs3());
+ MapIdsToInstruction(module->ext_inst_debuginfo());
MapIdsToInstruction(module->types_values());
for (const opt::Function& function : *module) {
function.ForEachInst(
@@ -321,6 +328,8 @@
// 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);
+ uint32_t GroupIdsHelperGetFunctionTypeId(const IdInstructions& id_to,
+ uint32_t id);
spv::StorageClass GroupIdsHelperGetTypePointerStorageClass(
const IdInstructions& id_to, uint32_t id);
spv::Op GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to,
@@ -883,6 +892,17 @@
return GetInst(id_to, id)->type_id();
}
+// Return an `OpFunction` instruction's full `OpTypeFunction` type,
+// which includes parameter types.
+//
+// `GroupIdsHelperGetTypeId` applied to an `OpFunction` only gets the
+// function's return type, so this is a slightly more precise way to
+// match up functions by signature.
+uint32_t Differ::GroupIdsHelperGetFunctionTypeId(const IdInstructions& id_to,
+ uint32_t id) {
+ return GetInst(id_to, id)->GetSingleWordOperand(3);
+}
+
spv::StorageClass Differ::GroupIdsHelperGetTypePointerStorageClass(
const IdInstructions& id_to, uint32_t id) {
const opt::Instruction* inst = GetInst(id_to, id);
@@ -902,6 +922,24 @@
return type_inst->opcode();
}
+// Group unmatched ids in `ids` according to some characteristic,
+// determined by `get_group`.
+//
+// Using `get_group` to compute some sort of key for each id, set
+// `groups` to map each key to all the ids that have that key.
+//
+// For example, to group ids by name, pass `Differ::GetName` as
+// `get_group`. This will fill `groups` with a map from each name to
+// all the ids with that name.
+//
+// Under the assumption that we're trying to establish new pairings,
+// ids that are already paired are omitted from `groups`.
+//
+// The `is_src` parameter indicates whether `ids` are drawn from the
+// source module or the destination module.
+//
+// The template parameter `T` is the key type, like `std::string` or
+// `uint32_t`.
template <typename T>
void Differ::GroupIds(const IdGroup& ids, bool is_src,
std::map<T, IdGroup>* groups,
@@ -924,6 +962,10 @@
}
}
+// Group `src_ids` and `dst_ids` according to `get_group`, and then use
+// `match_group` to pair up ids in corresponding groups.
+//
+// Don't try to pair ids in groups whose key is `invalid_group_key`.
template <typename T>
void Differ::GroupIdsAndMatch(
const IdGroup& src_ids, const IdGroup& dst_ids, T invalid_group_key,
@@ -2483,7 +2525,7 @@
// If there are multiple functions with the same name, group them by
// type, and match only if the types match (and are unique).
- GroupIdsAndMatch<uint32_t>(src_group, dst_group, 0,
+ GroupIdsAndMatchByMappedId(src_group, dst_group,
&Differ::GroupIdsHelperGetTypeId,
[this](const IdGroup& src_group_by_type_id,
const IdGroup& dst_group_by_type_id) {
@@ -2526,9 +2568,19 @@
dst_match_result, 0);
}
- // Best effort match functions with matching type.
- GroupIdsAndMatch<uint32_t>(
- src_func_ids, dst_func_ids, 0, &Differ::GroupIdsHelperGetTypeId,
+ // Best effort match functions with matching return and argument types.
+ GroupIdsAndMatchByMappedId(
+ src_func_ids, dst_func_ids, &Differ::GroupIdsHelperGetFunctionTypeId,
+ [this](const IdGroup& src_group_by_func_type_id,
+ const IdGroup& dst_group_by_func_type_id) {
+ BestEffortMatchFunctions(src_group_by_func_type_id,
+ dst_group_by_func_type_id, src_func_insts_,
+ dst_func_insts_);
+ });
+
+ // Best effort match functions with matching return types.
+ GroupIdsAndMatchByMappedId(
+ src_func_ids, dst_func_ids, &Differ::GroupIdsHelperGetTypeId,
[this](const IdGroup& src_group_by_type_id,
const IdGroup& dst_group_by_type_id) {
BestEffortMatchFunctions(src_group_by_type_id, dst_group_by_type_id,
@@ -2746,30 +2798,7 @@
src_id_to_.inst_map_.resize(id_map_.SrcToDstMap().IdBound(), nullptr);
dst_id_to_.inst_map_.resize(id_map_.DstToSrcMap().IdBound(), nullptr);
- const spv_target_env target_env = SPV_ENV_UNIVERSAL_1_6;
- spv_opcode_table opcode_table;
- spv_operand_table operand_table;
- spv_ext_inst_table ext_inst_table;
- spv_result_t result;
-
- result = spvOpcodeTableGet(&opcode_table, target_env);
- if (result != SPV_SUCCESS) return result;
-
- result = spvOperandTableGet(&operand_table, target_env);
- if (result != SPV_SUCCESS) return result;
-
- result = spvExtInstTableGet(&ext_inst_table, target_env);
- if (result != SPV_SUCCESS) return result;
-
- spv_context_t context{
- target_env,
- opcode_table,
- operand_table,
- ext_inst_table,
- };
-
- const AssemblyGrammar grammar(&context);
- if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE;
+ spv_context_t context{SPV_ENV_UNIVERSAL_1_6, nullptr};
uint32_t disassembly_options = SPV_BINARY_TO_TEXT_OPTION_PRINT;
if (options_.indent) {
@@ -2777,7 +2806,7 @@
}
NameMapper name_mapper = GetTrivialNameMapper();
- disassemble::InstructionDisassembler dis(grammar, out_, disassembly_options,
+ disassemble::InstructionDisassembler dis(out_, disassembly_options,
name_mapper);
if (!options_.no_header) {
diff --git a/third_party/SPIRV-Tools/source/disassemble.cpp b/third_party/SPIRV-Tools/source/disassemble.cpp
index f8f6f44..4267333 100644
--- a/third_party/SPIRV-Tools/source/disassemble.cpp
+++ b/third_party/SPIRV-Tools/source/disassemble.cpp
@@ -23,11 +23,14 @@
#include <cassert>
#include <cstring>
#include <iomanip>
+#include <ios>
#include <memory>
+#include <set>
+#include <sstream>
+#include <stack>
#include <unordered_map>
#include <utility>
-#include "source/assembly_grammar.h"
#include "source/binary.h"
#include "source/diagnostic.h"
#include "source/ext_inst.h"
@@ -36,6 +39,7 @@
#include "source/print.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
+#include "source/table2.h"
#include "source/util/hex_float.h"
#include "source/util/make_unique.h"
#include "spirv-tools/libspirv.h"
@@ -43,16 +47,83 @@
namespace spvtools {
namespace {
+// Indices to ControlFlowGraph's list of blocks from one block to its successors
+struct BlockSuccessors {
+ // Merge block in OpLoopMerge and OpSelectionMerge
+ uint32_t merge_block_id = 0;
+ // The continue block in OpLoopMerge
+ uint32_t continue_block_id = 0;
+ // The true and false blocks in OpBranchConditional
+ uint32_t true_block_id = 0;
+ uint32_t false_block_id = 0;
+ // The body block of a loop, as specified by OpBranch after a merge
+ // instruction
+ uint32_t body_block_id = 0;
+ // The same-nesting-level block that follows this one, indicated by an
+ // OpBranch with no merge instruction.
+ uint32_t next_block_id = 0;
+ // The cases (including default) of an OpSwitch
+ std::vector<uint32_t> case_block_ids;
+};
+
+class ParsedInstruction {
+ public:
+ ParsedInstruction(const spv_parsed_instruction_t* instruction) {
+ // Make a copy of the parsed instruction, including stable memory for its
+ // operands.
+ instruction_ = *instruction;
+ operands_ =
+ std::make_unique<spv_parsed_operand_t[]>(instruction->num_operands);
+ memcpy(operands_.get(), instruction->operands,
+ instruction->num_operands * sizeof(*instruction->operands));
+ instruction_.operands = operands_.get();
+ }
+
+ const spv_parsed_instruction_t* get() const { return &instruction_; }
+
+ private:
+ spv_parsed_instruction_t instruction_;
+ std::unique_ptr<spv_parsed_operand_t[]> operands_;
+};
+
+// One block in the CFG
+struct SingleBlock {
+ // The byte offset in the SPIR-V where the block starts. Used for printing in
+ // a comment.
+ size_t byte_offset;
+
+ // Block instructions
+ std::vector<ParsedInstruction> instructions;
+
+ // Successors of this block
+ BlockSuccessors successors;
+
+ // The nesting level for this block.
+ uint32_t nest_level = 0;
+ bool nest_level_assigned = false;
+
+ // Whether the block was reachable
+ bool reachable = false;
+};
+
+// CFG for one function
+struct ControlFlowGraph {
+ std::vector<SingleBlock> blocks;
+};
+
// A Disassembler instance converts a SPIR-V binary to its assembly
// representation.
class Disassembler {
public:
- Disassembler(const AssemblyGrammar& grammar, uint32_t options,
- NameMapper name_mapper)
+ Disassembler(uint32_t options, NameMapper name_mapper)
: print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
+ nested_indent_(
+ spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT, options)),
+ reorder_blocks_(
+ spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS, options)),
text_(),
out_(print_ ? out_stream() : out_stream(text_)),
- instruction_disassembler_(grammar, out_.get(), options, name_mapper),
+ instruction_disassembler_(out_.get(), options, name_mapper),
header_(!spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, options)),
byte_offset_(0) {}
@@ -70,7 +141,13 @@
spv_result_t SaveTextResult(spv_text* text_result) const;
private:
+ void EmitCFG();
+
const bool print_; // Should we also print to the standard output stream?
+ const bool nested_indent_; // Should the blocks be indented according to the
+ // control flow structure?
+ const bool
+ reorder_blocks_; // Should the blocks be reordered for readability?
spv_endianness_t endian_; // The detected endianness of the binary.
std::stringstream text_; // Captures the text, if not printing.
out_stream out_; // The Output stream. Either to text_ or standard output.
@@ -80,6 +157,9 @@
bool inserted_decoration_space_ = false;
bool inserted_debug_space_ = false;
bool inserted_type_space_ = false;
+
+ // The CFG for the current function
+ ControlFlowGraph current_function_cfg_;
};
spv_result_t Disassembler::HandleHeader(spv_endianness_t endian,
@@ -106,13 +186,336 @@
inserted_debug_space_,
inserted_type_space_);
- instruction_disassembler_.EmitInstruction(inst, byte_offset_);
+ // When nesting needs to be calculated or when the blocks are reordered, we
+ // have to have the full picture of the CFG first. Defer processing of the
+ // instructions until the entire function is visited. This is not done
+ // without those options (even if simpler) to improve debuggability; for
+ // example to be able to see whatever is parsed so far even if there is a
+ // parse error.
+ if (nested_indent_ || reorder_blocks_) {
+ switch (static_cast<spv::Op>(inst.opcode)) {
+ case spv::Op::OpLabel: {
+ // Add a new block to the CFG
+ SingleBlock new_block;
+ new_block.byte_offset = byte_offset_;
+ new_block.instructions.emplace_back(&inst);
+ current_function_cfg_.blocks.push_back(std::move(new_block));
+ break;
+ }
+ case spv::Op::OpFunctionEnd:
+ // Process the CFG and output the instructions
+ EmitCFG();
+ // Output OpFunctionEnd itself too
+ [[fallthrough]];
+ default:
+ if (!current_function_cfg_.blocks.empty()) {
+ // If in a function, stash the instruction for later.
+ current_function_cfg_.blocks.back().instructions.emplace_back(&inst);
+ } else {
+ // Otherwise emit the instruction right away.
+ instruction_disassembler_.EmitInstruction(inst, byte_offset_);
+ }
+ break;
+ }
+ } else {
+ instruction_disassembler_.EmitInstruction(inst, byte_offset_);
+ }
byte_offset_ += inst.num_words * sizeof(uint32_t);
return SPV_SUCCESS;
}
+// Helper to get the operand of an instruction as an id.
+uint32_t GetOperand(const spv_parsed_instruction_t* instruction,
+ uint32_t operand) {
+ return instruction->words[instruction->operands[operand].offset];
+}
+
+std::unordered_map<uint32_t, uint32_t> BuildControlFlowGraph(
+ ControlFlowGraph& cfg) {
+ std::unordered_map<uint32_t, uint32_t> id_to_index;
+
+ for (size_t index = 0; index < cfg.blocks.size(); ++index) {
+ SingleBlock& block = cfg.blocks[index];
+
+ // For future use, build the ID->index map
+ assert(static_cast<spv::Op>(block.instructions[0].get()->opcode) ==
+ spv::Op::OpLabel);
+ const uint32_t id = block.instructions[0].get()->result_id;
+
+ id_to_index[id] = static_cast<uint32_t>(index);
+
+ // Look for a merge instruction first. The function of OpBranch depends on
+ // that.
+ if (block.instructions.size() >= 3) {
+ const spv_parsed_instruction_t* maybe_merge =
+ block.instructions[block.instructions.size() - 2].get();
+
+ switch (static_cast<spv::Op>(maybe_merge->opcode)) {
+ case spv::Op::OpLoopMerge:
+ block.successors.merge_block_id = GetOperand(maybe_merge, 0);
+ block.successors.continue_block_id = GetOperand(maybe_merge, 1);
+ break;
+
+ case spv::Op::OpSelectionMerge:
+ block.successors.merge_block_id = GetOperand(maybe_merge, 0);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // Then look at the last instruction; it must be a branch
+ assert(block.instructions.size() >= 2);
+
+ const spv_parsed_instruction_t* branch = block.instructions.back().get();
+ switch (static_cast<spv::Op>(branch->opcode)) {
+ case spv::Op::OpBranch:
+ if (block.successors.merge_block_id != 0) {
+ block.successors.body_block_id = GetOperand(branch, 0);
+ } else {
+ block.successors.next_block_id = GetOperand(branch, 0);
+ }
+ break;
+
+ case spv::Op::OpBranchConditional:
+ block.successors.true_block_id = GetOperand(branch, 1);
+ block.successors.false_block_id = GetOperand(branch, 2);
+ break;
+
+ case spv::Op::OpSwitch:
+ for (uint32_t case_index = 1; case_index < branch->num_operands;
+ case_index += 2) {
+ block.successors.case_block_ids.push_back(
+ GetOperand(branch, case_index));
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return id_to_index;
+}
+
+// Helper to deal with nesting and non-existing ids / previously-assigned
+// levels. It assigns a given nesting level `level` to the block identified by
+// `id` (unless that block already has a nesting level assigned).
+void Nest(ControlFlowGraph& cfg,
+ const std::unordered_map<uint32_t, uint32_t>& id_to_index,
+ uint32_t id, uint32_t level) {
+ if (id == 0) {
+ return;
+ }
+
+ const uint32_t block_index = id_to_index.at(id);
+ SingleBlock& block = cfg.blocks[block_index];
+
+ if (!block.nest_level_assigned) {
+ block.nest_level = level;
+ block.nest_level_assigned = true;
+ }
+}
+
+// For a given block, assign nesting level to its successors.
+void NestSuccessors(ControlFlowGraph& cfg, const SingleBlock& block,
+ const std::unordered_map<uint32_t, uint32_t>& id_to_index) {
+ assert(block.nest_level_assigned);
+
+ // Nest loops as such:
+ //
+ // %loop = OpLabel
+ // OpLoopMerge %merge %cont ...
+ // OpBranch %body
+ // %body = OpLabel
+ // Op...
+ // %cont = OpLabel
+ // Op...
+ // %merge = OpLabel
+ // Op...
+ //
+ // Nest conditional branches as such:
+ //
+ // %header = OpLabel
+ // OpSelectionMerge %merge ...
+ // OpBranchConditional ... %true %false
+ // %true = OpLabel
+ // Op...
+ // %false = OpLabel
+ // Op...
+ // %merge = OpLabel
+ // Op...
+ //
+ // Nest switch/case as such:
+ //
+ // %header = OpLabel
+ // OpSelectionMerge %merge ...
+ // OpSwitch ... %default ... %case0 ... %case1 ...
+ // %default = OpLabel
+ // Op...
+ // %case0 = OpLabel
+ // Op...
+ // %case1 = OpLabel
+ // Op...
+ // ...
+ // %merge = OpLabel
+ // Op...
+ //
+ // The following can be observed:
+ //
+ // - In all cases, the merge block has the same nesting as this block
+ // - The continue block of loops is nested 1 level deeper
+ // - The body/branches/cases are nested 2 levels deeper
+ //
+ // Back branches to the header block, branches to the merge block, etc
+ // are correctly handled by processing the header block first (that is
+ // _this_ block, already processed), then following the above rules
+ // (in the same order) for any block that is not already processed.
+ Nest(cfg, id_to_index, block.successors.merge_block_id, block.nest_level);
+ Nest(cfg, id_to_index, block.successors.continue_block_id,
+ block.nest_level + 1);
+ Nest(cfg, id_to_index, block.successors.true_block_id, block.nest_level + 2);
+ Nest(cfg, id_to_index, block.successors.false_block_id, block.nest_level + 2);
+ Nest(cfg, id_to_index, block.successors.body_block_id, block.nest_level + 2);
+ Nest(cfg, id_to_index, block.successors.next_block_id, block.nest_level);
+ for (uint32_t case_block_id : block.successors.case_block_ids) {
+ Nest(cfg, id_to_index, case_block_id, block.nest_level + 2);
+ }
+}
+
+struct StackEntry {
+ // The index of the block (in ControlFlowGraph::blocks) to process.
+ uint32_t block_index;
+ // Whether this is the pre or post visit of the block. Because a post-visit
+ // traversal is needed, the same block is pushed back on the stack on
+ // pre-visit so it can be visited again on post-visit.
+ bool post_visit = false;
+};
+
+// Helper to deal with DFS traversal and non-existing ids
+void VisitSuccesor(std::stack<StackEntry>* dfs_stack,
+ const std::unordered_map<uint32_t, uint32_t>& id_to_index,
+ uint32_t id) {
+ if (id != 0) {
+ dfs_stack->push({id_to_index.at(id), false});
+ }
+}
+
+// Given the control flow graph, calculates and returns the reverse post-order
+// ordering of the blocks. The blocks are then disassembled in that order for
+// readability.
+std::vector<uint32_t> OrderBlocks(
+ ControlFlowGraph& cfg,
+ const std::unordered_map<uint32_t, uint32_t>& id_to_index) {
+ std::vector<uint32_t> post_order;
+
+ // Nest level of a function's first block is 0.
+ cfg.blocks[0].nest_level = 0;
+ cfg.blocks[0].nest_level_assigned = true;
+
+ // Stack of block indices as they are visited.
+ std::stack<StackEntry> dfs_stack;
+ dfs_stack.push({0, false});
+
+ std::set<uint32_t> visited;
+
+ while (!dfs_stack.empty()) {
+ const uint32_t block_index = dfs_stack.top().block_index;
+ const bool post_visit = dfs_stack.top().post_visit;
+ dfs_stack.pop();
+
+ // If this is the second time the block is visited, that's the post-order
+ // visit.
+ if (post_visit) {
+ post_order.push_back(block_index);
+ continue;
+ }
+
+ // If already visited, another path got to it first (like a case
+ // fallthrough), avoid reprocessing it.
+ if (visited.count(block_index) > 0) {
+ continue;
+ }
+ visited.insert(block_index);
+
+ // Push it back in the stack for post-order visit
+ dfs_stack.push({block_index, true});
+
+ SingleBlock& block = cfg.blocks[block_index];
+
+ // Assign nest levels of successors right away. The successors are either
+ // nested under this block, or are back or forward edges to blocks outside
+ // this nesting level (no farther than the merge block), whose nesting
+ // levels are already assigned before this block is visited.
+ NestSuccessors(cfg, block, id_to_index);
+ block.reachable = true;
+
+ // The post-order visit yields the order in which the blocks are naturally
+ // ordered _backwards_. So blocks to be ordered last should be visited
+ // first. In other words, they should be pushed to the DFS stack last.
+ VisitSuccesor(&dfs_stack, id_to_index, block.successors.true_block_id);
+ VisitSuccesor(&dfs_stack, id_to_index, block.successors.false_block_id);
+ VisitSuccesor(&dfs_stack, id_to_index, block.successors.body_block_id);
+ VisitSuccesor(&dfs_stack, id_to_index, block.successors.next_block_id);
+ for (uint32_t case_block_id : block.successors.case_block_ids) {
+ VisitSuccesor(&dfs_stack, id_to_index, case_block_id);
+ }
+ VisitSuccesor(&dfs_stack, id_to_index, block.successors.continue_block_id);
+ VisitSuccesor(&dfs_stack, id_to_index, block.successors.merge_block_id);
+ }
+
+ std::vector<uint32_t> order(post_order.rbegin(), post_order.rend());
+
+ // Finally, dump all unreachable blocks at the end
+ for (size_t index = 0; index < cfg.blocks.size(); ++index) {
+ SingleBlock& block = cfg.blocks[index];
+
+ if (!block.reachable) {
+ order.push_back(static_cast<uint32_t>(index));
+ block.nest_level = 0;
+ block.nest_level_assigned = true;
+ }
+ }
+
+ return order;
+}
+
+void Disassembler::EmitCFG() {
+ // Build the CFG edges. At the same time, build an ID->block index map to
+ // simplify building the CFG edges.
+ const std::unordered_map<uint32_t, uint32_t> id_to_index =
+ BuildControlFlowGraph(current_function_cfg_);
+
+ // Walk the CFG in reverse post-order to find the best ordering of blocks for
+ // presentation
+ std::vector<uint32_t> block_order =
+ OrderBlocks(current_function_cfg_, id_to_index);
+ assert(block_order.size() == current_function_cfg_.blocks.size());
+
+ // Walk the CFG either in block order or input order based on whether the
+ // reorder_blocks_ option is given.
+ for (uint32_t index = 0; index < current_function_cfg_.blocks.size();
+ ++index) {
+ const uint32_t block_index = reorder_blocks_ ? block_order[index] : index;
+ const SingleBlock& block = current_function_cfg_.blocks[block_index];
+
+ // Emit instructions for this block
+ size_t byte_offset = block.byte_offset;
+ assert(block.nest_level_assigned);
+
+ for (const ParsedInstruction& inst : block.instructions) {
+ instruction_disassembler_.EmitInstructionInBlock(*inst.get(), byte_offset,
+ block.nest_level);
+ byte_offset += inst.get()->num_words * sizeof(uint32_t);
+ }
+ }
+
+ current_function_cfg_.blocks.clear();
+}
+
spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const {
if (!print_) {
size_t length = text_.str().size();
@@ -194,25 +597,48 @@
return SPV_SUCCESS;
}
+uint32_t GetLineLengthWithoutColor(const std::string line) {
+ // Currently, every added color is in the form \x1b...m, so instead of doing a
+ // lot of string comparisons with spvtools::clr::* strings, we just ignore
+ // those ranges.
+ uint32_t length = 0;
+ for (size_t i = 0; i < line.size(); ++i) {
+ if (line[i] == '\x1b') {
+ do {
+ ++i;
+ } while (i < line.size() && line[i] != 'm');
+ continue;
+ }
+
+ ++length;
+ }
+
+ return length;
+}
+
constexpr int kStandardIndent = 15;
+constexpr int kBlockNestIndent = 2;
+constexpr int kBlockBodyIndentOffset = 2;
+constexpr uint32_t kCommentColumn = 50;
} // namespace
namespace disassemble {
-InstructionDisassembler::InstructionDisassembler(const AssemblyGrammar& grammar,
- std::ostream& stream,
+InstructionDisassembler::InstructionDisassembler(std::ostream& stream,
uint32_t options,
NameMapper name_mapper)
- : grammar_(grammar),
- stream_(stream),
+ : stream_(stream),
print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
color_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)),
indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options)
? kStandardIndent
: 0),
+ nested_indent_(
+ spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT, options)),
comment_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COMMENT, options)),
show_byte_offset_(
spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)),
- name_mapper_(std::move(name_mapper)) {}
+ name_mapper_(std::move(name_mapper)),
+ last_instruction_comment_alignment_(0) {}
void InstructionDisassembler::EmitHeaderSpirv() { stream_ << "; SPIR-V\n"; }
@@ -244,55 +670,160 @@
void InstructionDisassembler::EmitInstruction(
const spv_parsed_instruction_t& inst, size_t inst_byte_offset) {
+ EmitInstructionImpl(inst, inst_byte_offset, 0, false);
+}
+
+void InstructionDisassembler::EmitInstructionInBlock(
+ const spv_parsed_instruction_t& inst, size_t inst_byte_offset,
+ uint32_t block_indent) {
+ EmitInstructionImpl(inst, inst_byte_offset, block_indent, true);
+}
+
+void InstructionDisassembler::EmitInstructionImpl(
+ const spv_parsed_instruction_t& inst, size_t inst_byte_offset,
+ uint32_t block_indent, bool is_in_block) {
auto opcode = static_cast<spv::Op>(inst.opcode);
+ // To better align the comments (if any), write the instruction to a line
+ // first so its length can be readily available.
+ std::ostringstream line;
+
+ if (nested_indent_ && opcode == spv::Op::OpLabel) {
+ // Separate the blocks by an empty line to make them easier to separate
+ stream_ << std::endl;
+ }
+
if (inst.result_id) {
SetBlue();
const std::string id_name = name_mapper_(inst.result_id);
if (indent_)
- stream_ << std::setw(std::max(0, indent_ - 3 - int(id_name.size())));
- stream_ << "%" << id_name;
+ line << std::setw(std::max(0, indent_ - 3 - int(id_name.size())));
+ line << "%" << id_name;
ResetColor();
- stream_ << " = ";
+ line << " = ";
} else {
- stream_ << std::string(indent_, ' ');
+ line << std::string(indent_, ' ');
}
- stream_ << "Op" << spvOpcodeString(opcode);
+ if (nested_indent_ && is_in_block) {
+ // Output OpLabel at the specified nest level, and instructions inside
+ // blocks nested a little more.
+ uint32_t indent = block_indent;
+ bool body_indent = opcode != spv::Op::OpLabel;
+
+ line << std::string(
+ indent * kBlockNestIndent + (body_indent ? kBlockBodyIndentOffset : 0),
+ ' ');
+ }
+
+ line << "Op" << spvOpcodeString(opcode);
for (uint16_t i = 0; i < inst.num_operands; i++) {
const spv_operand_type_t type = inst.operands[i].type;
assert(type != SPV_OPERAND_TYPE_NONE);
if (type == SPV_OPERAND_TYPE_RESULT_ID) continue;
- stream_ << " ";
- EmitOperand(inst, i);
+ line << " ";
+ EmitOperand(line, inst, i);
+ }
+
+ // For the sake of comment generation, store information from some
+ // instructions for the future.
+ if (comment_) {
+ GenerateCommentForDecoratedId(inst);
+ }
+
+ std::ostringstream comments;
+ const char* comment_separator = "";
+
+ if (show_byte_offset_) {
+ SetGrey(comments);
+ auto saved_flags = comments.flags();
+ auto saved_fill = comments.fill();
+ comments << comment_separator << "0x" << std::setw(8) << std::hex
+ << std::setfill('0') << inst_byte_offset;
+ comments.flags(saved_flags);
+ comments.fill(saved_fill);
+ ResetColor(comments);
+ comment_separator = ", ";
}
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;
+ comments << comment_separator << "id %" << word;
+ comment_separator = ", ";
}
- if (show_byte_offset_) {
- SetGrey();
- auto saved_flags = stream_.flags();
- auto saved_fill = stream_.fill();
- stream_ << " ; 0x" << std::setw(8) << std::hex << std::setfill('0')
- << inst_byte_offset;
- stream_.flags(saved_flags);
- stream_.fill(saved_fill);
- ResetColor();
+ if (comment_ && inst.result_id && id_comments_.count(inst.result_id) > 0) {
+ comments << comment_separator << id_comments_[inst.result_id].str();
+ comment_separator = ", ";
}
+
+ stream_ << line.str();
+
+ if (!comments.str().empty()) {
+ // Align the comments
+ const uint32_t line_length = GetLineLengthWithoutColor(line.str());
+ uint32_t align = std::max(
+ {line_length + 2, last_instruction_comment_alignment_, kCommentColumn});
+ // Round up the alignment to a multiple of 4 for more niceness.
+ align = (align + 3) & ~0x3u;
+ last_instruction_comment_alignment_ = std::min({align, 256u});
+
+ stream_ << std::string(align - line_length, ' ') << "; " << comments.str();
+ } else {
+ last_instruction_comment_alignment_ = 0;
+ }
+
stream_ << "\n";
}
+void InstructionDisassembler::GenerateCommentForDecoratedId(
+ const spv_parsed_instruction_t& inst) {
+ assert(comment_);
+ auto opcode = static_cast<spv::Op>(inst.opcode);
+
+ std::ostringstream partial;
+ uint32_t id = 0;
+ const char* separator = "";
+
+ switch (opcode) {
+ case spv::Op::OpDecorate:
+ // Take everything after `OpDecorate %id` and associate it with id.
+ id = inst.words[inst.operands[0].offset];
+ for (uint16_t i = 1; i < inst.num_operands; i++) {
+ partial << separator;
+ separator = " ";
+ EmitOperand(partial, inst, i);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (id == 0) {
+ return;
+ }
+
+ // Add the new comment to the comments of this id
+ std::ostringstream& id_comment = id_comments_[id];
+ if (!id_comment.str().empty()) {
+ id_comment << ", ";
+ }
+ id_comment << partial.str();
+}
+
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<spv::Op>(inst.opcode);
if (comment_ && opcode == spv::Op::OpFunction) {
stream_ << std::endl;
+ if (nested_indent_) {
+ // Double the empty lines between Function sections since nested_indent_
+ // also separates blocks by a blank.
+ stream_ << std::endl;
+ }
stream_ << std::string(indent_, ' ');
stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl;
}
@@ -316,66 +847,67 @@
}
}
-void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst,
- const uint16_t operand_index) {
+void InstructionDisassembler::EmitOperand(std::ostream& stream,
+ const spv_parsed_instruction_t& inst,
+ const uint16_t operand_index) const {
assert(operand_index < inst.num_operands);
const spv_parsed_operand_t& operand = inst.operands[operand_index];
const uint32_t word = inst.words[operand.offset];
switch (operand.type) {
case SPV_OPERAND_TYPE_RESULT_ID:
assert(false && "<result-id> is not supposed to be handled here");
- SetBlue();
- stream_ << "%" << name_mapper_(word);
+ SetBlue(stream);
+ stream << "%" << name_mapper_(word);
break;
case SPV_OPERAND_TYPE_ID:
case SPV_OPERAND_TYPE_TYPE_ID:
case SPV_OPERAND_TYPE_SCOPE_ID:
case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
- SetYellow();
- stream_ << "%" << name_mapper_(word);
+ SetYellow(stream);
+ stream << "%" << name_mapper_(word);
break;
case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: {
- spv_ext_inst_desc ext_inst;
- SetRed();
- if (grammar_.lookupExtInst(inst.ext_inst_type, word, &ext_inst) ==
- SPV_SUCCESS) {
- stream_ << ext_inst->name;
+ SetRed(stream);
+ const ExtInstDesc* desc = nullptr;
+ if (LookupExtInst(inst.ext_inst_type, word, &desc) == SPV_SUCCESS) {
+ stream << desc->name().data();
} else {
if (!spvExtInstIsNonSemantic(inst.ext_inst_type)) {
assert(false && "should have caught this earlier");
} else {
// for non-semantic instruction sets we can just print the number
- stream_ << word;
+ stream << word;
}
}
} break;
case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: {
- spv_opcode_desc opcode_desc;
- if (grammar_.lookupOpcode(spv::Op(word), &opcode_desc))
+ const spvtools::InstructionDesc* opcodeEntry = nullptr;
+ if (LookupOpcode(spv::Op(word), &opcodeEntry))
assert(false && "should have caught this earlier");
- SetRed();
- stream_ << opcode_desc->name;
+ SetRed(stream);
+ stream << opcodeEntry->name().data();
} break;
case SPV_OPERAND_TYPE_LITERAL_INTEGER:
case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
case SPV_OPERAND_TYPE_LITERAL_FLOAT: {
- SetRed();
- EmitNumericLiteral(&stream_, inst, operand);
- ResetColor();
+ SetRed(stream);
+ EmitNumericLiteral(&stream, inst, operand);
+ ResetColor(stream);
} break;
case SPV_OPERAND_TYPE_LITERAL_STRING: {
- stream_ << "\"";
- SetGreen();
+ stream << "\"";
+ SetGreen(stream);
std::string str = spvDecodeLiteralStringOperand(inst, operand_index);
for (char const& c : str) {
- if (c == '"' || c == '\\') stream_ << '\\';
- stream_ << c;
+ if (c == '"' || c == '\\') stream << '\\';
+ stream << c;
}
- ResetColor();
- stream_ << '"';
+ ResetColor(stream);
+ stream << '"';
} break;
case SPV_OPERAND_TYPE_CAPABILITY:
+ case SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY:
case SPV_OPERAND_TYPE_SOURCE_LANGUAGE:
case SPV_OPERAND_TYPE_EXECUTION_MODEL:
case SPV_OPERAND_TYPE_ADDRESSING_MODEL:
@@ -411,11 +943,12 @@
case SPV_OPERAND_TYPE_FPDENORM_MODE:
case SPV_OPERAND_TYPE_FPOPERATION_MODE:
case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
+ case SPV_OPERAND_TYPE_FPENCODING:
case SPV_OPERAND_TYPE_OVERFLOW_MODES: {
- spv_operand_desc entry;
- if (grammar_.lookupOperand(operand.type, word, &entry))
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(operand.type, word, &entry))
assert(false && "should have caught this earlier");
- stream_ << entry->name;
+ stream << entry->name().data();
} break;
case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE:
case SPV_OPERAND_TYPE_FUNCTION_CONTROL:
@@ -426,26 +959,27 @@
case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS:
- EmitMaskOperand(operand.type, word);
+ EmitMaskOperand(stream, operand.type, word);
break;
default:
if (spvOperandIsConcreteMask(operand.type)) {
- EmitMaskOperand(operand.type, word);
+ EmitMaskOperand(stream, operand.type, word);
} else if (spvOperandIsConcrete(operand.type)) {
- spv_operand_desc entry;
- if (grammar_.lookupOperand(operand.type, word, &entry))
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(operand.type, word, &entry))
assert(false && "should have caught this earlier");
- stream_ << entry->name;
+ stream << entry->name().data();
} else {
assert(false && "unhandled or invalid case");
}
break;
}
- ResetColor();
+ ResetColor(stream);
}
-void InstructionDisassembler::EmitMaskOperand(const spv_operand_type_t type,
- const uint32_t word) {
+void InstructionDisassembler::EmitMaskOperand(std::ostream& stream,
+ const spv_operand_type_t type,
+ const uint32_t word) const {
// Scan the mask from least significant bit to most significant bit. For each
// set bit, emit the name of that bit. Separate multiple names with '|'.
uint32_t remaining_word = word;
@@ -454,41 +988,48 @@
for (mask = 1; remaining_word; mask <<= 1) {
if (remaining_word & mask) {
remaining_word ^= mask;
- spv_operand_desc entry;
- if (grammar_.lookupOperand(type, mask, &entry))
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(type, mask, &entry))
assert(false && "should have caught this earlier");
- if (num_emitted) stream_ << "|";
- stream_ << entry->name;
+ if (num_emitted) stream << "|";
+ stream << entry->name().data();
num_emitted++;
}
}
if (!num_emitted) {
// An operand value of 0 was provided, so represent it by the name
// of the 0 value. In many cases, that's "None".
- spv_operand_desc entry;
- if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry))
- stream_ << entry->name;
+ const spvtools::OperandDesc* entry = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(type, 0, &entry))
+ stream << entry->name().data();
}
}
-void InstructionDisassembler::ResetColor() {
- if (color_) stream_ << spvtools::clr::reset{print_};
+void InstructionDisassembler::ResetColor(std::ostream& stream) const {
+ if (color_) stream << spvtools::clr::reset{print_};
}
-void InstructionDisassembler::SetGrey() {
- if (color_) stream_ << spvtools::clr::grey{print_};
+void InstructionDisassembler::SetGrey(std::ostream& stream) const {
+ if (color_) stream << spvtools::clr::grey{print_};
}
-void InstructionDisassembler::SetBlue() {
- if (color_) stream_ << spvtools::clr::blue{print_};
+void InstructionDisassembler::SetBlue(std::ostream& stream) const {
+ if (color_) stream << spvtools::clr::blue{print_};
}
-void InstructionDisassembler::SetYellow() {
- if (color_) stream_ << spvtools::clr::yellow{print_};
+void InstructionDisassembler::SetYellow(std::ostream& stream) const {
+ if (color_) stream << spvtools::clr::yellow{print_};
}
-void InstructionDisassembler::SetRed() {
- if (color_) stream_ << spvtools::clr::red{print_};
+void InstructionDisassembler::SetRed(std::ostream& stream) const {
+ if (color_) stream << spvtools::clr::red{print_};
}
-void InstructionDisassembler::SetGreen() {
- if (color_) stream_ << spvtools::clr::green{print_};
+void InstructionDisassembler::SetGreen(std::ostream& stream) const {
+ if (color_) stream << spvtools::clr::green{print_};
}
+
+void InstructionDisassembler::ResetColor() { ResetColor(stream_); }
+void InstructionDisassembler::SetGrey() { SetGrey(stream_); }
+void InstructionDisassembler::SetBlue() { SetBlue(stream_); }
+void InstructionDisassembler::SetYellow() { SetYellow(stream_); }
+void InstructionDisassembler::SetRed() { SetRed(stream_); }
+void InstructionDisassembler::SetGreen() { SetGreen(stream_); }
} // namespace disassemble
std::string spvInstructionBinaryToText(const spv_target_env env,
@@ -498,11 +1039,6 @@
const size_t wordCount,
const uint32_t options) {
spv_context context = spvContextCreate(env);
- const AssemblyGrammar grammar(context);
- if (!grammar.isValid()) {
- spvContextDestroy(context);
- return "";
- }
// Generate friendly names for Ids if requested.
std::unique_ptr<FriendlyNameMapper> friendly_mapper;
@@ -513,7 +1049,7 @@
}
// Now disassemble!
- Disassembler disassembler(grammar, options, name_mapper);
+ Disassembler disassembler(options, name_mapper);
WrappedDisassembler wrapped(&disassembler, instCode, instWordCount);
spvBinaryParse(context, &wrapped, code, wordCount, DisassembleTargetHeader,
DisassembleTargetInstruction, nullptr);
@@ -542,9 +1078,6 @@
spvtools::UseDiagnosticAsMessageConsumer(&hijack_context, pDiagnostic);
}
- const spvtools::AssemblyGrammar grammar(&hijack_context);
- if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE;
-
// Generate friendly names for Ids if requested.
std::unique_ptr<spvtools::FriendlyNameMapper> friendly_mapper;
spvtools::NameMapper name_mapper = spvtools::GetTrivialNameMapper();
@@ -555,7 +1088,7 @@
}
// Now disassemble!
- spvtools::Disassembler disassembler(grammar, options, name_mapper);
+ spvtools::Disassembler disassembler(options, name_mapper);
if (auto error =
spvBinaryParse(&hijack_context, &disassembler, code, wordCount,
spvtools::DisassembleHeader,
diff --git a/third_party/SPIRV-Tools/source/disassemble.h b/third_party/SPIRV-Tools/source/disassemble.h
index b520a1e..08c3738 100644
--- a/third_party/SPIRV-Tools/source/disassemble.h
+++ b/third_party/SPIRV-Tools/source/disassemble.h
@@ -15,7 +15,8 @@
#ifndef SOURCE_DISASSEMBLE_H_
#define SOURCE_DISASSEMBLE_H_
-#include <iosfwd>
+#include <ios>
+#include <sstream>
#include <string>
#include "source/name_mapper.h"
@@ -36,7 +37,6 @@
const size_t word_count,
const uint32_t options);
-class AssemblyGrammar;
namespace disassemble {
// Shared code with other tools (than the disassembler) that might need to
@@ -44,8 +44,8 @@
// binary for an instruction to its assembly representation.
class InstructionDisassembler {
public:
- InstructionDisassembler(const AssemblyGrammar& grammar, std::ostream& stream,
- uint32_t options, NameMapper name_mapper);
+ InstructionDisassembler(std::ostream& stream, uint32_t options,
+ NameMapper name_mapper);
// Emits the assembly header for the module.
void EmitHeaderSpirv();
@@ -57,6 +57,11 @@
// Emits the assembly text for the given instruction.
void EmitInstruction(const spv_parsed_instruction_t& inst,
size_t inst_byte_offset);
+ // Same as EmitInstruction, but only for block instructions (including
+ // OpLabel) and useful for nested indentation. If nested indentation is not
+ // desired, EmitInstruction can still be used for block instructions.
+ void EmitInstructionInBlock(const spv_parsed_instruction_t& inst,
+ size_t inst_byte_offset, uint32_t block_indent);
// Emits a comment between different sections of the module.
void EmitSectionComment(const spv_parsed_instruction_t& inst,
@@ -74,22 +79,45 @@
void SetGreen();
private:
+ void ResetColor(std::ostream& stream) const;
+ void SetGrey(std::ostream& stream) const;
+ void SetBlue(std::ostream& stream) const;
+ void SetYellow(std::ostream& stream) const;
+ void SetRed(std::ostream& stream) const;
+ void SetGreen(std::ostream& stream) const;
+
+ void EmitInstructionImpl(const spv_parsed_instruction_t& inst,
+ size_t inst_byte_offset, uint32_t block_indent,
+ bool is_in_block);
+
// Emits an operand for the given instruction, where the instruction
// is at offset words from the start of the binary.
- void EmitOperand(const spv_parsed_instruction_t& inst,
- const uint16_t operand_index);
+ void EmitOperand(std::ostream& stream, const spv_parsed_instruction_t& inst,
+ uint16_t operand_index) const;
// Emits a mask expression for the given mask word of the specified type.
- void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word);
+ void EmitMaskOperand(std::ostream& stream, spv_operand_type_t type,
+ uint32_t word) const;
- const spvtools::AssemblyGrammar& grammar_;
+ // Generate part of the instruction as a comment to be added to
+ // |id_comments_|.
+ void GenerateCommentForDecoratedId(const spv_parsed_instruction_t& inst);
+
std::ostream& stream_;
- const bool print_; // Should we also print to the standard output stream?
- const bool color_; // Should we print in colour?
- const int indent_; // How much to indent. 0 means don't indent
- const int comment_; // Should we comment the source
+ const bool print_; // Should we also print to the standard output stream?
+ const bool color_; // Should we print in colour?
+ const int indent_; // How much to indent. 0 means don't indent
+ const bool nested_indent_; // Whether indentation should indicate nesting
+ const int comment_; // Should we comment the source
const bool show_byte_offset_; // Should we print byte offset, in hex?
spvtools::NameMapper name_mapper_;
+
+ // Some comments are generated as instructions (such as OpDecorate) are
+ // visited so that when the instruction with that result id is visited, the
+ // comment can be output.
+ std::unordered_map<uint32_t, std::ostringstream> id_comments_;
+ // Align the comments in consecutive lines for more readability.
+ uint32_t last_instruction_comment_alignment_;
};
} // namespace disassemble
diff --git a/third_party/SPIRV-Tools/source/enum_string_mapping.h b/third_party/SPIRV-Tools/source/enum_string_mapping.h
deleted file mode 100644
index b136584..0000000
--- a/third_party/SPIRV-Tools/source/enum_string_mapping.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2017 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef SOURCE_ENUM_STRING_MAPPING_H_
-#define SOURCE_ENUM_STRING_MAPPING_H_
-
-#include <string>
-
-#include "source/extensions.h"
-#include "source/latest_version_spirv_header.h"
-
-namespace spvtools {
-
-// Finds Extension enum corresponding to |str|. Returns false if not found.
-bool GetExtensionFromString(const char* str, Extension* extension);
-
-// Returns text string corresponding to |extension|.
-const char* ExtensionToString(Extension extension);
-
-// Returns text string corresponding to |capability|.
-const char* CapabilityToString(spv::Capability capability);
-
-} // namespace spvtools
-
-#endif // SOURCE_ENUM_STRING_MAPPING_H_
diff --git a/third_party/SPIRV-Tools/source/ext_inst.cpp b/third_party/SPIRV-Tools/source/ext_inst.cpp
index 9a5ba84..761b8d2 100644
--- a/third_party/SPIRV-Tools/source/ext_inst.cpp
+++ b/third_party/SPIRV-Tools/source/ext_inst.cpp
@@ -17,97 +17,7 @@
#include <cstring>
// DebugInfo extended instruction set.
-// See https://www.khronos.org/registry/spir-v/specs/1.0/DebugInfo.html
-// TODO(dneto): DebugInfo.h should probably move to SPIRV-Headers.
-#include "DebugInfo.h"
-
-#include "source/latest_version_glsl_std_450_header.h"
-#include "source/latest_version_opencl_std_header.h"
-#include "source/macro.h"
-#include "source/spirv_definition.h"
-
-#include "debuginfo.insts.inc"
-#include "glsl.std.450.insts.inc"
-#include "nonsemantic.clspvreflection.insts.inc"
-#include "nonsemantic.shader.debuginfo.100.insts.inc"
-#include "nonsemantic.vkspreflection.insts.inc"
-#include "opencl.debuginfo.100.insts.inc"
-#include "opencl.std.insts.inc"
-
-#include "spirv-tools/libspirv.h"
-#include "spv-amd-gcn-shader.insts.inc"
-#include "spv-amd-shader-ballot.insts.inc"
-#include "spv-amd-shader-explicit-vertex-parameter.insts.inc"
-#include "spv-amd-shader-trinary-minmax.insts.inc"
-
-static const spv_ext_inst_group_t kGroups_1_0[] = {
- {SPV_EXT_INST_TYPE_GLSL_STD_450, ARRAY_SIZE(glsl_entries), glsl_entries},
- {SPV_EXT_INST_TYPE_OPENCL_STD, ARRAY_SIZE(opencl_entries), opencl_entries},
- {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER,
- ARRAY_SIZE(spv_amd_shader_explicit_vertex_parameter_entries),
- spv_amd_shader_explicit_vertex_parameter_entries},
- {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX,
- ARRAY_SIZE(spv_amd_shader_trinary_minmax_entries),
- spv_amd_shader_trinary_minmax_entries},
- {SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER,
- ARRAY_SIZE(spv_amd_gcn_shader_entries), spv_amd_gcn_shader_entries},
- {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT,
- ARRAY_SIZE(spv_amd_shader_ballot_entries), spv_amd_shader_ballot_entries},
- {SPV_EXT_INST_TYPE_DEBUGINFO, ARRAY_SIZE(debuginfo_entries),
- debuginfo_entries},
- {SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100,
- ARRAY_SIZE(opencl_debuginfo_100_entries), opencl_debuginfo_100_entries},
- {SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100,
- ARRAY_SIZE(nonsemantic_shader_debuginfo_100_entries),
- nonsemantic_shader_debuginfo_100_entries},
- {SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION,
- ARRAY_SIZE(nonsemantic_clspvreflection_entries),
- nonsemantic_clspvreflection_entries},
- {SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION,
- ARRAY_SIZE(nonsemantic_vkspreflection_entries),
- nonsemantic_vkspreflection_entries},
-};
-
-static const spv_ext_inst_table_t kTable_1_0 = {ARRAY_SIZE(kGroups_1_0),
- kGroups_1_0};
-
-spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
- spv_target_env env) {
- if (!pExtInstTable) return SPV_ERROR_INVALID_POINTER;
-
- switch (env) {
- // The extended instruction sets are all version 1.0 so far.
- case SPV_ENV_UNIVERSAL_1_0:
- case SPV_ENV_VULKAN_1_0:
- case SPV_ENV_UNIVERSAL_1_1:
- case SPV_ENV_UNIVERSAL_1_2:
- case SPV_ENV_OPENCL_1_2:
- case SPV_ENV_OPENCL_EMBEDDED_1_2:
- case SPV_ENV_OPENCL_2_0:
- case SPV_ENV_OPENCL_EMBEDDED_2_0:
- case SPV_ENV_OPENCL_2_1:
- case SPV_ENV_OPENCL_EMBEDDED_2_1:
- case SPV_ENV_OPENCL_2_2:
- case SPV_ENV_OPENCL_EMBEDDED_2_2:
- case SPV_ENV_OPENGL_4_0:
- case SPV_ENV_OPENGL_4_1:
- case SPV_ENV_OPENGL_4_2:
- case SPV_ENV_OPENGL_4_3:
- case SPV_ENV_OPENGL_4_5:
- case SPV_ENV_UNIVERSAL_1_3:
- case SPV_ENV_VULKAN_1_1:
- case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
- case SPV_ENV_UNIVERSAL_1_4:
- case SPV_ENV_UNIVERSAL_1_5:
- case SPV_ENV_VULKAN_1_2:
- case SPV_ENV_UNIVERSAL_1_6:
- case SPV_ENV_VULKAN_1_3:
- *pExtInstTable = &kTable_1_0;
- return SPV_SUCCESS;
- default:
- return SPV_ERROR_INVALID_TABLE;
- }
-}
+// #include "DebugInfo.h"
spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) {
// The names are specified by the respective extension instruction
@@ -145,6 +55,9 @@
if (!strncmp("NonSemantic.VkspReflection.", name, 27)) {
return SPV_EXT_INST_TYPE_NONSEMANTIC_VKSPREFLECTION;
}
+ if (!strcmp("TOSA.001000.1", name)) {
+ return SPV_EXT_INST_TYPE_TOSA_001000_1;
+ }
// ensure to add any known non-semantic extended instruction sets
// above this point, and update spvExtInstIsNonSemantic()
if (!strncmp("NonSemantic.", name, 12)) {
@@ -171,47 +84,3 @@
}
return false;
}
-
-spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
- const spv_ext_inst_type_t type,
- const char* name,
- spv_ext_inst_desc* pEntry) {
- if (!table) return SPV_ERROR_INVALID_TABLE;
- if (!pEntry) return SPV_ERROR_INVALID_POINTER;
-
- for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) {
- const auto& group = table->groups[groupIndex];
- if (type != group.type) continue;
- for (uint32_t index = 0; index < group.count; index++) {
- const auto& entry = group.entries[index];
- if (!strcmp(name, entry.name)) {
- *pEntry = &entry;
- return SPV_SUCCESS;
- }
- }
- }
-
- return SPV_ERROR_INVALID_LOOKUP;
-}
-
-spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,
- const spv_ext_inst_type_t type,
- const uint32_t value,
- spv_ext_inst_desc* pEntry) {
- if (!table) return SPV_ERROR_INVALID_TABLE;
- if (!pEntry) return SPV_ERROR_INVALID_POINTER;
-
- for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) {
- const auto& group = table->groups[groupIndex];
- if (type != group.type) continue;
- for (uint32_t index = 0; index < group.count; index++) {
- const auto& entry = group.entries[index];
- if (value == entry.ext_inst) {
- *pEntry = &entry;
- return SPV_SUCCESS;
- }
- }
- }
-
- return SPV_ERROR_INVALID_LOOKUP;
-}
diff --git a/third_party/SPIRV-Tools/source/ext_inst.h b/third_party/SPIRV-Tools/source/ext_inst.h
index 4027f4c..3c3150b 100644
--- a/third_party/SPIRV-Tools/source/ext_inst.h
+++ b/third_party/SPIRV-Tools/source/ext_inst.h
@@ -27,20 +27,4 @@
// Returns true if the extended instruction set is debug info
bool spvExtInstIsDebugInfo(const spv_ext_inst_type_t type);
-// Finds the named extended instruction of the given type in the given extended
-// instruction table. On success, returns SPV_SUCCESS and writes a handle of
-// the instruction entry into *entry.
-spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
- const spv_ext_inst_type_t type,
- const char* name,
- spv_ext_inst_desc* entry);
-
-// Finds the extended instruction of the given type in the given extended
-// instruction table by value. On success, returns SPV_SUCCESS and writes a
-// handle of the instruction entry into *entry.
-spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,
- const spv_ext_inst_type_t type,
- const uint32_t value,
- spv_ext_inst_desc* pEntry);
-
#endif // SOURCE_EXT_INST_H_
diff --git a/third_party/SPIRV-Tools/source/extensions.cpp b/third_party/SPIRV-Tools/source/extensions.cpp
index ac987fc..91136e6 100644
--- a/third_party/SPIRV-Tools/source/extensions.cpp
+++ b/third_party/SPIRV-Tools/source/extensions.cpp
@@ -19,7 +19,7 @@
#include <string>
#include "source/binary.h"
-#include "source/enum_string_mapping.h"
+#include "source/table2.h"
namespace spvtools {
diff --git a/third_party/SPIRV-Tools/source/extensions.h b/third_party/SPIRV-Tools/source/extensions.h
index cda4924..ffca5f8 100644
--- a/third_party/SPIRV-Tools/source/extensions.h
+++ b/third_party/SPIRV-Tools/source/extensions.h
@@ -15,25 +15,19 @@
#ifndef SOURCE_EXTENSIONS_H_
#define SOURCE_EXTENSIONS_H_
-#include <cstdint>
#include <string>
#include "source/enum_set.h"
-#include "spirv-tools/libspirv.h"
+#include "source/table2.h"
namespace spvtools {
-// The known SPIR-V extensions.
-enum Extension : uint32_t {
-#include "extension_enum.inc"
-};
-
using ExtensionSet = EnumSet<Extension>;
-// Returns literal string operand of OpExtension instruction.
+// Returns the literal string operand of OpExtension instruction.
std::string GetExtensionString(const spv_parsed_instruction_t* inst);
-// Returns text string listing |extensions| separated by whitespace.
+// Returns a text string listing |extensions| separated by whitespace.
std::string ExtensionSetToString(const ExtensionSet& extensions);
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/fuzz/CMakeLists.txt b/third_party/SPIRV-Tools/source/fuzz/CMakeLists.txt
index 86ee657..d067bd4 100644
--- a/third_party/SPIRV-Tools/source/fuzz/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/source/fuzz/CMakeLists.txt
@@ -438,8 +438,16 @@
spvtools_pch(SPIRV_TOOLS_FUZZ_SOURCES pch_source_fuzz)
+ if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV_TOOLS_DIFF_SOURCES ${spirv-tools_SOURCE_DIR}/source/mimalloc.cpp)
+ endif()
+
add_library(SPIRV-Tools-fuzz ${SPIRV_TOOLS_FUZZ_SOURCES})
+ if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ target_link_libraries(SPIRV-Tools-fuzz PRIVATE mimalloc-static)
+ endif()
+
spvtools_default_compile_options(SPIRV-Tools-fuzz)
# Compilation of the auto-generated protobuf source file will yield warnings,
@@ -470,7 +478,13 @@
spvtools_check_symbol_exports(SPIRV-Tools-fuzz)
if(ENABLE_SPIRV_TOOLS_INSTALL)
- install(TARGETS SPIRV-Tools-fuzz EXPORT SPIRV-Tools-fuzzTargets)
+ set(SPIRV-Tools-fuzz-InstallTargets SPIRV-Tools-fuzz)
+
+ if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV-Tools-fuzz-InstallTargets mimalloc-static)
+ endif()
+
+ install(TARGETS ${SPIRV-Tools-fuzz-InstallTargets} EXPORT SPIRV-Tools-fuzzTargets)
export(EXPORT SPIRV-Tools-fuzzTargets FILE SPIRV-Tools-fuzzTarget.cmake)
spvtools_config_package_dir(SPIRV-Tools-fuzz PACKAGE_DIR)
diff --git a/third_party/SPIRV-Tools/source/link/linker.cpp b/third_party/SPIRV-Tools/source/link/linker.cpp
index 58930e4..5fb4478 100644
--- a/third_party/SPIRV-Tools/source/link/linker.cpp
+++ b/third_party/SPIRV-Tools/source/link/linker.cpp
@@ -26,11 +26,11 @@
#include <utility>
#include <vector>
-#include "source/assembly_grammar.h"
#include "source/diagnostic.h"
#include "source/opt/build_module.h"
#include "source/opt/compact_ids_pass.h"
#include "source/opt/decoration_manager.h"
+#include "source/opt/ir_builder.h"
#include "source/opt/ir_loader.h"
#include "source/opt/pass_manager.h"
#include "source/opt/remove_duplicates_pass.h"
@@ -38,6 +38,7 @@
#include "source/opt/type_manager.h"
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "source/util/make_unique.h"
#include "source/util/string_utils.h"
#include "spirv-tools/libspirv.hpp"
@@ -46,12 +47,14 @@
namespace {
using opt::Instruction;
+using opt::InstructionBuilder;
using opt::IRContext;
using opt::Module;
using opt::PassManager;
using opt::RemoveDuplicatesPass;
using opt::analysis::DecorationManager;
using opt::analysis::DefUseManager;
+using opt::analysis::Function;
using opt::analysis::Type;
using opt::analysis::TypeManager;
@@ -100,7 +103,6 @@
// |linked_context| should not be null.
spv_result_t MergeModules(const MessageConsumer& consumer,
const std::vector<Module*>& in_modules,
- const AssemblyGrammar& grammar,
IRContext* linked_context);
// Compute all pairs of import and export and return it in |linkings_to_do|.
@@ -126,6 +128,7 @@
// checked.
spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer,
const LinkageTable& linkings_to_do,
+ bool allow_ptr_type_mismatch,
opt::IRContext* context);
// Remove linkage specific instructions, such as prototypes of imported
@@ -242,7 +245,6 @@
spv_result_t MergeModules(const MessageConsumer& consumer,
const std::vector<Module*>& input_modules,
- const AssemblyGrammar& grammar,
IRContext* linked_context) {
spv_position_t position = {};
@@ -290,29 +292,33 @@
const uint32_t module_addressing_model =
memory_model_inst->GetSingleWordOperand(0u);
if (module_addressing_model != linked_addressing_model) {
- spv_operand_desc linked_desc = nullptr, module_desc = nullptr;
- grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
- linked_addressing_model, &linked_desc);
- grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
- module_addressing_model, &module_desc);
+ const spvtools::OperandDesc* linked_desc = nullptr;
+ const spvtools::OperandDesc* module_desc = nullptr;
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
+ linked_addressing_model, &linked_desc);
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
+ module_addressing_model, &module_desc);
return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
- << "Conflicting addressing models: " << linked_desc->name
+ << "Conflicting addressing models: " << linked_desc->name().data()
<< " (input modules 1 through " << i << ") vs "
- << module_desc->name << " (input module " << (i + 1) << ").";
+ << module_desc->name().data() << " (input module " << (i + 1)
+ << ").";
}
const uint32_t module_memory_model =
memory_model_inst->GetSingleWordOperand(1u);
if (module_memory_model != linked_memory_model) {
- spv_operand_desc linked_desc = nullptr, module_desc = nullptr;
- grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, linked_memory_model,
- &linked_desc);
- grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, module_memory_model,
- &module_desc);
+ const spvtools::OperandDesc* linked_desc = nullptr;
+ const spvtools::OperandDesc* module_desc = nullptr;
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL,
+ linked_memory_model, &linked_desc);
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL,
+ module_memory_model, &module_desc);
return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
- << "Conflicting memory models: " << linked_desc->name
+ << "Conflicting memory models: " << linked_desc->name().data()
<< " (input modules 1 through " << i << ") vs "
- << module_desc->name << " (input module " << (i + 1) << ").";
+ << module_desc->name().data() << " (input module " << (i + 1)
+ << ").";
}
}
linked_module->SetMemoryModel(std::unique_ptr<Instruction>(
@@ -329,11 +335,11 @@
return v.first == model && v.second == name;
});
if (i != entry_points.end()) {
- spv_operand_desc desc = nullptr;
- grammar.lookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODEL, model, &desc);
+ const spvtools::OperandDesc* desc = nullptr;
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODEL, model, &desc);
return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
<< "The entry point \"" << name << "\", with execution model "
- << desc->name << ", was already defined.";
+ << desc->name().data() << ", was already defined.";
}
linked_module->AddEntryPoint(
std::unique_ptr<Instruction>(inst.Clone(linked_context)));
@@ -416,6 +422,7 @@
std::vector<LinkageSymbolInfo> imports;
std::unordered_map<std::string, std::vector<LinkageSymbolInfo>> exports;
+ std::unordered_map<std::string, LinkageSymbolInfo> linkonce;
// Figure out the imports and exports
for (const auto& decoration : linked_context.annotations()) {
@@ -474,10 +481,24 @@
<< " LinkageAttributes; " << id << " is neither of them.\n";
}
- if (spv::LinkageType(type) == spv::LinkageType::Import)
+ if (spv::LinkageType(type) == spv::LinkageType::Import) {
imports.push_back(symbol_info);
- else if (spv::LinkageType(type) == spv::LinkageType::Export)
+ } else if (spv::LinkageType(type) == spv::LinkageType::Export) {
exports[symbol_info.name].push_back(symbol_info);
+ } else if (spv::LinkageType(type) == spv::LinkageType::LinkOnceODR) {
+ if (linkonce.find(symbol_info.name) == linkonce.end())
+ linkonce[symbol_info.name] = symbol_info;
+ }
+ }
+
+ for (const auto& possible_export : linkonce) {
+ if (exports.find(possible_export.first) == exports.end())
+ exports[possible_export.first].push_back(possible_export.second);
+ else
+ return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_BINARY)
+ << "Combination of Export and LinkOnceODR is not allowed, found "
+ "for \""
+ << possible_export.second.name << "\".";
}
// Find the import/export pairs
@@ -502,6 +523,7 @@
spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer,
const LinkageTable& linkings_to_do,
+ bool allow_ptr_type_mismatch,
opt::IRContext* context) {
spv_position_t position = {};
@@ -513,7 +535,34 @@
type_manager.GetType(linking_entry.imported_symbol.type_id);
Type* exported_symbol_type =
type_manager.GetType(linking_entry.exported_symbol.type_id);
- if (!(*imported_symbol_type == *exported_symbol_type))
+ if (!(*imported_symbol_type == *exported_symbol_type)) {
+ Function* imported_symbol_type_func = imported_symbol_type->AsFunction();
+ Function* exported_symbol_type_func = exported_symbol_type->AsFunction();
+
+ if (imported_symbol_type_func && exported_symbol_type_func) {
+ const auto& imported_params = imported_symbol_type_func->param_types();
+ const auto& exported_params = exported_symbol_type_func->param_types();
+ // allow_ptr_type_mismatch allows linking functions where the pointer
+ // type of arguments doesn't match. Everything else still needs to be
+ // equal. This is to workaround LLVM-17+ not having typed pointers and
+ // generated SPIR-Vs not knowing the actual pointer types in some cases.
+ if (allow_ptr_type_mismatch &&
+ imported_params.size() == exported_params.size()) {
+ bool correct = true;
+ for (size_t i = 0; i < imported_params.size(); i++) {
+ const auto& imported_param = imported_params[i];
+ const auto& exported_param = exported_params[i];
+
+ if (!imported_param->IsSame(exported_param) &&
+ (imported_param->kind() != Type::kPointer ||
+ exported_param->kind() != Type::kPointer)) {
+ correct = false;
+ break;
+ }
+ }
+ if (correct) continue;
+ }
+ }
return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_BINARY)
<< "Type mismatch on symbol \""
<< linking_entry.imported_symbol.name
@@ -521,6 +570,7 @@
<< linking_entry.imported_symbol.id
<< " and exported variable/function %"
<< linking_entry.exported_symbol.id << ".";
+ }
}
// Ensure the import and export decorations are similar
@@ -628,8 +678,10 @@
if (inst->opcode() == spv::Op::OpDecorate &&
spv::Decoration(inst->GetSingleWordOperand(1u)) ==
spv::Decoration::LinkageAttributes &&
- spv::LinkageType(inst->GetSingleWordOperand(3u)) ==
- spv::LinkageType::Export) {
+ (spv::LinkageType(inst->GetSingleWordOperand(3u)) ==
+ spv::LinkageType::Export ||
+ spv::LinkageType(inst->GetSingleWordOperand(3u)) ==
+ spv::LinkageType::LinkOnceODR)) {
linked_context->KillInst(&*inst);
}
}
@@ -696,6 +748,57 @@
return SPV_SUCCESS;
}
+spv_result_t FixFunctionCallTypes(opt::IRContext& context,
+ const LinkageTable& linkings) {
+ auto mod = context.module();
+ const auto type_manager = context.get_type_mgr();
+ const auto def_use_mgr = context.get_def_use_mgr();
+
+ for (auto& func : *mod) {
+ func.ForEachInst([&](Instruction* inst) {
+ if (inst->opcode() != spv::Op::OpFunctionCall) return;
+ opt::Operand& target = inst->GetInOperand(0);
+
+ // only fix calls to imported functions
+ auto linking = std::find_if(
+ linkings.begin(), linkings.end(), [&](const auto& entry) {
+ return entry.exported_symbol.id == target.AsId();
+ });
+ if (linking == linkings.end()) return;
+
+ auto builder = InstructionBuilder(&context, inst);
+ for (uint32_t i = 1; i < inst->NumInOperands(); ++i) {
+ auto exported_func_param =
+ def_use_mgr->GetDef(linking->exported_symbol.parameter_ids[i - 1]);
+ const Type* target_type =
+ type_manager->GetType(exported_func_param->type_id());
+ if (target_type->kind() != Type::kPointer) continue;
+
+ opt::Operand& arg = inst->GetInOperand(i);
+ const Type* param_type =
+ type_manager->GetType(def_use_mgr->GetDef(arg.AsId())->type_id());
+
+ // No need to cast if it already matches
+ if (*param_type == *target_type) continue;
+
+ auto new_id = context.TakeNextId();
+
+ // cast to the expected pointer type
+ builder.AddInstruction(MakeUnique<opt::Instruction>(
+ &context, spv::Op::OpBitcast, exported_func_param->type_id(),
+ new_id,
+ opt::Instruction::OperandList(
+ {{SPV_OPERAND_TYPE_ID, {arg.AsId()}}})));
+
+ inst->SetInOperand(i, {new_id});
+ }
+ });
+ }
+ context.InvalidateAnalyses(opt::IRContext::kAnalysisDefUse |
+ opt::IRContext::kAnalysisInstrToBlockMapping);
+ return SPV_SUCCESS;
+}
+
} // namespace
spv_result_t Link(const Context& context,
@@ -764,8 +867,7 @@
linked_context.module()->SetHeader(header);
// Phase 3: Merge all the binaries into a single one.
- AssemblyGrammar grammar(c_context);
- res = MergeModules(consumer, modules, grammar, &linked_context);
+ res = MergeModules(consumer, modules, &linked_context);
if (res != SPV_SUCCESS) return res;
if (options.GetVerifyIds()) {
@@ -773,7 +875,14 @@
if (res != SPV_SUCCESS) return res;
}
- // Phase 4: Find the import/export pairs
+ // Phase 4: Remove duplicates
+ PassManager manager;
+ manager.SetMessageConsumer(consumer);
+ manager.AddPass<RemoveDuplicatesPass>();
+ opt::Pass::Status pass_res = manager.Run(&linked_context);
+ if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
+
+ // Phase 5: Find the import/export pairs
LinkageTable linkings_to_do;
res = GetImportExportPairs(consumer, linked_context,
*linked_context.get_def_use_mgr(),
@@ -781,18 +890,12 @@
options.GetAllowPartialLinkage(), &linkings_to_do);
if (res != SPV_SUCCESS) return res;
- // Phase 5: Ensure the import and export have the same types and decorations.
- res =
- CheckImportExportCompatibility(consumer, linkings_to_do, &linked_context);
+ // Phase 6: Ensure the import and export have the same types and decorations.
+ res = CheckImportExportCompatibility(consumer, linkings_to_do,
+ options.GetAllowPtrTypeMismatch(),
+ &linked_context);
if (res != SPV_SUCCESS) return res;
- // Phase 6: Remove duplicates
- PassManager manager;
- manager.SetMessageConsumer(consumer);
- manager.AddPass<RemoveDuplicatesPass>();
- opt::Pass::Status pass_res = manager.Run(&linked_context);
- if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
-
// Phase 7: Remove all names and decorations of import variables/functions
for (const auto& linking_entry : linkings_to_do) {
linked_context.KillNamesAndDecorates(linking_entry.imported_symbol.id);
@@ -815,21 +918,27 @@
&linked_context);
if (res != SPV_SUCCESS) return res;
- // Phase 10: Compact the IDs used in the module
+ // Phase 10: Optionally fix function call types
+ if (options.GetAllowPtrTypeMismatch()) {
+ res = FixFunctionCallTypes(linked_context, linkings_to_do);
+ if (res != SPV_SUCCESS) return res;
+ }
+
+ // Phase 11: Compact the IDs used in the module
manager.AddPass<opt::CompactIdsPass>();
pass_res = manager.Run(&linked_context);
if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
- // Phase 11: Recompute EntryPoint variables
+ // Phase 12: Recompute EntryPoint variables
manager.AddPass<opt::RemoveUnusedInterfaceVariablesPass>();
pass_res = manager.Run(&linked_context);
if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
- // Phase 12: Warn if SPIR-V limits were exceeded
+ // Phase 13: Warn if SPIR-V limits were exceeded
res = VerifyLimits(consumer, linked_context);
if (res != SPV_SUCCESS) return res;
- // Phase 13: Output the module
+ // Phase 14: Output the module
linked_context.module()->ToBinary(linked_binary, true);
return SPV_SUCCESS;
diff --git a/third_party/SPIRV-Tools/source/enum_string_mapping.cpp b/third_party/SPIRV-Tools/source/mimalloc.cpp
similarity index 65%
copy from third_party/SPIRV-Tools/source/enum_string_mapping.cpp
copy to third_party/SPIRV-Tools/source/mimalloc.cpp
index 32361a0..777cd6f 100644
--- a/third_party/SPIRV-Tools/source/enum_string_mapping.cpp
+++ b/third_party/SPIRV-Tools/source/mimalloc.cpp
@@ -1,29 +1,15 @@
-// Copyright (c) 2017 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "source/enum_string_mapping.h"
-
-#include <algorithm>
-#include <cassert>
-#include <cstring>
-#include <string>
-#include <unordered_map>
-
-#include "source/extensions.h"
-
-namespace spvtools {
-
-#include "enum_string_mapping.inc"
-
-} // namespace spvtools
+// Copyright (c) 2025 The Khronos Group Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "mimalloc-new-delete.h"
diff --git a/third_party/SPIRV-Tools/source/name_mapper.cpp b/third_party/SPIRV-Tools/source/name_mapper.cpp
index b2d0f44..5f869c4 100644
--- a/third_party/SPIRV-Tools/source/name_mapper.cpp
+++ b/third_party/SPIRV-Tools/source/name_mapper.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2016 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -25,24 +27,16 @@
#include "source/binary.h"
#include "source/latest_version_spirv_header.h"
#include "source/parsed_operand.h"
+#include "source/table2.h"
+#include "source/to_string.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
-namespace {
-// Converts a uint32_t to its string decimal representation.
-std::string to_string(uint32_t id) {
- // Use stringstream, since some versions of Android compilers lack
- // std::to_string.
- std::stringstream os;
- os << id;
- return os.str();
+NameMapper GetTrivialNameMapper() {
+ return [](uint32_t i) { return spvtools::to_string(i); };
}
-} // anonymous namespace
-
-NameMapper GetTrivialNameMapper() { return to_string; }
-
FriendlyNameMapper::FriendlyNameMapper(const spv_const_context context,
const uint32_t* code,
const size_t wordCount)
@@ -218,6 +212,20 @@
} break;
case spv::Op::OpTypeFloat: {
const auto bit_width = inst.words[2];
+ if (inst.num_words > 3) {
+ if (spv::FPEncoding(inst.words[3]) == spv::FPEncoding::BFloat16KHR) {
+ SaveName(result_id, "bfloat16");
+ break;
+ }
+ if (spv::FPEncoding(inst.words[3]) == spv::FPEncoding::Float8E4M3EXT) {
+ SaveName(result_id, "fp8e4m3");
+ break;
+ }
+ if (spv::FPEncoding(inst.words[3]) == spv::FPEncoding::Float8E5M2EXT) {
+ SaveName(result_id, "fp8e5m2");
+ break;
+ }
+ }
switch (bit_width) {
case 16:
SaveName(result_id, "half");
@@ -249,12 +257,21 @@
SaveName(result_id,
std::string("_runtimearr_") + NameForId(inst.words[2]));
break;
+ case spv::Op::OpTypeNodePayloadArrayAMDX:
+ SaveName(result_id,
+ std::string("_payloadarr_") + NameForId(inst.words[2]));
+ break;
case spv::Op::OpTypePointer:
SaveName(result_id, std::string("_ptr_") +
NameForEnumOperand(SPV_OPERAND_TYPE_STORAGE_CLASS,
inst.words[2]) +
"_" + NameForId(inst.words[3]));
break;
+ case spv::Op::OpTypeUntypedPointerKHR:
+ SaveName(result_id, std::string("_ptr_") +
+ NameForEnumOperand(SPV_OPERAND_TYPE_STORAGE_CLASS,
+ inst.words[2]));
+ break;
case spv::Op::OpTypePipe:
SaveName(result_id,
std::string("Pipe") +
@@ -319,9 +336,9 @@
std::string FriendlyNameMapper::NameForEnumOperand(spv_operand_type_t type,
uint32_t word) {
- spv_operand_desc desc = nullptr;
- if (SPV_SUCCESS == grammar_.lookupOperand(type, word, &desc)) {
- return desc->name;
+ const spvtools::OperandDesc* desc = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(type, word, &desc)) {
+ return desc->name().data();
} else {
// Invalid input. Just give something.
return std::string("StorageClass") + to_string(word);
diff --git a/third_party/SPIRV-Tools/source/opcode.cpp b/third_party/SPIRV-Tools/source/opcode.cpp
index 787dbb3..adbd1a1 100644
--- a/third_party/SPIRV-Tools/source/opcode.cpp
+++ b/third_party/SPIRV-Tools/source/opcode.cpp
@@ -1,6 +1,6 @@
// Copyright (c) 2015-2022 The Khronos Group Inc.
-// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights
-// reserved.
+// Modifications Copyright (C) 2020-2024 Advanced Micro Devices, Inc. All
+// rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,18 +27,10 @@
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "spirv-tools/libspirv.h"
namespace {
-struct OpcodeDescPtrLen {
- const spv_opcode_desc_t* ptr;
- uint32_t len;
-};
-
-#include "core.insts-unified1.inc"
-
-static const spv_opcode_table_t kOpcodeTable = {ARRAY_SIZE(kOpcodeTableEntries),
- kOpcodeTableEntries};
// Represents a vendor tool entry in the SPIR-V XML Registry.
struct VendorTool {
@@ -78,94 +70,6 @@
}
}
-spv_result_t spvOpcodeTableGet(spv_opcode_table* pInstTable, spv_target_env) {
- if (!pInstTable) return SPV_ERROR_INVALID_POINTER;
-
- // Descriptions of each opcode. Each entry describes the format of the
- // instruction that follows a particular opcode.
-
- *pInstTable = &kOpcodeTable;
- return SPV_SUCCESS;
-}
-
-spv_result_t spvOpcodeTableNameLookup(spv_target_env env,
- const spv_opcode_table table,
- const char* name,
- spv_opcode_desc* pEntry) {
- if (!name || !pEntry) return SPV_ERROR_INVALID_POINTER;
- if (!table) return SPV_ERROR_INVALID_TABLE;
-
- // TODO: This lookup of the Opcode table is suboptimal! Binary sort would be
- // preferable but the table requires sorting on the Opcode name, but it's
- // static const initialized and matches the order of the spec.
- const size_t nameLength = strlen(name);
- const auto version = spvVersionForTargetEnv(env);
- for (uint64_t opcodeIndex = 0; opcodeIndex < table->count; ++opcodeIndex) {
- const spv_opcode_desc_t& entry = table->entries[opcodeIndex];
- // We considers the current opcode as available as long as
- // 1. The target environment satisfies the minimal requirement of the
- // opcode; or
- // 2. There is at least one extension enabling this opcode.
- //
- // Note that the second rule assumes the extension enabling this instruction
- // is indeed requested in the SPIR-V code; checking that should be
- // validator's work.
- if (((version >= entry.minVersion && version <= entry.lastVersion) ||
- entry.numExtensions > 0u || entry.numCapabilities > 0u) &&
- nameLength == strlen(entry.name) &&
- !strncmp(name, entry.name, nameLength)) {
- // NOTE: Found out Opcode!
- *pEntry = &entry;
- return SPV_SUCCESS;
- }
- }
-
- return SPV_ERROR_INVALID_LOOKUP;
-}
-
-spv_result_t spvOpcodeTableValueLookup(spv_target_env env,
- const spv_opcode_table table,
- const spv::Op opcode,
- spv_opcode_desc* pEntry) {
- if (!table) return SPV_ERROR_INVALID_TABLE;
- if (!pEntry) return SPV_ERROR_INVALID_POINTER;
-
- const auto beg = table->entries;
- const auto end = table->entries + table->count;
-
- spv_opcode_desc_t needle = {"", opcode, 0, nullptr, 0, {},
- false, false, 0, nullptr, ~0u, ~0u};
-
- auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
- return lhs.opcode < rhs.opcode;
- };
-
- // We need to loop here because there can exist multiple symbols for the same
- // opcode value, and they can be introduced in different target environments,
- // which means they can have different minimal version requirements.
- // Assumes the underlying table is already sorted ascendingly according to
- // opcode value.
- const auto version = spvVersionForTargetEnv(env);
- for (auto it = std::lower_bound(beg, end, needle, comp);
- it != end && it->opcode == opcode; ++it) {
- // We considers the current opcode as available as long as
- // 1. The target environment satisfies the minimal requirement of the
- // opcode; or
- // 2. There is at least one extension enabling this opcode.
- //
- // Note that the second rule assumes the extension enabling this instruction
- // is indeed requested in the SPIR-V code; checking that should be
- // validator's work.
- if ((version >= it->minVersion && version <= it->lastVersion) ||
- it->numExtensions > 0u || it->numCapabilities > 0u) {
- *pEntry = it;
- return SPV_SUCCESS;
- }
- }
-
- return SPV_ERROR_INVALID_LOOKUP;
-}
-
void spvInstructionCopy(const uint32_t* words, const spv::Op opcode,
const uint16_t wordCount, const spv_endianness_t endian,
spv_instruction_t* pInst) {
@@ -184,24 +88,13 @@
}
const char* spvOpcodeString(const uint32_t opcode) {
- const auto beg = kOpcodeTableEntries;
- const auto end = kOpcodeTableEntries + ARRAY_SIZE(kOpcodeTableEntries);
- spv_opcode_desc_t needle = {"", static_cast<spv::Op>(opcode),
- 0, nullptr,
- 0, {},
- false, false,
- 0, nullptr,
- ~0u, ~0u};
- auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
- return lhs.opcode < rhs.opcode;
- };
- auto it = std::lower_bound(beg, end, needle, comp);
- if (it != end && it->opcode == spv::Op(opcode)) {
- return it->name;
+ const spvtools::InstructionDesc* desc = nullptr;
+ if (SPV_SUCCESS !=
+ spvtools::LookupOpcode(static_cast<spv::Op>(opcode), &desc)) {
+ assert(0 && "Unreachable!");
+ return "unknown";
}
-
- assert(0 && "Unreachable!");
- return "unknown";
+ return desc->name().data();
}
const char* spvOpcodeString(const spv::Op opcode) {
@@ -225,6 +118,7 @@
case spv::Op::OpSpecConstantFalse:
case spv::Op::OpSpecConstant:
case spv::Op::OpSpecConstantComposite:
+ case spv::Op::OpSpecConstantCompositeReplicateEXT:
case spv::Op::OpSpecConstantOp:
return true;
default:
@@ -238,14 +132,20 @@
case spv::Op::OpConstantFalse:
case spv::Op::OpConstant:
case spv::Op::OpConstantComposite:
+ case spv::Op::OpConstantCompositeReplicateEXT:
case spv::Op::OpConstantSampler:
case spv::Op::OpConstantNull:
case spv::Op::OpConstantFunctionPointerINTEL:
+ case spv::Op::OpConstantStringAMDX:
case spv::Op::OpSpecConstantTrue:
case spv::Op::OpSpecConstantFalse:
case spv::Op::OpSpecConstant:
case spv::Op::OpSpecConstantComposite:
+ case spv::Op::OpSpecConstantCompositeReplicateEXT:
case spv::Op::OpSpecConstantOp:
+ case spv::Op::OpSpecConstantStringAMDX:
+ case spv::Op::OpAsmTargetINTEL:
+ case spv::Op::OpAsmINTEL:
return true;
default:
return false;
@@ -273,8 +173,10 @@
case spv::Op::OpTypeMatrix:
case spv::Op::OpTypeArray:
case spv::Op::OpTypeStruct:
+ case spv::Op::OpTypeRuntimeArray:
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
return true;
default:
return false;
@@ -284,15 +186,20 @@
bool spvOpcodeReturnsLogicalVariablePointer(const spv::Op opcode) {
switch (opcode) {
case spv::Op::OpVariable:
+ case spv::Op::OpUntypedVariableKHR:
case spv::Op::OpAccessChain:
case spv::Op::OpInBoundsAccessChain:
+ case spv::Op::OpUntypedAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsAccessChainKHR:
case spv::Op::OpFunctionParameter:
case spv::Op::OpImageTexelPointer:
case spv::Op::OpCopyObject:
+ case spv::Op::OpAllocateNodePayloadsAMDX:
case spv::Op::OpSelect:
case spv::Op::OpPhi:
case spv::Op::OpFunctionCall:
case spv::Op::OpPtrAccessChain:
+ case spv::Op::OpUntypedPtrAccessChainKHR:
case spv::Op::OpLoad:
case spv::Op::OpConstantNull:
case spv::Op::OpRawAccessChainNV:
@@ -305,12 +212,16 @@
int32_t spvOpcodeReturnsLogicalPointer(const spv::Op opcode) {
switch (opcode) {
case spv::Op::OpVariable:
+ case spv::Op::OpUntypedVariableKHR:
case spv::Op::OpAccessChain:
case spv::Op::OpInBoundsAccessChain:
+ case spv::Op::OpUntypedAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsAccessChainKHR:
case spv::Op::OpFunctionParameter:
case spv::Op::OpImageTexelPointer:
case spv::Op::OpCopyObject:
case spv::Op::OpRawAccessChainNV:
+ case spv::Op::OpAllocateNodePayloadsAMDX:
return true;
default:
return false;
@@ -344,10 +255,17 @@
case spv::Op::OpTypeAccelerationStructureNV:
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
// case spv::Op::OpTypeAccelerationStructureKHR: covered by
// spv::Op::OpTypeAccelerationStructureNV
case spv::Op::OpTypeRayQueryKHR:
case spv::Op::OpTypeHitObjectNV:
+ case spv::Op::OpTypeUntypedPointerKHR:
+ case spv::Op::OpTypeNodePayloadArrayAMDX:
+ case spv::Op::OpTypeTensorLayoutNV:
+ case spv::Op::OpTypeTensorViewNV:
+ case spv::Op::OpTypeTensorARM:
+ case spv::Op::OpTypeTaskSequenceINTEL:
return true;
default:
// In particular, OpTypeForwardPointer does not generate a type,
@@ -385,6 +303,7 @@
case spv::Op::OpImageSampleProjExplicitLod:
case spv::Op::OpImageSampleProjDrefImplicitLod:
case spv::Op::OpImageSampleProjDrefExplicitLod:
+ case spv::Op::OpImageSampleFootprintNV:
case spv::Op::OpImageFetch:
case spv::Op::OpImageGather:
case spv::Op::OpImageDrefGather:
@@ -711,6 +630,17 @@
case spv::Op::OpImageSparseSampleExplicitLod:
case spv::Op::OpImageSparseSampleDrefImplicitLod:
case spv::Op::OpImageSparseSampleDrefExplicitLod:
+ case spv::Op::OpImageSampleFootprintNV:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool spvIsExtendedInstruction(const spv::Op opcode) {
+ switch (opcode) {
+ case spv::Op::OpExtInst:
+ case spv::Op::OpExtInstWithForwardRefsKHR:
return true;
default:
return false;
@@ -779,3 +709,16 @@
return false;
}
}
+
+bool spvOpcodeGeneratesUntypedPointer(spv::Op opcode) {
+ switch (opcode) {
+ case spv::Op::OpUntypedVariableKHR:
+ case spv::Op::OpUntypedAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsAccessChainKHR:
+ case spv::Op::OpUntypedPtrAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsPtrAccessChainKHR:
+ return true;
+ default:
+ return false;
+ }
+}
diff --git a/third_party/SPIRV-Tools/source/opcode.h b/third_party/SPIRV-Tools/source/opcode.h
index 217aeb2..a314ff6 100644
--- a/third_party/SPIRV-Tools/source/opcode.h
+++ b/third_party/SPIRV-Tools/source/opcode.h
@@ -35,19 +35,6 @@
void spvOpcodeSplit(const uint32_t word, uint16_t* word_count,
uint16_t* opcode);
-// Finds the named opcode in the given opcode table. On success, returns
-// SPV_SUCCESS and writes a handle of the table entry into *entry.
-spv_result_t spvOpcodeTableNameLookup(spv_target_env,
- const spv_opcode_table table,
- const char* name, spv_opcode_desc* entry);
-
-// Finds the opcode by enumerant in the given opcode table. On success, returns
-// SPV_SUCCESS and writes a handle of the table entry into *entry.
-spv_result_t spvOpcodeTableValueLookup(spv_target_env,
- const spv_opcode_table table,
- const spv::Op opcode,
- spv_opcode_desc* entry);
-
// Copies an instruction's word and fixes the endianness to host native. The
// source instruction's stream/opcode/endianness is in the words/opcode/endian
// parameter. The word_count parameter specifies the number of words to copy.
@@ -146,6 +133,9 @@
// Returns true for opcodes that represent image sample instructions.
bool spvOpcodeIsImageSample(spv::Op opcode);
+// Returns true if the opcode is either OpExtInst or OpExtInstWithForwardRefsKHR
+bool spvIsExtendedInstruction(spv::Op opcode);
+
// Returns a vector containing the indices of the memory semantics <id>
// operands for |opcode|.
std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(spv::Op opcode);
@@ -159,4 +149,7 @@
// Gets the name of an instruction, without the "Op" prefix.
const char* spvOpcodeString(const spv::Op opcode);
+// Returns true for opcodes that generate an untyped pointer result.
+bool spvOpcodeGeneratesUntypedPointer(spv::Op opcode);
+
#endif // SOURCE_OPCODE_H_
diff --git a/third_party/SPIRV-Tools/source/operand.cpp b/third_party/SPIRV-Tools/source/operand.cpp
index 7848846..d7fc535 100644
--- a/third_party/SPIRV-Tools/source/operand.cpp
+++ b/third_party/SPIRV-Tools/source/operand.cpp
@@ -26,91 +26,9 @@
#include "source/macro.h"
#include "source/opcode.h"
#include "source/spirv_constant.h"
-
-// For now, assume unified1 contains up to SPIR-V 1.3 and no later
-// SPIR-V version.
-// TODO(dneto): Make one set of tables, but with version tags on a
-// per-item basis. https://github.com/KhronosGroup/SPIRV-Tools/issues/1195
-
-#include "operand.kinds-unified1.inc"
+#include "source/table2.h"
#include "spirv-tools/libspirv.h"
-static const spv_operand_table_t kOperandTable = {
- ARRAY_SIZE(pygen_variable_OperandInfoTable),
- pygen_variable_OperandInfoTable};
-
-spv_result_t spvOperandTableGet(spv_operand_table* pOperandTable,
- spv_target_env) {
- if (!pOperandTable) return SPV_ERROR_INVALID_POINTER;
-
- *pOperandTable = &kOperandTable;
- return SPV_SUCCESS;
-}
-
-spv_result_t spvOperandTableNameLookup(spv_target_env,
- const spv_operand_table table,
- const spv_operand_type_t type,
- const char* name,
- const size_t nameLength,
- spv_operand_desc* pEntry) {
- if (!table) return SPV_ERROR_INVALID_TABLE;
- if (!name || !pEntry) return SPV_ERROR_INVALID_POINTER;
-
- for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) {
- const auto& group = table->types[typeIndex];
- if (type != group.type) continue;
- for (uint64_t index = 0; index < group.count; ++index) {
- const auto& entry = group.entries[index];
- // We consider the current operand as available as long as
- // it is in the grammar. It might not be *valid* to use,
- // but that should be checked by the validator, not by parsing.
- if (nameLength == strlen(entry.name) &&
- !strncmp(entry.name, name, nameLength)) {
- *pEntry = &entry;
- return SPV_SUCCESS;
- }
- }
- }
-
- return SPV_ERROR_INVALID_LOOKUP;
-}
-
-spv_result_t spvOperandTableValueLookup(spv_target_env,
- const spv_operand_table table,
- const spv_operand_type_t type,
- const uint32_t value,
- spv_operand_desc* pEntry) {
- if (!table) return SPV_ERROR_INVALID_TABLE;
- if (!pEntry) return SPV_ERROR_INVALID_POINTER;
-
- spv_operand_desc_t needle = {"", value, 0, nullptr, 0, nullptr, {}, ~0u, ~0u};
-
- auto comp = [](const spv_operand_desc_t& lhs, const spv_operand_desc_t& rhs) {
- return lhs.value < rhs.value;
- };
-
- for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) {
- const auto& group = table->types[typeIndex];
- if (type != group.type) continue;
-
- const auto beg = group.entries;
- const auto end = group.entries + group.count;
-
- // Assumes the underlying table is already sorted ascendingly according to
- // opcode value.
- auto it = std::lower_bound(beg, end, needle, comp);
- if (it != end && it->value == value) {
- // The current operand is considered available as long as
- // it is in the grammar. It might not be *valid* to use,
- // but that should be checked by the validator, not by parsing.
- *pEntry = it;
- return SPV_SUCCESS;
- }
- }
-
- return SPV_ERROR_INVALID_LOOKUP;
-}
-
const char* spvOperandTypeStr(spv_operand_type_t type) {
switch (type) {
case SPV_OPERAND_TYPE_ID:
@@ -193,6 +111,7 @@
case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO:
return "kernel profiling info";
case SPV_OPERAND_TYPE_CAPABILITY:
+ case SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY:
return "capability";
case SPV_OPERAND_TYPE_RAY_FLAGS:
return "ray flags";
@@ -212,6 +131,18 @@
return "cooperative matrix layout";
case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_USE:
return "cooperative matrix use";
+ case SPV_OPERAND_TYPE_TENSOR_CLAMP_MODE:
+ return "tensor clamp mode";
+ case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_REDUCE:
+ return "cooperative matrix reduce";
+ case SPV_OPERAND_TYPE_TENSOR_ADDRESSING_OPERANDS:
+ return "tensor addressing operands";
+ case SPV_OPERAND_TYPE_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS:
+ return "matrix multiply accumulate operands";
+ case SPV_OPERAND_TYPE_TENSOR_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_TENSOR_OPERANDS:
+ return "tensor operands";
case SPV_OPERAND_TYPE_INITIALIZATION_MODE_QUALIFIER:
return "initialization mode qualifier";
case SPV_OPERAND_TYPE_HOST_ACCESS_QUALIFIER:
@@ -252,6 +183,9 @@
return "OpenCL.DebugInfo.100 debug operation";
case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY:
return "OpenCL.DebugInfo.100 debug imported entity";
+ case SPV_OPERAND_TYPE_FPENCODING:
+ case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING:
+ return "FP encoding";
// The next values are for values returned from an instruction, not actually
// an operand. So the specific strings don't matter. But let's add them
@@ -269,6 +203,28 @@
return "quantization mode";
case SPV_OPERAND_TYPE_OVERFLOW_MODES:
return "overflow mode";
+ case SPV_OPERAND_TYPE_COOPERATIVE_VECTOR_MATRIX_LAYOUT:
+ return "cooperative vector matrix layout";
+ case SPV_OPERAND_TYPE_COMPONENT_TYPE:
+ return "component type";
+
+ case SPV_OPERAND_TYPE_KERNEL_PROPERTY_FLAGS:
+ return "kernel property flags";
+ case SPV_OPERAND_TYPE_SHDEBUG100_BUILD_IDENTIFIER_FLAGS:
+ return "NonSemantic.Shader.DebugInfo.100 debug build identifier flags";
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
+ return "NonSemantic.Shader.DebugInfo.100 debug base type attribute "
+ "encoding";
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_COMPOSITE_TYPE:
+ return "NonSemantic.Shader.DebugInfo.100 debug composite type";
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_IMPORTED_ENTITY:
+ return "NonSemantic.Shader.DebugInfo.100 debug imported entity";
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_INFO_FLAGS:
+ return "NonSemantic.Shader.DebugInfo.100 debug info flags";
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_OPERATION:
+ return "NonSemantic.Shader.DebugInfo.100 debug operation";
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_TYPE_QUALIFIER:
+ return "NonSemantic.Shader.DebugInfo.100 debug type qualifier";
case SPV_OPERAND_TYPE_NONE:
return "NONE";
@@ -280,6 +236,7 @@
void spvPushOperandTypes(const spv_operand_type_t* types,
spv_operand_pattern_t* pattern) {
+ // Push them on in backward order.
const spv_operand_type_t* endTypes;
for (endTypes = types; *endTypes != SPV_OPERAND_TYPE_NONE; ++endTypes) {
}
@@ -289,9 +246,22 @@
}
}
-void spvPushOperandTypesForMask(spv_target_env env,
- const spv_operand_table operandTable,
- const spv_operand_type_t type,
+void spvPushOperandTypes(
+ const spvtools::utils::Span<const spv_operand_type_t>& types,
+ spv_operand_pattern_t* pattern) {
+ // Push them on in backward order.
+ auto n = types.size();
+ for (auto i = 0u; i < n; i++) {
+ auto type = types[n - 1 - i];
+ // Check against the NONE type, in case the tables have them.
+ // This might be cleaned up.
+ if (type != SPV_OPERAND_TYPE_NONE) {
+ pattern->push_back(type);
+ }
+ }
+}
+
+void spvPushOperandTypesForMask(const spv_operand_type_t type,
const uint32_t mask,
spv_operand_pattern_t* pattern) {
// Scan from highest bits to lowest bits because we will append in LIFO
@@ -299,10 +269,9 @@
for (uint32_t candidate_bit = (1u << 31u); candidate_bit;
candidate_bit >>= 1) {
if (candidate_bit & mask) {
- spv_operand_desc entry = nullptr;
- if (SPV_SUCCESS == spvOperandTableValueLookup(env, operandTable, type,
- candidate_bit, &entry)) {
- spvPushOperandTypes(entry->operandTypes, pattern);
+ const spvtools::OperandDesc* entry = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(type, candidate_bit, &entry)) {
+ spvPushOperandTypes(entry->operands(), pattern);
}
}
}
@@ -366,6 +335,18 @@
case SPV_OPERAND_TYPE_LOAD_CACHE_CONTROL:
case SPV_OPERAND_TYPE_STORE_CACHE_CONTROL:
case SPV_OPERAND_TYPE_NAMED_MAXIMUM_NUMBER_OF_REGISTERS:
+ case SPV_OPERAND_TYPE_FPENCODING:
+ case SPV_OPERAND_TYPE_TENSOR_CLAMP_MODE:
+ case SPV_OPERAND_TYPE_COOPERATIVE_VECTOR_MATRIX_LAYOUT:
+ case SPV_OPERAND_TYPE_COMPONENT_TYPE:
+ case SPV_OPERAND_TYPE_KERNEL_PROPERTY_FLAGS:
+ case SPV_OPERAND_TYPE_SHDEBUG100_BUILD_IDENTIFIER_FLAGS:
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_COMPOSITE_TYPE:
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_IMPORTED_ENTITY:
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_INFO_FLAGS:
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_OPERATION:
+ case SPV_OPERAND_TYPE_SHDEBUG100_DEBUG_TYPE_QUALIFIER:
return true;
default:
break;
@@ -385,7 +366,11 @@
case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_OPERANDS:
+ case SPV_OPERAND_TYPE_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS:
case SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS:
+ case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_REDUCE:
+ case SPV_OPERAND_TYPE_TENSOR_ADDRESSING_OPERANDS:
+ case SPV_OPERAND_TYPE_TENSOR_OPERANDS:
return true;
default:
break;
@@ -405,8 +390,12 @@
case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER:
case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT:
case SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS:
case SPV_OPERAND_TYPE_OPTIONAL_CIV:
case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_FPENCODING:
+ case SPV_OPERAND_TYPE_OPTIONAL_TENSOR_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY:
return true;
default:
break;
@@ -421,6 +410,7 @@
case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER:
case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID:
case SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER:
+ case SPV_OPERAND_TYPE_VARIABLE_CAPABILITY:
return true;
default:
break;
@@ -452,6 +442,10 @@
pattern->push_back(SPV_OPERAND_TYPE_LITERAL_INTEGER);
pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID);
return true;
+ case SPV_OPERAND_TYPE_VARIABLE_CAPABILITY:
+ pattern->push_back(type);
+ pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_CAPABILITY);
+ return true;
default:
break;
}
@@ -574,6 +568,16 @@
case spv::Op::OpTypeArray:
out = [](unsigned index) { return index == 1; };
break;
+ case spv::Op::OpCooperativeMatrixPerElementOpNV:
+ out = [](unsigned index) { return index == 3; };
+ break;
+ case spv::Op::OpCooperativeMatrixReduceNV:
+ out = [](unsigned index) { return index == 4; };
+ break;
+ case spv::Op::OpCooperativeMatrixLoadTensorNV:
+ // approximate, due to variable operands
+ out = [](unsigned index) { return index > 6; };
+ break;
default:
out = [](unsigned) { return false; };
break;
@@ -582,11 +586,13 @@
}
std::function<bool(unsigned)> spvDbgInfoExtOperandCanBeForwardDeclaredFunction(
- spv_ext_inst_type_t ext_type, uint32_t key) {
+ spv::Op opcode, spv_ext_inst_type_t ext_type, uint32_t key) {
// The Vulkan debug info extended instruction set is non-semantic so allows no
- // forward references ever
+ // forward references except if used through OpExtInstWithForwardRefsKHR.
if (ext_type == SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) {
- return [](unsigned) { return false; };
+ return [opcode](unsigned) {
+ return opcode == spv::Op::OpExtInstWithForwardRefsKHR;
+ };
}
// TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/532): Forward
@@ -620,3 +626,17 @@
}
return out;
}
+
+spv_fp_encoding_t spvFPEncodingFromOperandFPEncoding(spv::FPEncoding encoding) {
+ switch (encoding) {
+ case spv::FPEncoding::BFloat16KHR:
+ return SPV_FP_ENCODING_BFLOAT16;
+ case spv::FPEncoding::Float8E4M3EXT:
+ return SPV_FP_ENCODING_FLOAT8_E4M3;
+ case spv::FPEncoding::Float8E5M2EXT:
+ return SPV_FP_ENCODING_FLOAT8_E5M2;
+ case spv::FPEncoding::Max:
+ break;
+ }
+ return SPV_FP_ENCODING_UNKNOWN;
+}
diff --git a/third_party/SPIRV-Tools/source/operand.h b/third_party/SPIRV-Tools/source/operand.h
index f74c933..9fc9b74 100644
--- a/third_party/SPIRV-Tools/source/operand.h
+++ b/third_party/SPIRV-Tools/source/operand.h
@@ -19,6 +19,7 @@
#include <vector>
#include "source/table.h"
+#include "source/util/span.h"
#include "spirv-tools/libspirv.h"
// A sequence of operand types.
@@ -35,25 +36,6 @@
// performance.
using spv_operand_pattern_t = std::vector<spv_operand_type_t>;
-// Finds the named operand in the table. The type parameter specifies the
-// operand's group. A handle of the operand table entry for this operand will
-// be written into *entry.
-spv_result_t spvOperandTableNameLookup(spv_target_env,
- const spv_operand_table table,
- const spv_operand_type_t type,
- const char* name,
- const size_t name_length,
- spv_operand_desc* entry);
-
-// Finds the operand with value in the table. The type parameter specifies the
-// operand's group. A handle of the operand table entry for this operand will
-// be written into *entry.
-spv_result_t spvOperandTableValueLookup(spv_target_env,
- const spv_operand_table table,
- const spv_operand_type_t type,
- const uint32_t value,
- spv_operand_desc* entry);
-
// Gets the name string of the non-variable operand type.
const char* spvOperandTypeStr(spv_operand_type_t type);
@@ -68,10 +50,10 @@
bool spvOperandIsVariable(spv_operand_type_t type);
// Append a list of operand types to the end of the pattern vector.
-// The types parameter specifies the source array of types, ending with
-// SPV_OPERAND_TYPE_NONE.
-void spvPushOperandTypes(const spv_operand_type_t* types,
- spv_operand_pattern_t* pattern);
+// The types parameter specifies the source span of types.
+void spvPushOperandTypes(
+ const spvtools::utils::Span<const spv_operand_type_t>& types,
+ spv_operand_pattern_t* pattern);
// Appends the operands expected after the given typed mask onto the
// end of the given pattern.
@@ -81,9 +63,7 @@
// appear after operands for a more significant bit.
//
// If a set bit is unknown, then we assume it has no operands.
-void spvPushOperandTypesForMask(spv_target_env,
- const spv_operand_table operand_table,
- const spv_operand_type_t mask_type,
+void spvPushOperandTypesForMask(const spv_operand_type_t mask_type,
const uint32_t mask,
spv_operand_pattern_t* pattern);
@@ -140,6 +120,9 @@
// of the operand can be forward declared. This function will
// used in the SSA validation stage of the pipeline
std::function<bool(unsigned)> spvDbgInfoExtOperandCanBeForwardDeclaredFunction(
- spv_ext_inst_type_t ext_type, uint32_t key);
+ spv::Op opcode, spv_ext_inst_type_t ext_type, uint32_t key);
+
+// Converts an spv::FPEncoding to spv_fp_encoding_t
+spv_fp_encoding_t spvFPEncodingFromOperandFPEncoding(spv::FPEncoding encoding);
#endif // SOURCE_OPERAND_H_
diff --git a/third_party/SPIRV-Tools/source/opt/CMakeLists.txt b/third_party/SPIRV-Tools/source/opt/CMakeLists.txt
index 4e7d92d..7cba4a0 100644
--- a/third_party/SPIRV-Tools/source/opt/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/source/opt/CMakeLists.txt
@@ -64,15 +64,12 @@
inline_exhaustive_pass.h
inline_opaque_pass.h
inline_pass.h
- inst_bindless_check_pass.h
- inst_buff_addr_check_pass.h
- inst_debug_printf_pass.h
instruction.h
instruction_list.h
- instrument_pass.h
interface_var_sroa.h
invocation_interlock_placement_pass.h
interp_fixup_pass.h
+ opextinst_forward_ref_fixup_pass.h
ir_builder.h
ir_context.h
ir_loader.h
@@ -107,16 +104,19 @@
reflect.h
register_pressure.h
relax_float_ops_pass.h
+ canonicalize_ids_pass.h
remove_dontinline_pass.h
remove_duplicates_pass.h
remove_unused_interface_variables_pass.h
replace_desc_array_access_using_var_index.h
replace_invalid_opc.h
+ resolve_binding_conflicts_pass.h
scalar_analysis.h
scalar_analysis_nodes.h
scalar_replacement_pass.h
set_spec_constant_default_value_pass.h
simplification_pass.h
+ split_combined_image_sampler_pass.h
spread_volatile_semantics.h
ssa_rewrite_pass.h
strength_reduction_pass.h
@@ -186,15 +186,12 @@
inline_exhaustive_pass.cpp
inline_opaque_pass.cpp
inline_pass.cpp
- inst_bindless_check_pass.cpp
- inst_buff_addr_check_pass.cpp
- inst_debug_printf_pass.cpp
instruction.cpp
instruction_list.cpp
- instrument_pass.cpp
interface_var_sroa.cpp
invocation_interlock_placement_pass.cpp
interp_fixup_pass.cpp
+ opextinst_forward_ref_fixup_pass.cpp
ir_context.cpp
ir_loader.cpp
licm_pass.cpp
@@ -226,22 +223,26 @@
redundancy_elimination.cpp
register_pressure.cpp
relax_float_ops_pass.cpp
+ canonicalize_ids_pass.cpp
remove_dontinline_pass.cpp
remove_duplicates_pass.cpp
remove_unused_interface_variables_pass.cpp
replace_desc_array_access_using_var_index.cpp
replace_invalid_opc.cpp
+ resolve_binding_conflicts_pass.cpp
scalar_analysis.cpp
scalar_analysis_simplification.cpp
scalar_replacement_pass.cpp
set_spec_constant_default_value_pass.cpp
simplification_pass.cpp
+ split_combined_image_sampler_pass.cpp
spread_volatile_semantics.cpp
ssa_rewrite_pass.cpp
strength_reduction_pass.cpp
strip_debug_info_pass.cpp
strip_nonsemantic_info_pass.cpp
struct_cfg_analysis.cpp
+ struct_packing_pass.cpp
switch_descriptorset_pass.cpp
trim_capabilities_pass.cpp
type_manager.cpp
@@ -261,8 +262,16 @@
spvtools_pch(SPIRV_TOOLS_OPT_SOURCES pch_source_opt)
+if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV_TOOLS_OPT_SOURCES ${spirv-tools_SOURCE_DIR}/source/mimalloc.cpp)
+endif()
+
add_library(SPIRV-Tools-opt ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_OPT_SOURCES})
+if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ target_link_libraries(SPIRV-Tools-opt PRIVATE mimalloc-static)
+endif()
+
spvtools_default_compile_options(SPIRV-Tools-opt)
target_include_directories(SPIRV-Tools-opt
PUBLIC
@@ -279,7 +288,13 @@
spvtools_check_symbol_exports(SPIRV-Tools-opt)
if(ENABLE_SPIRV_TOOLS_INSTALL)
- install(TARGETS SPIRV-Tools-opt EXPORT SPIRV-Tools-optTargets)
+ set(SPIRV-Tools-opt-InstallTargets SPIRV-Tools-opt)
+
+ if (SPIRV_TOOLS_USE_MIMALLOC AND NOT SPIRV_TOOLS_BUILD_STATIC)
+ list(APPEND SPIRV-Tools-opt-InstallTargets mimalloc-static)
+ endif()
+
+ install(TARGETS ${SPIRV-Tools-opt-InstallTargets} EXPORT SPIRV-Tools-optTargets)
export(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake)
spvtools_config_package_dir(SPIRV-Tools-opt PACKAGE_DIR)
diff --git a/third_party/SPIRV-Tools/source/opt/aggressive_dead_code_elim_pass.cpp b/third_party/SPIRV-Tools/source/opt/aggressive_dead_code_elim_pass.cpp
index 4737da5..acd8fe2 100644
--- a/third_party/SPIRV-Tools/source/opt/aggressive_dead_code_elim_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/aggressive_dead_code_elim_pass.cpp
@@ -40,6 +40,10 @@
constexpr uint32_t kLoadSourceAddrInIdx = 0;
constexpr uint32_t kDebugDeclareOperandVariableIndex = 5;
constexpr uint32_t kGlobalVariableVariableIndex = 12;
+constexpr uint32_t kExtInstSetInIdx = 0;
+constexpr uint32_t kExtInstOpInIdx = 1;
+constexpr uint32_t kInterpolantInIdx = 2;
+constexpr uint32_t kCooperativeMatrixLoadSourceAddrInIdx = 0;
// Sorting functor to present annotation instructions in an easy-to-process
// order. The functor orders by opcode first and falls back on unique id
@@ -134,7 +138,12 @@
}
break;
// If default, assume it stores e.g. frexp, modf, function call
- case spv::Op::OpStore:
+ case spv::Op::OpStore: {
+ const uint32_t kStoreTargetAddrInIdx = 0;
+ if (user->GetSingleWordInOperand(kStoreTargetAddrInIdx) == ptrId)
+ AddToWorklist(user);
+ break;
+ }
default:
AddToWorklist(user);
break;
@@ -262,6 +271,7 @@
}
bool AggressiveDCEPass::AggressiveDCE(Function* func) {
+ if (func->IsDeclaration()) return false;
std::list<BasicBlock*> structured_order;
cfg()->ComputeStructuredOrder(func, &*func->begin(), &structured_order);
live_local_vars_.clear();
@@ -416,6 +426,24 @@
case spv::Op::OpCopyMemorySized:
return GetVariableId(
inst->GetSingleWordInOperand(kCopyMemorySourceAddrInIdx));
+ case spv::Op::OpExtInst: {
+ if (inst->GetSingleWordInOperand(kExtInstSetInIdx) ==
+ context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450()) {
+ auto ext_inst = inst->GetSingleWordInOperand(kExtInstOpInIdx);
+ switch (ext_inst) {
+ case GLSLstd450InterpolateAtCentroid:
+ case GLSLstd450InterpolateAtOffset:
+ case GLSLstd450InterpolateAtSample:
+ return inst->GetSingleWordInOperand(kInterpolantInIdx);
+ }
+ }
+ break;
+ }
+ case spv::Op::OpCooperativeMatrixLoadNV:
+ case spv::Op::OpCooperativeMatrixLoadKHR:
+ case spv::Op::OpCooperativeMatrixLoadTensorNV:
+ return GetVariableId(
+ inst->GetSingleWordInOperand(kCooperativeMatrixLoadSourceAddrInIdx));
default:
break;
}
@@ -648,6 +676,7 @@
auto op = dbg.GetShader100DebugOpcode();
if (op == NonSemanticShaderDebugInfo100DebugCompilationUnit ||
op == NonSemanticShaderDebugInfo100DebugEntryPoint ||
+ op == NonSemanticShaderDebugInfo100DebugSource ||
op == NonSemanticShaderDebugInfo100DebugSourceContinued) {
AddToWorklist(&dbg);
}
@@ -885,6 +914,19 @@
context()->AnalyzeUses(&dbg);
continue;
}
+ // Save debug build identifier even if no other instructions refer to it.
+ if (dbg.GetShader100DebugOpcode() ==
+ NonSemanticShaderDebugInfo100DebugBuildIdentifier) {
+ // The debug build identifier refers to other instructions that
+ // can potentially be removed, they also need to be kept alive.
+ dbg.ForEachInId([this](const uint32_t* id) {
+ Instruction* ref_inst = get_def_use_mgr()->GetDef(*id);
+ if (ref_inst) {
+ live_insts_.Set(ref_inst->unique_id());
+ }
+ });
+ continue;
+ }
to_kill_.push_back(&dbg);
modified = true;
}
@@ -942,7 +984,6 @@
void AggressiveDCEPass::InitExtensions() {
extensions_allowlist_.clear();
- // clang-format off
extensions_allowlist_.insert({
"SPV_AMD_shader_explicit_vertex_parameter",
"SPV_AMD_shader_trinary_minmax",
@@ -1004,9 +1045,16 @@
"SPV_NV_bindless_texture",
"SPV_EXT_shader_atomic_float_add",
"SPV_EXT_fragment_shader_interlock",
- "SPV_NV_compute_shader_derivatives"
+ "SPV_KHR_compute_shader_derivatives",
+ "SPV_NV_cooperative_matrix",
+ "SPV_KHR_cooperative_matrix",
+ "SPV_KHR_ray_tracing_position_fetch",
+ "SPV_KHR_fragment_shading_rate",
+ "SPV_KHR_quad_control",
+ "SPV_NV_shader_invocation_reorder",
+ "SPV_NV_cluster_acceleration_structure",
+ "SPV_NV_linear_swept_spheres",
});
- // clang-format on
}
Instruction* AggressiveDCEPass::GetHeaderBranch(BasicBlock* blk) {
diff --git a/third_party/SPIRV-Tools/source/opt/amd_ext_to_khr.cpp b/third_party/SPIRV-Tools/source/opt/amd_ext_to_khr.cpp
index a314567..085751b 100644
--- a/third_party/SPIRV-Tools/source/opt/amd_ext_to_khr.cpp
+++ b/third_party/SPIRV-Tools/source/opt/amd_ext_to_khr.cpp
@@ -19,7 +19,6 @@
#include "ir_builder.h"
#include "source/opt/ir_context.h"
-#include "spv-amd-shader-ballot.insts.inc"
#include "type_manager.h"
namespace spvtools {
diff --git a/third_party/SPIRV-Tools/source/opt/build_module.h b/third_party/SPIRV-Tools/source/opt/build_module.h
index 29eaf66..0f906c8 100644
--- a/third_party/SPIRV-Tools/source/opt/build_module.h
+++ b/third_party/SPIRV-Tools/source/opt/build_module.h
@@ -24,7 +24,7 @@
namespace spvtools {
-// Builds an Module returns the owning IRContext from the given SPIR-V
+// Builds a Module and returns the owning IRContext from the given SPIR-V
// |binary|. |size| specifies number of words in |binary|. The |binary| will be
// decoded according to the given target |env|. Returns nullptr if errors occur
// and sends the errors to |consumer|. When |extra_line_tracking| is true,
@@ -41,7 +41,7 @@
const uint32_t* binary,
size_t size);
-// Builds an Module and returns the owning IRContext from the given
+// Builds a Module and returns the owning IRContext from the given
// SPIR-V assembly |text|. The |text| will be encoded according to the given
// target |env|. Returns nullptr if errors occur and sends the errors to
// |consumer|.
diff --git a/third_party/SPIRV-Tools/source/opt/canonicalize_ids_pass.cpp b/third_party/SPIRV-Tools/source/opt/canonicalize_ids_pass.cpp
new file mode 100644
index 0000000..658dec5
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/canonicalize_ids_pass.cpp
@@ -0,0 +1,516 @@
+// Copyright (c) 2025 LunarG Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/opt/canonicalize_ids_pass.h"
+
+#include <algorithm>
+#include <limits>
+
+namespace spvtools {
+namespace opt {
+
+Pass::Status CanonicalizeIdsPass::Process() {
+ // Initialize the new ID map.
+ new_id_.resize(GetBound(), unused_);
+
+ // Scan the IDs and set to unmapped.
+ ScanIds();
+
+ // Create new IDs for types and consts.
+ CanonicalizeTypeAndConst();
+
+ // Create new IDs for names.
+ CanonicalizeNames();
+
+ // Create new IDs for functions.
+ CanonicalizeFunctions();
+
+ // Create new IDs for everything else.
+ CanonicalizeRemainders();
+
+ // Apply the new IDs to the module.
+ auto const modified = ApplyMap();
+
+ // Update bound in the header.
+ if (modified) {
+ UpdateBound();
+ }
+
+ return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
+}
+
+void CanonicalizeIdsPass::ScanIds() {
+ get_module()->ForEachInst(
+ [this](Instruction* inst) {
+ // Look for types and constants.
+ if (spvOpcodeGeneratesType(inst->opcode()) ||
+ spvOpcodeIsConstant(inst->opcode())) {
+ type_and_const_ids_.push_back(inst->result_id());
+ SetNewId(inst->result_id(), unmapped_);
+ }
+ // Look for names.
+ else if (inst->opcode() == spv::Op::OpName) {
+ // store name string in map so that we can compute the hash later
+ auto const name = inst->GetOperand(1).AsString();
+ auto const target = inst->GetSingleWordInOperand(0);
+ name_ids_[name] = target;
+ SetNewId(target, unmapped_);
+ }
+ // Look for function IDs.
+ else if (inst->opcode() == spv::Op::OpFunction) {
+ auto const res_id = inst->result_id();
+ function_ids_.push_back(res_id);
+ SetNewId(res_id, unmapped_);
+ }
+ // Look for remaining result IDs.
+ else if (inst->HasResultId()) {
+ auto const res_id = inst->result_id();
+ SetNewId(res_id, unmapped_);
+ }
+ },
+ true);
+}
+
+void CanonicalizeIdsPass::CanonicalizeTypeAndConst() {
+ // Remap type IDs.
+ static constexpr std::uint32_t soft_type_id_limit = 3011; // small prime.
+ static constexpr std::uint32_t first_mapped_id = 8; // offset into ID space
+ for (auto const id : type_and_const_ids_) {
+ if (!IsOldIdUnmapped(id)) {
+ continue;
+ }
+
+ // Compute the hash value.
+ auto const hash_value = HashTypeAndConst(id);
+ if (hash_value != unmapped_) {
+ SetNewId(id, hash_value % soft_type_id_limit + first_mapped_id);
+ }
+ }
+}
+
+// Hash types to canonical values. This can return ID collisions (it's a bit
+// inevitable): it's up to the caller to handle that gracefully.
+spv::Id CanonicalizeIdsPass::HashTypeAndConst(spv::Id const id) const {
+ spv::Id value = 0;
+
+ auto const inst = get_def_use_mgr()->GetDef(id);
+ auto const op_code = inst->opcode();
+ switch (op_code) {
+ case spv::Op::OpTypeVoid:
+ value = 0;
+ break;
+ case spv::Op::OpTypeBool:
+ value = 1;
+ break;
+ case spv::Op::OpTypeInt: {
+ auto const signedness = inst->GetSingleWordOperand(2);
+ value = 3 + signedness;
+ break;
+ }
+ case spv::Op::OpTypeFloat:
+ value = 5;
+ break;
+ case spv::Op::OpTypeVector: {
+ auto const component_type = inst->GetSingleWordOperand(1);
+ auto const component_count = inst->GetSingleWordOperand(2);
+ value = 6 + HashTypeAndConst(component_type) * (component_count - 1);
+ break;
+ }
+ case spv::Op::OpTypeMatrix: {
+ auto const column_type = inst->GetSingleWordOperand(1);
+ auto const column_count = inst->GetSingleWordOperand(2);
+ value = 30 + HashTypeAndConst(column_type) * (column_count - 1);
+ break;
+ }
+ case spv::Op::OpTypeImage: {
+ // TODO: Why isn't the format used to compute the hash value?
+ auto const sampled_type = inst->GetSingleWordOperand(1);
+ auto const dim = inst->GetSingleWordOperand(2);
+ auto const depth = inst->GetSingleWordOperand(3);
+ auto const arrayed = inst->GetSingleWordOperand(4);
+ auto const ms = inst->GetSingleWordOperand(5);
+ auto const sampled = inst->GetSingleWordOperand(6);
+ value = 120 + HashTypeAndConst(sampled_type) + dim + depth * 8 * 16 +
+ arrayed * 4 * 16 + ms * 2 * 16 + sampled * 1 * 16;
+ break;
+ }
+ case spv::Op::OpTypeSampler:
+ value = 500;
+ break;
+ case spv::Op::OpTypeSampledImage:
+ value = 502;
+ break;
+ case spv::Op::OpTypeArray: {
+ auto const element_type = inst->GetSingleWordOperand(1);
+ auto const length = inst->GetSingleWordOperand(2);
+ value = 501 + HashTypeAndConst(element_type) * length;
+ break;
+ }
+ case spv::Op::OpTypeRuntimeArray: {
+ auto const element_type = inst->GetSingleWordOperand(1);
+ value = 5000 + HashTypeAndConst(element_type);
+ break;
+ }
+ case spv::Op::OpTypeStruct:
+ value = 10000;
+ for (uint32_t w = 1; w < inst->NumOperandWords(); ++w) {
+ value += (w + 1) * HashTypeAndConst(inst->GetSingleWordOperand(w));
+ }
+ break;
+ case spv::Op::OpTypeOpaque: {
+ // TODO: Name is a literal that may have more than one word.
+ auto const name = inst->GetSingleWordOperand(1);
+ value = 6000 + name;
+ break;
+ }
+ case spv::Op::OpTypePointer: {
+ auto const type = inst->GetSingleWordOperand(2);
+ value = 100000 + HashTypeAndConst(type);
+ break;
+ }
+ case spv::Op::OpTypeFunction:
+ value = 200000;
+ for (uint32_t w = 1; w < inst->NumOperandWords(); ++w) {
+ value += (w + 1) * HashTypeAndConst(inst->GetSingleWordOperand(w));
+ }
+ break;
+ case spv::Op::OpTypeEvent:
+ value = 300000;
+ break;
+ case spv::Op::OpTypeDeviceEvent:
+ value = 300001;
+ break;
+ case spv::Op::OpTypeReserveId:
+ value = 300002;
+ break;
+ case spv::Op::OpTypeQueue:
+ value = 300003;
+ break;
+ case spv::Op::OpTypePipe:
+ value = 300004;
+ break;
+ case spv::Op::OpTypePipeStorage:
+ value = 300005;
+ break;
+ case spv::Op::OpTypeNamedBarrier:
+ value = 300006;
+ break;
+ case spv::Op::OpConstantTrue:
+ value = 300007;
+ break;
+ case spv::Op::OpConstantFalse:
+ value = 300008;
+ break;
+ case spv::Op::OpTypeRayQueryKHR:
+ value = 300009;
+ break;
+ case spv::Op::OpTypeAccelerationStructureKHR:
+ value = 300010;
+ break;
+ // Don't map the following types.
+ // TODO: These types were not remapped in the glslang version of the
+ // remapper. Support should be added as necessary.
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
+ case spv::Op::OpTypeHitObjectNV:
+ case spv::Op::OpTypeUntypedPointerKHR:
+ case spv::Op::OpTypeNodePayloadArrayAMDX:
+ case spv::Op::OpTypeTensorLayoutNV:
+ case spv::Op::OpTypeTensorViewNV:
+ case spv::Op::OpTypeTensorARM:
+ case spv::Op::OpTypeTaskSequenceINTEL:
+ value = unmapped_;
+ break;
+ case spv::Op::OpConstant: {
+ auto const result_type = inst->GetSingleWordOperand(0);
+ value = 400011 + HashTypeAndConst(result_type);
+ auto const literal = inst->GetOperand(2);
+ for (uint32_t w = 0; w < literal.words.size(); ++w) {
+ value += (w + 3) * literal.words[w];
+ }
+ break;
+ }
+ case spv::Op::OpConstantComposite: {
+ auto const result_type = inst->GetSingleWordOperand(0);
+ value = 300011 + HashTypeAndConst(result_type);
+ for (uint32_t w = 2; w < inst->NumOperandWords(); ++w) {
+ value += (w + 1) * HashTypeAndConst(inst->GetSingleWordOperand(w));
+ }
+ break;
+ }
+ case spv::Op::OpConstantNull: {
+ auto const result_type = inst->GetSingleWordOperand(0);
+ value = 500009 + HashTypeAndConst(result_type);
+ break;
+ }
+ case spv::Op::OpConstantSampler: {
+ auto const result_type = inst->GetSingleWordOperand(0);
+ value = 600011 + HashTypeAndConst(result_type);
+ for (uint32_t w = 2; w < inst->NumOperandWords(); ++w) {
+ value += (w + 1) * inst->GetSingleWordOperand(w);
+ }
+ break;
+ }
+ // Don't map the following constants.
+ // TODO: These constants were not remapped in the glslang version of the
+ // remapper. Support should be added as necessary.
+ case spv::Op::OpConstantCompositeReplicateEXT:
+ case spv::Op::OpConstantFunctionPointerINTEL:
+ case spv::Op::OpConstantStringAMDX:
+ case spv::Op::OpSpecConstantTrue:
+ case spv::Op::OpSpecConstantFalse:
+ case spv::Op::OpSpecConstant:
+ case spv::Op::OpSpecConstantComposite:
+ case spv::Op::OpSpecConstantCompositeReplicateEXT:
+ case spv::Op::OpSpecConstantOp:
+ case spv::Op::OpSpecConstantStringAMDX:
+ value = unmapped_;
+ break;
+ // TODO: Add additional types/constants as needed. See
+ // spvOpcodeGeneratesType and spvOpcodeIsConstant.
+ default:
+ context()->consumer()(SPV_MSG_WARNING, "", {0, 0, 0},
+ "unhandled opcode will not be canonicalized");
+ break;
+ }
+
+ return value;
+}
+
+void CanonicalizeIdsPass::CanonicalizeNames() {
+ static constexpr std::uint32_t soft_type_id_limit = 3011; // Small prime.
+ static constexpr std::uint32_t first_mapped_id =
+ 3019; // Offset into ID space.
+
+ for (auto const& [name, target] : name_ids_) {
+ if (!IsOldIdUnmapped(target)) {
+ continue;
+ }
+
+ spv::Id hash_value = 1911;
+ for (const char c : name) {
+ hash_value = hash_value * 1009 + c;
+ }
+
+ if (IsOldIdUnmapped(target)) {
+ SetNewId(target, hash_value % soft_type_id_limit + first_mapped_id);
+ }
+ }
+}
+
+void CanonicalizeIdsPass::CanonicalizeFunctions() {
+ static constexpr std::uint32_t soft_type_id_limit = 19071; // Small prime.
+ static constexpr std::uint32_t first_mapped_id =
+ 6203; // Offset into ID space.
+ // Window size for context-sensitive canonicalization values
+ // Empirical best size from a single data set. TODO: Would be a good tunable.
+ // We essentially perform a little convolution around each instruction,
+ // to capture the flavor of nearby code, to hopefully match to similar
+ // code in other modules.
+ static const int32_t window_size = 2;
+
+ for (auto const func_id : function_ids_) {
+ // Store the instructions and opcode hash values in vectors so that the
+ // window of instructions can be easily accessed and avoid having to
+ // recompute the hash value repeatedly in overlapping windows.
+ std::vector<Instruction*> insts;
+ std::vector<uint32_t> opcode_hashvals;
+ auto const func = context()->GetFunction(func_id);
+ func->WhileEachInst([&](Instruction* inst) {
+ insts.emplace_back(inst);
+ opcode_hashvals.emplace_back(HashOpCode(inst));
+ return true;
+ });
+
+ // For every instruction in the function, compute the hash value using the
+ // instruction and a small window of surrounding instructions.
+ assert(insts.size() < (size_t)std::numeric_limits<int32_t>::max());
+ for (int32_t i = 0; i < (int32_t)insts.size(); ++i) {
+ auto const inst = insts[i];
+ if (!inst->HasResultId()) {
+ continue;
+ }
+
+ auto const old_id = inst->result_id();
+ if (!IsOldIdUnmapped(old_id)) {
+ continue;
+ }
+
+ int32_t const lower_bound = std::max(0, i - window_size);
+ int32_t const upper_bound =
+ std::min((int32_t)insts.size() - 1, i + window_size);
+ spv::Id hash_value = func_id * 17; // Small prime.
+ // Include the hash value of the preceding instructions in the hash but
+ // don't include instructions before the OpFunction.
+ for (int32_t j = i - 1; j >= lower_bound; --j) {
+ auto const local_inst = insts[j];
+ if (local_inst->opcode() == spv::Op::OpFunction) {
+ break;
+ }
+
+ hash_value = hash_value * 30103 +
+ opcode_hashvals[j]; // 30103 is a semi-arbitrary prime.
+ }
+
+ // Include the hash value of the subsequent instructions in the hash but
+ // don't include instructions past OpFunctionEnd.
+ for (int32_t j = i; j <= upper_bound; ++j) {
+ auto const local_inst = insts[j];
+ if (local_inst->opcode() == spv::Op::OpFunctionEnd) {
+ break;
+ }
+
+ hash_value = hash_value * 30103 +
+ opcode_hashvals[j]; // 30103 is a semiarbitrary prime.
+ }
+
+ SetNewId(old_id, hash_value % soft_type_id_limit + first_mapped_id);
+ }
+ }
+}
+
+spv::Id CanonicalizeIdsPass::HashOpCode(Instruction const* const inst) const {
+ auto const op_code = inst->opcode();
+ std::uint32_t offset = 0;
+ if (op_code == spv::Op::OpExtInst) {
+ // offset is literal instruction
+ offset = inst->GetSingleWordOperand(3);
+ }
+
+ return (std::uint32_t)op_code * 19 + offset; // 19 is a small prime.
+}
+
+// Assign remaining IDs sequentially from remaining holes in the new ID space.
+void CanonicalizeIdsPass::CanonicalizeRemainders() {
+ spv::Id next_id = 1;
+ for (uint32_t old_id = 0; old_id < new_id_.size(); ++old_id) {
+ if (IsOldIdUnmapped(old_id)) {
+ next_id = SetNewId(old_id, next_id);
+ }
+ }
+}
+
+bool CanonicalizeIdsPass::ApplyMap() {
+ bool modified = false;
+ context()->module()->ForEachInst(
+ [this, &modified](Instruction* inst) {
+ for (auto operand = inst->begin(); operand != inst->end(); ++operand) {
+ const auto type = operand->type;
+ if (spvIsIdType(type)) {
+ uint32_t& id = operand->words[0];
+ uint32_t const new_id = GetNewId(id);
+ if (new_id == unused_) {
+ continue;
+ }
+
+ assert(new_id != unmapped_ && "new_id should not be unmapped_");
+
+ if (id != new_id) {
+ modified = true;
+ id = new_id;
+ if (type == SPV_OPERAND_TYPE_RESULT_ID) {
+ inst->SetResultId(new_id);
+ } else if (type == SPV_OPERAND_TYPE_TYPE_ID) {
+ inst->SetResultType(new_id);
+ }
+ }
+ }
+ }
+ },
+ true);
+
+ return modified;
+}
+
+spv::Id CanonicalizeIdsPass::GetBound() const {
+ return context()->module()->id_bound();
+}
+
+void CanonicalizeIdsPass::UpdateBound() {
+ context()->module()->SetIdBound(context()->module()->ComputeIdBound());
+
+ context()->ResetFeatureManager();
+}
+
+// Set a new ID. If the new ID is alreadly claimed, the next consecutive ID
+// will be claimed, mapped, and returned to the caller.
+spv::Id CanonicalizeIdsPass::SetNewId(spv::Id const old_id, spv::Id new_id) {
+ assert(old_id < GetBound() && "don't remap an ID that is out of bounds");
+
+ if (old_id >= new_id_.size()) {
+ new_id_.resize(old_id + 1, unused_);
+ }
+
+ if (new_id != unmapped_ && new_id != unused_) {
+ assert(!IsOldIdUnused(old_id) && "don't remap unused IDs");
+ assert(IsOldIdUnmapped(old_id) && "don't remap already mapped IDs");
+
+ new_id = ClaimNewId(new_id);
+ }
+
+ new_id_[old_id] = new_id;
+
+ return new_id;
+}
+
+// Helper function for SetNewID. Claim a new ID. If the new ID is already
+// claimed, the next consecutive ID will be claimed and returned to the caller.
+spv::Id CanonicalizeIdsPass::ClaimNewId(spv::Id new_id) {
+ // Return the ID if it's not taken.
+ auto iter = claimed_new_ids_.find(new_id);
+ if (iter != claimed_new_ids_.end()) {
+ // Otherwise, search for the next unused ID using our current iterator.
+ // Technically, it's a linear search across the set starting at the
+ // iterator, but it's not as bad as it would appear in practice assuming the
+ // hash values are well distributed.
+ iter = std::adjacent_find(iter, claimed_new_ids_.end(), [](int a, int b) {
+ return a + 1 != b; // Stop at the first non-consecutive pair.
+ });
+ if (iter != claimed_new_ids_.end()) {
+ new_id =
+ *iter + 1; // We need the next ID after where the search stopped.
+ } else {
+ new_id = *(--iter) + 1; // We reached the end so we use the next ID.
+ }
+ }
+
+ assert(!IsNewIdClaimed(new_id) &&
+ "don't remap to an ID that is already claimed");
+ iter = claimed_new_ids_.insert(iter, new_id);
+ assert(*iter == new_id);
+
+ return new_id;
+}
+
+std::string CanonicalizeIdsPass::IdAsString(spv::Id const id) const {
+ if (id == unused_) {
+ return "unused";
+ } else if (id == unmapped_) {
+ return "unmapped";
+ } else {
+ return std::to_string(id);
+ }
+}
+
+void CanonicalizeIdsPass::PrintNewIds() const {
+ for (spv::Id id = 0; id < new_id_.size(); ++id) {
+ auto const message =
+ "new id[" + IdAsString(id) + "]: " + IdAsString(new_id_[id]);
+ context()->consumer()(SPV_MSG_INFO, "", {0, 0, 0}, message.c_str());
+ }
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/canonicalize_ids_pass.h b/third_party/SPIRV-Tools/source/opt/canonicalize_ids_pass.h
new file mode 100644
index 0000000..6c38d34
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/canonicalize_ids_pass.h
@@ -0,0 +1,115 @@
+// Copyright (c) 2025 LunarG Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <algorithm>
+#include <map>
+#include <set>
+#include <vector>
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+// The canonicalize IDs pass is an optimization to improve compression of SPIR-V
+// binary files via entropy reduction. It transforms SPIR-V to SPIR-V, remapping
+// IDs. The resulting modules have an increased ID range (IDs are not as tightly
+// packed around zero), but will compress better when multiple modules are
+// compressed together, since the compressor's dictionary can find better cross
+// module commonality. Remapping is accomplished via canonicalization. Thus,
+// modules can be compressed one at a time with no loss of quality relative to
+// operating on many modules at once.
+
+// This pass should be run after most optimization passes except for
+// --strip-debug because this pass will use OpName to canonicalize IDs. i.e. Run
+// --strip-debug after this pass.
+
+// This is a port of remap utility in glslang. There are great deal of magic
+// numbers that are present throughout this code. The general goal is to replace
+// the IDs with a hash value such that the distribution of IDs is deterministic
+// and minimizes collisions. The magic numbers in the glslang version were
+// chosen semi-arbitrarily and have been preserved in this port in order to
+// maintain backward compatibility.
+
+class CanonicalizeIdsPass : public Pass {
+ public:
+ CanonicalizeIdsPass() = default;
+ virtual ~CanonicalizeIdsPass() = default;
+
+ Pass::Status Process() override;
+
+ const char* name() const override { return "canonicalize-ids"; }
+
+ private:
+ // Special values for IDs.
+ static constexpr spv::Id unmapped_{spv::Id(-10000)};
+ static constexpr spv::Id unused_{spv::Id(-10001)};
+
+ // Scans the module for IDs and sets them to unmapped_.
+ void ScanIds();
+
+ // Functions to compute new IDs.
+ void CanonicalizeTypeAndConst();
+ spv::Id HashTypeAndConst(
+ spv::Id const id) const; // Helper for CanonicalizeTypeAndConst.
+ void CanonicalizeNames();
+ void CanonicalizeFunctions();
+ spv::Id HashOpCode(Instruction const* const inst)
+ const; // Helper for CanonicalizeFunctions.
+ void CanonicalizeRemainders();
+
+ // Applies the new IDs.
+ bool ApplyMap();
+
+ // Methods to manage the bound field in header.
+ spv::Id GetBound() const; // All IDs must satisfy 0 < ID < bound.
+ void UpdateBound();
+
+ // Methods to map from old IDs to new IDs.
+ spv::Id GetNewId(spv::Id const old_id) const { return new_id_[old_id]; }
+ spv::Id SetNewId(spv::Id const old_id, spv::Id new_id);
+
+ // Methods to manage claimed IDs.
+ spv::Id ClaimNewId(spv::Id new_id);
+ bool IsNewIdClaimed(spv::Id const new_id) const {
+ return claimed_new_ids_.find(new_id) != claimed_new_ids_.end();
+ }
+
+ // Queries for old IDs.
+ bool IsOldIdUnmapped(spv::Id const old_id) const {
+ return GetNewId(old_id) == unmapped_;
+ }
+ bool IsOldIdUnused(spv::Id const old_id) const {
+ return GetNewId(old_id) == unused_;
+ }
+
+ // Container to map old IDs to new IDs. e.g. new_id_[old_id] = new_id
+ std::vector<spv::Id> new_id_;
+
+ // IDs from the new ID space that have been claimed (faster than searching
+ // through new_id_).
+ std::set<spv::Id> claimed_new_ids_;
+
+ // Helper functions for printing IDs (useful for debugging).
+ std::string IdAsString(spv::Id const id) const;
+ void PrintNewIds() const;
+
+ // Containers to track IDs we want to canonicalize.
+ std::vector<spv::Id> type_and_const_ids_;
+ std::map<std::string, spv::Id> name_ids_;
+ std::vector<spv::Id> function_ids_;
+};
+
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/const_folding_rules.cpp b/third_party/SPIRV-Tools/source/opt/const_folding_rules.cpp
index 17900af..a5d4cbe 100644
--- a/third_party/SPIRV-Tools/source/opt/const_folding_rules.cpp
+++ b/third_party/SPIRV-Tools/source/opt/const_folding_rules.cpp
@@ -21,59 +21,6 @@
namespace {
constexpr uint32_t kExtractCompositeIdInIdx = 0;
-// Returns the value obtained by extracting the |number_of_bits| least
-// significant bits from |value|, and sign-extending it to 64-bits.
-uint64_t SignExtendValue(uint64_t value, uint32_t number_of_bits) {
- if (number_of_bits == 64) return value;
-
- uint64_t mask_for_sign_bit = 1ull << (number_of_bits - 1);
- uint64_t mask_for_significant_bits = (mask_for_sign_bit << 1) - 1ull;
- if (value & mask_for_sign_bit) {
- // Set upper bits to 1
- value |= ~mask_for_significant_bits;
- } else {
- // Clear the upper bits
- value &= mask_for_significant_bits;
- }
- return value;
-}
-
-// Returns the value obtained by extracting the |number_of_bits| least
-// significant bits from |value|, and zero-extending it to 64-bits.
-uint64_t ZeroExtendValue(uint64_t value, uint32_t number_of_bits) {
- if (number_of_bits == 64) return value;
-
- uint64_t mask_for_first_bit_to_clear = 1ull << (number_of_bits);
- uint64_t mask_for_bits_to_keep = mask_for_first_bit_to_clear - 1;
- value &= mask_for_bits_to_keep;
- return value;
-}
-
-// Returns a constant whose value is `value` and type is `type`. This constant
-// will be generated by `const_mgr`. The type must be a scalar integer type.
-const analysis::Constant* GenerateIntegerConstant(
- const analysis::Integer* integer_type, uint64_t result,
- analysis::ConstantManager* const_mgr) {
- assert(integer_type != nullptr);
-
- std::vector<uint32_t> words;
- if (integer_type->width() == 64) {
- // In the 64-bit case, two words are needed to represent the value.
- words = {static_cast<uint32_t>(result),
- static_cast<uint32_t>(result >> 32)};
- } else {
- // In all other cases, only a single word is needed.
- assert(integer_type->width() <= 32);
- if (integer_type->IsSigned()) {
- result = SignExtendValue(result, integer_type->width());
- } else {
- result = ZeroExtendValue(result, integer_type->width());
- }
- words = {static_cast<uint32_t>(result)};
- }
- return const_mgr->GetConstant(integer_type, words);
-}
-
// Returns a constants with the value NaN of the given type. Only works for
// 32-bit and 64-bit float point types. Returns |nullptr| if an error occurs.
const analysis::Constant* GetNan(const analysis::Type* type,
@@ -1730,7 +1677,7 @@
uint64_t result = op(ia, ib);
const analysis::Constant* result_constant =
- GenerateIntegerConstant(integer_type, result, const_mgr);
+ const_mgr->GenerateIntegerConstant(integer_type, result);
return result_constant;
};
}
@@ -1745,7 +1692,7 @@
const analysis::Integer* integer_type = result_type->AsInteger();
assert(integer_type && "The result type of an SConvert");
int64_t value = a->GetSignExtendedValue();
- return GenerateIntegerConstant(integer_type, value, const_mgr);
+ return const_mgr->GenerateIntegerConstant(integer_type, value);
}
// A scalar folding rule that folds OpUConvert.
@@ -1762,8 +1709,8 @@
// If the operand was an unsigned value with less than 32-bit, it would have
// been sign extended earlier, and we need to clear those bits.
auto* operand_type = a->type()->AsInteger();
- value = ZeroExtendValue(value, operand_type->width());
- return GenerateIntegerConstant(integer_type, value, const_mgr);
+ value = utils::ClearHighBits(value, 64 - operand_type->width());
+ return const_mgr->GenerateIntegerConstant(integer_type, value);
}
} // namespace
diff --git a/third_party/SPIRV-Tools/source/opt/constants.cpp b/third_party/SPIRV-Tools/source/opt/constants.cpp
index 6eebbb5..7dc02de 100644
--- a/third_party/SPIRV-Tools/source/opt/constants.cpp
+++ b/third_party/SPIRV-Tools/source/opt/constants.cpp
@@ -525,6 +525,28 @@
return GetDefiningInstruction(c)->result_id();
}
+const Constant* ConstantManager::GenerateIntegerConstant(
+ const analysis::Integer* integer_type, uint64_t result) {
+ assert(integer_type != nullptr);
+
+ std::vector<uint32_t> words;
+ if (integer_type->width() == 64) {
+ // In the 64-bit case, two words are needed to represent the value.
+ words = {static_cast<uint32_t>(result),
+ static_cast<uint32_t>(result >> 32)};
+ } else {
+ // In all other cases, only a single word is needed.
+ assert(integer_type->width() <= 32);
+ if (integer_type->IsSigned()) {
+ result = utils::SignExtendValue(result, integer_type->width());
+ } else {
+ result = utils::ZeroExtendValue(result, integer_type->width());
+ }
+ words = {static_cast<uint32_t>(result)};
+ }
+ return GetConstant(integer_type, words);
+}
+
std::vector<const analysis::Constant*> Constant::GetVectorComponents(
analysis::ConstantManager* const_mgr) const {
std::vector<const analysis::Constant*> components;
diff --git a/third_party/SPIRV-Tools/source/opt/constants.h b/third_party/SPIRV-Tools/source/opt/constants.h
index ae8dc62..534afa6 100644
--- a/third_party/SPIRV-Tools/source/opt/constants.h
+++ b/third_party/SPIRV-Tools/source/opt/constants.h
@@ -671,6 +671,11 @@
// Returns the id of a OpConstantNull with type of |type|.
uint32_t GetNullConstId(const Type* type);
+ // Returns a constant whose value is `value` and type is `type`. This constant
+ // will be generated by `const_mgr`. The type must be a scalar integer type.
+ const Constant* GenerateIntegerConstant(const analysis::Integer* integer_type,
+ uint64_t result);
+
private:
// Creates a Constant instance with the given type and a vector of constant
// defining words. Returns a unique pointer to the created Constant instance
diff --git a/third_party/SPIRV-Tools/source/opt/convert_to_sampled_image_pass.cpp b/third_party/SPIRV-Tools/source/opt/convert_to_sampled_image_pass.cpp
index c82db41..d2da4d1 100644
--- a/third_party/SPIRV-Tools/source/opt/convert_to_sampled_image_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/convert_to_sampled_image_pass.cpp
@@ -329,12 +329,10 @@
if (sampled_image_type == nullptr) return false;
auto storage_class = GetStorageClass(*image_variable);
if (storage_class == spv::StorageClass::Max) return false;
- analysis::Pointer sampled_image_pointer(sampled_image_type, storage_class);
-
// Make sure |image_variable| is behind its type i.e., avoid the forward
// reference.
- uint32_t type_id =
- context()->get_type_mgr()->GetTypeInstruction(&sampled_image_pointer);
+ uint32_t type_id = context()->get_type_mgr()->FindPointerToType(
+ sampled_image_type_id, storage_class);
MoveInstructionNextToType(image_variable, type_id);
return true;
}
diff --git a/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.cpp b/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.cpp
index c2bea8a..3078a7c 100644
--- a/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.cpp
+++ b/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.cpp
@@ -28,6 +28,9 @@
constexpr uint32_t kCompositeExtractObjectInOperand = 0;
constexpr uint32_t kTypePointerStorageClassInIdx = 0;
constexpr uint32_t kTypePointerPointeeInIdx = 1;
+constexpr uint32_t kExtInstSetInIdx = 0;
+constexpr uint32_t kExtInstOpInIdx = 1;
+constexpr uint32_t kInterpolantInIdx = 2;
bool IsDebugDeclareOrValue(Instruction* di) {
auto dbg_opcode = di->GetCommonDebugOpcode();
@@ -74,28 +77,40 @@
for (auto var_inst = entry_bb->begin();
var_inst->opcode() == spv::Op::OpVariable; ++var_inst) {
- if (!IsPointerToArrayType(var_inst->type_id())) {
- continue;
- }
-
- // Find the only store to the entire memory location, if it exists.
- Instruction* store_inst = FindStoreInstruction(&*var_inst);
-
- if (!store_inst) {
- continue;
- }
-
- std::unique_ptr<MemoryObject> source_object =
- FindSourceObjectIfPossible(&*var_inst, store_inst);
-
- if (source_object != nullptr) {
- if (CanUpdateUses(&*var_inst, source_object->GetPointerTypeId(this))) {
- modified = true;
- PropagateObject(&*var_inst, source_object.get(), store_inst);
- }
- }
+ worklist_.push(&*var_inst);
}
}
+
+ while (!worklist_.empty()) {
+ Instruction* var_inst = worklist_.front();
+ worklist_.pop();
+
+ // Find the only store to the entire memory location, if it exists.
+ Instruction* store_inst = FindStoreInstruction(&*var_inst);
+
+ if (!store_inst) {
+ continue;
+ }
+
+ std::unique_ptr<MemoryObject> source_object =
+ FindSourceObjectIfPossible(&*var_inst, store_inst);
+
+ if (source_object == nullptr) {
+ continue;
+ }
+
+ if (!IsPointerToArrayType(var_inst->type_id()) &&
+ source_object->GetStorageClass() != spv::StorageClass::Input) {
+ continue;
+ }
+
+ if (CanUpdateUses(&*var_inst, source_object->GetPointerTypeId(this))) {
+ modified = true;
+
+ PropagateObject(&*var_inst, source_object.get(), store_inst);
+ }
+ }
+
return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange);
}
@@ -204,6 +219,10 @@
return true;
} else if (use->opcode() == spv::Op::OpEntryPoint) {
return true;
+ } else if (IsInterpolationInstruction(use)) {
+ return true;
+ } else if (use->IsCommonDebugInstr()) {
+ return true;
}
// Some other instruction. Be conservative.
return false;
@@ -225,16 +244,26 @@
// time to do the multiple traverses can add up. Consider collecting
// those loads and doing a single traversal.
return dominator_analysis->Dominates(store_inst, use);
+ } else if (IsInterpolationInstruction(use)) {
+ // GLSL InterpolateAt* instructions work similarly to loads
+ uint32_t interpolant = use->GetSingleWordInOperand(kInterpolantInIdx);
+ if (interpolant !=
+ store_inst->GetSingleWordInOperand(kStorePointerInOperand))
+ return false;
+ return dominator_analysis->Dominates(store_inst, use);
} else if (use->opcode() == spv::Op::OpAccessChain) {
return HasValidReferencesOnly(use, store_inst);
} else if (use->IsDecoration() || use->opcode() == spv::Op::OpName) {
return true;
} else if (use->opcode() == spv::Op::OpStore) {
- // If we are storing to part of the object it is not an candidate.
+ // If we are storing to part of the object it is not a candidate.
return ptr_inst->opcode() == spv::Op::OpVariable &&
store_inst->GetSingleWordInOperand(kStorePointerInOperand) ==
ptr_inst->result_id();
} else if (IsDebugDeclareOrValue(use)) {
+ // The store does not have to dominate debug instructions. We do not
+ // want debugging info to stop the transformation. It will be fixed
+ // up later.
return true;
}
// Some other instruction. Be conservative.
@@ -254,6 +283,7 @@
case spv::Op::OpCompositeConstruct:
return BuildMemoryObjectFromCompositeConstruct(result_inst);
case spv::Op::OpCopyObject:
+ case spv::Op::OpCopyLogical:
return GetSourceObjectIfAny(result_inst->GetSingleWordInOperand(0));
case spv::Op::OpCompositeInsert:
return BuildMemoryObjectFromInsert(result_inst);
@@ -489,6 +519,21 @@
return false;
}
+bool CopyPropagateArrays::IsInterpolationInstruction(Instruction* inst) {
+ if (inst->opcode() == spv::Op::OpExtInst &&
+ inst->GetSingleWordInOperand(kExtInstSetInIdx) ==
+ context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450()) {
+ uint32_t ext_inst = inst->GetSingleWordInOperand(kExtInstOpInIdx);
+ switch (ext_inst) {
+ case GLSLstd450InterpolateAtCentroid:
+ case GLSLstd450InterpolateAtOffset:
+ case GLSLstd450InterpolateAtSample:
+ return true;
+ }
+ }
+ return false;
+}
+
bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst,
uint32_t type_id) {
analysis::TypeManager* type_mgr = context()->get_type_mgr();
@@ -522,6 +567,11 @@
}
return true;
}
+ case spv::Op::OpExtInst:
+ if (IsInterpolationInstruction(use)) {
+ return true;
+ }
+ return false;
case spv::Op::OpAccessChain: {
analysis::Pointer* pointer_type = type->AsPointer();
const analysis::Type* pointee_type = pointer_type->pointee_type();
@@ -609,6 +659,22 @@
uint32_t index = pair.second;
if (use->IsCommonDebugInstr()) {
+ // It is possible that the debug instructions are not dominated by
+ // `new_ptr_inst`. If not, move the debug instruction to just after
+ // `new_ptr_inst`.
+ BasicBlock* store_block = context()->get_instr_block(new_ptr_inst);
+ if (store_block) {
+ Function* function = store_block->GetParent();
+ DominatorAnalysis* dominator_analysis =
+ context()->GetDominatorAnalysis(function);
+ if (!dominator_analysis->Dominates(new_ptr_inst, use)) {
+ assert(dominator_analysis->Dominates(use, new_ptr_inst));
+ use->InsertAfter(new_ptr_inst);
+ context()->set_instr_block(use,
+ context()->get_instr_block(new_ptr_inst));
+ }
+ }
+
switch (use->GetCommonDebugOpcode()) {
case CommonDebugInfoDebugDeclare: {
if (new_ptr_inst->opcode() == spv::Op::OpVariable ||
@@ -670,6 +736,18 @@
} else {
context()->AnalyzeUses(use);
}
+
+ AddUsesToWorklist(use);
+ } break;
+ case spv::Op::OpExtInst: {
+ if (IsInterpolationInstruction(use)) {
+ // Replace the actual use.
+ context()->ForgetUses(use);
+ use->SetOperand(index, {new_ptr_inst->result_id()});
+ context()->AnalyzeUses(use);
+ } else {
+ assert(false && "Don't know how to rewrite instruction");
+ }
} break;
case spv::Op::OpAccessChain: {
// Update the actual use.
@@ -751,6 +829,8 @@
uint32_t pointee_type_id =
pointer_type->GetSingleWordInOperand(kTypePointerPointeeInIdx);
uint32_t copy = GenerateCopy(original_ptr_inst, pointee_type_id, use);
+ assert(copy != 0 &&
+ "Should not be updating uses unless we know it can be done.");
context()->ForgetUses(use);
use->SetInOperand(index, {copy});
@@ -797,6 +877,22 @@
return id;
}
+void CopyPropagateArrays::AddUsesToWorklist(Instruction* inst) {
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+
+ def_use_mgr->ForEachUse(inst, [this](Instruction* use, uint32_t) {
+ if (use->opcode() == spv::Op::OpStore) {
+ uint32_t var_id;
+ Instruction* target_pointer = GetPtr(use, &var_id);
+ if (target_pointer->opcode() != spv::Op::OpVariable) {
+ return;
+ }
+
+ worklist_.push(target_pointer);
+ }
+ });
+}
+
void CopyPropagateArrays::MemoryObject::PushIndirection(
const std::vector<AccessChainEntry>& access_chain) {
access_chain_.insert(access_chain_.end(), access_chain.begin(),
@@ -820,9 +916,7 @@
iterator begin, iterator end)
: variable_inst_(var_inst) {
std::transform(begin, end, std::back_inserter(access_chain_),
- [](uint32_t id) {
- return AccessChainEntry{true, {id}};
- });
+ [](uint32_t id) { return AccessChainEntry{true, {id}}; });
}
std::vector<uint32_t> CopyPropagateArrays::MemoryObject::GetAccessIds() const {
diff --git a/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.h b/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.h
index c6ca7d2..bf4bfb5 100644
--- a/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.h
+++ b/third_party/SPIRV-Tools/source/opt/copy_prop_arrays.h
@@ -222,6 +222,10 @@
// Return true if |type_id| is a pointer type whose pointee type is an array.
bool IsPointerToArrayType(uint32_t type_id);
+ // Return true if |inst| is one of the InterpolateAt* GLSL.std.450 extended
+ // instructions.
+ bool IsInterpolationInstruction(Instruction* inst);
+
// Returns true if there are not stores using |ptr_inst| or something derived
// from it.
bool HasNoStores(Instruction* ptr_inst);
@@ -254,6 +258,14 @@
// same way the indexes are used in an |OpCompositeExtract| instruction.
uint32_t GetMemberTypeId(uint32_t id,
const std::vector<uint32_t>& access_chain) const;
+
+ // If the result of inst is stored to a variable, add that variable to the
+ // worklist.
+ void AddUsesToWorklist(Instruction* inst);
+
+ // OpVariable worklist. An instruction is added to this list if we would like
+ // to run copy propagation on it.
+ std::queue<Instruction*> worklist_;
};
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/debug_info_manager.cpp b/third_party/SPIRV-Tools/source/opt/debug_info_manager.cpp
index 1e614c6..cc309da 100644
--- a/third_party/SPIRV-Tools/source/opt/debug_info_manager.cpp
+++ b/third_party/SPIRV-Tools/source/opt/debug_info_manager.cpp
@@ -558,11 +558,11 @@
return false;
}
-bool DebugInfoManager::AddDebugValueForVariable(Instruction* scope_and_line,
+bool DebugInfoManager::AddDebugValueForVariable(Instruction* line,
uint32_t variable_id,
uint32_t value_id,
Instruction* insert_pos) {
- assert(scope_and_line != nullptr);
+ assert(line != nullptr);
auto dbg_decl_itr = var_id_to_dbg_decl_.find(variable_id);
if (dbg_decl_itr == var_id_to_dbg_decl_.end()) return false;
@@ -577,14 +577,15 @@
insert_before = insert_before->NextNode();
}
modified |= AddDebugValueForDecl(dbg_decl_or_val, value_id, insert_before,
- scope_and_line) != nullptr;
+ line) != nullptr;
}
return modified;
}
-Instruction* DebugInfoManager::AddDebugValueForDecl(
- Instruction* dbg_decl, uint32_t value_id, Instruction* insert_before,
- Instruction* scope_and_line) {
+Instruction* DebugInfoManager::AddDebugValueForDecl(Instruction* dbg_decl,
+ uint32_t value_id,
+ Instruction* insert_before,
+ Instruction* line) {
if (dbg_decl == nullptr || !IsDebugDeclare(dbg_decl)) return nullptr;
std::unique_ptr<Instruction> dbg_val(dbg_decl->Clone(context()));
@@ -593,7 +594,7 @@
dbg_val->SetOperand(kDebugDeclareOperandVariableIndex, {value_id});
dbg_val->SetOperand(kDebugValueOperandExpressionIndex,
{GetEmptyDebugExpression()->result_id()});
- dbg_val->UpdateDebugInfoFrom(scope_and_line);
+ dbg_val->UpdateDebugInfoFrom(dbg_decl, line);
auto* added_dbg_val = insert_before->InsertBefore(std::move(dbg_val));
AnalyzeDebugInst(added_dbg_val);
@@ -768,15 +769,29 @@
local_var->opcode() == spv::Op::OpFunctionParameter);
// Convert |dbg_global_var| to DebugLocalVariable
+ // All of the operands up to the scope operand are the same for the type
+ // instructions. The flag operand needs to move from operand
+ // kDebugGlobalVariableOperandFlagsIndex to
+ // kDebugLocalVariableOperandFlagsIndex. No other operands are needed to
+ // define the DebugLocalVariable.
+
+ // Modify the opcode.
dbg_global_var->SetInOperand(kExtInstInstructionInIdx,
{CommonDebugInfoDebugLocalVariable});
+
+ // Move the flags operand.
auto flags = dbg_global_var->GetSingleWordOperand(
kDebugGlobalVariableOperandFlagsIndex);
- for (uint32_t i = dbg_global_var->NumInOperands() - 1;
- i >= kDebugLocalVariableOperandFlagsIndex; --i) {
+ dbg_global_var->SetOperand(kDebugLocalVariableOperandFlagsIndex, {flags});
+
+ // Remove the extra operands. Starting at the end to avoid copying too much
+ // data.
+ for (uint32_t i = dbg_global_var->NumOperands() - 1;
+ i > kDebugLocalVariableOperandFlagsIndex; --i) {
dbg_global_var->RemoveOperand(i);
}
- dbg_global_var->SetOperand(kDebugLocalVariableOperandFlagsIndex, {flags});
+
+ // Update the def-use manager.
context()->ForgetUses(dbg_global_var);
context()->AnalyzeUses(dbg_global_var);
diff --git a/third_party/SPIRV-Tools/source/opt/debug_info_manager.h b/third_party/SPIRV-Tools/source/opt/debug_info_manager.h
index abb7b9a..631aedd 100644
--- a/third_party/SPIRV-Tools/source/opt/debug_info_manager.h
+++ b/third_party/SPIRV-Tools/source/opt/debug_info_manager.h
@@ -143,22 +143,21 @@
bool KillDebugDeclares(uint32_t variable_id);
// Generates a DebugValue instruction with value |value_id| for every local
- // variable that is in the scope of |scope_and_line| and whose memory is
- // |variable_id| and inserts it after the instruction |insert_pos|.
+ // variable that is in the scope of |line| and whose memory is |variable_id|
+ // and inserts it after the instruction |insert_pos|.
// Returns whether a DebugValue is added or not.
- bool AddDebugValueForVariable(Instruction* scope_and_line,
- uint32_t variable_id, uint32_t value_id,
- Instruction* insert_pos);
+ bool AddDebugValueForVariable(Instruction* line, uint32_t variable_id,
+ uint32_t value_id, Instruction* insert_pos);
// Creates a DebugValue for DebugDeclare |dbg_decl| and inserts it before
- // |insert_before|. The new DebugValue has the same line and scope as
- // |scope_and_line|, or no scope and line information if |scope_and_line|
- // is nullptr. The new DebugValue has the same operands as DebugDeclare
- // but it uses |value_id| for the value. Returns the created DebugValue,
+ // |insert_before|. The new DebugValue has the same line as |line} and the
+ // same scope as |dbg_decl|. The new DebugValue has the same operands as
+ // DebugDeclare but it uses |value_id| for the value. Returns the created
+ // DebugValue,
// or nullptr if fails to create one.
Instruction* AddDebugValueForDecl(Instruction* dbg_decl, uint32_t value_id,
Instruction* insert_before,
- Instruction* scope_and_line);
+ Instruction* line);
// Erases |instr| from data structures of this class.
void ClearDebugInfo(Instruction* instr);
diff --git a/third_party/SPIRV-Tools/source/opt/desc_sroa.cpp b/third_party/SPIRV-Tools/source/opt/desc_sroa.cpp
index 2c0f482..124a3d3 100644
--- a/third_party/SPIRV-Tools/source/opt/desc_sroa.cpp
+++ b/third_party/SPIRV-Tools/source/opt/desc_sroa.cpp
@@ -31,11 +31,14 @@
Pass::Status DescriptorScalarReplacement::Process() {
bool modified = false;
-
std::vector<Instruction*> vars_to_kill;
for (Instruction& var : context()->types_values()) {
- if (descsroautil::IsDescriptorArray(context(), &var)) {
+ bool is_candidate =
+ flatten_arrays_ && descsroautil::IsDescriptorArray(context(), &var);
+ is_candidate |= flatten_composites_ &&
+ descsroautil::IsDescriptorStruct(context(), &var);
+ if (is_candidate) {
modified = true;
if (!ReplaceCandidate(&var)) {
return Status::Failure;
diff --git a/third_party/SPIRV-Tools/source/opt/desc_sroa.h b/third_party/SPIRV-Tools/source/opt/desc_sroa.h
index 901be3e..d6af4df 100644
--- a/third_party/SPIRV-Tools/source/opt/desc_sroa.h
+++ b/third_party/SPIRV-Tools/source/opt/desc_sroa.h
@@ -32,9 +32,16 @@
// Documented in optimizer.hpp
class DescriptorScalarReplacement : public Pass {
public:
- DescriptorScalarReplacement() {}
+ DescriptorScalarReplacement(bool flatten_composites, bool flatten_arrays)
+ : flatten_composites_(flatten_composites),
+ flatten_arrays_(flatten_arrays) {}
- const char* name() const override { return "descriptor-scalar-replacement"; }
+ const char* name() const override {
+ if (flatten_composites_ && flatten_arrays_)
+ return "descriptor-scalar-replacement";
+ if (flatten_composites_) return "descriptor-compososite-scalar-replacement";
+ return "descriptor-array-scalar-replacement";
+ }
Status Process() override;
@@ -141,6 +148,9 @@
// array |var|. If the entry is |0|, then the variable has not been
// created yet.
std::map<Instruction*, std::vector<uint32_t>> replacement_variables_;
+
+ bool flatten_composites_;
+ bool flatten_arrays_;
};
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/desc_sroa_util.cpp b/third_party/SPIRV-Tools/source/opt/desc_sroa_util.cpp
index dba3de9..62d9476 100644
--- a/third_party/SPIRV-Tools/source/opt/desc_sroa_util.cpp
+++ b/third_party/SPIRV-Tools/source/opt/desc_sroa_util.cpp
@@ -29,41 +29,58 @@
return length_const->GetU32();
}
-} // namespace
+bool HasDescriptorDecorations(IRContext* context, Instruction* var) {
+ const auto& decoration_mgr = context->get_decoration_mgr();
+ return decoration_mgr->HasDecoration(
+ var->result_id(), uint32_t(spv::Decoration::DescriptorSet)) &&
+ decoration_mgr->HasDecoration(var->result_id(),
+ uint32_t(spv::Decoration::Binding));
+}
-namespace descsroautil {
-
-bool IsDescriptorArray(IRContext* context, Instruction* var) {
+Instruction* GetVariableType(IRContext* context, Instruction* var) {
if (var->opcode() != spv::Op::OpVariable) {
- return false;
+ return nullptr;
}
uint32_t ptr_type_id = var->type_id();
Instruction* ptr_type_inst = context->get_def_use_mgr()->GetDef(ptr_type_id);
if (ptr_type_inst->opcode() != spv::Op::OpTypePointer) {
- return false;
+ return nullptr;
}
uint32_t var_type_id = ptr_type_inst->GetSingleWordInOperand(1);
- Instruction* var_type_inst = context->get_def_use_mgr()->GetDef(var_type_id);
- if (var_type_inst->opcode() != spv::Op::OpTypeArray &&
- var_type_inst->opcode() != spv::Op::OpTypeStruct) {
- return false;
+ return context->get_def_use_mgr()->GetDef(var_type_id);
+}
+
+} // namespace
+
+namespace descsroautil {
+
+bool IsDescriptorArray(IRContext* context, Instruction* var) {
+ Instruction* var_type_inst = GetVariableType(context, var);
+ if (var_type_inst == nullptr) return false;
+ return var_type_inst->opcode() == spv::Op::OpTypeArray &&
+ HasDescriptorDecorations(context, var);
+}
+
+bool IsDescriptorStruct(IRContext* context, Instruction* var) {
+ Instruction* var_type_inst = GetVariableType(context, var);
+ if (var_type_inst == nullptr) return false;
+
+ while (var_type_inst->opcode() == spv::Op::OpTypeArray) {
+ var_type_inst = context->get_def_use_mgr()->GetDef(
+ var_type_inst->GetInOperand(0).AsId());
}
+ if (var_type_inst->opcode() != spv::Op::OpTypeStruct) return false;
+
// All structures with descriptor assignments must be replaced by variables,
// one for each of their members - with the exceptions of buffers.
if (IsTypeOfStructuredBuffer(context, var_type_inst)) {
return false;
}
- if (!context->get_decoration_mgr()->HasDecoration(
- var->result_id(), uint32_t(spv::Decoration::DescriptorSet))) {
- return false;
- }
-
- return context->get_decoration_mgr()->HasDecoration(
- var->result_id(), uint32_t(spv::Decoration::Binding));
+ return HasDescriptorDecorations(context, var);
}
bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type) {
diff --git a/third_party/SPIRV-Tools/source/opt/desc_sroa_util.h b/third_party/SPIRV-Tools/source/opt/desc_sroa_util.h
index 2f45c0c..0423356 100644
--- a/third_party/SPIRV-Tools/source/opt/desc_sroa_util.h
+++ b/third_party/SPIRV-Tools/source/opt/desc_sroa_util.h
@@ -27,6 +27,10 @@
// descriptor array.
bool IsDescriptorArray(IRContext* context, Instruction* var);
+// Returns true if |var| is an OpVariable instruction that represents a
+// struct containing descriptors.
+bool IsDescriptorStruct(IRContext* context, Instruction* var);
+
// Returns true if |type| is a type that could be used for a structured buffer
// as opposed to a type that would be used for a structure of resource
// descriptors.
diff --git a/third_party/SPIRV-Tools/source/opt/eliminate_dead_members_pass.cpp b/third_party/SPIRV-Tools/source/opt/eliminate_dead_members_pass.cpp
index 1c98502..170f270 100644
--- a/third_party/SPIRV-Tools/source/opt/eliminate_dead_members_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/eliminate_dead_members_pass.cpp
@@ -70,6 +70,11 @@
MarkPointeeTypeAsFullUsed(inst.type_id());
break;
}
+ } else if (inst.opcode() == spv::Op::OpTypePointer) {
+ uint32_t storage_class = inst.GetSingleWordInOperand(0);
+ if (storage_class == uint32_t(spv::StorageClass::PhysicalStorageBuffer)) {
+ MarkTypeAsFullyUsed(inst.GetSingleWordInOperand(1));
+ }
}
}
@@ -200,6 +205,9 @@
case spv::Op::OpTypeRuntimeArray:
case spv::Op::OpTypeVector:
case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
type_id = type_inst->GetSingleWordInOperand(0);
break;
default:
@@ -246,6 +254,9 @@
case spv::Op::OpTypeRuntimeArray:
case spv::Op::OpTypeVector:
case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
type_id = type_inst->GetSingleWordInOperand(0);
break;
default:
@@ -505,6 +516,9 @@
case spv::Op::OpTypeRuntimeArray:
case spv::Op::OpTypeVector:
case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
new_operands.emplace_back(inst->GetInOperand(i));
type_id = type_inst->GetSingleWordInOperand(0);
break;
@@ -578,6 +592,9 @@
case spv::Op::OpTypeRuntimeArray:
case spv::Op::OpTypeVector:
case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
type_id = type_inst->GetSingleWordInOperand(0);
break;
default:
@@ -639,6 +656,9 @@
case spv::Op::OpTypeRuntimeArray:
case spv::Op::OpTypeVector:
case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
type_id = type_inst->GetSingleWordInOperand(0);
break;
default:
diff --git a/third_party/SPIRV-Tools/source/opt/eliminate_dead_output_stores_pass.cpp b/third_party/SPIRV-Tools/source/opt/eliminate_dead_output_stores_pass.cpp
index 99711a1..e71032d 100644
--- a/third_party/SPIRV-Tools/source/opt/eliminate_dead_output_stores_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/eliminate_dead_output_stores_pass.cpp
@@ -92,16 +92,19 @@
});
// Compute offset and final type of reference. If no location found
// or any stored locations are live, return without removing stores.
- auto ptr_type = type_mgr->GetType(var->type_id())->AsPointer();
+
+ Instruction* ptr_type = get_def_use_mgr()->GetDef(var->type_id());
assert(ptr_type && "unexpected var type");
- auto var_type = ptr_type->pointee_type();
+ const uint32_t kPointerTypePointeeIdx = 1;
+ uint32_t var_type_id =
+ ptr_type->GetSingleWordInOperand(kPointerTypePointeeIdx);
uint32_t ref_loc = start_loc;
- auto curr_type = var_type;
if (ref->opcode() == spv::Op::OpAccessChain ||
ref->opcode() == spv::Op::OpInBoundsAccessChain) {
- live_mgr->AnalyzeAccessChainLoc(ref, &curr_type, &ref_loc, &no_loc,
- is_patch, /* input */ false);
+ var_type_id = live_mgr->AnalyzeAccessChainLoc(
+ ref, var_type_id, &ref_loc, &no_loc, is_patch, /* input */ false);
}
+ const analysis::Type* curr_type = type_mgr->GetType(var_type_id);
if (no_loc || AnyLocsAreLive(ref_loc, live_mgr->GetLocSize(curr_type)))
return;
// Kill all stores based on this reference
diff --git a/third_party/SPIRV-Tools/source/opt/feature_manager.cpp b/third_party/SPIRV-Tools/source/opt/feature_manager.cpp
index 5188370..2810739 100644
--- a/third_party/SPIRV-Tools/source/opt/feature_manager.cpp
+++ b/third_party/SPIRV-Tools/source/opt/feature_manager.cpp
@@ -16,7 +16,7 @@
#include <string>
-#include "source/enum_string_mapping.h"
+#include "source/table2.h"
namespace spvtools {
namespace opt {
@@ -54,11 +54,12 @@
capabilities_.insert(cap);
- spv_operand_desc desc = {};
- if (SPV_SUCCESS == grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
- uint32_t(cap), &desc)) {
+ const spvtools::OperandDesc* desc = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
+ uint32_t(cap), &desc)) {
for (auto capability :
- CapabilitySet(desc->numCapabilities, desc->capabilities)) {
+ CapabilitySet(static_cast<uint32_t>(desc->capabilities().size()),
+ desc->capabilities().data())) {
AddCapability(capability);
}
}
diff --git a/third_party/SPIRV-Tools/source/opt/fix_storage_class.cpp b/third_party/SPIRV-Tools/source/opt/fix_storage_class.cpp
index 564cd1b..608285e 100644
--- a/third_party/SPIRV-Tools/source/opt/fix_storage_class.cpp
+++ b/third_party/SPIRV-Tools/source/opt/fix_storage_class.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2019 Google LLC
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -99,6 +101,7 @@
case spv::Op::OpCopyMemorySized:
case spv::Op::OpVariable:
case spv::Op::OpBitcast:
+ case spv::Op::OpAllocateNodePayloadsAMDX:
// Nothing to change for these opcode. The result type is the same
// regardless of the storage class of the operand.
return false;
@@ -141,22 +144,26 @@
if (inst->type_id() == 0) {
return false;
}
- const analysis::Type* ret_type =
- context()->get_type_mgr()->GetType(inst->type_id());
- return ret_type->AsPointer() != nullptr;
+
+ Instruction* type_def = get_def_use_mgr()->GetDef(inst->type_id());
+ return type_def->opcode() == spv::Op::OpTypePointer;
}
bool FixStorageClass::IsPointerToStorageClass(Instruction* inst,
spv::StorageClass storage_class) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Type* pType = type_mgr->GetType(inst->type_id());
- const analysis::Pointer* result_type = pType->AsPointer();
-
- if (result_type == nullptr) {
+ if (inst->type_id() == 0) {
return false;
}
- return (result_type->storage_class() == storage_class);
+ Instruction* type_def = get_def_use_mgr()->GetDef(inst->type_id());
+ if (type_def->opcode() != spv::Op::OpTypePointer) {
+ return false;
+ }
+
+ const uint32_t kPointerTypeStorageClassIndex = 0;
+ spv::StorageClass pointer_storage_class = static_cast<spv::StorageClass>(
+ type_def->GetSingleWordInOperand(kPointerTypeStorageClassIndex));
+ return pointer_storage_class == storage_class;
}
bool FixStorageClass::ChangeResultType(Instruction* inst,
@@ -233,6 +240,9 @@
}
uint32_t copy_id = GenerateCopy(obj_inst, pointee_type_id, inst);
+ if (copy_id == 0) {
+ return false;
+ }
inst->SetInOperand(1, {copy_id});
context()->UpdateDefUse(inst);
}
@@ -301,17 +311,21 @@
break;
}
- Instruction* orig_type_inst = get_def_use_mgr()->GetDef(id);
- assert(orig_type_inst->opcode() == spv::Op::OpTypePointer);
- id = orig_type_inst->GetSingleWordInOperand(1);
+ Instruction* id_type_inst = get_def_use_mgr()->GetDef(id);
+ assert(id_type_inst->opcode() == spv::Op::OpTypePointer);
+ id = id_type_inst->GetSingleWordInOperand(1);
+ spv::StorageClass input_storage_class =
+ static_cast<spv::StorageClass>(id_type_inst->GetSingleWordInOperand(0));
for (uint32_t i = start_idx; i < inst->NumInOperands(); ++i) {
Instruction* type_inst = get_def_use_mgr()->GetDef(id);
switch (type_inst->opcode()) {
case spv::Op::OpTypeArray:
case spv::Op::OpTypeRuntimeArray:
+ case spv::Op::OpTypeNodePayloadArrayAMDX:
case spv::Op::OpTypeMatrix:
case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
id = type_inst->GetSingleWordInOperand(0);
break;
case spv::Op::OpTypeStruct: {
@@ -335,9 +349,19 @@
"Tried to extract from an object where it cannot be done.");
}
- return context()->get_type_mgr()->FindPointerToType(
- id, static_cast<spv::StorageClass>(
- orig_type_inst->GetSingleWordInOperand(0)));
+ Instruction* orig_type_inst = get_def_use_mgr()->GetDef(inst->type_id());
+ spv::StorageClass orig_storage_class =
+ static_cast<spv::StorageClass>(orig_type_inst->GetSingleWordInOperand(0));
+ assert(orig_type_inst->opcode() == spv::Op::OpTypePointer);
+ if (orig_type_inst->GetSingleWordInOperand(1) == id &&
+ input_storage_class == orig_storage_class) {
+ // The existing type is correct. Avoid the search for the type. Note that if
+ // there is a duplicate type, the search below could return a different type
+ // forcing more changes to the code than necessary.
+ return inst->type_id();
+ }
+
+ return context()->get_type_mgr()->FindPointerToType(id, input_storage_class);
}
// namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/fold.cpp b/third_party/SPIRV-Tools/source/opt/fold.cpp
index 942da68..cd070c7 100644
--- a/third_party/SPIRV-Tools/source/opt/fold.cpp
+++ b/third_party/SPIRV-Tools/source/opt/fold.cpp
@@ -50,7 +50,7 @@
if (s_operand == std::numeric_limits<int32_t>::min()) {
return s_operand;
}
- return -s_operand;
+ return static_cast<uint32_t>(-s_operand);
}
case spv::Op::OpNot:
return ~operand;
diff --git a/third_party/SPIRV-Tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/third_party/SPIRV-Tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
index c568027..ddfe59f 100644
--- a/third_party/SPIRV-Tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
@@ -247,18 +247,7 @@
// Truncate first_word if the |type| has width less than uint32.
if (bit_width < bits_per_word) {
- const uint32_t num_high_bits_to_mask = bits_per_word - bit_width;
- const bool is_negative_after_truncation =
- result_type_signed &&
- utils::IsBitAtPositionSet(first_word, bit_width - 1);
-
- if (is_negative_after_truncation) {
- // Truncate and sign-extend |first_word|. No padding words will be
- // added and |pad_value| can be left as-is.
- first_word = utils::SetHighBits(first_word, num_high_bits_to_mask);
- } else {
- first_word = utils::ClearHighBits(first_word, num_high_bits_to_mask);
- }
+ first_word = utils::SignExtendValue(first_word, bit_width);
}
utils::SmallVector<uint32_t, 2> words = {first_word};
diff --git a/third_party/SPIRV-Tools/source/opt/folding_rules.cpp b/third_party/SPIRV-Tools/source/opt/folding_rules.cpp
index 5c68e29..3f5f79a 100644
--- a/third_party/SPIRV-Tools/source/opt/folding_rules.cpp
+++ b/third_party/SPIRV-Tools/source/opt/folding_rules.cpp
@@ -77,7 +77,10 @@
// Returns the element width of |type|.
uint32_t ElementWidth(const analysis::Type* type) {
- if (const analysis::Vector* vec_type = type->AsVector()) {
+ if (const analysis::CooperativeVectorNV* coopvec_type =
+ type->AsCooperativeVectorNV()) {
+ return ElementWidth(coopvec_type->component_type());
+ } else if (const analysis::Vector* vec_type = type->AsVector()) {
return ElementWidth(vec_type->element_type());
} else if (const analysis::Float* float_type = type->AsFloat()) {
return float_type->width();
@@ -112,6 +115,12 @@
}
}
+// Returns true if `type` is a cooperative matrix.
+bool IsCooperativeMatrix(const analysis::Type* type) {
+ return type->kind() == analysis::Type::kCooperativeMatrixKHR ||
+ type->kind() == analysis::Type::kCooperativeMatrixNV;
+}
+
const analysis::Constant* ConstInput(
const std::vector<const analysis::Constant*>& constants) {
return constants[0] ? constants[0] : constants[1];
@@ -180,8 +189,14 @@
const analysis::Constant* ConvertWordsToNumericScalarOrVectorConstant(
analysis::ConstantManager* const_mgr, const std::vector<uint32_t>& words,
const analysis::Type* type) {
- if (type->AsInteger() || type->AsFloat())
- return const_mgr->GetConstant(type, words);
+ const spvtools::opt::analysis::Integer* int_type = type->AsInteger();
+
+ if (int_type && int_type->width() <= 32) {
+ assert(words.size() == 1);
+ return const_mgr->GenerateIntegerConstant(int_type, words[0]);
+ }
+
+ if (int_type || type->AsFloat()) return const_mgr->GetConstant(type, words);
if (const auto* vec_type = type->AsVector())
return const_mgr->GetNumericVectorConstantWithWords(vec_type, words);
return nullptr;
@@ -307,6 +322,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (!inst->IsFloatingPointFoldingAllowed()) return false;
uint32_t width = ElementWidth(type);
@@ -388,6 +408,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed())
return false;
@@ -400,36 +425,37 @@
if (width != 32 && width != 64) return false;
spv::Op opcode = op_inst->opcode();
- if (opcode == spv::Op::OpFMul || opcode == spv::Op::OpFDiv ||
- opcode == spv::Op::OpIMul || opcode == spv::Op::OpSDiv ||
- opcode == spv::Op::OpUDiv) {
- std::vector<const analysis::Constant*> op_constants =
- const_mgr->GetOperandConstants(op_inst);
- // Merge negate into mul or div if one operand is constant.
- if (op_constants[0] || op_constants[1]) {
- bool zero_is_variable = op_constants[0] == nullptr;
- const analysis::Constant* c = ConstInput(op_constants);
- uint32_t neg_id = NegateConstant(const_mgr, c);
- uint32_t non_const_id = zero_is_variable
- ? op_inst->GetSingleWordInOperand(0u)
- : op_inst->GetSingleWordInOperand(1u);
- // Change this instruction to a mul/div.
- inst->SetOpcode(op_inst->opcode());
- if (opcode == spv::Op::OpFDiv || opcode == spv::Op::OpUDiv ||
- opcode == spv::Op::OpSDiv) {
- uint32_t op0 = zero_is_variable ? non_const_id : neg_id;
- uint32_t op1 = zero_is_variable ? neg_id : non_const_id;
- inst->SetInOperands(
- {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}});
- } else {
- inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}},
- {SPV_OPERAND_TYPE_ID, {neg_id}}});
- }
- return true;
- }
+ if (opcode != spv::Op::OpFMul && opcode != spv::Op::OpFDiv &&
+ opcode != spv::Op::OpIMul && opcode != spv::Op::OpSDiv) {
+ return false;
}
- return false;
+ std::vector<const analysis::Constant*> op_constants =
+ const_mgr->GetOperandConstants(op_inst);
+ // Merge negate into mul or div if one operand is constant.
+ if (op_constants[0] == nullptr && op_constants[1] == nullptr) {
+ return false;
+ }
+
+ bool zero_is_variable = op_constants[0] == nullptr;
+ const analysis::Constant* c = ConstInput(op_constants);
+ uint32_t neg_id = NegateConstant(const_mgr, c);
+ uint32_t non_const_id = zero_is_variable
+ ? op_inst->GetSingleWordInOperand(0u)
+ : op_inst->GetSingleWordInOperand(1u);
+ // Change this instruction to a mul/div.
+ inst->SetOpcode(op_inst->opcode());
+ if (opcode == spv::Op::OpFDiv || opcode == spv::Op::OpUDiv ||
+ opcode == spv::Op::OpSDiv) {
+ uint32_t op0 = zero_is_variable ? non_const_id : neg_id;
+ uint32_t op1 = zero_is_variable ? neg_id : non_const_id;
+ inst->SetInOperands(
+ {{SPV_OPERAND_TYPE_ID, {op0}}, {SPV_OPERAND_TYPE_ID, {op1}}});
+ } else {
+ inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {non_const_id}},
+ {SPV_OPERAND_TYPE_ID, {neg_id}}});
+ }
+ return true;
};
}
@@ -449,6 +475,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed())
return false;
@@ -680,6 +711,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (HasFloatingPoint(type) && !inst->IsFloatingPointFoldingAllowed())
return false;
@@ -734,6 +770,11 @@
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (!inst->IsFloatingPointFoldingAllowed()) return false;
uint32_t width = ElementWidth(type);
@@ -807,6 +848,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -847,6 +893,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (!inst->IsFloatingPointFoldingAllowed()) return false;
uint32_t width = ElementWidth(type);
@@ -920,6 +971,11 @@
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
if (!inst->IsFloatingPointFoldingAllowed()) return false;
uint32_t width = ElementWidth(type);
@@ -1062,6 +1118,11 @@
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -1110,6 +1171,11 @@
inst->opcode() == spv::Op::OpIAdd);
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -1158,6 +1224,11 @@
inst->opcode() == spv::Op::OpIAdd);
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -1218,6 +1289,11 @@
inst->opcode() == spv::Op::OpISub);
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -1284,6 +1360,11 @@
inst->opcode() == spv::Op::OpISub);
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -1377,6 +1458,11 @@
inst->opcode() == spv::Op::OpIAdd);
const analysis::Type* type =
context->get_type_mgr()->GetType(inst->type_id());
+
+ if (IsCooperativeMatrix(type)) {
+ return false;
+ }
+
bool uses_float = HasFloatingPoint(type);
if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
@@ -1459,132 +1545,6 @@
};
}
-// Replaces |inst| inplace with an FMA instruction |(x*y)+a|.
-void ReplaceWithFma(Instruction* inst, uint32_t x, uint32_t y, uint32_t a) {
- uint32_t ext =
- inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
-
- if (ext == 0) {
- inst->context()->AddExtInstImport("GLSL.std.450");
- ext = inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
- assert(ext != 0 &&
- "Could not add the GLSL.std.450 extended instruction set");
- }
-
- std::vector<Operand> operands;
- operands.push_back({SPV_OPERAND_TYPE_ID, {ext}});
- operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}});
- operands.push_back({SPV_OPERAND_TYPE_ID, {x}});
- operands.push_back({SPV_OPERAND_TYPE_ID, {y}});
- operands.push_back({SPV_OPERAND_TYPE_ID, {a}});
-
- inst->SetOpcode(spv::Op::OpExtInst);
- inst->SetInOperands(std::move(operands));
-}
-
-// Folds a multiple and add into an Fma.
-//
-// Cases:
-// (x * y) + a = Fma x y a
-// a + (x * y) = Fma x y a
-bool MergeMulAddArithmetic(IRContext* context, Instruction* inst,
- const std::vector<const analysis::Constant*>&) {
- assert(inst->opcode() == spv::Op::OpFAdd);
-
- if (!inst->IsFloatingPointFoldingAllowed()) {
- return false;
- }
-
- analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
- for (int i = 0; i < 2; i++) {
- uint32_t op_id = inst->GetSingleWordInOperand(i);
- Instruction* op_inst = def_use_mgr->GetDef(op_id);
-
- if (op_inst->opcode() != spv::Op::OpFMul) {
- continue;
- }
-
- if (!op_inst->IsFloatingPointFoldingAllowed()) {
- continue;
- }
-
- uint32_t x = op_inst->GetSingleWordInOperand(0);
- uint32_t y = op_inst->GetSingleWordInOperand(1);
- uint32_t a = inst->GetSingleWordInOperand((i + 1) % 2);
- ReplaceWithFma(inst, x, y, a);
- return true;
- }
- return false;
-}
-
-// Replaces |sub| inplace with an FMA instruction |(x*y)+a| where |a| first gets
-// negated if |negate_addition| is true, otherwise |x| gets negated.
-void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y,
- uint32_t a, bool negate_addition) {
- uint32_t ext =
- sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
-
- if (ext == 0) {
- sub->context()->AddExtInstImport("GLSL.std.450");
- ext = sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
- assert(ext != 0 &&
- "Could not add the GLSL.std.450 extended instruction set");
- }
-
- InstructionBuilder ir_builder(
- sub->context(), sub,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
-
- Instruction* neg = ir_builder.AddUnaryOp(sub->type_id(), spv::Op::OpFNegate,
- negate_addition ? a : x);
- uint32_t neg_op = neg->result_id(); // -a : -x
-
- std::vector<Operand> operands;
- operands.push_back({SPV_OPERAND_TYPE_ID, {ext}});
- operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}});
- operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? x : neg_op}});
- operands.push_back({SPV_OPERAND_TYPE_ID, {y}});
- operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? neg_op : a}});
-
- sub->SetOpcode(spv::Op::OpExtInst);
- sub->SetInOperands(std::move(operands));
-}
-
-// Folds a multiply and subtract into an Fma and negation.
-//
-// Cases:
-// (x * y) - a = Fma x y -a
-// a - (x * y) = Fma -x y a
-bool MergeMulSubArithmetic(IRContext* context, Instruction* sub,
- const std::vector<const analysis::Constant*>&) {
- assert(sub->opcode() == spv::Op::OpFSub);
-
- if (!sub->IsFloatingPointFoldingAllowed()) {
- return false;
- }
-
- analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
- for (int i = 0; i < 2; i++) {
- uint32_t op_id = sub->GetSingleWordInOperand(i);
- Instruction* mul = def_use_mgr->GetDef(op_id);
-
- if (mul->opcode() != spv::Op::OpFMul) {
- continue;
- }
-
- if (!mul->IsFloatingPointFoldingAllowed()) {
- continue;
- }
-
- uint32_t x = mul->GetSingleWordInOperand(0);
- uint32_t y = mul->GetSingleWordInOperand(1);
- uint32_t a = sub->GetSingleWordInOperand((i + 1) % 2);
- ReplaceWithFmaAndNegate(sub, x, y, a, i == 0);
- return true;
- }
- return false;
-}
-
FoldingRule IntMultipleBy1() {
return [](IRContext*, Instruction* inst,
const std::vector<const analysis::Constant*>& constants) {
@@ -1733,27 +1693,26 @@
}
// Walks the indexes chain from |start| to |end| of an OpCompositeInsert or
-// OpCompositeExtract instruction, and returns the type of the final element
-// being accessed.
-const analysis::Type* GetElementType(uint32_t type_id,
- Instruction::iterator start,
- Instruction::iterator end,
- const analysis::TypeManager* type_mgr) {
- const analysis::Type* type = type_mgr->GetType(type_id);
+// OpCompositeExtract instruction, and returns the type id of the final element
+// being accessed. Returns 0 if a valid type could not be found.
+uint32_t GetElementType(uint32_t type_id, Instruction::iterator start,
+ Instruction::iterator end,
+ const analysis::DefUseManager* def_use_manager) {
for (auto index : make_range(std::move(start), std::move(end))) {
+ const Instruction* type_inst = def_use_manager->GetDef(type_id);
assert(index.type == SPV_OPERAND_TYPE_LITERAL_INTEGER &&
index.words.size() == 1);
- if (auto* array_type = type->AsArray()) {
- type = array_type->element_type();
- } else if (auto* matrix_type = type->AsMatrix()) {
- type = matrix_type->element_type();
- } else if (auto* struct_type = type->AsStruct()) {
- type = struct_type->element_types()[index.words[0]];
+ if (type_inst->opcode() == spv::Op::OpTypeArray) {
+ type_id = type_inst->GetSingleWordInOperand(0);
+ } else if (type_inst->opcode() == spv::Op::OpTypeMatrix) {
+ type_id = type_inst->GetSingleWordInOperand(0);
+ } else if (type_inst->opcode() == spv::Op::OpTypeStruct) {
+ type_id = type_inst->GetSingleWordInOperand(index.words[0]);
} else {
- type = nullptr;
+ return 0;
}
}
- return type;
+ return type_id;
}
// Returns true of |inst_1| and |inst_2| have the same indexes that will be used
@@ -1834,20 +1793,16 @@
return false;
}
}
+ assert(first_element_inst != nullptr);
// The last check it to see that the object being extracted from is the
// correct type.
Instruction* original_inst = def_use_mgr->GetDef(original_id);
- analysis::TypeManager* type_mgr = context->get_type_mgr();
- const analysis::Type* original_type =
+ uint32_t original_type_id =
GetElementType(original_inst->type_id(), first_element_inst->begin() + 3,
- first_element_inst->end() - 1, type_mgr);
+ first_element_inst->end() - 1, def_use_mgr);
- if (original_type == nullptr) {
- return false;
- }
-
- if (inst->type_id() != type_mgr->GetId(original_type)) {
+ if (inst->type_id() != original_type_id) {
return false;
}
@@ -2137,13 +2092,15 @@
return true;
}
-// Returns the type of the element that immediately contains the element being
-// inserted by the OpCompositeInsert instruction |inst|.
-const analysis::Type* GetContainerType(Instruction* inst) {
+// Returns id of the type of the element that immediately contains the element
+// being inserted by the OpCompositeInsert instruction |inst|. Returns 0 if it
+// could not be found.
+uint32_t GetContainerTypeId(Instruction* inst) {
assert(inst->opcode() == spv::Op::OpCompositeInsert);
- analysis::TypeManager* type_mgr = inst->context()->get_type_mgr();
- return GetElementType(inst->type_id(), inst->begin() + 4, inst->end() - 1,
- type_mgr);
+ analysis::DefUseManager* def_use_manager = inst->context()->get_def_use_mgr();
+ uint32_t container_type_id = GetElementType(
+ inst->type_id(), inst->begin() + 4, inst->end() - 1, def_use_manager);
+ return container_type_id;
}
// Returns an OpCompositeConstruct instruction that build an object with
@@ -2190,18 +2147,20 @@
if (inst->NumInOperands() < 3) return false;
std::map<uint32_t, uint32_t> values_inserted = GetInsertedValues(inst);
- const analysis::Type* container_type = GetContainerType(inst);
- if (container_type == nullptr) {
- return false;
- }
-
- if (!DoInsertedValuesCoverEntireObject(container_type, values_inserted)) {
+ uint32_t container_type_id = GetContainerTypeId(inst);
+ if (container_type_id == 0) {
return false;
}
analysis::TypeManager* type_mgr = context->get_type_mgr();
- Instruction* construct = BuildCompositeConstruct(
- type_mgr->GetId(container_type), values_inserted, inst);
+ const analysis::Type* container_type = type_mgr->GetType(container_type_id);
+ assert(container_type && "GetContainerTypeId returned a bad id.");
+ if (!DoInsertedValuesCoverEntireObject(container_type, values_inserted)) {
+ return false;
+ }
+
+ Instruction* construct =
+ BuildCompositeConstruct(container_type_id, values_inserted, inst);
InsertConstructedObject(inst, construct);
return true;
}
@@ -2495,14 +2454,31 @@
FloatConstantKind kind0 = getFloatConstantKind(constants[0]);
FloatConstantKind kind1 = getFloatConstantKind(constants[1]);
- if (kind0 == FloatConstantKind::Zero) {
+ if (kind0 == FloatConstantKind::Zero || kind1 == FloatConstantKind::One) {
inst->SetOpcode(spv::Op::OpCopyObject);
inst->SetInOperands(
{{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}});
return true;
}
- if (kind1 == FloatConstantKind::One) {
+ return false;
+ };
+}
+
+FoldingRule RedundantFMod() {
+ return [](IRContext*, Instruction* inst,
+ const std::vector<const analysis::Constant*>& constants) {
+ assert(inst->opcode() == spv::Op::OpFMod &&
+ "Wrong opcode. Should be OpFMod.");
+ assert(constants.size() == 2);
+
+ if (!inst->IsFloatingPointFoldingAllowed()) {
+ return false;
+ }
+
+ FloatConstantKind kind0 = getFloatConstantKind(constants[0]);
+
+ if (kind0 == FloatConstantKind::Zero) {
inst->SetOpcode(spv::Op::OpCopyObject);
inst->SetInOperands(
{{SPV_OPERAND_TYPE_ID, {inst->GetSingleWordInOperand(0)}}});
@@ -2548,24 +2524,18 @@
};
}
-// This rule handles addition of zero for integers.
-FoldingRule RedundantIAdd() {
- return [](IRContext* context, Instruction* inst,
- const std::vector<const analysis::Constant*>& constants) {
- assert(inst->opcode() == spv::Op::OpIAdd &&
- "Wrong opcode. Should be OpIAdd.");
+// Returns a folding rule that folds the instruction to operand |foldToArg|
+// (0 or 1) if operand |arg| (0 or 1) is a zero constant.
+FoldingRule RedundantBinaryOpWithZeroOperand(uint32_t arg, uint32_t foldToArg) {
+ return [arg, foldToArg](
+ IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>& constants) {
+ assert(constants.size() == 2);
- uint32_t operand = std::numeric_limits<uint32_t>::max();
- const analysis::Type* operand_type = nullptr;
- if (constants[0] && constants[0]->IsZero()) {
- operand = inst->GetSingleWordInOperand(1);
- operand_type = constants[0]->type();
- } else if (constants[1] && constants[1]->IsZero()) {
- operand = inst->GetSingleWordInOperand(0);
- operand_type = constants[1]->type();
- }
+ if (constants[arg] && constants[arg]->IsZero()) {
+ auto operand = inst->GetSingleWordInOperand(foldToArg);
+ auto operand_type = constants[arg]->type();
- if (operand != std::numeric_limits<uint32_t>::max()) {
const analysis::Type* inst_type =
context->get_type_mgr()->GetType(inst->type_id());
if (inst_type->IsSame(operand_type)) {
@@ -2580,6 +2550,117 @@
};
}
+// This rule handles any of RedundantBinaryRhs0Ops with a 0 or vector 0 on the
+// right-hand side (a | 0 => a).
+static const constexpr spv::Op RedundantBinaryRhs0Ops[] = {
+ spv::Op::OpBitwiseOr,
+ spv::Op::OpBitwiseXor,
+ spv::Op::OpShiftRightLogical,
+ spv::Op::OpShiftRightArithmetic,
+ spv::Op::OpShiftLeftLogical,
+ spv::Op::OpIAdd,
+ spv::Op::OpISub};
+FoldingRule RedundantBinaryRhs0(spv::Op op) {
+ assert(std::find(std::begin(RedundantBinaryRhs0Ops),
+ std::end(RedundantBinaryRhs0Ops),
+ op) != std::end(RedundantBinaryRhs0Ops) &&
+ "Wrong opcode.");
+ (void)op;
+ return RedundantBinaryOpWithZeroOperand(1, 0);
+}
+
+// This rule handles any of RedundantBinaryLhs0Ops with a 0 or vector 0 on the
+// left-hand side (0 | a => a).
+static const constexpr spv::Op RedundantBinaryLhs0Ops[] = {
+ spv::Op::OpBitwiseOr, spv::Op::OpBitwiseXor, spv::Op::OpIAdd};
+FoldingRule RedundantBinaryLhs0(spv::Op op) {
+ assert(std::find(std::begin(RedundantBinaryLhs0Ops),
+ std::end(RedundantBinaryLhs0Ops),
+ op) != std::end(RedundantBinaryLhs0Ops) &&
+ "Wrong opcode.");
+ (void)op;
+ return RedundantBinaryOpWithZeroOperand(0, 1);
+}
+
+// This rule handles shifts and divisions of 0 or vector 0 by any amount
+// (0 >> a => 0).
+static const constexpr spv::Op RedundantBinaryLhs0To0Ops[] = {
+ spv::Op::OpShiftRightLogical,
+ spv::Op::OpShiftRightArithmetic,
+ spv::Op::OpShiftLeftLogical,
+ spv::Op::OpSDiv,
+ spv::Op::OpUDiv,
+ spv::Op::OpSMod,
+ spv::Op::OpUMod};
+FoldingRule RedundantBinaryLhs0To0(spv::Op op) {
+ assert(std::find(std::begin(RedundantBinaryLhs0To0Ops),
+ std::end(RedundantBinaryLhs0To0Ops),
+ op) != std::end(RedundantBinaryLhs0To0Ops) &&
+ "Wrong opcode.");
+ (void)op;
+ return RedundantBinaryOpWithZeroOperand(0, 0);
+}
+
+// Returns true if all elements in |c| are 1.
+bool IsAllInt1(const analysis::Constant* c) {
+ if (auto composite = c->AsCompositeConstant()) {
+ auto& components = composite->GetComponents();
+ return std::all_of(std::begin(components), std::end(components), IsAllInt1);
+ } else if (c->AsIntConstant()) {
+ return c->GetSignExtendedValue() == 1;
+ }
+
+ return false;
+}
+
+// This rule handles divisions by 1 or vector 1 (a / 1 => a).
+FoldingRule RedundantSUDiv() {
+ return [](IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>& constants) {
+ assert(constants.size() == 2);
+ assert((inst->opcode() == spv::Op::OpUDiv ||
+ inst->opcode() == spv::Op::OpSDiv) &&
+ "Wrong opcode.");
+
+ if (constants[1] && IsAllInt1(constants[1])) {
+ auto operand = inst->GetSingleWordInOperand(0);
+ auto operand_type = constants[1]->type();
+
+ const analysis::Type* inst_type =
+ context->get_type_mgr()->GetType(inst->type_id());
+ if (inst_type->IsSame(operand_type)) {
+ inst->SetOpcode(spv::Op::OpCopyObject);
+ } else {
+ inst->SetOpcode(spv::Op::OpBitcast);
+ }
+ inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {operand}}});
+ return true;
+ }
+ return false;
+ };
+}
+
+// This rule handles modulo from division by 1 or vector 1 (a % 1 => 0).
+FoldingRule RedundantSUMod() {
+ return [](IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>& constants) {
+ assert(constants.size() == 2);
+ assert((inst->opcode() == spv::Op::OpUMod ||
+ inst->opcode() == spv::Op::OpSMod) &&
+ "Wrong opcode.");
+
+ if (constants[1] && IsAllInt1(constants[1])) {
+ auto type = context->get_type_mgr()->GetType(inst->type_id());
+ auto zero_id = context->get_constant_mgr()->GetNullConstId(type);
+
+ inst->SetOpcode(spv::Op::OpCopyObject);
+ inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {zero_id}}});
+ return true;
+ }
+ return false;
+ };
+}
+
// This rule look for a dot with a constant vector containing a single 1 and
// the rest 0s. This is the same as doing an extract.
FoldingRule DotProductDoingExtract() {
@@ -2917,6 +2998,17 @@
// Note that the order in which rules are added to the list matters. If a rule
// applies to the instruction, the rest of the rules will not be attempted.
// Take that into consideration.
+ for (auto op : RedundantBinaryRhs0Ops)
+ rules_[op].push_back(RedundantBinaryRhs0(op));
+ for (auto op : RedundantBinaryLhs0Ops)
+ rules_[op].push_back(RedundantBinaryLhs0(op));
+ for (auto op : RedundantBinaryLhs0To0Ops)
+ rules_[op].push_back(RedundantBinaryLhs0To0(op));
+ rules_[spv::Op::OpSDiv].push_back(RedundantSUDiv());
+ rules_[spv::Op::OpUDiv].push_back(RedundantSUDiv());
+ rules_[spv::Op::OpSMod].push_back(RedundantSUMod());
+ rules_[spv::Op::OpUMod].push_back(RedundantSUMod());
+
rules_[spv::Op::OpBitcast].push_back(BitCastScalarOrVector());
rules_[spv::Op::OpCompositeConstruct].push_back(
@@ -2941,7 +3033,6 @@
rules_[spv::Op::OpFAdd].push_back(MergeAddSubArithmetic());
rules_[spv::Op::OpFAdd].push_back(MergeGenericAddSubArithmetic());
rules_[spv::Op::OpFAdd].push_back(FactorAddMuls());
- rules_[spv::Op::OpFAdd].push_back(MergeMulAddArithmetic);
rules_[spv::Op::OpFDiv].push_back(RedundantFDiv());
rules_[spv::Op::OpFDiv].push_back(ReciprocalFDiv());
@@ -2949,6 +3040,8 @@
rules_[spv::Op::OpFDiv].push_back(MergeDivMulArithmetic());
rules_[spv::Op::OpFDiv].push_back(MergeDivNegateArithmetic());
+ rules_[spv::Op::OpFMod].push_back(RedundantFMod());
+
rules_[spv::Op::OpFMul].push_back(RedundantFMul());
rules_[spv::Op::OpFMul].push_back(MergeMulMulArithmetic());
rules_[spv::Op::OpFMul].push_back(MergeMulDivArithmetic());
@@ -2962,9 +3055,7 @@
rules_[spv::Op::OpFSub].push_back(MergeSubNegateArithmetic());
rules_[spv::Op::OpFSub].push_back(MergeSubAddArithmetic());
rules_[spv::Op::OpFSub].push_back(MergeSubSubArithmetic());
- rules_[spv::Op::OpFSub].push_back(MergeMulSubArithmetic);
- rules_[spv::Op::OpIAdd].push_back(RedundantIAdd());
rules_[spv::Op::OpIAdd].push_back(MergeAddNegateArithmetic());
rules_[spv::Op::OpIAdd].push_back(MergeAddAddArithmetic());
rules_[spv::Op::OpIAdd].push_back(MergeAddSubArithmetic());
diff --git a/third_party/SPIRV-Tools/source/opt/function.h b/third_party/SPIRV-Tools/source/opt/function.h
index 8c0472c..45a0b23 100644
--- a/third_party/SPIRV-Tools/source/opt/function.h
+++ b/third_party/SPIRV-Tools/source/opt/function.h
@@ -17,6 +17,7 @@
#include <algorithm>
#include <functional>
+#include <iterator>
#include <memory>
#include <string>
#include <unordered_set>
@@ -39,6 +40,7 @@
public:
using iterator = UptrVectorIterator<BasicBlock>;
using const_iterator = UptrVectorIterator<BasicBlock, true>;
+ using ParamList = std::vector<std::unique_ptr<Instruction>>;
// Creates a function instance declared by the given OpFunction instruction
// |def_inst|.
@@ -77,6 +79,23 @@
// Does nothing if the function doesn't have such a parameter.
inline void RemoveParameter(uint32_t id);
+ // Rewrites the function parameters by calling a replacer callback.
+ // The replacer takes two parameters: an expiring unique pointer to a current
+ // instruction, and a back-inserter into a new list of unique pointers to
+ // instructions. The replacer is called for each current parameter, in order.
+ // Not valid to call while also iterating through the parameter list, e.g.
+ // within the ForEachParam method.
+ using RewriteParamFn = std::function<void(
+ std::unique_ptr<Instruction>&&, std::back_insert_iterator<ParamList>&)>;
+ void RewriteParams(RewriteParamFn& replacer) {
+ ParamList new_params;
+ auto appender = std::back_inserter(new_params);
+ for (auto& param : params_) {
+ replacer(std::move(param), appender);
+ }
+ params_ = std::move(new_params);
+ }
+
// Saves the given function end instruction.
inline void SetFunctionEnd(std::unique_ptr<Instruction> end_inst);
@@ -197,7 +216,7 @@
// The OpFunction instruction that begins the definition of this function.
std::unique_ptr<Instruction> def_inst_;
// All parameters to this function.
- std::vector<std::unique_ptr<Instruction>> params_;
+ ParamList params_;
// All debug instructions in this function's header.
InstructionList debug_insts_in_header_;
// All basic blocks inside this function in specification order
diff --git a/third_party/SPIRV-Tools/source/opt/inline_exhaustive_pass.cpp b/third_party/SPIRV-Tools/source/opt/inline_exhaustive_pass.cpp
index bef4501..9cdea43 100644
--- a/third_party/SPIRV-Tools/source/opt/inline_exhaustive_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/inline_exhaustive_pass.cpp
@@ -55,6 +55,11 @@
}
}
}
+
+ if (modified) {
+ FixDebugDeclares(func);
+ }
+
return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange);
}
diff --git a/third_party/SPIRV-Tools/source/opt/inline_pass.cpp b/third_party/SPIRV-Tools/source/opt/inline_pass.cpp
index 3186433..193e276 100644
--- a/third_party/SPIRV-Tools/source/opt/inline_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/inline_pass.cpp
@@ -30,6 +30,8 @@
constexpr int kSpvFunctionCallFunctionId = 2;
constexpr int kSpvFunctionCallArgumentId = 3;
constexpr int kSpvReturnValueId = 0;
+constexpr int kSpvDebugDeclareVarInIdx = 3;
+constexpr int kSpvAccessChainBaseInIdx = 0;
} // namespace
uint32_t InlinePass::AddPointerToType(uint32_t type_id,
@@ -858,5 +860,68 @@
InlinePass::InlinePass() {}
+void InlinePass::FixDebugDeclares(Function* func) {
+ std::map<uint32_t, Instruction*> access_chains;
+ std::vector<Instruction*> debug_declare_insts;
+
+ func->ForEachInst([&access_chains, &debug_declare_insts](Instruction* inst) {
+ if (inst->opcode() == spv::Op::OpAccessChain) {
+ access_chains[inst->result_id()] = inst;
+ }
+ if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugDeclare) {
+ debug_declare_insts.push_back(inst);
+ }
+ });
+
+ for (auto& inst : debug_declare_insts) {
+ FixDebugDeclare(inst, access_chains);
+ }
+}
+
+void InlinePass::FixDebugDeclare(
+ Instruction* dbg_declare_inst,
+ const std::map<uint32_t, Instruction*>& access_chains) {
+ do {
+ uint32_t var_id =
+ dbg_declare_inst->GetSingleWordInOperand(kSpvDebugDeclareVarInIdx);
+
+ // The def-use chains are not kept up to date while inlining, so we need to
+ // get the variable by traversing the functions.
+ auto it = access_chains.find(var_id);
+ if (it == access_chains.end()) {
+ return;
+ }
+ Instruction* access_chain = it->second;
+
+ // If the variable id in the debug declare is an access chain, it is
+ // invalid. it needs to be fixed up. The debug declare will be updated so
+ // that its Var operand becomes the base of the access chain. The indexes of
+ // the access chain are prepended before the indexes of the debug declare.
+
+ std::vector<Operand> operands;
+ for (int i = 0; i < kSpvDebugDeclareVarInIdx; i++) {
+ operands.push_back(dbg_declare_inst->GetInOperand(i));
+ }
+
+ uint32_t access_chain_base =
+ access_chain->GetSingleWordInOperand(kSpvAccessChainBaseInIdx);
+ operands.push_back(Operand(SPV_OPERAND_TYPE_ID, {access_chain_base}));
+ operands.push_back(
+ dbg_declare_inst->GetInOperand(kSpvDebugDeclareVarInIdx + 1));
+
+ for (uint32_t i = kSpvAccessChainBaseInIdx + 1;
+ i < access_chain->NumInOperands(); ++i) {
+ operands.push_back(access_chain->GetInOperand(i));
+ }
+
+ for (uint32_t i = kSpvDebugDeclareVarInIdx + 2;
+ i < dbg_declare_inst->NumInOperands(); ++i) {
+ operands.push_back(dbg_declare_inst->GetInOperand(i));
+ }
+
+ dbg_declare_inst->SetInOperands(std::move(operands));
+ } while (true);
+}
+
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/inline_pass.h b/third_party/SPIRV-Tools/source/opt/inline_pass.h
index 1c9d60e..7bea31d 100644
--- a/third_party/SPIRV-Tools/source/opt/inline_pass.h
+++ b/third_party/SPIRV-Tools/source/opt/inline_pass.h
@@ -150,6 +150,12 @@
// Initialize state for optimization of |module|
void InitializeInline();
+ // Fixes invalid debug declare functions in `func` that were caused by
+ // inlining. This function cannot be called while in the middle of inlining
+ // because it needs to be able to find the instructions that define an
+ // id.
+ void FixDebugDeclares(Function* func);
+
// Map from function's result id to function.
std::unordered_map<uint32_t, Function*> id2function_;
@@ -241,6 +247,11 @@
// structural dominance.
void UpdateSingleBlockLoopContinueTarget(
uint32_t new_id, std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
+
+ // Replaces the `var` operand of `dbg_declare_inst` and updates the indexes
+ // accordingly, if it is the id of an access chain in `access_chains`.
+ void FixDebugDeclare(Instruction* dbg_declare_inst,
+ const std::map<uint32_t, Instruction*>& access_chains);
};
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/inst_bindless_check_pass.cpp b/third_party/SPIRV-Tools/source/opt/inst_bindless_check_pass.cpp
deleted file mode 100644
index 8e7d4f8..0000000
--- a/third_party/SPIRV-Tools/source/opt/inst_bindless_check_pass.cpp
+++ /dev/null
@@ -1,761 +0,0 @@
-// Copyright (c) 2018 The Khronos Group Inc.
-// Copyright (c) 2018 Valve Corporation
-// Copyright (c) 2018 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "inst_bindless_check_pass.h"
-
-#include "source/spirv_constant.h"
-
-namespace spvtools {
-namespace opt {
-namespace {
-// Input Operand Indices
-constexpr int kSpvImageSampleImageIdInIdx = 0;
-constexpr int kSpvSampledImageImageIdInIdx = 0;
-constexpr int kSpvSampledImageSamplerIdInIdx = 1;
-constexpr int kSpvImageSampledImageIdInIdx = 0;
-constexpr int kSpvCopyObjectOperandIdInIdx = 0;
-constexpr int kSpvLoadPtrIdInIdx = 0;
-constexpr int kSpvAccessChainBaseIdInIdx = 0;
-constexpr int kSpvAccessChainIndex0IdInIdx = 1;
-constexpr int kSpvTypeArrayTypeIdInIdx = 0;
-constexpr int kSpvVariableStorageClassInIdx = 0;
-constexpr int kSpvTypePtrTypeIdInIdx = 1;
-constexpr int kSpvTypeImageDim = 1;
-constexpr int kSpvTypeImageDepth = 2;
-constexpr int kSpvTypeImageArrayed = 3;
-constexpr int kSpvTypeImageMS = 4;
-} // namespace
-
-// This is a stub function for use with Import linkage
-// clang-format off
-// GLSL:
-//bool inst_bindless_check_desc(const uint shader_id, const uint inst_num, const uvec4 stage_info, const uint desc_set,
-// const uint binding, const uint desc_index, const uint byte_offset) {
-//}
-// clang-format on
-uint32_t InstBindlessCheckPass::GenDescCheckFunctionId() {
- enum {
- kShaderId = 0,
- kInstructionIndex = 1,
- kStageInfo = 2,
- kDescSet = 3,
- kDescBinding = 4,
- kDescIndex = 5,
- kByteOffset = 6,
- kNumArgs
- };
- if (check_desc_func_id_ != 0) {
- return check_desc_func_id_;
- }
-
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- const analysis::Integer* uint_type = GetInteger(32, false);
- const analysis::Vector v4uint(uint_type, 4);
- const analysis::Type* v4uint_type = type_mgr->GetRegisteredType(&v4uint);
- std::vector<const analysis::Type*> param_types(kNumArgs, uint_type);
- param_types[2] = v4uint_type;
-
- const uint32_t func_id = TakeNextId();
- std::unique_ptr<Function> func =
- StartFunction(func_id, type_mgr->GetBoolType(), param_types);
-
- func->SetFunctionEnd(EndFunction());
-
- static const std::string func_name{"inst_bindless_check_desc"};
- context()->AddFunctionDeclaration(std::move(func));
- context()->AddDebug2Inst(NewName(func_id, func_name));
- std::vector<Operand> operands{
- {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {func_id}},
- {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER,
- {uint32_t(spv::Decoration::LinkageAttributes)}},
- {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_STRING,
- utils::MakeVector(func_name.c_str())},
- {spv_operand_type_t::SPV_OPERAND_TYPE_LINKAGE_TYPE,
- {uint32_t(spv::LinkageType::Import)}},
- };
- get_decoration_mgr()->AddDecoration(spv::Op::OpDecorate, operands);
-
- check_desc_func_id_ = func_id;
- // Make sure function doesn't get processed by
- // InstrumentPass::InstProcessCallTreeFromRoots()
- param2output_func_id_[3] = func_id;
- return check_desc_func_id_;
-}
-
-// clang-format off
-// GLSL:
-// result = inst_bindless_check_desc(shader_id, inst_idx, stage_info, desc_set, binding, desc_idx, offset);
-//
-// clang-format on
-uint32_t InstBindlessCheckPass::GenDescCheckCall(
- uint32_t inst_idx, uint32_t stage_idx, uint32_t var_id,
- uint32_t desc_idx_id, uint32_t offset_id, InstructionBuilder* builder) {
- const uint32_t func_id = GenDescCheckFunctionId();
- const std::vector<uint32_t> args = {
- builder->GetUintConstantId(shader_id_),
- builder->GetUintConstantId(inst_idx),
- GenStageInfo(stage_idx, builder),
- builder->GetUintConstantId(var2desc_set_[var_id]),
- builder->GetUintConstantId(var2binding_[var_id]),
- GenUintCastCode(desc_idx_id, builder),
- offset_id};
- return GenReadFunctionCall(GetBoolId(), func_id, args, builder);
-}
-
-uint32_t InstBindlessCheckPass::CloneOriginalImage(
- uint32_t old_image_id, InstructionBuilder* builder) {
- Instruction* new_image_inst;
- Instruction* old_image_inst = get_def_use_mgr()->GetDef(old_image_id);
- if (old_image_inst->opcode() == spv::Op::OpLoad) {
- new_image_inst = builder->AddLoad(
- old_image_inst->type_id(),
- old_image_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx));
- } else if (old_image_inst->opcode() == spv::Op::OpSampledImage) {
- uint32_t clone_id = CloneOriginalImage(
- old_image_inst->GetSingleWordInOperand(kSpvSampledImageImageIdInIdx),
- builder);
- new_image_inst = builder->AddBinaryOp(
- old_image_inst->type_id(), spv::Op::OpSampledImage, clone_id,
- old_image_inst->GetSingleWordInOperand(kSpvSampledImageSamplerIdInIdx));
- } else if (old_image_inst->opcode() == spv::Op::OpImage) {
- uint32_t clone_id = CloneOriginalImage(
- old_image_inst->GetSingleWordInOperand(kSpvImageSampledImageIdInIdx),
- builder);
- new_image_inst = builder->AddUnaryOp(old_image_inst->type_id(),
- spv::Op::OpImage, clone_id);
- } else {
- assert(old_image_inst->opcode() == spv::Op::OpCopyObject &&
- "expecting OpCopyObject");
- uint32_t clone_id = CloneOriginalImage(
- old_image_inst->GetSingleWordInOperand(kSpvCopyObjectOperandIdInIdx),
- builder);
- // Since we are cloning, no need to create new copy
- new_image_inst = get_def_use_mgr()->GetDef(clone_id);
- }
- uid2offset_[new_image_inst->unique_id()] =
- uid2offset_[old_image_inst->unique_id()];
- uint32_t new_image_id = new_image_inst->result_id();
- get_decoration_mgr()->CloneDecorations(old_image_id, new_image_id);
- return new_image_id;
-}
-
-uint32_t InstBindlessCheckPass::CloneOriginalReference(
- RefAnalysis* ref, InstructionBuilder* builder) {
- // If original is image based, start by cloning descriptor load
- uint32_t new_image_id = 0;
- if (ref->desc_load_id != 0) {
- uint32_t old_image_id =
- ref->ref_inst->GetSingleWordInOperand(kSpvImageSampleImageIdInIdx);
- new_image_id = CloneOriginalImage(old_image_id, builder);
- }
- // Clone original reference
- std::unique_ptr<Instruction> new_ref_inst(ref->ref_inst->Clone(context()));
- uint32_t ref_result_id = ref->ref_inst->result_id();
- uint32_t new_ref_id = 0;
- if (ref_result_id != 0) {
- new_ref_id = TakeNextId();
- new_ref_inst->SetResultId(new_ref_id);
- }
- // Update new ref with new image if created
- if (new_image_id != 0)
- new_ref_inst->SetInOperand(kSpvImageSampleImageIdInIdx, {new_image_id});
- // Register new reference and add to new block
- Instruction* added_inst = builder->AddInstruction(std::move(new_ref_inst));
- uid2offset_[added_inst->unique_id()] =
- uid2offset_[ref->ref_inst->unique_id()];
- if (new_ref_id != 0)
- get_decoration_mgr()->CloneDecorations(ref_result_id, new_ref_id);
- return new_ref_id;
-}
-
-uint32_t InstBindlessCheckPass::GetImageId(Instruction* inst) {
- switch (inst->opcode()) {
- 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::OpImageGather:
- case spv::Op::OpImageDrefGather:
- case spv::Op::OpImageQueryLod:
- 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::OpImageSparseGather:
- case spv::Op::OpImageSparseDrefGather:
- case spv::Op::OpImageFetch:
- case spv::Op::OpImageRead:
- case spv::Op::OpImageQueryFormat:
- case spv::Op::OpImageQueryOrder:
- case spv::Op::OpImageQuerySizeLod:
- case spv::Op::OpImageQuerySize:
- case spv::Op::OpImageQueryLevels:
- case spv::Op::OpImageQuerySamples:
- case spv::Op::OpImageSparseFetch:
- case spv::Op::OpImageSparseRead:
- case spv::Op::OpImageWrite:
- return inst->GetSingleWordInOperand(kSpvImageSampleImageIdInIdx);
- default:
- break;
- }
- return 0;
-}
-
-Instruction* InstBindlessCheckPass::GetPointeeTypeInst(Instruction* ptr_inst) {
- uint32_t pte_ty_id = GetPointeeTypeId(ptr_inst);
- return get_def_use_mgr()->GetDef(pte_ty_id);
-}
-
-bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst,
- RefAnalysis* ref) {
- ref->ref_inst = ref_inst;
- if (ref_inst->opcode() == spv::Op::OpLoad ||
- ref_inst->opcode() == spv::Op::OpStore) {
- ref->desc_load_id = 0;
- ref->ptr_id = ref_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx);
- Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref->ptr_id);
- if (ptr_inst->opcode() != spv::Op::OpAccessChain) return false;
- ref->var_id = ptr_inst->GetSingleWordInOperand(kSpvAccessChainBaseIdInIdx);
- Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id);
- if (var_inst->opcode() != spv::Op::OpVariable) return false;
- spv::StorageClass storage_class = spv::StorageClass(
- var_inst->GetSingleWordInOperand(kSpvVariableStorageClassInIdx));
- switch (storage_class) {
- case spv::StorageClass::Uniform:
- case spv::StorageClass::StorageBuffer:
- break;
- default:
- return false;
- break;
- }
- // Check for deprecated storage block form
- if (storage_class == spv::StorageClass::Uniform) {
- uint32_t var_ty_id = var_inst->type_id();
- Instruction* var_ty_inst = get_def_use_mgr()->GetDef(var_ty_id);
- uint32_t ptr_ty_id =
- var_ty_inst->GetSingleWordInOperand(kSpvTypePtrTypeIdInIdx);
- Instruction* ptr_ty_inst = get_def_use_mgr()->GetDef(ptr_ty_id);
- spv::Op ptr_ty_op = ptr_ty_inst->opcode();
- uint32_t block_ty_id =
- (ptr_ty_op == spv::Op::OpTypeArray ||
- ptr_ty_op == spv::Op::OpTypeRuntimeArray)
- ? ptr_ty_inst->GetSingleWordInOperand(kSpvTypeArrayTypeIdInIdx)
- : ptr_ty_id;
- assert(get_def_use_mgr()->GetDef(block_ty_id)->opcode() ==
- spv::Op::OpTypeStruct &&
- "unexpected block type");
- bool block_found = get_decoration_mgr()->FindDecoration(
- block_ty_id, uint32_t(spv::Decoration::Block),
- [](const Instruction&) { return true; });
- if (!block_found) {
- // If block decoration not found, verify deprecated form of SSBO
- bool buffer_block_found = get_decoration_mgr()->FindDecoration(
- block_ty_id, uint32_t(spv::Decoration::BufferBlock),
- [](const Instruction&) { return true; });
- USE_ASSERT(buffer_block_found && "block decoration not found");
- storage_class = spv::StorageClass::StorageBuffer;
- }
- }
- ref->strg_class = uint32_t(storage_class);
- Instruction* desc_type_inst = GetPointeeTypeInst(var_inst);
- switch (desc_type_inst->opcode()) {
- case spv::Op::OpTypeArray:
- case spv::Op::OpTypeRuntimeArray:
- // A load through a descriptor array will have at least 3 operands. We
- // do not want to instrument loads of descriptors here which are part of
- // an image-based reference.
- if (ptr_inst->NumInOperands() < 3) return false;
- ref->desc_idx_id =
- ptr_inst->GetSingleWordInOperand(kSpvAccessChainIndex0IdInIdx);
- break;
- default:
- break;
- }
- auto decos =
- context()->get_decoration_mgr()->GetDecorationsFor(ref->var_id, false);
- for (const auto& deco : decos) {
- spv::Decoration d = spv::Decoration(deco->GetSingleWordInOperand(1u));
- if (d == spv::Decoration::DescriptorSet) {
- ref->set = deco->GetSingleWordInOperand(2u);
- } else if (d == spv::Decoration::Binding) {
- ref->binding = deco->GetSingleWordInOperand(2u);
- }
- }
- return true;
- }
- // Reference is not load or store. If not an image-based reference, return.
- ref->image_id = GetImageId(ref_inst);
- if (ref->image_id == 0) return false;
- // Search for descriptor load
- uint32_t desc_load_id = ref->image_id;
- Instruction* desc_load_inst;
- for (;;) {
- desc_load_inst = get_def_use_mgr()->GetDef(desc_load_id);
- if (desc_load_inst->opcode() == spv::Op::OpSampledImage)
- desc_load_id =
- desc_load_inst->GetSingleWordInOperand(kSpvSampledImageImageIdInIdx);
- else if (desc_load_inst->opcode() == spv::Op::OpImage)
- desc_load_id =
- desc_load_inst->GetSingleWordInOperand(kSpvImageSampledImageIdInIdx);
- else if (desc_load_inst->opcode() == spv::Op::OpCopyObject)
- desc_load_id =
- desc_load_inst->GetSingleWordInOperand(kSpvCopyObjectOperandIdInIdx);
- else
- break;
- }
- if (desc_load_inst->opcode() != spv::Op::OpLoad) {
- // TODO(greg-lunarg): Handle additional possibilities?
- return false;
- }
- ref->desc_load_id = desc_load_id;
- ref->ptr_id = desc_load_inst->GetSingleWordInOperand(kSpvLoadPtrIdInIdx);
- Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref->ptr_id);
- if (ptr_inst->opcode() == spv::Op::OpVariable) {
- ref->desc_idx_id = 0;
- ref->var_id = ref->ptr_id;
- } else if (ptr_inst->opcode() == spv::Op::OpAccessChain) {
- if (ptr_inst->NumInOperands() != 2) {
- assert(false && "unexpected bindless index number");
- return false;
- }
- ref->desc_idx_id =
- ptr_inst->GetSingleWordInOperand(kSpvAccessChainIndex0IdInIdx);
- ref->var_id = ptr_inst->GetSingleWordInOperand(kSpvAccessChainBaseIdInIdx);
- Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id);
- if (var_inst->opcode() != spv::Op::OpVariable) {
- assert(false && "unexpected bindless base");
- return false;
- }
- } else {
- // TODO(greg-lunarg): Handle additional possibilities?
- return false;
- }
- auto decos =
- context()->get_decoration_mgr()->GetDecorationsFor(ref->var_id, false);
- for (const auto& deco : decos) {
- spv::Decoration d = spv::Decoration(deco->GetSingleWordInOperand(1u));
- if (d == spv::Decoration::DescriptorSet) {
- ref->set = deco->GetSingleWordInOperand(2u);
- } else if (d == spv::Decoration::Binding) {
- ref->binding = deco->GetSingleWordInOperand(2u);
- }
- }
- return true;
-}
-
-uint32_t InstBindlessCheckPass::FindStride(uint32_t ty_id,
- uint32_t stride_deco) {
- uint32_t stride = 0xdeadbeef;
- bool found = get_decoration_mgr()->FindDecoration(
- ty_id, stride_deco, [&stride](const Instruction& deco_inst) {
- stride = deco_inst.GetSingleWordInOperand(2u);
- return true;
- });
- USE_ASSERT(found && "stride not found");
- return stride;
-}
-
-uint32_t InstBindlessCheckPass::ByteSize(uint32_t ty_id, uint32_t matrix_stride,
- bool col_major, bool in_matrix) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- const analysis::Type* sz_ty = type_mgr->GetType(ty_id);
- if (sz_ty->kind() == analysis::Type::kPointer) {
- // Assuming PhysicalStorageBuffer pointer
- return 8;
- }
- if (sz_ty->kind() == analysis::Type::kMatrix) {
- assert(matrix_stride != 0 && "missing matrix stride");
- const analysis::Matrix* m_ty = sz_ty->AsMatrix();
- if (col_major) {
- return m_ty->element_count() * matrix_stride;
- } else {
- const analysis::Vector* v_ty = m_ty->element_type()->AsVector();
- return v_ty->element_count() * matrix_stride;
- }
- }
- uint32_t size = 1;
- if (sz_ty->kind() == analysis::Type::kVector) {
- const analysis::Vector* v_ty = sz_ty->AsVector();
- size = v_ty->element_count();
- const analysis::Type* comp_ty = v_ty->element_type();
- // if vector in row major matrix, the vector is strided so return the
- // number of bytes spanned by the vector
- if (in_matrix && !col_major && matrix_stride > 0) {
- uint32_t comp_ty_id = type_mgr->GetId(comp_ty);
- return (size - 1) * matrix_stride + ByteSize(comp_ty_id, 0, false, false);
- }
- sz_ty = comp_ty;
- }
- switch (sz_ty->kind()) {
- case analysis::Type::kFloat: {
- const analysis::Float* f_ty = sz_ty->AsFloat();
- size *= f_ty->width();
- } break;
- case analysis::Type::kInteger: {
- const analysis::Integer* i_ty = sz_ty->AsInteger();
- size *= i_ty->width();
- } break;
- default: { assert(false && "unexpected type"); } break;
- }
- size /= 8;
- return size;
-}
-
-uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref,
- InstructionBuilder* builder) {
- // Find outermost buffer type and its access chain index
- Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id);
- Instruction* desc_ty_inst = GetPointeeTypeInst(var_inst);
- uint32_t buff_ty_id;
- uint32_t ac_in_idx = 1;
- switch (desc_ty_inst->opcode()) {
- case spv::Op::OpTypeArray:
- case spv::Op::OpTypeRuntimeArray:
- buff_ty_id = desc_ty_inst->GetSingleWordInOperand(0);
- ++ac_in_idx;
- break;
- default:
- assert(desc_ty_inst->opcode() == spv::Op::OpTypeStruct &&
- "unexpected descriptor type");
- buff_ty_id = desc_ty_inst->result_id();
- break;
- }
- // Process remaining access chain indices
- Instruction* ac_inst = get_def_use_mgr()->GetDef(ref->ptr_id);
- uint32_t curr_ty_id = buff_ty_id;
- uint32_t sum_id = 0u;
- uint32_t matrix_stride = 0u;
- bool col_major = false;
- uint32_t matrix_stride_id = 0u;
- bool in_matrix = false;
- while (ac_in_idx < ac_inst->NumInOperands()) {
- uint32_t curr_idx_id = ac_inst->GetSingleWordInOperand(ac_in_idx);
- Instruction* curr_ty_inst = get_def_use_mgr()->GetDef(curr_ty_id);
- uint32_t curr_offset_id = 0;
- switch (curr_ty_inst->opcode()) {
- case spv::Op::OpTypeArray:
- case spv::Op::OpTypeRuntimeArray: {
- // Get array stride and multiply by current index
- uint32_t arr_stride =
- FindStride(curr_ty_id, uint32_t(spv::Decoration::ArrayStride));
- uint32_t arr_stride_id = builder->GetUintConstantId(arr_stride);
- uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder);
- Instruction* curr_offset_inst = builder->AddBinaryOp(
- GetUintId(), spv::Op::OpIMul, arr_stride_id, curr_idx_32b_id);
- curr_offset_id = curr_offset_inst->result_id();
- // Get element type for next step
- curr_ty_id = curr_ty_inst->GetSingleWordInOperand(0);
- } break;
- case spv::Op::OpTypeMatrix: {
- assert(matrix_stride != 0 && "missing matrix stride");
- matrix_stride_id = builder->GetUintConstantId(matrix_stride);
- uint32_t vec_ty_id = curr_ty_inst->GetSingleWordInOperand(0);
- // If column major, multiply column index by matrix stride, otherwise
- // by vector component size and save matrix stride for vector (row)
- // index
- uint32_t col_stride_id;
- if (col_major) {
- col_stride_id = matrix_stride_id;
- } else {
- Instruction* vec_ty_inst = get_def_use_mgr()->GetDef(vec_ty_id);
- uint32_t comp_ty_id = vec_ty_inst->GetSingleWordInOperand(0u);
- uint32_t col_stride = ByteSize(comp_ty_id, 0u, false, false);
- col_stride_id = builder->GetUintConstantId(col_stride);
- }
- uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder);
- Instruction* curr_offset_inst = builder->AddBinaryOp(
- GetUintId(), spv::Op::OpIMul, col_stride_id, curr_idx_32b_id);
- curr_offset_id = curr_offset_inst->result_id();
- // Get element type for next step
- curr_ty_id = vec_ty_id;
- in_matrix = true;
- } break;
- case spv::Op::OpTypeVector: {
- // If inside a row major matrix type, multiply index by matrix stride,
- // else multiply by component size
- uint32_t comp_ty_id = curr_ty_inst->GetSingleWordInOperand(0u);
- uint32_t curr_idx_32b_id = Gen32BitCvtCode(curr_idx_id, builder);
- if (in_matrix && !col_major) {
- Instruction* curr_offset_inst = builder->AddBinaryOp(
- GetUintId(), spv::Op::OpIMul, matrix_stride_id, curr_idx_32b_id);
- curr_offset_id = curr_offset_inst->result_id();
- } else {
- uint32_t comp_ty_sz = ByteSize(comp_ty_id, 0u, false, false);
- uint32_t comp_ty_sz_id = builder->GetUintConstantId(comp_ty_sz);
- Instruction* curr_offset_inst = builder->AddBinaryOp(
- GetUintId(), spv::Op::OpIMul, comp_ty_sz_id, curr_idx_32b_id);
- curr_offset_id = curr_offset_inst->result_id();
- }
- // Get element type for next step
- curr_ty_id = comp_ty_id;
- } break;
- case spv::Op::OpTypeStruct: {
- // Get buffer byte offset for the referenced member
- Instruction* curr_idx_inst = get_def_use_mgr()->GetDef(curr_idx_id);
- assert(curr_idx_inst->opcode() == spv::Op::OpConstant &&
- "unexpected struct index");
- uint32_t member_idx = curr_idx_inst->GetSingleWordInOperand(0);
- uint32_t member_offset = 0xdeadbeef;
- bool found = get_decoration_mgr()->FindDecoration(
- curr_ty_id, uint32_t(spv::Decoration::Offset),
- [&member_idx, &member_offset](const Instruction& deco_inst) {
- if (deco_inst.GetSingleWordInOperand(1u) != member_idx)
- return false;
- member_offset = deco_inst.GetSingleWordInOperand(3u);
- return true;
- });
- USE_ASSERT(found && "member offset not found");
- curr_offset_id = builder->GetUintConstantId(member_offset);
- // Look for matrix stride for this member if there is one. The matrix
- // stride is not on the matrix type, but in a OpMemberDecorate on the
- // enclosing struct type at the member index. If none found, reset
- // stride to 0.
- found = get_decoration_mgr()->FindDecoration(
- curr_ty_id, uint32_t(spv::Decoration::MatrixStride),
- [&member_idx, &matrix_stride](const Instruction& deco_inst) {
- if (deco_inst.GetSingleWordInOperand(1u) != member_idx)
- return false;
- matrix_stride = deco_inst.GetSingleWordInOperand(3u);
- return true;
- });
- if (!found) matrix_stride = 0;
- // Look for column major decoration
- found = get_decoration_mgr()->FindDecoration(
- curr_ty_id, uint32_t(spv::Decoration::ColMajor),
- [&member_idx, &col_major](const Instruction& deco_inst) {
- if (deco_inst.GetSingleWordInOperand(1u) != member_idx)
- return false;
- col_major = true;
- return true;
- });
- if (!found) col_major = false;
- // Get element type for next step
- curr_ty_id = curr_ty_inst->GetSingleWordInOperand(member_idx);
- } break;
- default: { assert(false && "unexpected non-composite type"); } break;
- }
- if (sum_id == 0)
- sum_id = curr_offset_id;
- else {
- Instruction* sum_inst =
- builder->AddIAdd(GetUintId(), sum_id, curr_offset_id);
- sum_id = sum_inst->result_id();
- }
- ++ac_in_idx;
- }
- // Add in offset of last byte of referenced object
- uint32_t bsize = ByteSize(curr_ty_id, matrix_stride, col_major, in_matrix);
- uint32_t last = bsize - 1;
- uint32_t last_id = builder->GetUintConstantId(last);
- Instruction* sum_inst = builder->AddIAdd(GetUintId(), sum_id, last_id);
- return sum_inst->result_id();
-}
-
-void InstBindlessCheckPass::GenCheckCode(
- uint32_t check_id, RefAnalysis* ref,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- BasicBlock* back_blk_ptr = &*new_blocks->back();
- InstructionBuilder builder(
- context(), back_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- // Gen conditional branch on check_id. Valid branch generates original
- // reference. Invalid generates debug output and zero result (if needed).
- uint32_t merge_blk_id = TakeNextId();
- uint32_t valid_blk_id = TakeNextId();
- uint32_t invalid_blk_id = TakeNextId();
- std::unique_ptr<Instruction> merge_label(NewLabel(merge_blk_id));
- std::unique_ptr<Instruction> valid_label(NewLabel(valid_blk_id));
- std::unique_ptr<Instruction> invalid_label(NewLabel(invalid_blk_id));
- (void)builder.AddConditionalBranch(
- check_id, valid_blk_id, invalid_blk_id, merge_blk_id,
- uint32_t(spv::SelectionControlMask::MaskNone));
- // Gen valid bounds branch
- std::unique_ptr<BasicBlock> new_blk_ptr(
- new BasicBlock(std::move(valid_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
- uint32_t new_ref_id = CloneOriginalReference(ref, &builder);
- uint32_t null_id = 0;
- uint32_t ref_type_id = ref->ref_inst->type_id();
- (void)builder.AddBranch(merge_blk_id);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Gen invalid block
- new_blk_ptr.reset(new BasicBlock(std::move(invalid_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
-
- // Generate a ConstantNull, converting to uint64 if the type cannot be a null.
- if (new_ref_id != 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Type* ref_type = type_mgr->GetType(ref_type_id);
- if (ref_type->AsPointer() != nullptr) {
- context()->AddCapability(spv::Capability::Int64);
- uint32_t null_u64_id = GetNullId(GetUint64Id());
- Instruction* null_ptr_inst = builder.AddUnaryOp(
- ref_type_id, spv::Op::OpConvertUToPtr, null_u64_id);
- null_id = null_ptr_inst->result_id();
- } else {
- null_id = GetNullId(ref_type_id);
- }
- }
- // Remember last invalid block id
- uint32_t last_invalid_blk_id = new_blk_ptr->GetLabelInst()->result_id();
- // Gen zero for invalid reference
- (void)builder.AddBranch(merge_blk_id);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Gen merge block
- new_blk_ptr.reset(new BasicBlock(std::move(merge_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
- // Gen phi of new reference and zero, if necessary, and replace the
- // result id of the original reference with that of the Phi. Kill original
- // reference.
- if (new_ref_id != 0) {
- Instruction* phi_inst = builder.AddPhi(
- ref_type_id, {new_ref_id, valid_blk_id, null_id, last_invalid_blk_id});
- context()->ReplaceAllUsesWith(ref->ref_inst->result_id(),
- phi_inst->result_id());
- }
- new_blocks->push_back(std::move(new_blk_ptr));
- context()->KillInst(ref->ref_inst);
-}
-
-void InstBindlessCheckPass::GenDescCheckCode(
- BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr, uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- // Look for reference through descriptor. If not, return.
- RefAnalysis ref;
- if (!AnalyzeDescriptorReference(&*ref_inst_itr, &ref)) return;
- std::unique_ptr<BasicBlock> new_blk_ptr;
- // Move original block's preceding instructions into first new block
- MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr);
- InstructionBuilder builder(
- context(), &*new_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Determine if we can only do initialization check
- uint32_t ref_id = builder.GetUintConstantId(0u);
- spv::Op op = ref.ref_inst->opcode();
- if (ref.desc_load_id != 0) {
- uint32_t num_in_oprnds = ref.ref_inst->NumInOperands();
- if ((op == spv::Op::OpImageRead && num_in_oprnds == 2) ||
- (op == spv::Op::OpImageFetch && num_in_oprnds == 2) ||
- (op == spv::Op::OpImageWrite && num_in_oprnds == 3)) {
- Instruction* image_inst = get_def_use_mgr()->GetDef(ref.image_id);
- uint32_t image_ty_id = image_inst->type_id();
- Instruction* image_ty_inst = get_def_use_mgr()->GetDef(image_ty_id);
- if (spv::Dim(image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDim)) ==
- spv::Dim::Buffer) {
- if ((image_ty_inst->GetSingleWordInOperand(kSpvTypeImageDepth) == 0) &&
- (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageArrayed) ==
- 0) &&
- (image_ty_inst->GetSingleWordInOperand(kSpvTypeImageMS) == 0)) {
- ref_id = GenUintCastCode(ref.ref_inst->GetSingleWordInOperand(1),
- &builder);
- }
- }
- }
- } else {
- // For now, only do bounds check for non-aggregate types. Otherwise
- // just do descriptor initialization check.
- // TODO(greg-lunarg): Do bounds check for aggregate loads and stores
- Instruction* ref_ptr_inst = get_def_use_mgr()->GetDef(ref.ptr_id);
- Instruction* pte_type_inst = GetPointeeTypeInst(ref_ptr_inst);
- spv::Op pte_type_op = pte_type_inst->opcode();
- if (pte_type_op != spv::Op::OpTypeArray &&
- pte_type_op != spv::Op::OpTypeRuntimeArray &&
- pte_type_op != spv::Op::OpTypeStruct) {
- ref_id = GenLastByteIdx(&ref, &builder);
- }
- }
- // Read initialization/bounds from debug input buffer. If index id not yet
- // set, binding is single descriptor, so set index to constant 0.
- if (ref.desc_idx_id == 0) ref.desc_idx_id = builder.GetUintConstantId(0u);
- uint32_t check_id =
- GenDescCheckCall(ref.ref_inst->unique_id(), stage_idx, ref.var_id,
- ref.desc_idx_id, ref_id, &builder);
-
- // Generate runtime initialization/bounds test code with true branch
- // being full reference and false branch being zero
- // for the referenced value.
- GenCheckCode(check_id, &ref, new_blocks);
-
- // Move original block's remaining code into remainder/merge block and add
- // to new blocks
- BasicBlock* back_blk_ptr = &*new_blocks->back();
- MovePostludeCode(ref_block_itr, back_blk_ptr);
-}
-
-void InstBindlessCheckPass::InitializeInstBindlessCheck() {
- // Initialize base class
- InitializeInstrument();
- for (auto& anno : get_module()->annotations()) {
- if (anno.opcode() == spv::Op::OpDecorate) {
- if (spv::Decoration(anno.GetSingleWordInOperand(1u)) ==
- spv::Decoration::DescriptorSet) {
- var2desc_set_[anno.GetSingleWordInOperand(0u)] =
- anno.GetSingleWordInOperand(2u);
- } else if (spv::Decoration(anno.GetSingleWordInOperand(1u)) ==
- spv::Decoration::Binding) {
- var2binding_[anno.GetSingleWordInOperand(0u)] =
- anno.GetSingleWordInOperand(2u);
- }
- }
- }
-}
-
-Pass::Status InstBindlessCheckPass::ProcessImpl() {
- // The memory model and linkage must always be updated for spirv-link to work
- // correctly.
- AddStorageBufferExt();
- if (!get_feature_mgr()->HasExtension(kSPV_KHR_physical_storage_buffer)) {
- context()->AddExtension("SPV_KHR_physical_storage_buffer");
- }
-
- context()->AddCapability(spv::Capability::PhysicalStorageBufferAddresses);
- Instruction* memory_model = get_module()->GetMemoryModel();
- memory_model->SetInOperand(
- 0u, {uint32_t(spv::AddressingModel::PhysicalStorageBuffer64)});
-
- context()->AddCapability(spv::Capability::Linkage);
-
- InstProcessFunction pfn =
- [this](BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr, uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- return GenDescCheckCode(ref_inst_itr, ref_block_itr, stage_idx,
- new_blocks);
- };
-
- InstProcessEntryPointCallTree(pfn);
- // This pass always changes the memory model, so that linking will work
- // properly.
- return Status::SuccessWithChange;
-}
-
-Pass::Status InstBindlessCheckPass::Process() {
- InitializeInstBindlessCheck();
- return ProcessImpl();
-}
-
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/inst_bindless_check_pass.h b/third_party/SPIRV-Tools/source/opt/inst_bindless_check_pass.h
deleted file mode 100644
index 243cba7..0000000
--- a/third_party/SPIRV-Tools/source/opt/inst_bindless_check_pass.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2018 The Khronos Group Inc.
-// Copyright (c) 2018 Valve Corporation
-// Copyright (c) 2018 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef LIBSPIRV_OPT_INST_BINDLESS_CHECK_PASS_H_
-#define LIBSPIRV_OPT_INST_BINDLESS_CHECK_PASS_H_
-
-#include "instrument_pass.h"
-
-namespace spvtools {
-namespace opt {
-
-// This class/pass is designed to support the bindless (descriptor indexing)
-// GPU-assisted validation layer of
-// https://github.com/KhronosGroup/Vulkan-ValidationLayers. Its internal and
-// external design may change as the layer evolves.
-class InstBindlessCheckPass : public InstrumentPass {
- public:
- InstBindlessCheckPass(uint32_t shader_id)
- : InstrumentPass(0, shader_id, true, true) {}
-
- ~InstBindlessCheckPass() override = default;
-
- // See optimizer.hpp for pass user documentation.
- Status Process() override;
-
- const char* name() const override { return "inst-bindless-check-pass"; }
-
- private:
- void GenDescCheckCode(BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr,
- uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- uint32_t GenDescCheckFunctionId();
-
- uint32_t GenDescCheckCall(uint32_t inst_idx, uint32_t stage_idx,
- uint32_t var_id, uint32_t index_id,
- uint32_t byte_offset, InstructionBuilder* builder);
-
- // Analysis data for descriptor reference components, generated by
- // AnalyzeDescriptorReference. It is necessary and sufficient for further
- // analysis and regeneration of the reference.
- typedef struct RefAnalysis {
- uint32_t desc_load_id{0};
- uint32_t image_id{0};
- uint32_t load_id{0};
- uint32_t ptr_id{0};
- uint32_t var_id{0};
- uint32_t set{0};
- uint32_t binding{0};
- uint32_t desc_idx_id{0};
- uint32_t strg_class{0};
- Instruction* ref_inst{nullptr};
- } RefAnalysis;
-
- // Return size of type |ty_id| in bytes. Use |matrix_stride| and |col_major|
- // for matrix type, or for vector type if vector is |in_matrix|.
- uint32_t ByteSize(uint32_t ty_id, uint32_t matrix_stride, bool col_major,
- bool in_matrix);
-
- // Return stride of type |ty_id| with decoration |stride_deco|. Return 0
- // if not found
- uint32_t FindStride(uint32_t ty_id, uint32_t stride_deco);
-
- // Generate index of last byte referenced by buffer reference |ref|
- uint32_t GenLastByteIdx(RefAnalysis* ref, InstructionBuilder* builder);
-
- // Clone original image computation starting at |image_id| into |builder|.
- // This may generate more than one instruction if necessary.
- uint32_t CloneOriginalImage(uint32_t image_id, InstructionBuilder* builder);
-
- // Clone original original reference encapsulated by |ref| into |builder|.
- // This may generate more than one instruction if necessary.
- uint32_t CloneOriginalReference(RefAnalysis* ref,
- InstructionBuilder* builder);
-
- // If |inst| references through an image, return the id of the image it
- // references through. Else return 0.
- uint32_t GetImageId(Instruction* inst);
-
- // Get pointee type inst of pointer value |ptr_inst|.
- Instruction* GetPointeeTypeInst(Instruction* ptr_inst);
-
- // Analyze descriptor reference |ref_inst| and save components into |ref|.
- // Return true if |ref_inst| is a descriptor reference, false otherwise.
- bool AnalyzeDescriptorReference(Instruction* ref_inst, RefAnalysis* ref);
-
- // Generate instrumentation code for generic test result |check_id|, starting
- // with |builder| of block |new_blk_ptr|, adding new blocks to |new_blocks|.
- // Generate conditional branch to a valid or invalid branch. Generate valid
- // block which does original reference |ref|. Generate invalid block which
- // writes debug error output utilizing |ref|, |error_id|, |length_id| and
- // |stage_idx|. Generate merge block for valid and invalid branches. Kill
- // original reference.
- void GenCheckCode(uint32_t check_id, RefAnalysis* ref,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- // Initialize state for instrumenting bindless checking
- void InitializeInstBindlessCheck();
-
- // Apply GenDescIdxCheckCode to every instruction in module. Then apply
- // GenDescInitCheckCode to every instruction in module.
- Pass::Status ProcessImpl();
-
- // Mapping from variable to descriptor set
- std::unordered_map<uint32_t, uint32_t> var2desc_set_;
-
- // Mapping from variable to binding
- std::unordered_map<uint32_t, uint32_t> var2binding_;
-
- uint32_t check_desc_func_id_{0};
-};
-
-} // namespace opt
-} // namespace spvtools
-
-#endif // LIBSPIRV_OPT_INST_BINDLESS_CHECK_PASS_H_
diff --git a/third_party/SPIRV-Tools/source/opt/inst_buff_addr_check_pass.cpp b/third_party/SPIRV-Tools/source/opt/inst_buff_addr_check_pass.cpp
deleted file mode 100644
index e6c5508..0000000
--- a/third_party/SPIRV-Tools/source/opt/inst_buff_addr_check_pass.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright (c) 2019 The Khronos Group Inc.
-// Copyright (c) 2019 Valve Corporation
-// Copyright (c) 2019 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "inst_buff_addr_check_pass.h"
-
-namespace spvtools {
-namespace opt {
-
-uint32_t InstBuffAddrCheckPass::CloneOriginalReference(
- Instruction* ref_inst, InstructionBuilder* builder) {
- // Clone original ref with new result id (if load)
- assert((ref_inst->opcode() == spv::Op::OpLoad ||
- ref_inst->opcode() == spv::Op::OpStore) &&
- "unexpected ref");
- std::unique_ptr<Instruction> new_ref_inst(ref_inst->Clone(context()));
- uint32_t ref_result_id = ref_inst->result_id();
- uint32_t new_ref_id = 0;
- if (ref_result_id != 0) {
- new_ref_id = TakeNextId();
- new_ref_inst->SetResultId(new_ref_id);
- }
- // Register new reference and add to new block
- Instruction* added_inst = builder->AddInstruction(std::move(new_ref_inst));
- uid2offset_[added_inst->unique_id()] = uid2offset_[ref_inst->unique_id()];
- if (new_ref_id != 0)
- get_decoration_mgr()->CloneDecorations(ref_result_id, new_ref_id);
- return new_ref_id;
-}
-
-bool InstBuffAddrCheckPass::IsPhysicalBuffAddrReference(Instruction* ref_inst) {
- if (ref_inst->opcode() != spv::Op::OpLoad &&
- ref_inst->opcode() != spv::Op::OpStore)
- return false;
- uint32_t ptr_id = ref_inst->GetSingleWordInOperand(0);
- analysis::DefUseManager* du_mgr = get_def_use_mgr();
- Instruction* ptr_inst = du_mgr->GetDef(ptr_id);
- if (ptr_inst->opcode() != spv::Op::OpAccessChain) return false;
- uint32_t ptr_ty_id = ptr_inst->type_id();
- Instruction* ptr_ty_inst = du_mgr->GetDef(ptr_ty_id);
- if (spv::StorageClass(ptr_ty_inst->GetSingleWordInOperand(0)) !=
- spv::StorageClass::PhysicalStorageBufferEXT)
- return false;
- return true;
-}
-
-// TODO(greg-lunarg): Refactor with InstBindlessCheckPass::GenCheckCode() ??
-void InstBuffAddrCheckPass::GenCheckCode(
- uint32_t check_id, Instruction* ref_inst,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- BasicBlock* back_blk_ptr = &*new_blocks->back();
- InstructionBuilder builder(
- context(), back_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- // Gen conditional branch on check_id. Valid branch generates original
- // reference. Invalid generates debug output and zero result (if needed).
- uint32_t merge_blk_id = TakeNextId();
- uint32_t valid_blk_id = TakeNextId();
- uint32_t invalid_blk_id = TakeNextId();
- std::unique_ptr<Instruction> merge_label(NewLabel(merge_blk_id));
- std::unique_ptr<Instruction> valid_label(NewLabel(valid_blk_id));
- std::unique_ptr<Instruction> invalid_label(NewLabel(invalid_blk_id));
- (void)builder.AddConditionalBranch(
- check_id, valid_blk_id, invalid_blk_id, merge_blk_id,
- uint32_t(spv::SelectionControlMask::MaskNone));
- // Gen valid branch
- std::unique_ptr<BasicBlock> new_blk_ptr(
- new BasicBlock(std::move(valid_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
- uint32_t new_ref_id = CloneOriginalReference(ref_inst, &builder);
- (void)builder.AddBranch(merge_blk_id);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Gen invalid block
- new_blk_ptr.reset(new BasicBlock(std::move(invalid_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
- // Gen zero for invalid load. If pointer type, need to convert uint64
- // zero to pointer; cannot create ConstantNull of pointer type.
- uint32_t null_id = 0;
- if (new_ref_id != 0) {
- uint32_t ref_type_id = ref_inst->type_id();
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Type* ref_type = type_mgr->GetType(ref_type_id);
- if (ref_type->AsPointer() != nullptr) {
- uint32_t null_u64_id = GetNullId(GetUint64Id());
- Instruction* null_ptr_inst = builder.AddUnaryOp(
- ref_type_id, spv::Op::OpConvertUToPtr, null_u64_id);
- null_id = null_ptr_inst->result_id();
- } else {
- null_id = GetNullId(ref_type_id);
- }
- }
- (void)builder.AddBranch(merge_blk_id);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Gen merge block
- new_blk_ptr.reset(new BasicBlock(std::move(merge_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
- // Gen phi of new reference and zero, if necessary, and replace the
- // result id of the original reference with that of the Phi. Kill original
- // reference.
- if (new_ref_id != 0) {
- Instruction* phi_inst =
- builder.AddPhi(ref_inst->type_id(),
- {new_ref_id, valid_blk_id, null_id, invalid_blk_id});
- context()->ReplaceAllUsesWith(ref_inst->result_id(), phi_inst->result_id());
- }
- new_blocks->push_back(std::move(new_blk_ptr));
- context()->KillInst(ref_inst);
-}
-
-uint32_t InstBuffAddrCheckPass::GetTypeLength(uint32_t type_id) {
- Instruction* type_inst = get_def_use_mgr()->GetDef(type_id);
- switch (type_inst->opcode()) {
- case spv::Op::OpTypeFloat:
- case spv::Op::OpTypeInt:
- return type_inst->GetSingleWordInOperand(0) / 8u;
- case spv::Op::OpTypeVector:
- case spv::Op::OpTypeMatrix:
- return type_inst->GetSingleWordInOperand(1) *
- GetTypeLength(type_inst->GetSingleWordInOperand(0));
- case spv::Op::OpTypePointer:
- assert(spv::StorageClass(type_inst->GetSingleWordInOperand(0)) ==
- spv::StorageClass::PhysicalStorageBufferEXT &&
- "unexpected pointer type");
- return 8u;
- case spv::Op::OpTypeArray: {
- uint32_t const_id = type_inst->GetSingleWordInOperand(1);
- Instruction* const_inst = get_def_use_mgr()->GetDef(const_id);
- uint32_t cnt = const_inst->GetSingleWordInOperand(0);
- return cnt * GetTypeLength(type_inst->GetSingleWordInOperand(0));
- }
- case spv::Op::OpTypeStruct: {
- // Figure out the location of the last byte of the last member of the
- // structure.
- uint32_t last_offset = 0, last_len = 0;
-
- get_decoration_mgr()->ForEachDecoration(
- type_id, uint32_t(spv::Decoration::Offset),
- [&last_offset](const Instruction& deco_inst) {
- last_offset = deco_inst.GetSingleWordInOperand(3);
- });
- type_inst->ForEachInId([&last_len, this](const uint32_t* iid) {
- last_len = GetTypeLength(*iid);
- });
- return last_offset + last_len;
- }
- case spv::Op::OpTypeRuntimeArray:
- default:
- assert(false && "unexpected type");
- return 0;
- }
-}
-
-void InstBuffAddrCheckPass::AddParam(uint32_t type_id,
- std::vector<uint32_t>* param_vec,
- std::unique_ptr<Function>* input_func) {
- uint32_t pid = TakeNextId();
- param_vec->push_back(pid);
- std::unique_ptr<Instruction> param_inst(new Instruction(
- get_module()->context(), spv::Op::OpFunctionParameter, type_id, pid, {}));
- get_def_use_mgr()->AnalyzeInstDefUse(&*param_inst);
- (*input_func)->AddParameter(std::move(param_inst));
-}
-
-// This is a stub function for use with Import linkage
-// clang-format off
-// GLSL:
-//bool inst_bindless_search_and_test(const uint shader_id, const uint inst_num, const uvec4 stage_info,
-// const uint64 ref_ptr, const uint length) {
-//}
-// clang-format on
-uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() {
- enum {
- kShaderId = 0,
- kInstructionIndex = 1,
- kStageInfo = 2,
- kRefPtr = 3,
- kLength = 4,
- kNumArgs
- };
- if (search_test_func_id_ != 0) {
- return search_test_func_id_;
- }
- // Generate function "bool search_and_test(uint64_t ref_ptr, uint32_t len)"
- // which searches input buffer for buffer which most likely contains the
- // pointer value |ref_ptr| and verifies that the entire reference of
- // length |len| bytes is contained in the buffer.
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- const analysis::Integer* uint_type = GetInteger(32, false);
- const analysis::Vector v4uint(uint_type, 4);
- const analysis::Type* v4uint_type = type_mgr->GetRegisteredType(&v4uint);
-
- std::vector<const analysis::Type*> param_types = {
- uint_type, uint_type, v4uint_type, type_mgr->GetType(GetUint64Id()),
- uint_type};
-
- const std::string func_name{"inst_buff_addr_search_and_test"};
- const uint32_t func_id = TakeNextId();
- std::unique_ptr<Function> func =
- StartFunction(func_id, type_mgr->GetBoolType(), param_types);
- func->SetFunctionEnd(EndFunction());
- context()->AddFunctionDeclaration(std::move(func));
- context()->AddDebug2Inst(NewName(func_id, func_name));
-
- std::vector<Operand> operands{
- {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {func_id}},
- {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER,
- {uint32_t(spv::Decoration::LinkageAttributes)}},
- {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_STRING,
- utils::MakeVector(func_name.c_str())},
- {spv_operand_type_t::SPV_OPERAND_TYPE_LINKAGE_TYPE,
- {uint32_t(spv::LinkageType::Import)}},
- };
- get_decoration_mgr()->AddDecoration(spv::Op::OpDecorate, operands);
-
- search_test_func_id_ = func_id;
- return search_test_func_id_;
-}
-
-uint32_t InstBuffAddrCheckPass::GenSearchAndTest(Instruction* ref_inst,
- InstructionBuilder* builder,
- uint32_t* ref_uptr_id,
- uint32_t stage_idx) {
- // Enable Int64 if necessary
- // Convert reference pointer to uint64
- const uint32_t ref_ptr_id = ref_inst->GetSingleWordInOperand(0);
- Instruction* ref_uptr_inst =
- builder->AddUnaryOp(GetUint64Id(), spv::Op::OpConvertPtrToU, ref_ptr_id);
- *ref_uptr_id = ref_uptr_inst->result_id();
- // Compute reference length in bytes
- analysis::DefUseManager* du_mgr = get_def_use_mgr();
- Instruction* ref_ptr_inst = du_mgr->GetDef(ref_ptr_id);
- const uint32_t ref_ptr_ty_id = ref_ptr_inst->type_id();
- Instruction* ref_ptr_ty_inst = du_mgr->GetDef(ref_ptr_ty_id);
- const uint32_t ref_len =
- GetTypeLength(ref_ptr_ty_inst->GetSingleWordInOperand(1));
- // Gen call to search and test function
- const uint32_t func_id = GetSearchAndTestFuncId();
- const std::vector<uint32_t> args = {
- builder->GetUintConstantId(shader_id_),
- builder->GetUintConstantId(ref_inst->unique_id()),
- GenStageInfo(stage_idx, builder), *ref_uptr_id,
- builder->GetUintConstantId(ref_len)};
- return GenReadFunctionCall(GetBoolId(), func_id, args, builder);
-}
-
-void InstBuffAddrCheckPass::GenBuffAddrCheckCode(
- BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr, uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- // Look for reference through indexed descriptor. If found, analyze and
- // save components. If not, return.
- Instruction* ref_inst = &*ref_inst_itr;
- if (!IsPhysicalBuffAddrReference(ref_inst)) return;
- // Move original block's preceding instructions into first new block
- std::unique_ptr<BasicBlock> new_blk_ptr;
- MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr);
- InstructionBuilder builder(
- context(), &*new_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Generate code to do search and test if all bytes of reference
- // are within a listed buffer. Return reference pointer converted to uint64.
- uint32_t ref_uptr_id;
- uint32_t valid_id =
- GenSearchAndTest(ref_inst, &builder, &ref_uptr_id, stage_idx);
- // Generate test of search results with true branch
- // being full reference and false branch being debug output and zero
- // for the referenced value.
- GenCheckCode(valid_id, ref_inst, new_blocks);
-
- // Move original block's remaining code into remainder/merge block and add
- // to new blocks
- BasicBlock* back_blk_ptr = &*new_blocks->back();
- MovePostludeCode(ref_block_itr, back_blk_ptr);
-}
-
-void InstBuffAddrCheckPass::InitInstBuffAddrCheck() {
- // Initialize base class
- InitializeInstrument();
- // Initialize class
- search_test_func_id_ = 0;
-}
-
-Pass::Status InstBuffAddrCheckPass::ProcessImpl() {
- // The memory model and linkage must always be updated for spirv-link to work
- // correctly.
- AddStorageBufferExt();
- if (!get_feature_mgr()->HasExtension(kSPV_KHR_physical_storage_buffer)) {
- context()->AddExtension("SPV_KHR_physical_storage_buffer");
- }
-
- context()->AddCapability(spv::Capability::PhysicalStorageBufferAddresses);
- Instruction* memory_model = get_module()->GetMemoryModel();
- memory_model->SetInOperand(
- 0u, {uint32_t(spv::AddressingModel::PhysicalStorageBuffer64)});
-
- context()->AddCapability(spv::Capability::Int64);
- context()->AddCapability(spv::Capability::Linkage);
- // Perform bindless bounds check on each entry point function in module
- InstProcessFunction pfn =
- [this](BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr, uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- return GenBuffAddrCheckCode(ref_inst_itr, ref_block_itr, stage_idx,
- new_blocks);
- };
- InstProcessEntryPointCallTree(pfn);
- // This pass always changes the memory model, so that linking will work
- // properly.
- return Status::SuccessWithChange;
-}
-
-Pass::Status InstBuffAddrCheckPass::Process() {
- InitInstBuffAddrCheck();
- return ProcessImpl();
-}
-
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/inst_buff_addr_check_pass.h b/third_party/SPIRV-Tools/source/opt/inst_buff_addr_check_pass.h
deleted file mode 100644
index f07f98a..0000000
--- a/third_party/SPIRV-Tools/source/opt/inst_buff_addr_check_pass.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2019 The Khronos Group Inc.
-// Copyright (c) 2019 Valve Corporation
-// Copyright (c) 2019 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef LIBSPIRV_OPT_INST_BUFFER_ADDRESS_PASS_H_
-#define LIBSPIRV_OPT_INST_BUFFER_ADDRESS_PASS_H_
-
-#include "instrument_pass.h"
-
-namespace spvtools {
-namespace opt {
-
-// This class/pass is designed to support the GPU-assisted validation layer of
-// the Buffer Device Address (BDA) extension in
-// https://github.com/KhronosGroup/Vulkan-ValidationLayers. The internal and
-// external design of this class may change as the layer evolves.
-class InstBuffAddrCheckPass : public InstrumentPass {
- public:
- // For test harness only
- InstBuffAddrCheckPass() : InstrumentPass(0, 23, false, true) {}
- // For all other interfaces
- InstBuffAddrCheckPass(uint32_t shader_id)
- : InstrumentPass(0, shader_id, false, true) {}
-
- ~InstBuffAddrCheckPass() override = default;
-
- // See optimizer.hpp for pass user documentation.
- Status Process() override;
-
- const char* name() const override { return "inst-buff-addr-check-pass"; }
-
- private:
- // Return byte length of type |type_id|. Must be int, float, vector, matrix,
- // struct, array or physical pointer. Uses std430 alignment and sizes.
- uint32_t GetTypeLength(uint32_t type_id);
-
- // Add |type_id| param to |input_func| and add id to |param_vec|.
- void AddParam(uint32_t type_id, std::vector<uint32_t>* param_vec,
- std::unique_ptr<Function>* input_func);
-
- // Return id for search and test function. Generate it if not already gen'd.
- uint32_t GetSearchAndTestFuncId();
-
- // Generate code into |builder| to do search of the BDA debug input buffer
- // for the buffer used by |ref_inst| and test that all bytes of reference
- // are within the buffer. Returns id of boolean value which is true if
- // search and test is successful, false otherwise.
- uint32_t GenSearchAndTest(Instruction* ref_inst, InstructionBuilder* builder,
- uint32_t* ref_uptr_id, uint32_t stage_idx);
-
- // This function does checking instrumentation on a single
- // instruction which references through a physical storage buffer address.
- // GenBuffAddrCheckCode generates code that checks that all bytes that
- // are referenced fall within a buffer that was queried via
- // the Vulkan API call vkGetBufferDeviceAddressEXT().
- //
- // The function is designed to be passed to
- // InstrumentPass::InstProcessEntryPointCallTree(), which applies the
- // function to each instruction in a module and replaces the instruction
- // with instrumented code if warranted.
- //
- // If |ref_inst_itr| is a physical storage buffer reference, return in
- // |new_blocks| the result of instrumenting it with validation code within
- // its block at |ref_block_itr|. The validation code first executes a check
- // for the specific condition called for. If the check passes, it executes
- // the remainder of the reference, otherwise writes a record to the debug
- // output buffer stream including |function_idx, instruction_idx, stage_idx|
- // and replaces the reference with the null value of the original type. The
- // block at |ref_block_itr| can just be replaced with the blocks in
- // |new_blocks|, which will contain at least two blocks. The last block will
- // comprise all instructions following |ref_inst_itr|,
- // preceded by a phi instruction if needed.
- //
- // This instrumentation function utilizes GenDebugStreamWrite() to write its
- // error records. The validation-specific part of the error record will
- // have the format:
- //
- // Validation Error Code (=kInstErrorBuffAddr)
- // Buffer Address (lowest 32 bits)
- // Buffer Address (highest 32 bits)
- //
- void GenBuffAddrCheckCode(
- BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr, uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- // Return true if |ref_inst| is a physical buffer address reference, false
- // otherwise.
- bool IsPhysicalBuffAddrReference(Instruction* ref_inst);
-
- // Clone original reference |ref_inst| into |builder| and return id of result
- uint32_t CloneOriginalReference(Instruction* ref_inst,
- InstructionBuilder* builder);
-
- // Generate instrumentation code for boolean test result |check_id|,
- // adding new blocks to |new_blocks|. Generate conditional branch to valid
- // or invalid reference blocks. Generate valid reference block which does
- // original reference |ref_inst|. Then generate invalid reference block which
- // writes debug error output utilizing |ref_inst|, |error_id| and
- // |stage_idx|. Generate merge block for valid and invalid reference blocks.
- // Kill original reference.
- void GenCheckCode(uint32_t check_id, Instruction* ref_inst,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- // Initialize state for instrumenting physical buffer address checking
- void InitInstBuffAddrCheck();
-
- // Apply GenBuffAddrCheckCode to every instruction in module.
- Pass::Status ProcessImpl();
-
- // Id of search and test function, if already gen'd, else zero.
- uint32_t search_test_func_id_;
-};
-
-} // namespace opt
-} // namespace spvtools
-
-#endif // LIBSPIRV_OPT_INST_BUFFER_ADDRESS_PASS_H_
diff --git a/third_party/SPIRV-Tools/source/opt/inst_debug_printf_pass.cpp b/third_party/SPIRV-Tools/source/opt/inst_debug_printf_pass.cpp
deleted file mode 100644
index abd25e9..0000000
--- a/third_party/SPIRV-Tools/source/opt/inst_debug_printf_pass.cpp
+++ /dev/null
@@ -1,483 +0,0 @@
-// Copyright (c) 2020 The Khronos Group Inc.
-// Copyright (c) 2020 Valve Corporation
-// Copyright (c) 2020 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "inst_debug_printf_pass.h"
-
-#include "source/spirv_constant.h"
-#include "source/util/string_utils.h"
-#include "spirv/unified1/NonSemanticDebugPrintf.h"
-
-namespace spvtools {
-namespace opt {
-
-void InstDebugPrintfPass::GenOutputValues(Instruction* val_inst,
- std::vector<uint32_t>* val_ids,
- InstructionBuilder* builder) {
- uint32_t val_ty_id = val_inst->type_id();
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Type* val_ty = type_mgr->GetType(val_ty_id);
- switch (val_ty->kind()) {
- case analysis::Type::kVector: {
- analysis::Vector* v_ty = val_ty->AsVector();
- const analysis::Type* c_ty = v_ty->element_type();
- uint32_t c_ty_id = type_mgr->GetId(c_ty);
- for (uint32_t c = 0; c < v_ty->element_count(); ++c) {
- Instruction* c_inst =
- builder->AddCompositeExtract(c_ty_id, val_inst->result_id(), {c});
- GenOutputValues(c_inst, val_ids, builder);
- }
- return;
- }
- case analysis::Type::kBool: {
- // Select between uint32 zero or one
- uint32_t zero_id = builder->GetUintConstantId(0);
- uint32_t one_id = builder->GetUintConstantId(1);
- Instruction* sel_inst = builder->AddSelect(
- GetUintId(), val_inst->result_id(), one_id, zero_id);
- val_ids->push_back(sel_inst->result_id());
- return;
- }
- case analysis::Type::kFloat: {
- analysis::Float* f_ty = val_ty->AsFloat();
- switch (f_ty->width()) {
- case 16: {
- // Convert float16 to float32 and recurse
- Instruction* f32_inst = builder->AddUnaryOp(
- GetFloatId(), spv::Op::OpFConvert, val_inst->result_id());
- GenOutputValues(f32_inst, val_ids, builder);
- return;
- }
- case 64: {
- // Bitcast float64 to uint64 and recurse
- Instruction* ui64_inst = builder->AddUnaryOp(
- GetUint64Id(), spv::Op::OpBitcast, val_inst->result_id());
- GenOutputValues(ui64_inst, val_ids, builder);
- return;
- }
- case 32: {
- // Bitcase float32 to uint32
- Instruction* bc_inst = builder->AddUnaryOp(
- GetUintId(), spv::Op::OpBitcast, val_inst->result_id());
- val_ids->push_back(bc_inst->result_id());
- return;
- }
- default:
- assert(false && "unsupported float width");
- return;
- }
- }
- case analysis::Type::kInteger: {
- analysis::Integer* i_ty = val_ty->AsInteger();
- switch (i_ty->width()) {
- case 64: {
- Instruction* ui64_inst = val_inst;
- if (i_ty->IsSigned()) {
- // Bitcast sint64 to uint64
- ui64_inst = builder->AddUnaryOp(GetUint64Id(), spv::Op::OpBitcast,
- val_inst->result_id());
- }
- // Break uint64 into 2x uint32
- Instruction* lo_ui64_inst = builder->AddUnaryOp(
- GetUintId(), spv::Op::OpUConvert, ui64_inst->result_id());
- Instruction* rshift_ui64_inst = builder->AddBinaryOp(
- GetUint64Id(), spv::Op::OpShiftRightLogical,
- ui64_inst->result_id(), builder->GetUintConstantId(32));
- Instruction* hi_ui64_inst = builder->AddUnaryOp(
- GetUintId(), spv::Op::OpUConvert, rshift_ui64_inst->result_id());
- val_ids->push_back(lo_ui64_inst->result_id());
- val_ids->push_back(hi_ui64_inst->result_id());
- return;
- }
- case 8: {
- Instruction* ui8_inst = val_inst;
- if (i_ty->IsSigned()) {
- // Bitcast sint8 to uint8
- ui8_inst = builder->AddUnaryOp(GetUint8Id(), spv::Op::OpBitcast,
- val_inst->result_id());
- }
- // Convert uint8 to uint32
- Instruction* ui32_inst = builder->AddUnaryOp(
- GetUintId(), spv::Op::OpUConvert, ui8_inst->result_id());
- val_ids->push_back(ui32_inst->result_id());
- return;
- }
- case 32: {
- Instruction* ui32_inst = val_inst;
- if (i_ty->IsSigned()) {
- // Bitcast sint32 to uint32
- ui32_inst = builder->AddUnaryOp(GetUintId(), spv::Op::OpBitcast,
- val_inst->result_id());
- }
- // uint32 needs no further processing
- val_ids->push_back(ui32_inst->result_id());
- return;
- }
- default:
- // TODO(greg-lunarg): Support non-32-bit int
- assert(false && "unsupported int width");
- return;
- }
- }
- default:
- assert(false && "unsupported type");
- return;
- }
-}
-
-void InstDebugPrintfPass::GenOutputCode(
- Instruction* printf_inst,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- BasicBlock* back_blk_ptr = &*new_blocks->back();
- InstructionBuilder builder(
- context(), back_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- // Gen debug printf record validation-specific values. The format string
- // will have its id written. Vectors will need to be broken down into
- // component values. float16 will need to be converted to float32. Pointer
- // and uint64 will need to be converted to two uint32 values. float32 will
- // need to be bitcast to uint32. int32 will need to be bitcast to uint32.
- std::vector<uint32_t> val_ids;
- bool is_first_operand = false;
- printf_inst->ForEachInId(
- [&is_first_operand, &val_ids, &builder, this](const uint32_t* iid) {
- // skip set operand
- if (!is_first_operand) {
- is_first_operand = true;
- return;
- }
- Instruction* opnd_inst = get_def_use_mgr()->GetDef(*iid);
- if (opnd_inst->opcode() == spv::Op::OpString) {
- uint32_t string_id_id = builder.GetUintConstantId(*iid);
- val_ids.push_back(string_id_id);
- } else {
- GenOutputValues(opnd_inst, &val_ids, &builder);
- }
- });
- GenDebugStreamWrite(
- builder.GetUintConstantId(shader_id_),
- builder.GetUintConstantId(uid2offset_[printf_inst->unique_id()]), val_ids,
- &builder);
- context()->KillInst(printf_inst);
-}
-
-void InstDebugPrintfPass::GenDebugPrintfCode(
- BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- // If not DebugPrintf OpExtInst, return.
- Instruction* printf_inst = &*ref_inst_itr;
- if (printf_inst->opcode() != spv::Op::OpExtInst) return;
- if (printf_inst->GetSingleWordInOperand(0) != ext_inst_printf_id_) return;
- if (printf_inst->GetSingleWordInOperand(1) !=
- NonSemanticDebugPrintfDebugPrintf)
- return;
- // Initialize DefUse manager before dismantling module
- (void)get_def_use_mgr();
- // Move original block's preceding instructions into first new block
- std::unique_ptr<BasicBlock> new_blk_ptr;
- MovePreludeCode(ref_inst_itr, ref_block_itr, &new_blk_ptr);
- new_blocks->push_back(std::move(new_blk_ptr));
- // Generate instructions to output printf args to printf buffer
- GenOutputCode(printf_inst, new_blocks);
- // Caller expects at least two blocks with last block containing remaining
- // code, so end block after instrumentation, create remainder block, and
- // branch to it
- uint32_t rem_blk_id = TakeNextId();
- std::unique_ptr<Instruction> rem_label(NewLabel(rem_blk_id));
- BasicBlock* back_blk_ptr = &*new_blocks->back();
- InstructionBuilder builder(
- context(), back_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- (void)builder.AddBranch(rem_blk_id);
- // Gen remainder block
- new_blk_ptr.reset(new BasicBlock(std::move(rem_label)));
- builder.SetInsertPoint(&*new_blk_ptr);
- // Move original block's remaining code into remainder block and add
- // to new blocks
- MovePostludeCode(ref_block_itr, &*new_blk_ptr);
- new_blocks->push_back(std::move(new_blk_ptr));
-}
-
-// Return id for output buffer
-uint32_t InstDebugPrintfPass::GetOutputBufferId() {
- if (output_buffer_id_ == 0) {
- // If not created yet, create one
- analysis::DecorationManager* deco_mgr = get_decoration_mgr();
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::RuntimeArray* reg_uint_rarr_ty = GetUintRuntimeArrayType(32);
- analysis::Integer* reg_uint_ty = GetInteger(32, false);
- analysis::Type* reg_buf_ty =
- GetStruct({reg_uint_ty, reg_uint_ty, reg_uint_rarr_ty});
- uint32_t obufTyId = type_mgr->GetTypeInstruction(reg_buf_ty);
- // By the Vulkan spec, a pre-existing struct containing a RuntimeArray
- // must be a block, and will therefore be decorated with Block. Therefore
- // the undecorated type returned here will not be pre-existing and can
- // safely be decorated. Since this type is now decorated, it is out of
- // sync with the TypeManager and therefore the TypeManager must be
- // invalidated after this pass.
- assert(context()->get_def_use_mgr()->NumUses(obufTyId) == 0 &&
- "used struct type returned");
- deco_mgr->AddDecoration(obufTyId, uint32_t(spv::Decoration::Block));
- deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputFlagsOffset,
- uint32_t(spv::Decoration::Offset), 0);
- deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputSizeOffset,
- uint32_t(spv::Decoration::Offset), 4);
- deco_mgr->AddMemberDecoration(obufTyId, kDebugOutputDataOffset,
- uint32_t(spv::Decoration::Offset), 8);
- uint32_t obufTyPtrId_ =
- type_mgr->FindPointerToType(obufTyId, spv::StorageClass::StorageBuffer);
- output_buffer_id_ = TakeNextId();
- std::unique_ptr<Instruction> newVarOp(new Instruction(
- context(), spv::Op::OpVariable, obufTyPtrId_, output_buffer_id_,
- {{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER,
- {uint32_t(spv::StorageClass::StorageBuffer)}}}));
- context()->AddGlobalValue(std::move(newVarOp));
- context()->AddDebug2Inst(NewGlobalName(obufTyId, "OutputBuffer"));
- context()->AddDebug2Inst(NewMemberName(obufTyId, 0, "flags"));
- context()->AddDebug2Inst(NewMemberName(obufTyId, 1, "written_count"));
- context()->AddDebug2Inst(NewMemberName(obufTyId, 2, "data"));
- context()->AddDebug2Inst(NewGlobalName(output_buffer_id_, "output_buffer"));
- deco_mgr->AddDecorationVal(
- output_buffer_id_, uint32_t(spv::Decoration::DescriptorSet), desc_set_);
- deco_mgr->AddDecorationVal(output_buffer_id_,
- uint32_t(spv::Decoration::Binding),
- GetOutputBufferBinding());
- AddStorageBufferExt();
- if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4)) {
- // Add the new buffer to all entry points.
- for (auto& entry : get_module()->entry_points()) {
- entry.AddOperand({SPV_OPERAND_TYPE_ID, {output_buffer_id_}});
- context()->AnalyzeUses(&entry);
- }
- }
- }
- return output_buffer_id_;
-}
-
-uint32_t InstDebugPrintfPass::GetOutputBufferPtrId() {
- if (output_buffer_ptr_id_ == 0) {
- output_buffer_ptr_id_ = context()->get_type_mgr()->FindPointerToType(
- GetUintId(), spv::StorageClass::StorageBuffer);
- }
- return output_buffer_ptr_id_;
-}
-
-uint32_t InstDebugPrintfPass::GetOutputBufferBinding() {
- return kDebugOutputPrintfStream;
-}
-
-void InstDebugPrintfPass::GenDebugOutputFieldCode(uint32_t base_offset_id,
- uint32_t field_offset,
- uint32_t field_value_id,
- InstructionBuilder* builder) {
- // Cast value to 32-bit unsigned if necessary
- uint32_t val_id = GenUintCastCode(field_value_id, builder);
- // Store value
- Instruction* data_idx_inst = builder->AddIAdd(
- GetUintId(), base_offset_id, builder->GetUintConstantId(field_offset));
- uint32_t buf_id = GetOutputBufferId();
- uint32_t buf_uint_ptr_id = GetOutputBufferPtrId();
- Instruction* achain_inst = builder->AddAccessChain(
- buf_uint_ptr_id, buf_id,
- {builder->GetUintConstantId(kDebugOutputDataOffset),
- data_idx_inst->result_id()});
- (void)builder->AddStore(achain_inst->result_id(), val_id);
-}
-
-uint32_t InstDebugPrintfPass::GetStreamWriteFunctionId(uint32_t param_cnt) {
- enum {
- kShaderId = 0,
- kInstructionIndex = 1,
- kFirstParam = 2,
- };
- // Total param count is common params plus validation-specific
- // params
- if (param2output_func_id_[param_cnt] == 0) {
- // Create function
- param2output_func_id_[param_cnt] = TakeNextId();
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
-
- const analysis::Type* uint_type = GetInteger(32, false);
-
- std::vector<const analysis::Type*> param_types(kFirstParam + param_cnt,
- uint_type);
- std::unique_ptr<Function> output_func = StartFunction(
- param2output_func_id_[param_cnt], type_mgr->GetVoidType(), param_types);
-
- std::vector<uint32_t> param_ids = AddParameters(*output_func, param_types);
-
- // Create first block
- auto new_blk_ptr = MakeUnique<BasicBlock>(NewLabel(TakeNextId()));
-
- InstructionBuilder builder(
- context(), &*new_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- // Gen test if debug output buffer size will not be exceeded.
- const uint32_t first_param_offset = kInstCommonOutInstructionIdx + 1;
- const uint32_t obuf_record_sz = first_param_offset + param_cnt;
- const uint32_t buf_id = GetOutputBufferId();
- const uint32_t buf_uint_ptr_id = GetOutputBufferPtrId();
- Instruction* obuf_curr_sz_ac_inst = builder.AddAccessChain(
- buf_uint_ptr_id, buf_id,
- {builder.GetUintConstantId(kDebugOutputSizeOffset)});
- // Fetch the current debug buffer written size atomically, adding the
- // size of the record to be written.
- uint32_t obuf_record_sz_id = builder.GetUintConstantId(obuf_record_sz);
- uint32_t mask_none_id =
- builder.GetUintConstantId(uint32_t(spv::MemoryAccessMask::MaskNone));
- uint32_t scope_invok_id =
- builder.GetUintConstantId(uint32_t(spv::Scope::Invocation));
- Instruction* obuf_curr_sz_inst = builder.AddQuadOp(
- GetUintId(), spv::Op::OpAtomicIAdd, obuf_curr_sz_ac_inst->result_id(),
- scope_invok_id, mask_none_id, obuf_record_sz_id);
- uint32_t obuf_curr_sz_id = obuf_curr_sz_inst->result_id();
- // Compute new written size
- Instruction* obuf_new_sz_inst =
- builder.AddIAdd(GetUintId(), obuf_curr_sz_id,
- builder.GetUintConstantId(obuf_record_sz));
- // Fetch the data bound
- Instruction* obuf_bnd_inst =
- builder.AddIdLiteralOp(GetUintId(), spv::Op::OpArrayLength,
- GetOutputBufferId(), kDebugOutputDataOffset);
- // Test that new written size is less than or equal to debug output
- // data bound
- Instruction* obuf_safe_inst = builder.AddBinaryOp(
- GetBoolId(), spv::Op::OpULessThanEqual, obuf_new_sz_inst->result_id(),
- obuf_bnd_inst->result_id());
- uint32_t merge_blk_id = TakeNextId();
- uint32_t write_blk_id = TakeNextId();
- std::unique_ptr<Instruction> merge_label(NewLabel(merge_blk_id));
- std::unique_ptr<Instruction> write_label(NewLabel(write_blk_id));
- (void)builder.AddConditionalBranch(
- obuf_safe_inst->result_id(), write_blk_id, merge_blk_id, merge_blk_id,
- uint32_t(spv::SelectionControlMask::MaskNone));
- // Close safety test block and gen write block
- output_func->AddBasicBlock(std::move(new_blk_ptr));
- new_blk_ptr = MakeUnique<BasicBlock>(std::move(write_label));
- builder.SetInsertPoint(&*new_blk_ptr);
- // Generate common and stage-specific debug record members
- GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutSize,
- builder.GetUintConstantId(obuf_record_sz),
- &builder);
- // Store Shader Id
- GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutShaderId,
- param_ids[kShaderId], &builder);
- // Store Instruction Idx
- GenDebugOutputFieldCode(obuf_curr_sz_id, kInstCommonOutInstructionIdx,
- param_ids[kInstructionIndex], &builder);
- // Gen writes of validation specific data
- for (uint32_t i = 0; i < param_cnt; ++i) {
- GenDebugOutputFieldCode(obuf_curr_sz_id, first_param_offset + i,
- param_ids[kFirstParam + i], &builder);
- }
- // Close write block and gen merge block
- (void)builder.AddBranch(merge_blk_id);
- output_func->AddBasicBlock(std::move(new_blk_ptr));
- new_blk_ptr = MakeUnique<BasicBlock>(std::move(merge_label));
- builder.SetInsertPoint(&*new_blk_ptr);
- // Close merge block and function and add function to module
- (void)builder.AddNullaryOp(0, spv::Op::OpReturn);
-
- output_func->AddBasicBlock(std::move(new_blk_ptr));
- output_func->SetFunctionEnd(EndFunction());
- context()->AddFunction(std::move(output_func));
-
- std::string name("stream_write_");
- name += std::to_string(param_cnt);
-
- context()->AddDebug2Inst(
- NewGlobalName(param2output_func_id_[param_cnt], name));
- }
- return param2output_func_id_[param_cnt];
-}
-
-void InstDebugPrintfPass::GenDebugStreamWrite(
- uint32_t shader_id, uint32_t instruction_idx_id,
- const std::vector<uint32_t>& validation_ids, InstructionBuilder* builder) {
- // Call debug output function. Pass func_idx, instruction_idx and
- // validation ids as args.
- uint32_t val_id_cnt = static_cast<uint32_t>(validation_ids.size());
- std::vector<uint32_t> args = {shader_id, instruction_idx_id};
- (void)args.insert(args.end(), validation_ids.begin(), validation_ids.end());
- (void)builder->AddFunctionCall(GetVoidId(),
- GetStreamWriteFunctionId(val_id_cnt), args);
-}
-
-std::unique_ptr<Instruction> InstDebugPrintfPass::NewGlobalName(
- uint32_t id, const std::string& name_str) {
- std::string prefixed_name{"inst_printf_"};
- prefixed_name += name_str;
- return NewName(id, prefixed_name);
-}
-
-std::unique_ptr<Instruction> InstDebugPrintfPass::NewMemberName(
- uint32_t id, uint32_t member_index, const std::string& name_str) {
- return MakeUnique<Instruction>(
- context(), spv::Op::OpMemberName, 0, 0,
- std::initializer_list<Operand>{
- {SPV_OPERAND_TYPE_ID, {id}},
- {SPV_OPERAND_TYPE_LITERAL_INTEGER, {member_index}},
- {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}});
-}
-
-void InstDebugPrintfPass::InitializeInstDebugPrintf() {
- // Initialize base class
- InitializeInstrument();
- output_buffer_id_ = 0;
- output_buffer_ptr_id_ = 0;
-}
-
-Pass::Status InstDebugPrintfPass::ProcessImpl() {
- // Perform printf instrumentation on each entry point function in module
- InstProcessFunction pfn =
- [this](BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr,
- [[maybe_unused]] uint32_t stage_idx,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- return GenDebugPrintfCode(ref_inst_itr, ref_block_itr, new_blocks);
- };
- (void)InstProcessEntryPointCallTree(pfn);
- // Remove DebugPrintf OpExtInstImport instruction
- Instruction* ext_inst_import_inst =
- get_def_use_mgr()->GetDef(ext_inst_printf_id_);
- context()->KillInst(ext_inst_import_inst);
- // If no remaining non-semantic instruction sets, remove non-semantic debug
- // info extension from module and feature manager
- bool non_sem_set_seen = false;
- for (auto c_itr = context()->module()->ext_inst_import_begin();
- c_itr != context()->module()->ext_inst_import_end(); ++c_itr) {
- const std::string set_name = c_itr->GetInOperand(0).AsString();
- if (spvtools::utils::starts_with(set_name, "NonSemantic.")) {
- non_sem_set_seen = true;
- break;
- }
- }
- if (!non_sem_set_seen) {
- context()->RemoveExtension(kSPV_KHR_non_semantic_info);
- }
- return Status::SuccessWithChange;
-}
-
-Pass::Status InstDebugPrintfPass::Process() {
- ext_inst_printf_id_ =
- get_module()->GetExtInstImportId("NonSemantic.DebugPrintf");
- if (ext_inst_printf_id_ == 0) return Status::SuccessWithoutChange;
- InitializeInstDebugPrintf();
- return ProcessImpl();
-}
-
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/inst_debug_printf_pass.h b/third_party/SPIRV-Tools/source/opt/inst_debug_printf_pass.h
deleted file mode 100644
index 5688d38..0000000
--- a/third_party/SPIRV-Tools/source/opt/inst_debug_printf_pass.h
+++ /dev/null
@@ -1,198 +0,0 @@
-// Copyright (c) 2020 The Khronos Group Inc.
-// Copyright (c) 2020 Valve Corporation
-// Copyright (c) 2020 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef LIBSPIRV_OPT_INST_DEBUG_PRINTF_PASS_H_
-#define LIBSPIRV_OPT_INST_DEBUG_PRINTF_PASS_H_
-
-#include "instrument_pass.h"
-
-namespace spvtools {
-namespace opt {
-
-// This class/pass is designed to support the debug printf GPU-assisted layer
-// of https://github.com/KhronosGroup/Vulkan-ValidationLayers. Its internal and
-// external design may change as the layer evolves.
-class InstDebugPrintfPass : public InstrumentPass {
- public:
- // For test harness only
- InstDebugPrintfPass() : InstrumentPass(7, 23, false, false) {}
- // For all other interfaces
- InstDebugPrintfPass(uint32_t desc_set, uint32_t shader_id)
- : InstrumentPass(desc_set, shader_id, false, false) {}
-
- ~InstDebugPrintfPass() override = default;
-
- // See optimizer.hpp for pass user documentation.
- Status Process() override;
-
- const char* name() const override { return "inst-printf-pass"; }
-
- private:
- // Gen code into |builder| to write |field_value_id| into debug output
- // buffer at |base_offset_id| + |field_offset|.
- void GenDebugOutputFieldCode(uint32_t base_offset_id, uint32_t field_offset,
- uint32_t field_value_id,
- InstructionBuilder* builder);
-
- // Generate instructions in |builder| which will atomically fetch and
- // increment the size of the debug output buffer stream of the current
- // validation and write a record to the end of the stream, if enough space
- // in the buffer remains. The record will contain the index of the function
- // and instruction within that function |func_idx, instruction_idx| which
- // generated the record. Finally, the record will contain validation-specific
- // data contained in |validation_ids| which will identify the validation
- // error as well as the values involved in the error.
- //
- // The output buffer binding written to by the code generated by the function
- // is determined by the validation id specified when each specific
- // instrumentation pass is created.
- //
- // The output buffer is a sequence of 32-bit values with the following
- // format (where all elements are unsigned 32-bit unless otherwise noted):
- //
- // Size
- // Record0
- // Record1
- // Record2
- // ...
- //
- // Size is the number of 32-bit values that have been written or
- // attempted to be written to the output buffer, excluding the Size. It is
- // initialized to 0. If the size of attempts to write the buffer exceeds
- // the actual size of the buffer, it is possible that this field can exceed
- // the actual size of the buffer.
- //
- // Each Record* is a variable-length sequence of 32-bit values with the
- // following format defined using static const offsets in the .cpp file:
- //
- // Record Size
- // Shader ID
- // Instruction Index
- // ...
- // Validation Error Code
- // Validation-specific Word 0
- // Validation-specific Word 1
- // Validation-specific Word 2
- // ...
- //
- // Each record consists of two subsections: members common across all
- // validation and members specific to a
- // validation.
- //
- // The Record Size is the number of 32-bit words in the record, including
- // the Record Size word.
- //
- // Shader ID is a value that identifies which shader has generated the
- // validation error. It is passed when the instrumentation pass is created.
- //
- // The Instruction Index is the position of the instruction within the
- // SPIR-V file which is in error.
- //
- // The Validation Error Code specifies the exact error which has occurred.
- // These are enumerated with the kInstError* static consts. This allows
- // multiple validation layers to use the same, single output buffer.
- //
- // The Validation-specific Words are a validation-specific number of 32-bit
- // words which give further information on the validation error that
- // occurred. These are documented further in each file containing the
- // validation-specific class which derives from this base class.
- //
- // Because the code that is generated checks against the size of the buffer
- // before writing, the size of the debug out buffer can be used by the
- // validation layer to control the number of error records that are written.
- void GenDebugStreamWrite(uint32_t shader_id, uint32_t instruction_idx_id,
- const std::vector<uint32_t>& validation_ids,
- InstructionBuilder* builder);
-
- // Return id for output function. Define if it doesn't exist with
- // |val_spec_param_cnt| validation-specific uint32 parameters.
- uint32_t GetStreamWriteFunctionId(uint32_t val_spec_param_cnt);
-
- // Generate instructions for OpDebugPrintf.
- //
- // If |ref_inst_itr| is an OpDebugPrintf, return in |new_blocks| the result
- // of replacing it with buffer write instructions within its block at
- // |ref_block_itr|. The instructions write a record to the printf
- // output buffer stream including |function_idx, instruction_idx|
- // and removes the OpDebugPrintf. The block at |ref_block_itr| can just be
- // replaced with the block in |new_blocks|. Besides the buffer writes, this
- // block will comprise all instructions preceding and following
- // |ref_inst_itr|.
- //
- // This function is designed to be passed to
- // InstrumentPass::InstProcessEntryPointCallTree(), which applies the
- // function to each instruction in a module and replaces the instruction
- // if warranted.
- //
- // This instrumentation function utilizes GenDebugStreamWrite() to write its
- // error records. The validation-specific part of the error record will
- // consist of a uint32 which is the id of the format string plus a sequence
- // of uint32s representing the values of the remaining operands of the
- // DebugPrintf.
- void GenDebugPrintfCode(BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- // Generate a sequence of uint32 instructions in |builder| (if necessary)
- // representing the value of |val_inst|, which must be a buffer pointer, a
- // uint64, or a scalar or vector of type uint32, float32 or float16. Append
- // the ids of all values to the end of |val_ids|.
- void GenOutputValues(Instruction* val_inst, std::vector<uint32_t>* val_ids,
- InstructionBuilder* builder);
-
- // Generate instructions to write a record containing the operands of
- // |printf_inst| arguments to printf buffer, adding new code to the end of
- // the last block in |new_blocks|. Kill OpDebugPrintf instruction.
- void GenOutputCode(Instruction* printf_inst,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- // Set the name for a function or global variable, names will be
- // prefixed to identify which instrumentation pass generated them.
- std::unique_ptr<Instruction> NewGlobalName(uint32_t id,
- const std::string& name_str);
-
- // Set the name for a structure member
- std::unique_ptr<Instruction> NewMemberName(uint32_t id, uint32_t member_index,
- const std::string& name_str);
-
- // Return id for debug output buffer
- uint32_t GetOutputBufferId();
-
- // Return id for buffer uint type
- uint32_t GetOutputBufferPtrId();
-
- // Return binding for output buffer for current validation.
- uint32_t GetOutputBufferBinding();
-
- // Initialize state for instrumenting bindless checking
- void InitializeInstDebugPrintf();
-
- // Apply GenDebugPrintfCode to every instruction in module.
- Pass::Status ProcessImpl();
-
- uint32_t ext_inst_printf_id_{0};
-
- // id for output buffer variable
- uint32_t output_buffer_id_{0};
-
- // ptr type id for output buffer element
- uint32_t output_buffer_ptr_id_{0};
-};
-
-} // namespace opt
-} // namespace spvtools
-
-#endif // LIBSPIRV_OPT_INST_DEBUG_PRINTF_PASS_H_
diff --git a/third_party/SPIRV-Tools/source/opt/instruction.cpp b/third_party/SPIRV-Tools/source/opt/instruction.cpp
index aa4ae26..fa16965 100644
--- a/third_party/SPIRV-Tools/source/opt/instruction.cpp
+++ b/third_party/SPIRV-Tools/source/opt/instruction.cpp
@@ -250,8 +250,7 @@
case spv::Op::OpInBoundsPtrAccessChain:
case spv::Op::OpImageTexelPointer:
case spv::Op::OpCopyObject:
- // All of these instructions have the base pointer use a base pointer
- // in in-operand 0.
+ // All of these instructions have their base pointer in in-operand 0.
base = base_inst->GetSingleWordInOperand(0);
base_inst = context()->get_def_use_mgr()->GetDef(base);
break;
@@ -547,11 +546,13 @@
clear_dbg_line_insts();
}
-void Instruction::UpdateDebugInfoFrom(const Instruction* from) {
+void Instruction::UpdateDebugInfoFrom(const Instruction* from,
+ const Instruction* line) {
if (from == nullptr) return;
ClearDbgLineInsts();
- if (!from->dbg_line_insts().empty())
- AddDebugLine(&from->dbg_line_insts().back());
+ const Instruction* fromLine = line != nullptr ? line : from;
+ if (!fromLine->dbg_line_insts().empty())
+ AddDebugLine(&fromLine->dbg_line_insts().back());
SetDebugScope(from->GetDebugScope());
if (!IsLineInst() &&
context()->AreAnalysesValid(IRContext::kAnalysisDebugInfo)) {
diff --git a/third_party/SPIRV-Tools/source/opt/instruction.h b/third_party/SPIRV-Tools/source/opt/instruction.h
index c2617fb..c026b21 100644
--- a/third_party/SPIRV-Tools/source/opt/instruction.h
+++ b/third_party/SPIRV-Tools/source/opt/instruction.h
@@ -338,7 +338,8 @@
// Updates lexical scope of DebugScope and OpLine.
void UpdateLexicalScope(uint32_t scope);
// Updates OpLine and DebugScope based on the information of |from|.
- void UpdateDebugInfoFrom(const Instruction* from);
+ void UpdateDebugInfoFrom(const Instruction* from,
+ const Instruction* line = nullptr);
// Remove the |index|-th operand
void RemoveOperand(uint32_t index) {
operands_.erase(operands_.begin() + index);
diff --git a/third_party/SPIRV-Tools/source/opt/instrument_pass.cpp b/third_party/SPIRV-Tools/source/opt/instrument_pass.cpp
deleted file mode 100644
index b6845a5..0000000
--- a/third_party/SPIRV-Tools/source/opt/instrument_pass.cpp
+++ /dev/null
@@ -1,803 +0,0 @@
-// Copyright (c) 2018 The Khronos Group Inc.
-// Copyright (c) 2018 Valve Corporation
-// Copyright (c) 2018 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "instrument_pass.h"
-
-#include "source/cfa.h"
-#include "source/spirv_constant.h"
-
-namespace spvtools {
-namespace opt {
-namespace {
-// Indices of operands in SPIR-V instructions
-constexpr int kEntryPointFunctionIdInIdx = 1;
-} // namespace
-
-void InstrumentPass::MovePreludeCode(
- BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr,
- std::unique_ptr<BasicBlock>* new_blk_ptr) {
- same_block_pre_.clear();
- same_block_post_.clear();
- // Initialize new block. Reuse label from original block.
- new_blk_ptr->reset(new BasicBlock(std::move(ref_block_itr->GetLabel())));
- // Move contents of original ref block up to ref instruction.
- for (auto cii = ref_block_itr->begin(); cii != ref_inst_itr;
- cii = ref_block_itr->begin()) {
- Instruction* inst = &*cii;
- inst->RemoveFromList();
- std::unique_ptr<Instruction> mv_ptr(inst);
- // Remember same-block ops for possible regeneration.
- if (IsSameBlockOp(&*mv_ptr)) {
- auto* sb_inst_ptr = mv_ptr.get();
- same_block_pre_[mv_ptr->result_id()] = sb_inst_ptr;
- }
- (*new_blk_ptr)->AddInstruction(std::move(mv_ptr));
- }
-}
-
-void InstrumentPass::MovePostludeCode(
- UptrVectorIterator<BasicBlock> ref_block_itr, BasicBlock* new_blk_ptr) {
- // Move contents of original ref block.
- for (auto cii = ref_block_itr->begin(); cii != ref_block_itr->end();
- cii = ref_block_itr->begin()) {
- Instruction* inst = &*cii;
- inst->RemoveFromList();
- std::unique_ptr<Instruction> mv_inst(inst);
- // Regenerate any same-block instruction that has not been seen in the
- // current block.
- if (same_block_pre_.size() > 0) {
- CloneSameBlockOps(&mv_inst, &same_block_post_, &same_block_pre_,
- new_blk_ptr);
- // Remember same-block ops in this block.
- if (IsSameBlockOp(&*mv_inst)) {
- const uint32_t rid = mv_inst->result_id();
- same_block_post_[rid] = rid;
- }
- }
- new_blk_ptr->AddInstruction(std::move(mv_inst));
- }
-}
-
-std::unique_ptr<Instruction> InstrumentPass::NewLabel(uint32_t label_id) {
- auto new_label =
- MakeUnique<Instruction>(context(), spv::Op::OpLabel, 0, label_id,
- std::initializer_list<Operand>{});
- get_def_use_mgr()->AnalyzeInstDefUse(&*new_label);
- return new_label;
-}
-
-std::unique_ptr<Function> InstrumentPass::StartFunction(
- uint32_t func_id, const analysis::Type* return_type,
- const std::vector<const analysis::Type*>& param_types) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Function* func_type = GetFunction(return_type, param_types);
-
- const std::vector<Operand> operands{
- {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER,
- {uint32_t(spv::FunctionControlMask::MaskNone)}},
- {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {type_mgr->GetId(func_type)}},
- };
- auto func_inst =
- MakeUnique<Instruction>(context(), spv::Op::OpFunction,
- type_mgr->GetId(return_type), func_id, operands);
- get_def_use_mgr()->AnalyzeInstDefUse(&*func_inst);
- return MakeUnique<Function>(std::move(func_inst));
-}
-
-std::unique_ptr<Instruction> InstrumentPass::EndFunction() {
- auto end = MakeUnique<Instruction>(context(), spv::Op::OpFunctionEnd, 0, 0,
- std::initializer_list<Operand>{});
- get_def_use_mgr()->AnalyzeInstDefUse(end.get());
- return end;
-}
-
-std::vector<uint32_t> InstrumentPass::AddParameters(
- Function& func, const std::vector<const analysis::Type*>& param_types) {
- std::vector<uint32_t> param_ids;
- param_ids.reserve(param_types.size());
- for (const analysis::Type* param : param_types) {
- uint32_t pid = TakeNextId();
- param_ids.push_back(pid);
- auto param_inst =
- MakeUnique<Instruction>(context(), spv::Op::OpFunctionParameter,
- context()->get_type_mgr()->GetId(param), pid,
- std::initializer_list<Operand>{});
- get_def_use_mgr()->AnalyzeInstDefUse(param_inst.get());
- func.AddParameter(std::move(param_inst));
- }
- return param_ids;
-}
-
-std::unique_ptr<Instruction> InstrumentPass::NewName(
- uint32_t id, const std::string& name_str) {
- return MakeUnique<Instruction>(
- context(), spv::Op::OpName, 0, 0,
- std::initializer_list<Operand>{
- {SPV_OPERAND_TYPE_ID, {id}},
- {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}});
-}
-
-uint32_t InstrumentPass::Gen32BitCvtCode(uint32_t val_id,
- InstructionBuilder* builder) {
- // Convert integer value to 32-bit if necessary
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- uint32_t val_ty_id = get_def_use_mgr()->GetDef(val_id)->type_id();
- analysis::Integer* val_ty = type_mgr->GetType(val_ty_id)->AsInteger();
- if (val_ty->width() == 32) return val_id;
- bool is_signed = val_ty->IsSigned();
- analysis::Integer val_32b_ty(32, is_signed);
- analysis::Type* val_32b_reg_ty = type_mgr->GetRegisteredType(&val_32b_ty);
- uint32_t val_32b_reg_ty_id = type_mgr->GetId(val_32b_reg_ty);
- if (is_signed)
- return builder->AddUnaryOp(val_32b_reg_ty_id, spv::Op::OpSConvert, val_id)
- ->result_id();
- else
- return builder->AddUnaryOp(val_32b_reg_ty_id, spv::Op::OpUConvert, val_id)
- ->result_id();
-}
-
-uint32_t InstrumentPass::GenUintCastCode(uint32_t val_id,
- InstructionBuilder* builder) {
- // Convert value to 32-bit if necessary
- uint32_t val_32b_id = Gen32BitCvtCode(val_id, builder);
- // Cast value to unsigned if necessary
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- uint32_t val_ty_id = get_def_use_mgr()->GetDef(val_32b_id)->type_id();
- analysis::Integer* val_ty = type_mgr->GetType(val_ty_id)->AsInteger();
- if (!val_ty->IsSigned()) return val_32b_id;
- return builder->AddUnaryOp(GetUintId(), spv::Op::OpBitcast, val_32b_id)
- ->result_id();
-}
-
-uint32_t InstrumentPass::GenVarLoad(uint32_t var_id,
- InstructionBuilder* builder) {
- Instruction* var_inst = get_def_use_mgr()->GetDef(var_id);
- uint32_t type_id = GetPointeeTypeId(var_inst);
- Instruction* load_inst = builder->AddLoad(type_id, var_id);
- return load_inst->result_id();
-}
-
-uint32_t InstrumentPass::GenStageInfo(uint32_t stage_idx,
- InstructionBuilder* builder) {
- std::vector<uint32_t> ids(4, builder->GetUintConstantId(0));
- ids[0] = builder->GetUintConstantId(stage_idx);
- // %289 = OpCompositeConstruct %v4uint %uint_0 %285 %288 %uint_0
- // TODO(greg-lunarg): Add support for all stages
- switch (spv::ExecutionModel(stage_idx)) {
- case spv::ExecutionModel::Vertex: {
- // Load and store VertexId and InstanceId
- uint32_t load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::VertexIndex)),
- builder);
- ids[1] = GenUintCastCode(load_id, builder);
-
- load_id = GenVarLoad(context()->GetBuiltinInputVarId(
- uint32_t(spv::BuiltIn::InstanceIndex)),
- builder);
- ids[2] = GenUintCastCode(load_id, builder);
- } break;
- case spv::ExecutionModel::GLCompute:
- case spv::ExecutionModel::TaskNV:
- case spv::ExecutionModel::MeshNV:
- case spv::ExecutionModel::TaskEXT:
- case spv::ExecutionModel::MeshEXT: {
- // Load and store GlobalInvocationId.
- uint32_t load_id = GenVarLoad(context()->GetBuiltinInputVarId(uint32_t(
- spv::BuiltIn::GlobalInvocationId)),
- builder);
- for (uint32_t u = 0; u < 3u; ++u) {
- ids[u + 1] = builder->AddCompositeExtract(GetUintId(), load_id, {u})
- ->result_id();
- }
- } break;
- case spv::ExecutionModel::Geometry: {
- // Load and store PrimitiveId and InvocationId.
- uint32_t load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)),
- builder);
- ids[1] = load_id;
- load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::InvocationId)),
- builder);
- ids[2] = GenUintCastCode(load_id, builder);
- } break;
- case spv::ExecutionModel::TessellationControl: {
- // Load and store InvocationId and PrimitiveId
- uint32_t load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::InvocationId)),
- builder);
- ids[1] = GenUintCastCode(load_id, builder);
- load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)),
- builder);
- ids[2] = load_id;
- } break;
- case spv::ExecutionModel::TessellationEvaluation: {
- // Load and store PrimitiveId and TessCoord.uv
- uint32_t load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::PrimitiveId)),
- builder);
- ids[1] = load_id;
- load_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::TessCoord)),
- builder);
- Instruction* uvec3_cast_inst =
- builder->AddUnaryOp(GetVec3UintId(), spv::Op::OpBitcast, load_id);
- uint32_t uvec3_cast_id = uvec3_cast_inst->result_id();
- for (uint32_t u = 0; u < 2u; ++u) {
- ids[u + 2] =
- builder->AddCompositeExtract(GetUintId(), uvec3_cast_id, {u})
- ->result_id();
- }
- } break;
- case spv::ExecutionModel::Fragment: {
- // Load FragCoord and convert to Uint
- Instruction* frag_coord_inst = builder->AddLoad(
- GetVec4FloatId(),
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::FragCoord)));
- Instruction* uint_frag_coord_inst = builder->AddUnaryOp(
- GetVec4UintId(), spv::Op::OpBitcast, frag_coord_inst->result_id());
- for (uint32_t u = 0; u < 2u; ++u) {
- ids[u + 1] =
- builder
- ->AddCompositeExtract(GetUintId(),
- uint_frag_coord_inst->result_id(), {u})
- ->result_id();
- }
- } break;
- case spv::ExecutionModel::RayGenerationNV:
- case spv::ExecutionModel::IntersectionNV:
- case spv::ExecutionModel::AnyHitNV:
- case spv::ExecutionModel::ClosestHitNV:
- case spv::ExecutionModel::MissNV:
- case spv::ExecutionModel::CallableNV: {
- // Load and store LaunchIdNV.
- uint32_t launch_id = GenVarLoad(
- context()->GetBuiltinInputVarId(uint32_t(spv::BuiltIn::LaunchIdNV)),
- builder);
- for (uint32_t u = 0; u < 3u; ++u) {
- ids[u + 1] = builder->AddCompositeExtract(GetUintId(), launch_id, {u})
- ->result_id();
- }
- } break;
- default: { assert(false && "unsupported stage"); } break;
- }
- return builder->AddCompositeConstruct(GetVec4UintId(), ids)->result_id();
-}
-
-bool InstrumentPass::AllConstant(const std::vector<uint32_t>& ids) {
- for (auto& id : ids) {
- Instruction* id_inst = context()->get_def_use_mgr()->GetDef(id);
- if (!spvOpcodeIsConstant(id_inst->opcode())) return false;
- }
- return true;
-}
-
-uint32_t InstrumentPass::GenReadFunctionCall(
- uint32_t return_id, uint32_t func_id,
- const std::vector<uint32_t>& func_call_args,
- InstructionBuilder* ref_builder) {
- // If optimizing direct reads and the call has already been generated,
- // use its result
- if (opt_direct_reads_) {
- uint32_t res_id = call2id_[func_call_args];
- if (res_id != 0) return res_id;
- }
- // If the function arguments are all constants, the call can be moved to the
- // first block of the function where its result can be reused. One example
- // where this is profitable is for uniform buffer references, of which there
- // are often many.
- InstructionBuilder builder(ref_builder->GetContext(),
- &*ref_builder->GetInsertPoint(),
- ref_builder->GetPreservedAnalysis());
- bool insert_in_first_block = opt_direct_reads_ && AllConstant(func_call_args);
- if (insert_in_first_block) {
- Instruction* insert_before = &*curr_func_->begin()->tail();
- builder.SetInsertPoint(insert_before);
- }
- uint32_t res_id =
- builder.AddFunctionCall(return_id, func_id, func_call_args)->result_id();
- if (insert_in_first_block) call2id_[func_call_args] = res_id;
- return res_id;
-}
-
-bool InstrumentPass::IsSameBlockOp(const Instruction* inst) const {
- return inst->opcode() == spv::Op::OpSampledImage ||
- inst->opcode() == spv::Op::OpImage;
-}
-
-void InstrumentPass::CloneSameBlockOps(
- std::unique_ptr<Instruction>* inst,
- std::unordered_map<uint32_t, uint32_t>* same_blk_post,
- std::unordered_map<uint32_t, Instruction*>* same_blk_pre,
- BasicBlock* block_ptr) {
- bool changed = false;
- (*inst)->ForEachInId([&same_blk_post, &same_blk_pre, &block_ptr, &changed,
- this](uint32_t* iid) {
- const auto map_itr = (*same_blk_post).find(*iid);
- if (map_itr == (*same_blk_post).end()) {
- const auto map_itr2 = (*same_blk_pre).find(*iid);
- if (map_itr2 != (*same_blk_pre).end()) {
- // Clone pre-call same-block ops, map result id.
- const Instruction* in_inst = map_itr2->second;
- std::unique_ptr<Instruction> sb_inst(in_inst->Clone(context()));
- const uint32_t rid = sb_inst->result_id();
- const uint32_t nid = this->TakeNextId();
- get_decoration_mgr()->CloneDecorations(rid, nid);
- sb_inst->SetResultId(nid);
- get_def_use_mgr()->AnalyzeInstDefUse(&*sb_inst);
- (*same_blk_post)[rid] = nid;
- *iid = nid;
- changed = true;
- CloneSameBlockOps(&sb_inst, same_blk_post, same_blk_pre, block_ptr);
- block_ptr->AddInstruction(std::move(sb_inst));
- }
- } else {
- // Reset same-block op operand if necessary
- if (*iid != map_itr->second) {
- *iid = map_itr->second;
- changed = true;
- }
- }
- });
- if (changed) get_def_use_mgr()->AnalyzeInstUse(&**inst);
-}
-
-void InstrumentPass::UpdateSucceedingPhis(
- std::vector<std::unique_ptr<BasicBlock>>& new_blocks) {
- const auto first_blk = new_blocks.begin();
- const auto last_blk = new_blocks.end() - 1;
- const uint32_t first_id = (*first_blk)->id();
- const uint32_t last_id = (*last_blk)->id();
- const BasicBlock& const_last_block = *last_blk->get();
- const_last_block.ForEachSuccessorLabel(
- [&first_id, &last_id, this](const uint32_t succ) {
- BasicBlock* sbp = this->id2block_[succ];
- sbp->ForEachPhiInst([&first_id, &last_id, this](Instruction* phi) {
- bool changed = false;
- phi->ForEachInId([&first_id, &last_id, &changed](uint32_t* id) {
- if (*id == first_id) {
- *id = last_id;
- changed = true;
- }
- });
- if (changed) get_def_use_mgr()->AnalyzeInstUse(phi);
- });
- });
-}
-
-analysis::Integer* InstrumentPass::GetInteger(uint32_t width, bool is_signed) {
- analysis::Integer i(width, is_signed);
- analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&i);
- assert(type && type->AsInteger());
- return type->AsInteger();
-}
-
-analysis::Struct* InstrumentPass::GetStruct(
- const std::vector<const analysis::Type*>& fields) {
- analysis::Struct s(fields);
- analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&s);
- assert(type && type->AsStruct());
- return type->AsStruct();
-}
-
-analysis::RuntimeArray* InstrumentPass::GetRuntimeArray(
- const analysis::Type* element) {
- analysis::RuntimeArray r(element);
- analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&r);
- assert(type && type->AsRuntimeArray());
- return type->AsRuntimeArray();
-}
-
-analysis::Array* InstrumentPass::GetArray(const analysis::Type* element,
- uint32_t length) {
- uint32_t length_id = context()->get_constant_mgr()->GetUIntConstId(length);
- analysis::Array::LengthInfo length_info{
- length_id, {analysis::Array::LengthInfo::Case::kConstant, length}};
-
- analysis::Array r(element, length_info);
-
- analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&r);
- assert(type && type->AsArray());
- return type->AsArray();
-}
-
-analysis::Function* InstrumentPass::GetFunction(
- const analysis::Type* return_val,
- const std::vector<const analysis::Type*>& args) {
- analysis::Function func(return_val, args);
- analysis::Type* type = context()->get_type_mgr()->GetRegisteredType(&func);
- assert(type && type->AsFunction());
- return type->AsFunction();
-}
-
-analysis::RuntimeArray* InstrumentPass::GetUintXRuntimeArrayType(
- uint32_t width, analysis::RuntimeArray** rarr_ty) {
- if (*rarr_ty == nullptr) {
- *rarr_ty = GetRuntimeArray(GetInteger(width, false));
- uint32_t uint_arr_ty_id =
- context()->get_type_mgr()->GetTypeInstruction(*rarr_ty);
- // By the Vulkan spec, a pre-existing RuntimeArray of uint must be part of
- // a block, and will therefore be decorated with an ArrayStride. Therefore
- // the undecorated type returned here will not be pre-existing and can
- // safely be decorated. Since this type is now decorated, it is out of
- // sync with the TypeManager and therefore the TypeManager must be
- // invalidated after this pass.
- assert(get_def_use_mgr()->NumUses(uint_arr_ty_id) == 0 &&
- "used RuntimeArray type returned");
- get_decoration_mgr()->AddDecorationVal(
- uint_arr_ty_id, uint32_t(spv::Decoration::ArrayStride), width / 8u);
- }
- return *rarr_ty;
-}
-
-analysis::RuntimeArray* InstrumentPass::GetUintRuntimeArrayType(
- uint32_t width) {
- analysis::RuntimeArray** rarr_ty =
- (width == 64) ? &uint64_rarr_ty_ : &uint32_rarr_ty_;
- return GetUintXRuntimeArrayType(width, rarr_ty);
-}
-
-void InstrumentPass::AddStorageBufferExt() {
- if (storage_buffer_ext_defined_) return;
- if (!get_feature_mgr()->HasExtension(kSPV_KHR_storage_buffer_storage_class)) {
- context()->AddExtension("SPV_KHR_storage_buffer_storage_class");
- }
- storage_buffer_ext_defined_ = true;
-}
-
-uint32_t InstrumentPass::GetFloatId() {
- if (float_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Float float_ty(32);
- analysis::Type* reg_float_ty = type_mgr->GetRegisteredType(&float_ty);
- float_id_ = type_mgr->GetTypeInstruction(reg_float_ty);
- }
- return float_id_;
-}
-
-uint32_t InstrumentPass::GetVec4FloatId() {
- if (v4float_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Float float_ty(32);
- analysis::Type* reg_float_ty = type_mgr->GetRegisteredType(&float_ty);
- analysis::Vector v4float_ty(reg_float_ty, 4);
- analysis::Type* reg_v4float_ty = type_mgr->GetRegisteredType(&v4float_ty);
- v4float_id_ = type_mgr->GetTypeInstruction(reg_v4float_ty);
- }
- return v4float_id_;
-}
-
-uint32_t InstrumentPass::GetUintId() {
- if (uint_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Integer uint_ty(32, false);
- analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty);
- uint_id_ = type_mgr->GetTypeInstruction(reg_uint_ty);
- }
- return uint_id_;
-}
-
-uint32_t InstrumentPass::GetUint64Id() {
- if (uint64_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Integer uint64_ty(64, false);
- analysis::Type* reg_uint64_ty = type_mgr->GetRegisteredType(&uint64_ty);
- uint64_id_ = type_mgr->GetTypeInstruction(reg_uint64_ty);
- }
- return uint64_id_;
-}
-
-uint32_t InstrumentPass::GetUint8Id() {
- if (uint8_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Integer uint8_ty(8, false);
- analysis::Type* reg_uint8_ty = type_mgr->GetRegisteredType(&uint8_ty);
- uint8_id_ = type_mgr->GetTypeInstruction(reg_uint8_ty);
- }
- return uint8_id_;
-}
-
-uint32_t InstrumentPass::GetVecUintId(uint32_t len) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Integer uint_ty(32, false);
- analysis::Type* reg_uint_ty = type_mgr->GetRegisteredType(&uint_ty);
- analysis::Vector v_uint_ty(reg_uint_ty, len);
- analysis::Type* reg_v_uint_ty = type_mgr->GetRegisteredType(&v_uint_ty);
- uint32_t v_uint_id = type_mgr->GetTypeInstruction(reg_v_uint_ty);
- return v_uint_id;
-}
-
-uint32_t InstrumentPass::GetVec4UintId() {
- if (v4uint_id_ == 0) v4uint_id_ = GetVecUintId(4u);
- return v4uint_id_;
-}
-
-uint32_t InstrumentPass::GetVec3UintId() {
- if (v3uint_id_ == 0) v3uint_id_ = GetVecUintId(3u);
- return v3uint_id_;
-}
-
-uint32_t InstrumentPass::GetBoolId() {
- if (bool_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Bool bool_ty;
- analysis::Type* reg_bool_ty = type_mgr->GetRegisteredType(&bool_ty);
- bool_id_ = type_mgr->GetTypeInstruction(reg_bool_ty);
- }
- return bool_id_;
-}
-
-uint32_t InstrumentPass::GetVoidId() {
- if (void_id_ == 0) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
- analysis::Void void_ty;
- analysis::Type* reg_void_ty = type_mgr->GetRegisteredType(&void_ty);
- void_id_ = type_mgr->GetTypeInstruction(reg_void_ty);
- }
- return void_id_;
-}
-
-void InstrumentPass::SplitBlock(
- BasicBlock::iterator inst_itr, UptrVectorIterator<BasicBlock> block_itr,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
- // Make sure def/use analysis is done before we start moving instructions
- // out of function
- (void)get_def_use_mgr();
- // Move original block's preceding instructions into first new block
- std::unique_ptr<BasicBlock> first_blk_ptr;
- MovePreludeCode(inst_itr, block_itr, &first_blk_ptr);
- InstructionBuilder builder(
- context(), &*first_blk_ptr,
- IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- uint32_t split_blk_id = TakeNextId();
- std::unique_ptr<Instruction> split_label(NewLabel(split_blk_id));
- (void)builder.AddBranch(split_blk_id);
- new_blocks->push_back(std::move(first_blk_ptr));
- // Move remaining instructions into split block and add to new blocks
- std::unique_ptr<BasicBlock> split_blk_ptr(
- new BasicBlock(std::move(split_label)));
- MovePostludeCode(block_itr, &*split_blk_ptr);
- new_blocks->push_back(std::move(split_blk_ptr));
-}
-
-bool InstrumentPass::InstrumentFunction(Function* func, uint32_t stage_idx,
- InstProcessFunction& pfn) {
- curr_func_ = func;
- call2id_.clear();
- bool first_block_split = false;
- bool modified = false;
- // Apply instrumentation function to each instruction.
- // Using block iterators here because of block erasures and insertions.
- std::vector<std::unique_ptr<BasicBlock>> new_blks;
- for (auto bi = func->begin(); bi != func->end(); ++bi) {
- for (auto ii = bi->begin(); ii != bi->end();) {
- // Split all executable instructions out of first block into a following
- // block. This will allow function calls to be inserted into the first
- // block without interfering with the instrumentation algorithm.
- if (opt_direct_reads_ && !first_block_split) {
- if (ii->opcode() != spv::Op::OpVariable) {
- SplitBlock(ii, bi, &new_blks);
- first_block_split = true;
- }
- } else {
- pfn(ii, bi, stage_idx, &new_blks);
- }
- // If no new code, continue
- if (new_blks.size() == 0) {
- ++ii;
- continue;
- }
- // Add new blocks to label id map
- for (auto& blk : new_blks) id2block_[blk->id()] = &*blk;
- // If there are new blocks we know there will always be two or
- // more, so update succeeding phis with label of new last block.
- size_t newBlocksSize = new_blks.size();
- assert(newBlocksSize > 1);
- UpdateSucceedingPhis(new_blks);
- // Replace original block with new block(s)
- bi = bi.Erase();
- for (auto& bb : new_blks) {
- bb->SetParent(func);
- }
- bi = bi.InsertBefore(&new_blks);
- // Reset block iterator to last new block
- for (size_t i = 0; i < newBlocksSize - 1; i++) ++bi;
- modified = true;
- // Restart instrumenting at beginning of last new block,
- // but skip over any new phi or copy instruction.
- ii = bi->begin();
- if (ii->opcode() == spv::Op::OpPhi ||
- ii->opcode() == spv::Op::OpCopyObject)
- ++ii;
- new_blks.clear();
- }
- }
- return modified;
-}
-
-bool InstrumentPass::InstProcessCallTreeFromRoots(InstProcessFunction& pfn,
- std::queue<uint32_t>* roots,
- uint32_t stage_idx) {
- bool modified = false;
- std::unordered_set<uint32_t> done;
- // Don't process input and output functions
- for (auto& ifn : param2input_func_id_) done.insert(ifn.second);
- for (auto& ofn : param2output_func_id_) done.insert(ofn.second);
- // Process all functions from roots
- while (!roots->empty()) {
- const uint32_t fi = roots->front();
- roots->pop();
- if (done.insert(fi).second) {
- Function* fn = id2function_.at(fi);
- // Add calls first so we don't add new output function
- context()->AddCalls(fn, roots);
- modified = InstrumentFunction(fn, stage_idx, pfn) || modified;
- }
- }
- return modified;
-}
-
-bool InstrumentPass::InstProcessEntryPointCallTree(InstProcessFunction& pfn) {
- uint32_t stage_id;
- if (use_stage_info_) {
- // Make sure all entry points have the same execution model. Do not
- // instrument if they do not.
- // TODO(greg-lunarg): Handle mixed stages. Technically, a shader module
- // can contain entry points with different execution models, although
- // such modules will likely be rare as GLSL and HLSL are geared toward
- // one model per module. In such cases we will need
- // to clone any functions which are in the call trees of entrypoints
- // with differing execution models.
- spv::ExecutionModel stage = context()->GetStage();
- // Check for supported stages
- if (stage != spv::ExecutionModel::Vertex &&
- stage != spv::ExecutionModel::Fragment &&
- stage != spv::ExecutionModel::Geometry &&
- stage != spv::ExecutionModel::GLCompute &&
- stage != spv::ExecutionModel::TessellationControl &&
- stage != spv::ExecutionModel::TessellationEvaluation &&
- stage != spv::ExecutionModel::TaskNV &&
- stage != spv::ExecutionModel::MeshNV &&
- stage != spv::ExecutionModel::RayGenerationNV &&
- stage != spv::ExecutionModel::IntersectionNV &&
- stage != spv::ExecutionModel::AnyHitNV &&
- stage != spv::ExecutionModel::ClosestHitNV &&
- stage != spv::ExecutionModel::MissNV &&
- stage != spv::ExecutionModel::CallableNV &&
- stage != spv::ExecutionModel::TaskEXT &&
- stage != spv::ExecutionModel::MeshEXT) {
- if (consumer()) {
- std::string message = "Stage not supported by instrumentation";
- consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str());
- }
- return false;
- }
- stage_id = static_cast<uint32_t>(stage);
- } else {
- stage_id = 0;
- }
- // Add together the roots of all entry points
- std::queue<uint32_t> roots;
- for (auto& e : get_module()->entry_points()) {
- roots.push(e.GetSingleWordInOperand(kEntryPointFunctionIdInIdx));
- }
- bool modified = InstProcessCallTreeFromRoots(pfn, &roots, stage_id);
- return modified;
-}
-
-void InstrumentPass::InitializeInstrument() {
- float_id_ = 0;
- v4float_id_ = 0;
- uint_id_ = 0;
- uint64_id_ = 0;
- uint8_id_ = 0;
- v4uint_id_ = 0;
- v3uint_id_ = 0;
- bool_id_ = 0;
- void_id_ = 0;
- storage_buffer_ext_defined_ = false;
- uint32_rarr_ty_ = nullptr;
- uint64_rarr_ty_ = nullptr;
-
- // clear collections
- id2function_.clear();
- id2block_.clear();
-
- // clear maps
- param2input_func_id_.clear();
- param2output_func_id_.clear();
-
- // Initialize function and block maps.
- for (auto& fn : *get_module()) {
- id2function_[fn.result_id()] = &fn;
- for (auto& blk : fn) {
- id2block_[blk.id()] = &blk;
- }
- }
-
- // Remember original instruction offsets
- uint32_t module_offset = 0;
- Module* module = get_module();
- for (auto& i : context()->capabilities()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->extensions()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->ext_inst_imports()) {
- (void)i;
- ++module_offset;
- }
- ++module_offset; // memory_model
- for (auto& i : module->entry_points()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->execution_modes()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->debugs1()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->debugs2()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->debugs3()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->ext_inst_debuginfo()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->annotations()) {
- (void)i;
- ++module_offset;
- }
- for (auto& i : module->types_values()) {
- module_offset += 1;
- module_offset += static_cast<uint32_t>(i.dbg_line_insts().size());
- }
-
- auto curr_fn = get_module()->begin();
- for (; curr_fn != get_module()->end(); ++curr_fn) {
- // Count function instruction
- module_offset += 1;
- curr_fn->ForEachParam(
- [&module_offset](const Instruction*) { module_offset += 1; }, true);
- for (auto& blk : *curr_fn) {
- // Count label
- module_offset += 1;
- for (auto& inst : blk) {
- module_offset += static_cast<uint32_t>(inst.dbg_line_insts().size());
- uid2offset_[inst.unique_id()] = module_offset;
- module_offset += 1;
- }
- }
- // Count function end instruction
- module_offset += 1;
- }
-}
-
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/instrument_pass.h b/third_party/SPIRV-Tools/source/opt/instrument_pass.h
deleted file mode 100644
index e4408c9..0000000
--- a/third_party/SPIRV-Tools/source/opt/instrument_pass.h
+++ /dev/null
@@ -1,326 +0,0 @@
-// Copyright (c) 2018 The Khronos Group Inc.
-// Copyright (c) 2018 Valve Corporation
-// Copyright (c) 2018 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef LIBSPIRV_OPT_INSTRUMENT_PASS_H_
-#define LIBSPIRV_OPT_INSTRUMENT_PASS_H_
-
-#include <list>
-#include <memory>
-#include <vector>
-
-#include "source/opt/ir_builder.h"
-#include "source/opt/pass.h"
-#include "spirv-tools/instrument.hpp"
-
-// This is a base class to assist in the creation of passes which instrument
-// shader modules. More specifically, passes which replace instructions with a
-// larger and more capable set of instructions. Commonly, these new
-// instructions will add testing of operands and execute different
-// instructions depending on the outcome, including outputting of debug
-// information into a buffer created especially for that purpose.
-//
-// This class contains helper functions to create an InstProcessFunction,
-// which is the heart of any derived class implementing a specific
-// instrumentation pass. It takes an instruction as an argument, decides
-// if it should be instrumented, and generates code to replace it. This class
-// also supplies function InstProcessEntryPointCallTree which applies the
-// InstProcessFunction to every reachable instruction in a module and replaces
-// the instruction with new instructions if generated.
-//
-// Chief among the helper functions are output code generation functions,
-// used to generate code in the shader which writes data to output buffers
-// associated with that validation. Currently one such function,
-// GenDebugStreamWrite, exists. Other such functions may be added in the
-// future. Each is accompanied by documentation describing the format of
-// its output buffer.
-//
-// A validation pass may read or write multiple buffers. All such buffers
-// are located in a single debug descriptor set whose index is passed at the
-// creation of the instrumentation pass. The bindings of the buffers used by
-// a validation pass are permanently assigned and fixed and documented by
-// the kDebugOutput* static consts.
-
-namespace spvtools {
-namespace opt {
-
-class InstrumentPass : public Pass {
- using cbb_ptr = const BasicBlock*;
-
- public:
- using InstProcessFunction =
- std::function<void(BasicBlock::iterator, UptrVectorIterator<BasicBlock>,
- uint32_t, std::vector<std::unique_ptr<BasicBlock>>*)>;
-
- ~InstrumentPass() override = default;
-
- IRContext::Analysis GetPreservedAnalyses() override {
- return IRContext::kAnalysisDefUse | IRContext::kAnalysisDecorations |
- IRContext::kAnalysisCombinators | IRContext::kAnalysisNameMap |
- IRContext::kAnalysisBuiltinVarId | IRContext::kAnalysisConstants;
- }
-
- protected:
- // Create instrumentation pass for |validation_id| which utilizes descriptor
- // set |desc_set| for debug input and output buffers and writes |shader_id|
- // into debug output records. |opt_direct_reads| indicates that the pass
- // will see direct input buffer reads and should prepare to optimize them.
- InstrumentPass(uint32_t desc_set, uint32_t shader_id, bool opt_direct_reads,
- bool use_stage_info)
- : Pass(),
- desc_set_(desc_set),
- shader_id_(shader_id),
- opt_direct_reads_(opt_direct_reads),
- use_stage_info_(use_stage_info) {}
-
- // Initialize state for instrumentation of module.
- void InitializeInstrument();
-
- // Call |pfn| on all instructions in all functions in the call tree of the
- // entry points in |module|. If code is generated for an instruction, replace
- // the instruction's block with the new blocks that are generated. Continue
- // processing at the top of the last new block.
- bool InstProcessEntryPointCallTree(InstProcessFunction& pfn);
-
- // Move all code in |ref_block_itr| preceding the instruction |ref_inst_itr|
- // to be instrumented into block |new_blk_ptr|.
- void MovePreludeCode(BasicBlock::iterator ref_inst_itr,
- UptrVectorIterator<BasicBlock> ref_block_itr,
- std::unique_ptr<BasicBlock>* new_blk_ptr);
-
- // Move all code in |ref_block_itr| succeeding the instruction |ref_inst_itr|
- // to be instrumented into block |new_blk_ptr|.
- void MovePostludeCode(UptrVectorIterator<BasicBlock> ref_block_itr,
- BasicBlock* new_blk_ptr);
-
- // Return true if all instructions in |ids| are constants or spec constants.
- bool AllConstant(const std::vector<uint32_t>& ids);
-
- uint32_t GenReadFunctionCall(uint32_t return_id, uint32_t func_id,
- const std::vector<uint32_t>& args,
- InstructionBuilder* builder);
-
- // Generate code to convert integer |value_id| to 32bit, if needed. Return
- // an id to the 32bit equivalent.
- uint32_t Gen32BitCvtCode(uint32_t value_id, InstructionBuilder* builder);
-
- // Generate code to cast integer |value_id| to 32bit unsigned, if needed.
- // Return an id to the Uint equivalent.
- uint32_t GenUintCastCode(uint32_t value_id, InstructionBuilder* builder);
-
- std::unique_ptr<Function> StartFunction(
- uint32_t func_id, const analysis::Type* return_type,
- const std::vector<const analysis::Type*>& param_types);
-
- std::vector<uint32_t> AddParameters(
- Function& func, const std::vector<const analysis::Type*>& param_types);
-
- std::unique_ptr<Instruction> EndFunction();
-
- // Return new label.
- std::unique_ptr<Instruction> NewLabel(uint32_t label_id);
-
- // Set the name function parameter or local variable
- std::unique_ptr<Instruction> NewName(uint32_t id,
- const std::string& name_str);
-
- // Return id for 32-bit unsigned type
- uint32_t GetUintId();
-
- // Return id for 64-bit unsigned type
- uint32_t GetUint64Id();
-
- // Return id for 8-bit unsigned type
- uint32_t GetUint8Id();
-
- // Return id for 32-bit unsigned type
- uint32_t GetBoolId();
-
- // Return id for void type
- uint32_t GetVoidId();
-
- // Get registered type structures
- analysis::Integer* GetInteger(uint32_t width, bool is_signed);
- analysis::Struct* GetStruct(const std::vector<const analysis::Type*>& fields);
- analysis::RuntimeArray* GetRuntimeArray(const analysis::Type* element);
- analysis::Array* GetArray(const analysis::Type* element, uint32_t size);
- analysis::Function* GetFunction(
- const analysis::Type* return_val,
- const std::vector<const analysis::Type*>& args);
-
- // Return pointer to type for runtime array of uint
- analysis::RuntimeArray* GetUintXRuntimeArrayType(
- uint32_t width, analysis::RuntimeArray** rarr_ty);
-
- // Return pointer to type for runtime array of uint
- analysis::RuntimeArray* GetUintRuntimeArrayType(uint32_t width);
-
- // Add storage buffer extension if needed
- void AddStorageBufferExt();
-
- // Return id for 32-bit float type
- uint32_t GetFloatId();
-
- // Return id for v4float type
- uint32_t GetVec4FloatId();
-
- // Return id for uint vector type of |length|
- uint32_t GetVecUintId(uint32_t length);
-
- // Return id for v4uint type
- uint32_t GetVec4UintId();
-
- // Return id for v3uint type
- uint32_t GetVec3UintId();
-
- // Split block |block_itr| into two new blocks where the second block
- // contains |inst_itr| and place in |new_blocks|.
- void SplitBlock(BasicBlock::iterator inst_itr,
- UptrVectorIterator<BasicBlock> block_itr,
- std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
-
- // Apply instrumentation function |pfn| to every instruction in |func|.
- // If code is generated for an instruction, replace the instruction's
- // block with the new blocks that are generated. Continue processing at the
- // top of the last new block.
- virtual bool InstrumentFunction(Function* func, uint32_t stage_idx,
- InstProcessFunction& pfn);
-
- // Call |pfn| on all functions in the call tree of the function
- // ids in |roots|.
- bool InstProcessCallTreeFromRoots(InstProcessFunction& pfn,
- std::queue<uint32_t>* roots,
- uint32_t stage_idx);
-
- // Generate instructions into |builder| which will load |var_id| and return
- // its result id.
- uint32_t GenVarLoad(uint32_t var_id, InstructionBuilder* builder);
-
- uint32_t GenStageInfo(uint32_t stage_idx, InstructionBuilder* builder);
-
- // Return true if instruction must be in the same block that its result
- // is used.
- bool IsSameBlockOp(const Instruction* inst) const;
-
- // Clone operands which must be in same block as consumer instructions.
- // Look in same_blk_pre for instructions that need cloning. Look in
- // same_blk_post for instructions already cloned. Add cloned instruction
- // to same_blk_post.
- void CloneSameBlockOps(
- std::unique_ptr<Instruction>* inst,
- std::unordered_map<uint32_t, uint32_t>* same_blk_post,
- std::unordered_map<uint32_t, Instruction*>* same_blk_pre,
- BasicBlock* block_ptr);
-
- // Update phis in succeeding blocks to point to new last block
- void UpdateSucceedingPhis(
- std::vector<std::unique_ptr<BasicBlock>>& new_blocks);
-
- // Debug descriptor set index
- uint32_t desc_set_;
-
- // Shader module ID written into output record
- uint32_t shader_id_;
-
- // Map from function id to function pointer.
- std::unordered_map<uint32_t, Function*> id2function_;
-
- // Map from block's label id to block. TODO(dnovillo): This is superfluous wrt
- // CFG. It has functionality not present in CFG. Consolidate.
- std::unordered_map<uint32_t, BasicBlock*> id2block_;
-
- // Map from instruction's unique id to offset in original file.
- std::unordered_map<uint32_t, uint32_t> uid2offset_;
-
- // id for debug output function
- std::unordered_map<uint32_t, uint32_t> param2output_func_id_;
-
- // ids for debug input functions
- std::unordered_map<uint32_t, uint32_t> param2input_func_id_;
-
- // id for 32-bit float type
- uint32_t float_id_{0};
-
- // id for v4float type
- uint32_t v4float_id_{0};
-
- // id for v4uint type
- uint32_t v4uint_id_{0};
-
- // id for v3uint type
- uint32_t v3uint_id_{0};
-
- // id for 32-bit unsigned type
- uint32_t uint_id_{0};
-
- // id for 64-bit unsigned type
- uint32_t uint64_id_{0};
-
- // id for 8-bit unsigned type
- uint32_t uint8_id_{0};
-
- // id for bool type
- uint32_t bool_id_{0};
-
- // id for void type
- uint32_t void_id_{0};
-
- // boolean to remember storage buffer extension
- bool storage_buffer_ext_defined_{false};
-
- // runtime array of uint type
- analysis::RuntimeArray* uint64_rarr_ty_{nullptr};
-
- // runtime array of uint type
- analysis::RuntimeArray* uint32_rarr_ty_{nullptr};
-
- // Pre-instrumentation same-block insts
- std::unordered_map<uint32_t, Instruction*> same_block_pre_;
-
- // Post-instrumentation same-block op ids
- std::unordered_map<uint32_t, uint32_t> same_block_post_;
-
- // Map function calls to result id. Clear for every function.
- // This is for debug input reads with constant arguments that
- // have been generated into the first block of the function.
- // This mechanism is used to avoid multiple identical debug
- // input buffer reads.
- struct vector_hash_ {
- std::size_t operator()(const std::vector<uint32_t>& v) const {
- std::size_t hash = v.size();
- for (auto& u : v) {
- hash ^= u + 0x9e3779b9 + (hash << 11) + (hash >> 21);
- }
- return hash;
- }
- };
- std::unordered_map<std::vector<uint32_t>, uint32_t, vector_hash_> call2id_;
-
- // Function currently being instrumented
- Function* curr_func_{nullptr};
-
- // Optimize direct debug input buffer reads. Specifically, move all such
- // reads with constant args to first block and reuse them.
- const bool opt_direct_reads_;
-
- // Set true if the instrumentation needs to know the current stage.
- // Note that this does not work with multi-stage modules.
- const bool use_stage_info_;
-};
-
-} // namespace opt
-} // namespace spvtools
-
-#endif // LIBSPIRV_OPT_INSTRUMENT_PASS_H_
diff --git a/third_party/SPIRV-Tools/source/opt/invocation_interlock_placement_pass.cpp b/third_party/SPIRV-Tools/source/opt/invocation_interlock_placement_pass.cpp
index 642e2d2..f25f554 100644
--- a/third_party/SPIRV-Tools/source/opt/invocation_interlock_placement_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/invocation_interlock_placement_pass.cpp
@@ -26,10 +26,10 @@
#include <vector>
#include "source/enum_set.h"
-#include "source/enum_string_mapping.h"
#include "source/opt/ir_context.h"
#include "source/opt/reflect.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "source/util/string_utils.h"
namespace spvtools {
diff --git a/third_party/SPIRV-Tools/source/opt/ir_builder.h b/third_party/SPIRV-Tools/source/opt/ir_builder.h
index f3e0afc..f7ac692 100644
--- a/third_party/SPIRV-Tools/source/opt/ir_builder.h
+++ b/third_party/SPIRV-Tools/source/opt/ir_builder.h
@@ -15,6 +15,7 @@
#ifndef SOURCE_OPT_IR_BUILDER_H_
#define SOURCE_OPT_IR_BUILDER_H_
+#include <cassert>
#include <limits>
#include <memory>
#include <utility>
@@ -480,8 +481,11 @@
return AddInstruction(std::move(select));
}
- Instruction* AddAccessChain(uint32_t type_id, uint32_t base_ptr_id,
- std::vector<uint32_t> ids) {
+ Instruction* AddOpcodeAccessChain(spv::Op opcode, uint32_t type_id,
+ uint32_t base_ptr_id,
+ const std::vector<uint32_t>& ids) {
+ assert(opcode == spv::Op::OpAccessChain ||
+ opcode == spv::Op::OpInBoundsAccessChain);
std::vector<Operand> operands;
operands.push_back({SPV_OPERAND_TYPE_ID, {base_ptr_id}});
@@ -490,12 +494,22 @@
}
// TODO(1841): Handle id overflow.
- std::unique_ptr<Instruction> new_inst(
- new Instruction(GetContext(), spv::Op::OpAccessChain, type_id,
- GetContext()->TakeNextId(), operands));
+ std::unique_ptr<Instruction> new_inst(new Instruction(
+ GetContext(), opcode, type_id, GetContext()->TakeNextId(), operands));
return AddInstruction(std::move(new_inst));
}
+ Instruction* AddAccessChain(uint32_t type_id, uint32_t base_ptr_id,
+ const std::vector<uint32_t>& ids) {
+ return AddOpcodeAccessChain(spv::Op::OpAccessChain, type_id, base_ptr_id,
+ ids);
+ }
+ Instruction* AddInBoundsAccessChain(uint32_t type_id, uint32_t base_ptr_id,
+ const std::vector<uint32_t>& ids) {
+ return AddOpcodeAccessChain(spv::Op::OpInBoundsAccessChain, type_id,
+ base_ptr_id, ids);
+ }
+
Instruction* AddLoad(uint32_t type_id, uint32_t base_ptr_id,
uint32_t alignment = 0) {
std::vector<Operand> operands;
@@ -514,9 +528,19 @@
return AddInstruction(std::move(new_inst));
}
+ Instruction* AddCopyObject(uint32_t type_id, uint32_t value_id) {
+ std::vector<Operand> operands{{SPV_OPERAND_TYPE_ID, {value_id}}};
+
+ // TODO(1841): Handle id overflow.
+ std::unique_ptr<Instruction> new_inst(
+ new Instruction(GetContext(), spv::Op::OpCopyObject, type_id,
+ GetContext()->TakeNextId(), operands));
+ return AddInstruction(std::move(new_inst));
+ }
+
Instruction* AddVariable(uint32_t type_id, uint32_t storage_class) {
std::vector<Operand> operands;
- operands.push_back({SPV_OPERAND_TYPE_ID, {storage_class}});
+ operands.push_back({SPV_OPERAND_TYPE_STORAGE_CLASS, {storage_class}});
std::unique_ptr<Instruction> new_inst(
new Instruction(GetContext(), spv::Op::OpVariable, type_id,
GetContext()->TakeNextId(), operands));
@@ -572,6 +596,26 @@
return AddInstruction(std::move(new_inst));
}
+ Instruction* AddDecoration(uint32_t target_id, spv::Decoration d,
+ const std::vector<uint32_t>& literals) {
+ std::vector<Operand> operands;
+ operands.push_back({SPV_OPERAND_TYPE_ID, {target_id}});
+ operands.push_back({SPV_OPERAND_TYPE_DECORATION, {uint32_t(d)}});
+ for (uint32_t literal : literals) {
+ operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {literal}});
+ }
+
+ std::unique_ptr<Instruction> new_inst(
+ new Instruction(GetContext(), spv::Op::OpDecorate, 0, 0, operands));
+ // Decorations are annotation instructions. Add it via the IR context,
+ // so the decoration manager will be updated.
+ // Decorations don't belong to basic blocks, so there is no need
+ // to update the instruction to block mapping.
+ Instruction* result = new_inst.get();
+ GetContext()->AddAnnotationInst(std::move(new_inst));
+ return result;
+ }
+
Instruction* AddNaryExtendedInstruction(
uint32_t result_type, uint32_t set, uint32_t instruction,
const std::vector<uint32_t>& ext_operands) {
@@ -593,6 +637,23 @@
return AddInstruction(std::move(new_inst));
}
+ Instruction* AddSampledImage(uint32_t sampled_image_type_id,
+ uint32_t image_id, uint32_t sampler_id) {
+ std::vector<Operand> operands;
+ operands.push_back({SPV_OPERAND_TYPE_ID, {image_id}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {sampler_id}});
+
+ uint32_t result_id = GetContext()->TakeNextId();
+ if (result_id == 0) {
+ return nullptr;
+ }
+
+ std::unique_ptr<Instruction> new_inst(
+ new Instruction(GetContext(), spv::Op::OpSampledImage,
+ sampled_image_type_id, result_id, operands));
+ return AddInstruction(std::move(new_inst));
+ }
+
// Inserts the new instruction before the insertion point.
Instruction* AddInstruction(std::unique_ptr<Instruction>&& insn) {
Instruction* insn_ptr = &*insert_before_.InsertBefore(std::move(insn));
diff --git a/third_party/SPIRV-Tools/source/opt/ir_context.cpp b/third_party/SPIRV-Tools/source/opt/ir_context.cpp
index d864b7c..3f41965 100644
--- a/third_party/SPIRV-Tools/source/opt/ir_context.cpp
+++ b/third_party/SPIRV-Tools/source/opt/ir_context.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2017 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -539,6 +541,7 @@
(uint32_t)spv::Op::OpTypeHitObjectNV,
(uint32_t)spv::Op::OpTypeArray,
(uint32_t)spv::Op::OpTypeRuntimeArray,
+ (uint32_t)spv::Op::OpTypeNodePayloadArrayAMDX,
(uint32_t)spv::Op::OpTypeStruct,
(uint32_t)spv::Op::OpTypeOpaque,
(uint32_t)spv::Op::OpTypePointer,
@@ -561,6 +564,7 @@
(uint32_t)spv::Op::OpCompositeConstruct,
(uint32_t)spv::Op::OpCompositeExtract,
(uint32_t)spv::Op::OpCompositeInsert,
+ (uint32_t)spv::Op::OpCopyLogical,
(uint32_t)spv::Op::OpCopyObject,
(uint32_t)spv::Op::OpTranspose,
(uint32_t)spv::Op::OpSampledImage,
@@ -926,9 +930,35 @@
void IRContext::AddCalls(const Function* func, std::queue<uint32_t>* todo) {
for (auto bi = func->begin(); bi != func->end(); ++bi)
- for (auto ii = bi->begin(); ii != bi->end(); ++ii)
+ for (auto ii = bi->begin(); ii != bi->end(); ++ii) {
if (ii->opcode() == spv::Op::OpFunctionCall)
todo->push(ii->GetSingleWordInOperand(0));
+ if (ii->opcode() == spv::Op::OpCooperativeMatrixPerElementOpNV)
+ todo->push(ii->GetSingleWordInOperand(1));
+ if (ii->opcode() == spv::Op::OpCooperativeMatrixReduceNV)
+ todo->push(ii->GetSingleWordInOperand(2));
+ if (ii->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) {
+ const auto memory_operands_index = 3;
+ auto mask = ii->GetSingleWordInOperand(memory_operands_index);
+
+ uint32_t count = 1;
+ if (mask & uint32_t(spv::MemoryAccessMask::Aligned)) ++count;
+ if (mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR))
+ ++count;
+ if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR))
+ ++count;
+
+ const auto tensor_operands_index = memory_operands_index + count;
+ mask = ii->GetSingleWordInOperand(tensor_operands_index);
+ count = 1;
+ if (mask & uint32_t(spv::TensorAddressingOperandsMask::TensorView))
+ ++count;
+
+ if (mask & uint32_t(spv::TensorAddressingOperandsMask::DecodeFunc)) {
+ todo->push(ii->GetSingleWordInOperand(tensor_operands_index + count));
+ }
+ }
+ }
}
bool IRContext::ProcessEntryPointCallTree(ProcessFunction& pfn) {
diff --git a/third_party/SPIRV-Tools/source/opt/ir_context.h b/third_party/SPIRV-Tools/source/opt/ir_context.h
index ef7c458..d2b2092 100644
--- a/third_party/SPIRV-Tools/source/opt/ir_context.h
+++ b/third_party/SPIRV-Tools/source/opt/ir_context.h
@@ -27,7 +27,6 @@
#include <vector>
#include "source/assembly_grammar.h"
-#include "source/enum_string_mapping.h"
#include "source/opt/cfg.h"
#include "source/opt/constants.h"
#include "source/opt/debug_info_manager.h"
@@ -44,6 +43,7 @@
#include "source/opt/struct_cfg_analysis.h"
#include "source/opt/type_manager.h"
#include "source/opt/value_number_table.h"
+#include "source/table2.h"
#include "source/util/make_unique.h"
#include "source/util/string_utils.h"
@@ -202,8 +202,9 @@
inline IteratorRange<Module::const_inst_iterator> debugs3() const;
// Iterators for debug info instructions (excluding OpLine & OpNoLine)
- // contained in this module. These are OpExtInst for DebugInfo extension
- // placed between section 9 and 10.
+ // contained in this module. These are OpExtInst &
+ // OpExtInstWithForwardRefsKHR for DebugInfo extension placed between section
+ // 9 and 10.
inline Module::inst_iterator ext_inst_debuginfo_begin();
inline Module::inst_iterator ext_inst_debuginfo_end();
inline IteratorRange<Module::inst_iterator> ext_inst_debuginfo();
diff --git a/third_party/SPIRV-Tools/source/opt/ir_loader.cpp b/third_party/SPIRV-Tools/source/opt/ir_loader.cpp
index e9b7bbf..567b180 100644
--- a/third_party/SPIRV-Tools/source/opt/ir_loader.cpp
+++ b/third_party/SPIRV-Tools/source/opt/ir_loader.cpp
@@ -42,7 +42,7 @@
bool IsLineInst(const spv_parsed_instruction_t* inst) {
const auto opcode = static_cast<spv::Op>(inst->opcode);
if (IsOpLineInst(opcode)) return true;
- if (opcode != spv::Op::OpExtInst) return false;
+ if (!spvIsExtendedInstruction(opcode)) return false;
if (inst->ext_inst_type != SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100)
return false;
const uint32_t ext_inst_index = inst->words[kExtInstSetIndex];
@@ -65,7 +65,7 @@
// create a new instruction, but simply keep the information in
// struct DebugScope.
const auto opcode = static_cast<spv::Op>(inst->opcode);
- if (opcode == spv::Op::OpExtInst &&
+ if (spvIsExtendedInstruction(opcode) &&
spvExtInstIsDebugInfo(inst->ext_inst_type)) {
const uint32_t ext_inst_index = inst->words[kExtInstSetIndex];
if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 ||
@@ -207,12 +207,13 @@
} else if (IsTypeInst(opcode)) {
module_->AddType(std::move(spv_inst));
} else if (IsConstantInst(opcode) || opcode == spv::Op::OpVariable ||
+ opcode == spv::Op::OpUntypedVariableKHR ||
opcode == spv::Op::OpUndef) {
module_->AddGlobalValue(std::move(spv_inst));
- } else if (opcode == spv::Op::OpExtInst &&
+ } else if (spvIsExtendedInstruction(opcode) &&
spvExtInstIsDebugInfo(inst->ext_inst_type)) {
module_->AddExtInstDebugInfo(std::move(spv_inst));
- } else if (opcode == spv::Op::OpExtInst &&
+ } else if (spvIsExtendedInstruction(opcode) &&
spvExtInstIsNonSemantic(inst->ext_inst_type)) {
// If there are no functions, add the non-semantic instructions to the
// global values. Otherwise append it to the list of the last function.
@@ -235,7 +236,7 @@
last_dbg_scope_ = DebugScope(kNoDebugScope, kNoInlinedAt);
if (last_dbg_scope_.GetLexicalScope() != kNoDebugScope)
spv_inst->SetDebugScope(last_dbg_scope_);
- if (opcode == spv::Op::OpExtInst &&
+ if (spvIsExtendedInstruction(opcode) &&
spvExtInstIsDebugInfo(inst->ext_inst_type)) {
const uint32_t ext_inst_index = inst->words[kExtInstSetIndex];
if (inst->ext_inst_type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100) {
diff --git a/third_party/SPIRV-Tools/source/opt/liveness.cpp b/third_party/SPIRV-Tools/source/opt/liveness.cpp
index 336f3ae..dae705d 100644
--- a/third_party/SPIRV-Tools/source/opt/liveness.cpp
+++ b/third_party/SPIRV-Tools/source/opt/liveness.cpp
@@ -123,21 +123,29 @@
return 1;
}
-const analysis::Type* LivenessManager::GetComponentType(
- uint32_t index, const analysis::Type* agg_type) const {
- auto arr_type = agg_type->AsArray();
- if (arr_type) return arr_type->element_type();
- auto struct_type = agg_type->AsStruct();
- if (struct_type) return struct_type->element_types()[index];
- auto mat_type = agg_type->AsMatrix();
- if (mat_type) return mat_type->element_type();
- auto vec_type = agg_type->AsVector();
- assert(vec_type && "unexpected non-aggregate type");
- return vec_type->element_type();
+uint32_t LivenessManager::GetComponentType(uint32_t index,
+ uint32_t agg_type_id) const {
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ Instruction* agg_type_inst = def_use_mgr->GetDef(agg_type_id);
+
+ const uint32_t kArrayElementInIdx = 0;
+ switch (agg_type_inst->opcode()) {
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
+ return agg_type_inst->GetSingleWordInOperand(kArrayElementInIdx);
+ case spv::Op::OpTypeStruct:
+ return agg_type_inst->GetSingleWordInOperand(index);
+ default:
+ assert(false && "unexpected aggregate type");
+ return 0;
+ }
}
uint32_t LivenessManager::GetLocOffset(uint32_t index,
- const analysis::Type* agg_type) const {
+ uint32_t agg_type_id) const {
+ analysis::TypeManager* type_mgr = context()->get_type_mgr();
+ const analysis::Type* agg_type = type_mgr->GetType(agg_type_id);
auto arr_type = agg_type->AsArray();
if (arr_type) return index * GetLocSize(arr_type->element_type());
auto struct_type = agg_type->AsStruct();
@@ -161,12 +169,11 @@
return 0;
}
-void LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac,
- const analysis::Type** curr_type,
- uint32_t* offset, bool* no_loc,
- bool is_patch, bool input) {
+uint32_t LivenessManager::AnalyzeAccessChainLoc(const Instruction* ac,
+ uint32_t curr_type_id,
+ uint32_t* offset, bool* no_loc,
+ bool is_patch, bool input) {
analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
analysis::DecorationManager* deco_mgr = context()->get_decoration_mgr();
// For tesc, tese and geom input variables, and tesc output variables,
// first array index does not contribute to offset.
@@ -178,15 +185,18 @@
(!input && stage == spv::ExecutionModel::TessellationControl))
skip_first_index = !is_patch;
uint32_t ocnt = 0;
- ac->WhileEachInOperand([this, &ocnt, def_use_mgr, type_mgr, deco_mgr,
- curr_type, offset, no_loc,
+ ac->WhileEachInOperand([this, &ocnt, def_use_mgr, deco_mgr, &curr_type_id,
+ offset, no_loc,
skip_first_index](const uint32_t* opnd) {
if (ocnt >= 1) {
// Skip first index's contribution to offset if indicated
+ Instruction* curr_type_inst = def_use_mgr->GetDef(curr_type_id);
if (ocnt == 1 && skip_first_index) {
- auto arr_type = (*curr_type)->AsArray();
- assert(arr_type && "unexpected wrapper type");
- *curr_type = arr_type->element_type();
+ assert(curr_type_inst->opcode() == spv::Op::OpTypeArray &&
+ "unexpected wrapper type");
+ const uint32_t kArrayElementTypeInIdx = 0;
+ curr_type_id =
+ curr_type_inst->GetSingleWordInOperand(kArrayElementTypeInIdx);
ocnt++;
return true;
}
@@ -196,12 +206,10 @@
// If current type is struct, look for location decoration on member and
// reset offset if found.
auto index = idx_inst->GetSingleWordInOperand(0);
- auto str_type = (*curr_type)->AsStruct();
- if (str_type) {
+ if (curr_type_inst->opcode() == spv::Op::OpTypeStruct) {
uint32_t loc = 0;
- auto str_type_id = type_mgr->GetId(str_type);
bool no_mem_loc = deco_mgr->WhileEachDecoration(
- str_type_id, uint32_t(spv::Decoration::Location),
+ curr_type_id, uint32_t(spv::Decoration::Location),
[&loc, index, no_loc](const Instruction& deco) {
assert(deco.opcode() == spv::Op::OpMemberDecorate &&
"unexpected decoration");
@@ -216,19 +224,20 @@
});
if (!no_mem_loc) {
*offset = loc;
- *curr_type = GetComponentType(index, *curr_type);
+ curr_type_id = curr_type_inst->GetSingleWordInOperand(index);
ocnt++;
return true;
}
}
// Update offset and current type based on constant index.
- *offset += GetLocOffset(index, *curr_type);
- *curr_type = GetComponentType(index, *curr_type);
+ *offset += GetLocOffset(index, curr_type_id);
+ curr_type_id = GetComponentType(index, curr_type_id);
}
ocnt++;
return true;
});
+ return curr_type_id;
}
void LivenessManager::MarkRefLive(const Instruction* ref, Instruction* var) {
@@ -268,8 +277,15 @@
// through constant indices and mark those locs live. Assert if no location
// found.
uint32_t offset = loc;
- auto curr_type = var_type;
- AnalyzeAccessChainLoc(ref, &curr_type, &offset, &no_loc, is_patch);
+ Instruction* ptr_type_inst =
+ context()->get_def_use_mgr()->GetDef(var->type_id());
+ assert(ptr_type && "unexpected var type");
+ const uint32_t kPointerTypePointeeIdx = 1;
+ uint32_t var_type_id =
+ ptr_type_inst->GetSingleWordInOperand(kPointerTypePointeeIdx);
+ uint32_t curr_type_id =
+ AnalyzeAccessChainLoc(ref, var_type_id, &offset, &no_loc, is_patch);
+ auto curr_type = type_mgr->GetType(curr_type_id);
assert(!no_loc && "missing input variable location");
MarkLocsLive(offset, GetLocSize(curr_type));
}
@@ -277,15 +293,18 @@
void LivenessManager::ComputeLiveness() {
InitializeAnalysis();
analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
// Process all input variables
for (auto& var : context()->types_values()) {
if (var.opcode() != spv::Op::OpVariable) {
continue;
}
- analysis::Type* var_type = type_mgr->GetType(var.type_id());
- analysis::Pointer* ptr_type = var_type->AsPointer();
- if (ptr_type->storage_class() != spv::StorageClass::Input) {
+ Instruction* var_type_inst = def_use_mgr->GetDef(var.type_id());
+ assert(var_type_inst->opcode() == spv::Op::OpTypePointer &&
+ "Expected a pointer type");
+ const uint32_t kPointerTypeStorageClassInIdx = 0;
+ spv::StorageClass sc = static_cast<spv::StorageClass>(
+ var_type_inst->GetSingleWordInOperand(kPointerTypeStorageClassInIdx));
+ if (sc != spv::StorageClass::Input) {
continue;
}
// If var is builtin, mark live if analyzed and continue to next variable
@@ -295,14 +314,15 @@
// continue to next variable. Input interface blocks will only appear
// in tesc, tese and geom shaders. Will need to strip off one level of
// arrayness to get to block type.
- auto pte_type = ptr_type->pointee_type();
- auto arr_type = pte_type->AsArray();
- if (arr_type) {
- auto elt_type = arr_type->element_type();
- auto str_type = elt_type->AsStruct();
- if (str_type) {
- auto str_type_id = type_mgr->GetId(str_type);
- if (AnalyzeBuiltIn(str_type_id)) continue;
+ const uint32_t kPointerTypePointeeTypeInIdx = 1;
+ uint32_t pte_type_id =
+ var_type_inst->GetSingleWordInOperand(kPointerTypePointeeTypeInIdx);
+ Instruction* pte_type_inst = def_use_mgr->GetDef(pte_type_id);
+ if (pte_type_inst->opcode() == spv::Op::OpTypeArray) {
+ uint32_t array_elt_type_id = pte_type_inst->GetSingleWordInOperand(0);
+ Instruction* arr_elt_type = def_use_mgr->GetDef(array_elt_type_id);
+ if (arr_elt_type->opcode() == spv::Op::OpTypeStruct) {
+ if (AnalyzeBuiltIn(array_elt_type_id)) continue;
}
}
// Mark all used locations of var live
diff --git a/third_party/SPIRV-Tools/source/opt/liveness.h b/third_party/SPIRV-Tools/source/opt/liveness.h
index 7d8a9fb..7050005 100644
--- a/third_party/SPIRV-Tools/source/opt/liveness.h
+++ b/third_party/SPIRV-Tools/source/opt/liveness.h
@@ -41,13 +41,13 @@
// Return true if builtin |bi| is being analyzed.
bool IsAnalyzedBuiltin(uint32_t bi);
- // Determine starting loc |offset| and the type |cur_type| of
- // access chain |ac|. Set |no_loc| to true if no loc found.
- // |is_patch| indicates if patch variable. |input| is true
- // if input variable, otherwise output variable.
- void AnalyzeAccessChainLoc(const Instruction* ac,
- const analysis::Type** curr_type, uint32_t* offset,
- bool* no_loc, bool is_patch, bool input = true);
+ // Return the result type of |ac| when applied to |cur_type_id|. Set
+ // |no_loc| to true if no loc found. Set |is_patch| indicates if the variable
+ // is a patch variable. Set |input| if the variable is an input variable.
+ // Otherwise it is assumed that the variable is an output variable.
+ uint32_t AnalyzeAccessChainLoc(const Instruction* ac, uint32_t curr_type_id,
+ uint32_t* offset, bool* no_loc, bool is_patch,
+ bool input = true);
// Return size of |type_id| in units of locations
uint32_t GetLocSize(const analysis::Type* type) const;
@@ -68,13 +68,12 @@
// Mark |count| locations starting at location |start|.
void MarkLocsLive(uint32_t start, uint32_t count);
- // Return type of component of aggregate type |agg_type| at |index|
- const analysis::Type* GetComponentType(uint32_t index,
- const analysis::Type* agg_type) const;
+ // Return type of the member |index| in the aggregate type |agg_type_id|.
+ uint32_t GetComponentType(uint32_t index, uint32_t agg_type_id) const;
- // Return offset of |index| into aggregate type |agg_type| in units of
- // input locations
- uint32_t GetLocOffset(uint32_t index, const analysis::Type* agg_type) const;
+ // Return offset of member |index| in the aggregate type |agg_type_id| in
+ // units of input locations.
+ uint32_t GetLocOffset(uint32_t index, uint32_t agg_type_id) const;
// Populate live_locs_ and live_builtins_
void ComputeLiveness();
diff --git a/third_party/SPIRV-Tools/source/opt/local_access_chain_convert_pass.cpp b/third_party/SPIRV-Tools/source/opt/local_access_chain_convert_pass.cpp
index 7ba75cb..ae473ca 100644
--- a/third_party/SPIRV-Tools/source/opt/local_access_chain_convert_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/local_access_chain_convert_pass.cpp
@@ -1,6 +1,8 @@
// Copyright (c) 2017 The Khronos Group Inc.
// Copyright (c) 2017 Valve Corporation
// Copyright (c) 2017 LunarG Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -397,39 +399,75 @@
void LocalAccessChainConvertPass::InitExtensions() {
extensions_allowlist_.clear();
- extensions_allowlist_.insert(
- {"SPV_AMD_shader_explicit_vertex_parameter",
- "SPV_AMD_shader_trinary_minmax", "SPV_AMD_gcn_shader",
- "SPV_KHR_shader_ballot", "SPV_AMD_shader_ballot",
- "SPV_AMD_gpu_shader_half_float", "SPV_KHR_shader_draw_parameters",
- "SPV_KHR_subgroup_vote", "SPV_KHR_8bit_storage", "SPV_KHR_16bit_storage",
- "SPV_KHR_device_group", "SPV_KHR_multiview",
- "SPV_NVX_multiview_per_view_attributes", "SPV_NV_viewport_array2",
- "SPV_NV_stereo_view_rendering", "SPV_NV_sample_mask_override_coverage",
- "SPV_NV_geometry_shader_passthrough", "SPV_AMD_texture_gather_bias_lod",
- "SPV_KHR_storage_buffer_storage_class",
- // SPV_KHR_variable_pointers
- // Currently do not support extended pointer expressions
- "SPV_AMD_gpu_shader_int16", "SPV_KHR_post_depth_coverage",
- "SPV_KHR_shader_atomic_counter_ops", "SPV_EXT_shader_stencil_export",
- "SPV_EXT_shader_viewport_index_layer",
- "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask",
- "SPV_EXT_fragment_fully_covered", "SPV_AMD_gpu_shader_half_float_fetch",
- "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
- "SPV_GOOGLE_user_type", "SPV_NV_shader_subgroup_partitioned",
- "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing",
- "SPV_NV_fragment_shader_barycentric",
- "SPV_NV_compute_shader_derivatives", "SPV_NV_shader_image_footprint",
- "SPV_NV_shading_rate", "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader",
- "SPV_NV_ray_tracing", "SPV_KHR_ray_tracing", "SPV_KHR_ray_query",
- "SPV_EXT_fragment_invocation_density", "SPV_KHR_terminate_invocation",
- "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product",
- "SPV_EXT_shader_image_int64", "SPV_KHR_non_semantic_info",
- "SPV_KHR_uniform_group_instructions",
- "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model",
- "SPV_NV_bindless_texture", "SPV_EXT_shader_atomic_float_add",
- "SPV_EXT_fragment_shader_interlock",
- "SPV_NV_compute_shader_derivatives"});
+ extensions_allowlist_.insert({
+ "SPV_AMD_shader_explicit_vertex_parameter",
+ "SPV_AMD_shader_trinary_minmax",
+ "SPV_AMD_gcn_shader",
+ "SPV_KHR_shader_ballot",
+ "SPV_AMD_shader_ballot",
+ "SPV_AMD_gpu_shader_half_float",
+ "SPV_KHR_shader_draw_parameters",
+ "SPV_KHR_subgroup_vote",
+ "SPV_KHR_8bit_storage",
+ "SPV_KHR_16bit_storage",
+ "SPV_KHR_device_group",
+ "SPV_KHR_multiview",
+ "SPV_NVX_multiview_per_view_attributes",
+ "SPV_NV_viewport_array2",
+ "SPV_NV_stereo_view_rendering",
+ "SPV_NV_sample_mask_override_coverage",
+ "SPV_NV_geometry_shader_passthrough",
+ "SPV_AMD_texture_gather_bias_lod",
+ "SPV_KHR_storage_buffer_storage_class",
+ // SPV_KHR_variable_pointers
+ // Currently do not support extended pointer expressions
+ "SPV_AMD_gpu_shader_int16",
+ "SPV_KHR_post_depth_coverage",
+ "SPV_KHR_shader_atomic_counter_ops",
+ "SPV_EXT_shader_stencil_export",
+ "SPV_EXT_shader_viewport_index_layer",
+ "SPV_AMD_shader_image_load_store_lod",
+ "SPV_AMD_shader_fragment_mask",
+ "SPV_EXT_fragment_fully_covered",
+ "SPV_AMD_gpu_shader_half_float_fetch",
+ "SPV_GOOGLE_decorate_string",
+ "SPV_GOOGLE_hlsl_functionality1",
+ "SPV_GOOGLE_user_type",
+ "SPV_NV_shader_subgroup_partitioned",
+ "SPV_EXT_demote_to_helper_invocation",
+ "SPV_EXT_descriptor_indexing",
+ "SPV_NV_fragment_shader_barycentric",
+ "SPV_NV_compute_shader_derivatives",
+ "SPV_NV_shader_image_footprint",
+ "SPV_NV_shading_rate",
+ "SPV_NV_mesh_shader",
+ "SPV_EXT_mesh_shader",
+ "SPV_NV_ray_tracing",
+ "SPV_KHR_ray_tracing",
+ "SPV_KHR_ray_query",
+ "SPV_EXT_fragment_invocation_density",
+ "SPV_KHR_terminate_invocation",
+ "SPV_KHR_subgroup_uniform_control_flow",
+ "SPV_KHR_integer_dot_product",
+ "SPV_EXT_shader_image_int64",
+ "SPV_KHR_non_semantic_info",
+ "SPV_KHR_uniform_group_instructions",
+ "SPV_KHR_fragment_shader_barycentric",
+ "SPV_KHR_vulkan_memory_model",
+ "SPV_NV_bindless_texture",
+ "SPV_EXT_shader_atomic_float_add",
+ "SPV_EXT_fragment_shader_interlock",
+ "SPV_KHR_compute_shader_derivatives",
+ "SPV_NV_cooperative_matrix",
+ "SPV_KHR_cooperative_matrix",
+ "SPV_KHR_ray_tracing_position_fetch",
+ "SPV_AMDX_shader_enqueue",
+ "SPV_KHR_fragment_shading_rate",
+ "SPV_KHR_quad_control",
+ "SPV_NV_shader_invocation_reorder",
+ "SPV_NV_cluster_acceleration_structure",
+ "SPV_NV_linear_swept_spheres",
+ });
}
bool LocalAccessChainConvertPass::AnyIndexIsOutOfBounds(
diff --git a/third_party/SPIRV-Tools/source/opt/local_single_block_elim_pass.cpp b/third_party/SPIRV-Tools/source/opt/local_single_block_elim_pass.cpp
index d7a9295..1995470 100644
--- a/third_party/SPIRV-Tools/source/opt/local_single_block_elim_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/local_single_block_elim_pass.cpp
@@ -1,6 +1,8 @@
// Copyright (c) 2017 The Khronos Group Inc.
// Copyright (c) 2017 Valve Corporation
// Copyright (c) 2017 LunarG Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -233,65 +235,76 @@
void LocalSingleBlockLoadStoreElimPass::InitExtensions() {
extensions_allowlist_.clear();
- extensions_allowlist_.insert({"SPV_AMD_shader_explicit_vertex_parameter",
- "SPV_AMD_shader_trinary_minmax",
- "SPV_AMD_gcn_shader",
- "SPV_KHR_shader_ballot",
- "SPV_AMD_shader_ballot",
- "SPV_AMD_gpu_shader_half_float",
- "SPV_KHR_shader_draw_parameters",
- "SPV_KHR_subgroup_vote",
- "SPV_KHR_8bit_storage",
- "SPV_KHR_16bit_storage",
- "SPV_KHR_device_group",
- "SPV_KHR_multiview",
- "SPV_NVX_multiview_per_view_attributes",
- "SPV_NV_viewport_array2",
- "SPV_NV_stereo_view_rendering",
- "SPV_NV_sample_mask_override_coverage",
- "SPV_NV_geometry_shader_passthrough",
- "SPV_AMD_texture_gather_bias_lod",
- "SPV_KHR_storage_buffer_storage_class",
- "SPV_KHR_variable_pointers",
- "SPV_AMD_gpu_shader_int16",
- "SPV_KHR_post_depth_coverage",
- "SPV_KHR_shader_atomic_counter_ops",
- "SPV_EXT_shader_stencil_export",
- "SPV_EXT_shader_viewport_index_layer",
- "SPV_AMD_shader_image_load_store_lod",
- "SPV_AMD_shader_fragment_mask",
- "SPV_EXT_fragment_fully_covered",
- "SPV_AMD_gpu_shader_half_float_fetch",
- "SPV_GOOGLE_decorate_string",
- "SPV_GOOGLE_hlsl_functionality1",
- "SPV_GOOGLE_user_type",
- "SPV_NV_shader_subgroup_partitioned",
- "SPV_EXT_demote_to_helper_invocation",
- "SPV_EXT_descriptor_indexing",
- "SPV_NV_fragment_shader_barycentric",
- "SPV_NV_compute_shader_derivatives",
- "SPV_NV_shader_image_footprint",
- "SPV_NV_shading_rate",
- "SPV_NV_mesh_shader",
- "SPV_EXT_mesh_shader",
- "SPV_NV_ray_tracing",
- "SPV_KHR_ray_tracing",
- "SPV_KHR_ray_query",
- "SPV_EXT_fragment_invocation_density",
- "SPV_EXT_physical_storage_buffer",
- "SPV_KHR_physical_storage_buffer",
- "SPV_KHR_terminate_invocation",
- "SPV_KHR_subgroup_uniform_control_flow",
- "SPV_KHR_integer_dot_product",
- "SPV_EXT_shader_image_int64",
- "SPV_KHR_non_semantic_info",
- "SPV_KHR_uniform_group_instructions",
- "SPV_KHR_fragment_shader_barycentric",
- "SPV_KHR_vulkan_memory_model",
- "SPV_NV_bindless_texture",
- "SPV_EXT_shader_atomic_float_add",
- "SPV_EXT_fragment_shader_interlock",
- "SPV_NV_compute_shader_derivatives"});
+ extensions_allowlist_.insert({
+ "SPV_AMD_shader_explicit_vertex_parameter",
+ "SPV_AMD_shader_trinary_minmax",
+ "SPV_AMD_gcn_shader",
+ "SPV_KHR_shader_ballot",
+ "SPV_AMD_shader_ballot",
+ "SPV_AMDX_shader_enqueue",
+ "SPV_AMD_gpu_shader_half_float",
+ "SPV_KHR_shader_draw_parameters",
+ "SPV_KHR_subgroup_vote",
+ "SPV_KHR_8bit_storage",
+ "SPV_KHR_16bit_storage",
+ "SPV_KHR_device_group",
+ "SPV_KHR_multiview",
+ "SPV_NVX_multiview_per_view_attributes",
+ "SPV_NV_viewport_array2",
+ "SPV_NV_stereo_view_rendering",
+ "SPV_NV_sample_mask_override_coverage",
+ "SPV_NV_geometry_shader_passthrough",
+ "SPV_AMD_texture_gather_bias_lod",
+ "SPV_KHR_storage_buffer_storage_class",
+ "SPV_KHR_variable_pointers",
+ "SPV_AMD_gpu_shader_int16",
+ "SPV_KHR_post_depth_coverage",
+ "SPV_KHR_shader_atomic_counter_ops",
+ "SPV_EXT_shader_stencil_export",
+ "SPV_EXT_shader_viewport_index_layer",
+ "SPV_AMD_shader_image_load_store_lod",
+ "SPV_AMD_shader_fragment_mask",
+ "SPV_EXT_fragment_fully_covered",
+ "SPV_AMD_gpu_shader_half_float_fetch",
+ "SPV_GOOGLE_decorate_string",
+ "SPV_GOOGLE_hlsl_functionality1",
+ "SPV_GOOGLE_user_type",
+ "SPV_NV_shader_subgroup_partitioned",
+ "SPV_EXT_demote_to_helper_invocation",
+ "SPV_EXT_descriptor_indexing",
+ "SPV_NV_fragment_shader_barycentric",
+ "SPV_NV_compute_shader_derivatives",
+ "SPV_NV_shader_image_footprint",
+ "SPV_NV_shading_rate",
+ "SPV_NV_mesh_shader",
+ "SPV_EXT_mesh_shader",
+ "SPV_NV_ray_tracing",
+ "SPV_KHR_ray_tracing",
+ "SPV_KHR_ray_query",
+ "SPV_EXT_fragment_invocation_density",
+ "SPV_EXT_physical_storage_buffer",
+ "SPV_KHR_physical_storage_buffer",
+ "SPV_KHR_terminate_invocation",
+ "SPV_KHR_subgroup_uniform_control_flow",
+ "SPV_KHR_integer_dot_product",
+ "SPV_EXT_shader_image_int64",
+ "SPV_KHR_non_semantic_info",
+ "SPV_KHR_uniform_group_instructions",
+ "SPV_KHR_fragment_shader_barycentric",
+ "SPV_KHR_vulkan_memory_model",
+ "SPV_NV_bindless_texture",
+ "SPV_EXT_shader_atomic_float_add",
+ "SPV_EXT_fragment_shader_interlock",
+ "SPV_KHR_compute_shader_derivatives",
+ "SPV_NV_cooperative_matrix",
+ "SPV_KHR_cooperative_matrix",
+ "SPV_KHR_ray_tracing_position_fetch",
+ "SPV_KHR_fragment_shading_rate",
+ "SPV_KHR_quad_control",
+ "SPV_NV_shader_invocation_reorder",
+ "SPV_NV_cluster_acceleration_structure",
+ "SPV_NV_linear_swept_spheres",
+ });
}
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/local_single_store_elim_pass.cpp b/third_party/SPIRV-Tools/source/opt/local_single_store_elim_pass.cpp
index 7cd6b0e..6f28e54 100644
--- a/third_party/SPIRV-Tools/source/opt/local_single_store_elim_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/local_single_store_elim_pass.cpp
@@ -1,6 +1,8 @@
// Copyright (c) 2017 The Khronos Group Inc.
// Copyright (c) 2017 Valve Corporation
// Copyright (c) 2017 LunarG Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -86,62 +88,75 @@
}
void LocalSingleStoreElimPass::InitExtensionAllowList() {
- extensions_allowlist_.insert({"SPV_AMD_shader_explicit_vertex_parameter",
- "SPV_AMD_shader_trinary_minmax",
- "SPV_AMD_gcn_shader",
- "SPV_KHR_shader_ballot",
- "SPV_AMD_shader_ballot",
- "SPV_AMD_gpu_shader_half_float",
- "SPV_KHR_shader_draw_parameters",
- "SPV_KHR_subgroup_vote",
- "SPV_KHR_8bit_storage",
- "SPV_KHR_16bit_storage",
- "SPV_KHR_device_group",
- "SPV_KHR_multiview",
- "SPV_NVX_multiview_per_view_attributes",
- "SPV_NV_viewport_array2",
- "SPV_NV_stereo_view_rendering",
- "SPV_NV_sample_mask_override_coverage",
- "SPV_NV_geometry_shader_passthrough",
- "SPV_AMD_texture_gather_bias_lod",
- "SPV_KHR_storage_buffer_storage_class",
- "SPV_KHR_variable_pointers",
- "SPV_AMD_gpu_shader_int16",
- "SPV_KHR_post_depth_coverage",
- "SPV_KHR_shader_atomic_counter_ops",
- "SPV_EXT_shader_stencil_export",
- "SPV_EXT_shader_viewport_index_layer",
- "SPV_AMD_shader_image_load_store_lod",
- "SPV_AMD_shader_fragment_mask",
- "SPV_EXT_fragment_fully_covered",
- "SPV_AMD_gpu_shader_half_float_fetch",
- "SPV_GOOGLE_decorate_string",
- "SPV_GOOGLE_hlsl_functionality1",
- "SPV_NV_shader_subgroup_partitioned",
- "SPV_EXT_descriptor_indexing",
- "SPV_NV_fragment_shader_barycentric",
- "SPV_NV_compute_shader_derivatives",
- "SPV_NV_shader_image_footprint",
- "SPV_NV_shading_rate",
- "SPV_NV_mesh_shader",
- "SPV_EXT_mesh_shader",
- "SPV_NV_ray_tracing",
- "SPV_KHR_ray_query",
- "SPV_EXT_fragment_invocation_density",
- "SPV_EXT_physical_storage_buffer",
- "SPV_KHR_physical_storage_buffer",
- "SPV_KHR_terminate_invocation",
- "SPV_KHR_subgroup_uniform_control_flow",
- "SPV_KHR_integer_dot_product",
- "SPV_EXT_shader_image_int64",
- "SPV_KHR_non_semantic_info",
- "SPV_KHR_uniform_group_instructions",
- "SPV_KHR_fragment_shader_barycentric",
- "SPV_KHR_vulkan_memory_model",
- "SPV_NV_bindless_texture",
- "SPV_EXT_shader_atomic_float_add",
- "SPV_EXT_fragment_shader_interlock",
- "SPV_NV_compute_shader_derivatives"});
+ extensions_allowlist_.insert({
+ "SPV_AMD_shader_explicit_vertex_parameter",
+ "SPV_AMD_shader_trinary_minmax",
+ "SPV_AMD_gcn_shader",
+ "SPV_KHR_shader_ballot",
+ "SPV_AMD_shader_ballot",
+ "SPV_AMD_gpu_shader_half_float",
+ "SPV_KHR_shader_draw_parameters",
+ "SPV_KHR_subgroup_vote",
+ "SPV_KHR_8bit_storage",
+ "SPV_KHR_16bit_storage",
+ "SPV_KHR_device_group",
+ "SPV_KHR_multiview",
+ "SPV_NVX_multiview_per_view_attributes",
+ "SPV_NV_viewport_array2",
+ "SPV_NV_stereo_view_rendering",
+ "SPV_NV_sample_mask_override_coverage",
+ "SPV_NV_geometry_shader_passthrough",
+ "SPV_AMD_texture_gather_bias_lod",
+ "SPV_KHR_storage_buffer_storage_class",
+ "SPV_KHR_variable_pointers",
+ "SPV_AMD_gpu_shader_int16",
+ "SPV_KHR_post_depth_coverage",
+ "SPV_KHR_shader_atomic_counter_ops",
+ "SPV_EXT_shader_stencil_export",
+ "SPV_EXT_shader_viewport_index_layer",
+ "SPV_AMD_shader_image_load_store_lod",
+ "SPV_AMD_shader_fragment_mask",
+ "SPV_EXT_fragment_fully_covered",
+ "SPV_AMD_gpu_shader_half_float_fetch",
+ "SPV_GOOGLE_decorate_string",
+ "SPV_GOOGLE_hlsl_functionality1",
+ "SPV_NV_shader_subgroup_partitioned",
+ "SPV_EXT_descriptor_indexing",
+ "SPV_NV_fragment_shader_barycentric",
+ "SPV_NV_compute_shader_derivatives",
+ "SPV_NV_shader_image_footprint",
+ "SPV_NV_shading_rate",
+ "SPV_NV_mesh_shader",
+ "SPV_EXT_mesh_shader",
+ "SPV_NV_ray_tracing",
+ "SPV_KHR_ray_query",
+ "SPV_EXT_fragment_invocation_density",
+ "SPV_EXT_physical_storage_buffer",
+ "SPV_KHR_physical_storage_buffer",
+ "SPV_KHR_terminate_invocation",
+ "SPV_KHR_subgroup_uniform_control_flow",
+ "SPV_KHR_integer_dot_product",
+ "SPV_EXT_shader_image_int64",
+ "SPV_KHR_non_semantic_info",
+ "SPV_KHR_uniform_group_instructions",
+ "SPV_KHR_fragment_shader_barycentric",
+ "SPV_KHR_vulkan_memory_model",
+ "SPV_NV_bindless_texture",
+ "SPV_EXT_shader_atomic_float_add",
+ "SPV_EXT_fragment_shader_interlock",
+ "SPV_KHR_compute_shader_derivatives",
+ "SPV_NV_cooperative_matrix",
+ "SPV_KHR_cooperative_matrix",
+ "SPV_KHR_ray_tracing_position_fetch",
+ "SPV_AMDX_shader_enqueue",
+ "SPV_KHR_fragment_shading_rate",
+ "SPV_KHR_ray_tracing",
+ "SPV_KHR_quad_control",
+ "SPV_GOOGLE_user_type",
+ "SPV_NV_shader_invocation_reorder",
+ "SPV_NV_cluster_acceleration_structure",
+ "SPV_NV_linear_swept_spheres",
+ });
}
bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) {
std::vector<Instruction*> users;
diff --git a/third_party/SPIRV-Tools/source/opt/loop_fission.cpp b/third_party/SPIRV-Tools/source/opt/loop_fission.cpp
index 2ae05c3..1bbe4ba 100644
--- a/third_party/SPIRV-Tools/source/opt/loop_fission.cpp
+++ b/third_party/SPIRV-Tools/source/opt/loop_fission.cpp
@@ -499,6 +499,7 @@
// next iteration.
if (split_multiple_times_) {
inner_most_loops = std::move(new_loops_to_split);
+ new_loops_to_split = {};
} else {
break;
}
diff --git a/third_party/SPIRV-Tools/source/opt/loop_unroller.cpp b/third_party/SPIRV-Tools/source/opt/loop_unroller.cpp
index d9e34f2..2e279a7 100644
--- a/third_party/SPIRV-Tools/source/opt/loop_unroller.cpp
+++ b/third_party/SPIRV-Tools/source/opt/loop_unroller.cpp
@@ -560,6 +560,10 @@
loop->GetInductionVariables(inductions);
for (size_t index = 0; index < inductions.size(); ++index) {
+ // We don't want the decorations that applied to the induction variable
+ // to be applied to the value that replace it.
+ context_->KillNamesAndDecorates(state_.previous_phis_[index]);
+
uint32_t trip_step_id = GetPhiDefID(state_.previous_phis_[index],
state_.previous_latch_block_->id());
context_->ReplaceAllUsesWith(inductions[index]->result_id(), trip_step_id);
diff --git a/third_party/SPIRV-Tools/source/opt/mem_pass.cpp b/third_party/SPIRV-Tools/source/opt/mem_pass.cpp
index 9972c4f..e4eb751 100644
--- a/third_party/SPIRV-Tools/source/opt/mem_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/mem_pass.cpp
@@ -43,6 +43,8 @@
case spv::Op::OpTypeSampler:
case spv::Op::OpTypeSampledImage:
case spv::Op::OpTypePointer:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ case spv::Op::OpTypeCooperativeMatrixKHR:
return true;
default:
break;
@@ -98,17 +100,25 @@
Instruction* ptrInst = get_def_use_mgr()->GetDef(*varId);
Instruction* varInst;
- if (ptrInst->opcode() == spv::Op::OpConstantNull) {
- *varId = 0;
- return ptrInst;
+ switch (ptrInst->opcode()) {
+ case spv::Op::OpVariable:
+ case spv::Op::OpFunctionParameter:
+ varInst = ptrInst;
+ break;
+ case spv::Op::OpAccessChain:
+ case spv::Op::OpInBoundsAccessChain:
+ case spv::Op::OpPtrAccessChain:
+ case spv::Op::OpInBoundsPtrAccessChain:
+ case spv::Op::OpImageTexelPointer:
+ case spv::Op::OpCopyObject:
+ varInst = ptrInst->GetBaseAddress();
+ break;
+ default:
+ *varId = 0;
+ return ptrInst;
+ break;
}
- if (ptrInst->opcode() != spv::Op::OpVariable &&
- ptrInst->opcode() != spv::Op::OpFunctionParameter) {
- varInst = ptrInst->GetBaseAddress();
- } else {
- varInst = ptrInst;
- }
if (varInst->opcode() == spv::Op::OpVariable) {
*varId = varInst->result_id();
} else {
@@ -413,6 +423,7 @@
}
bool MemPass::RemoveUnreachableBlocks(Function* func) {
+ if (func->IsDeclaration()) return false;
bool modified = false;
// Mark reachable all blocks reachable from the function's entry block.
diff --git a/third_party/SPIRV-Tools/source/opt/merge_return_pass.cpp b/third_party/SPIRV-Tools/source/opt/merge_return_pass.cpp
index c262ea0..4173494 100644
--- a/third_party/SPIRV-Tools/source/opt/merge_return_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/merge_return_pass.cpp
@@ -828,7 +828,8 @@
bool MergeReturnPass::CreateSingleCaseSwitch(BasicBlock* merge_target) {
// Insert the switch before any code is run. We have to split the entry
- // block to make sure the OpVariable instructions remain in the entry block.
+ // block to make sure the OpVariable instructions and DebugFunctionDefinition
+ // instructions remain in the entry block.
BasicBlock* start_block = &*function_->begin();
auto split_pos = start_block->begin();
while (split_pos->opcode() == spv::Op::OpVariable) {
@@ -838,6 +839,18 @@
BasicBlock* old_block =
start_block->SplitBasicBlock(context(), TakeNextId(), split_pos);
+ // Find DebugFunctionDefinition inst in the old block, and if we can find it,
+ // move it to the entry block. Since DebugFunctionDefinition is not necessary
+ // after OpVariable inst, we have to traverse the whole block to find it.
+ for (auto pos = old_block->begin(); pos != old_block->end(); ++pos) {
+ if (pos->GetShader100DebugOpcode() ==
+ NonSemanticShaderDebugInfo100DebugFunctionDefinition) {
+ start_block->AddInstruction(MakeUnique<Instruction>(*pos));
+ pos.Erase();
+ break;
+ }
+ }
+
// Add the switch to the end of the entry block.
InstructionBuilder builder(
context(), start_block,
diff --git a/third_party/SPIRV-Tools/source/opt/opextinst_forward_ref_fixup_pass.cpp b/third_party/SPIRV-Tools/source/opt/opextinst_forward_ref_fixup_pass.cpp
new file mode 100644
index 0000000..8684feb
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/opextinst_forward_ref_fixup_pass.cpp
@@ -0,0 +1,112 @@
+// Copyright (c) 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/opt/opextinst_forward_ref_fixup_pass.h"
+
+#include <string>
+#include <unordered_set>
+
+#include "source/extensions.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "type_manager.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+// Returns true if the instruction |inst| has a forward reference to another
+// debug instruction.
+// |debug_ids| contains the list of IDs belonging to debug instructions.
+// |seen_ids| contains the list of IDs already seen.
+bool HasForwardReference(const Instruction& inst,
+ const std::unordered_set<uint32_t>& debug_ids,
+ const std::unordered_set<uint32_t>& seen_ids) {
+ const uint32_t num_in_operands = inst.NumInOperands();
+ for (uint32_t i = 0; i < num_in_operands; ++i) {
+ const Operand& op = inst.GetInOperand(i);
+ if (!spvIsIdType(op.type)) continue;
+
+ if (debug_ids.count(op.AsId()) == 0) continue;
+
+ if (seen_ids.count(op.AsId()) == 0) return true;
+ }
+
+ return false;
+}
+
+// Replace |inst| opcode with OpExtInstWithForwardRefsKHR or OpExtInst
+// if required to comply with forward references.
+bool ReplaceOpcodeIfRequired(Instruction& inst, bool hasForwardReferences) {
+ if (hasForwardReferences &&
+ inst.opcode() != spv::Op::OpExtInstWithForwardRefsKHR)
+ inst.SetOpcode(spv::Op::OpExtInstWithForwardRefsKHR);
+ else if (!hasForwardReferences && inst.opcode() != spv::Op::OpExtInst)
+ inst.SetOpcode(spv::Op::OpExtInst);
+ else
+ return false;
+ return true;
+}
+
+// Returns all the result IDs of the instructions in |range|.
+std::unordered_set<uint32_t> gatherResultIds(
+ const IteratorRange<Module::inst_iterator>& range) {
+ std::unordered_set<uint32_t> output;
+ for (const auto& it : range) output.insert(it.result_id());
+ return output;
+}
+
+} // namespace
+
+Pass::Status OpExtInstWithForwardReferenceFixupPass::Process() {
+ std::unordered_set<uint32_t> seen_ids =
+ gatherResultIds(get_module()->ext_inst_imports());
+ std::unordered_set<uint32_t> debug_ids =
+ gatherResultIds(get_module()->ext_inst_debuginfo());
+ for (uint32_t id : seen_ids) debug_ids.insert(id);
+
+ bool moduleChanged = false;
+ bool hasAtLeastOneForwardReference = false;
+ IRContext* ctx = context();
+ for (Instruction& inst : get_module()->ext_inst_debuginfo()) {
+ if (inst.opcode() != spv::Op::OpExtInst &&
+ inst.opcode() != spv::Op::OpExtInstWithForwardRefsKHR)
+ continue;
+
+ seen_ids.insert(inst.result_id());
+ bool hasForwardReferences = HasForwardReference(inst, debug_ids, seen_ids);
+ hasAtLeastOneForwardReference |= hasForwardReferences;
+
+ if (ReplaceOpcodeIfRequired(inst, hasForwardReferences)) {
+ moduleChanged = true;
+ ctx->AnalyzeUses(&inst);
+ }
+ }
+
+ if (hasAtLeastOneForwardReference !=
+ ctx->get_feature_mgr()->HasExtension(
+ kSPV_KHR_relaxed_extended_instruction)) {
+ if (hasAtLeastOneForwardReference)
+ ctx->AddExtension("SPV_KHR_relaxed_extended_instruction");
+ else
+ ctx->RemoveExtension(Extension::kSPV_KHR_relaxed_extended_instruction);
+ moduleChanged = true;
+ }
+
+ return moduleChanged ? Status::SuccessWithChange
+ : Status::SuccessWithoutChange;
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/opextinst_forward_ref_fixup_pass.h b/third_party/SPIRV-Tools/source/opt/opextinst_forward_ref_fixup_pass.h
new file mode 100644
index 0000000..26e5b81
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/opextinst_forward_ref_fixup_pass.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_OPT_OPEXTINST_FORWARD_REF_FIXUP_H
+#define SOURCE_OPT_OPEXTINST_FORWARD_REF_FIXUP_H
+
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+class OpExtInstWithForwardReferenceFixupPass : public Pass {
+ public:
+ const char* name() const override { return "fix-opextinst-opcodes"; }
+ Status Process() override;
+
+ IRContext::Analysis GetPreservedAnalyses() override {
+ return IRContext::kAnalysisInstrToBlockMapping |
+ IRContext::kAnalysisDecorations | IRContext::kAnalysisCombinators |
+ IRContext::kAnalysisCFG | IRContext::kAnalysisDominatorAnalysis |
+ IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap |
+ IRContext::kAnalysisScalarEvolution |
+ IRContext::kAnalysisRegisterPressure |
+ IRContext::kAnalysisValueNumberTable |
+ IRContext::kAnalysisStructuredCFG |
+ IRContext::kAnalysisBuiltinVarId |
+ IRContext::kAnalysisIdToFuncMapping | IRContext::kAnalysisTypes |
+ IRContext::kAnalysisDefUse | IRContext::kAnalysisConstants;
+ }
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_OPEXTINST_FORWARD_REF_FIXUP_H
diff --git a/third_party/SPIRV-Tools/source/opt/optimizer.cpp b/third_party/SPIRV-Tools/source/opt/optimizer.cpp
index e62ca10..1380204 100644
--- a/third_party/SPIRV-Tools/source/opt/optimizer.cpp
+++ b/third_party/SPIRV-Tools/source/opt/optimizer.cpp
@@ -170,7 +170,8 @@
.RegisterPass(CreateAggressiveDCEPass(preserve_interface))
.RegisterPass(CreateRemoveUnusedInterfaceVariablesPass())
.RegisterPass(CreateInterpolateFixupPass())
- .RegisterPass(CreateInvocationInterlockPlacementPass());
+ .RegisterPass(CreateInvocationInterlockPlacementPass())
+ .RegisterPass(CreateOpExtInstWithForwardReferenceFixupPass());
}
Optimizer& Optimizer::RegisterLegalizationPasses() {
@@ -188,7 +189,7 @@
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
.RegisterPass(CreateLocalSingleStoreElimPass())
.RegisterPass(CreateAggressiveDCEPass(preserve_interface))
- .RegisterPass(CreateScalarReplacementPass())
+ .RegisterPass(CreateScalarReplacementPass(0))
.RegisterPass(CreateLocalAccessChainConvertPass())
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
.RegisterPass(CreateLocalSingleStoreElimPass())
@@ -202,7 +203,7 @@
.RegisterPass(CreateRedundancyEliminationPass())
.RegisterPass(CreateCombineAccessChainsPass())
.RegisterPass(CreateSimplificationPass())
- .RegisterPass(CreateScalarReplacementPass())
+ .RegisterPass(CreateScalarReplacementPass(0))
.RegisterPass(CreateLocalAccessChainConvertPass())
.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass())
.RegisterPass(CreateLocalSingleStoreElimPass())
@@ -324,6 +325,8 @@
RegisterPass(CreateStripReflectInfoPass());
} else if (pass_name == "strip-nonsemantic") {
RegisterPass(CreateStripNonSemanticInfoPass());
+ } else if (pass_name == "fix-opextinst-opcodes") {
+ RegisterPass(CreateOpExtInstWithForwardReferenceFixupPass());
} else if (pass_name == "set-spec-const-default-value") {
if (pass_args.size() > 0) {
auto spec_ids_vals =
@@ -362,6 +365,10 @@
RegisterPass(CreateSpreadVolatileSemanticsPass());
} else if (pass_name == "descriptor-scalar-replacement") {
RegisterPass(CreateDescriptorScalarReplacementPass());
+ } else if (pass_name == "descriptor-composite-scalar-replacement") {
+ RegisterPass(CreateDescriptorCompositeScalarReplacementPass());
+ } else if (pass_name == "descriptor-array-scalar-replacement") {
+ RegisterPass(CreateDescriptorArrayScalarReplacementPass());
} else if (pass_name == "eliminate-dead-code-aggressive") {
RegisterPass(CreateAggressiveDCEPass(preserve_interface));
} else if (pass_name == "eliminate-insert-extract") {
@@ -394,7 +401,7 @@
RegisterPass(CreateLoopUnswitchPass());
} else if (pass_name == "scalar-replacement") {
if (pass_args.size() == 0) {
- RegisterPass(CreateScalarReplacementPass());
+ RegisterPass(CreateScalarReplacementPass(0));
} else {
int limit = -1;
if (pass_args.find_first_not_of("0123456789") == std::string::npos) {
@@ -452,27 +459,10 @@
RegisterPass(CreateWorkaround1209Pass());
} else if (pass_name == "replace-invalid-opcode") {
RegisterPass(CreateReplaceInvalidOpcodePass());
- } else if (pass_name == "inst-bindless-check" ||
- pass_name == "inst-desc-idx-check" ||
- pass_name == "inst-buff-oob-check") {
- // preserve legacy names
- RegisterPass(CreateInstBindlessCheckPass(23));
- RegisterPass(CreateSimplificationPass());
- RegisterPass(CreateDeadBranchElimPass());
- RegisterPass(CreateBlockMergePass());
- } else if (pass_name == "inst-buff-addr-check") {
- RegisterPass(CreateInstBuffAddrCheckPass(23));
} else if (pass_name == "convert-relaxed-to-half") {
RegisterPass(CreateConvertRelaxedToHalfPass());
} else if (pass_name == "relax-float-ops") {
RegisterPass(CreateRelaxFloatOpsPass());
- } else if (pass_name == "inst-debug-printf") {
- // This private option is not for user consumption.
- // It is here to assist in debugging and fixing the debug printf
- // instrumentation pass.
- // For users who wish to utilize debug printf, see the white paper at
- // https://www.lunarg.com/wp-content/uploads/2021/08/Using-Debug-Printf-02August2021.pdf
- RegisterPass(CreateInstDebugPrintfPass(7, 23));
} else if (pass_name == "simplify-instructions") {
RegisterPass(CreateSimplificationPass());
} else if (pass_name == "ssa-rewrite") {
@@ -575,6 +565,26 @@
pass_args.c_str());
return false;
}
+ } else if (pass_name == "struct-packing") {
+ if (pass_args.size() == 0) {
+ Error(consumer(), nullptr, {},
+ "--struct-packing requires a name:rule argument.");
+ return false;
+ }
+
+ auto separator_pos = pass_args.find(':');
+ if (separator_pos == std::string::npos || separator_pos == 0 ||
+ separator_pos + 1 == pass_args.size()) {
+ Errorf(consumer(), nullptr, {},
+ "Invalid argument for --struct-packing: %s", pass_args.c_str());
+ return false;
+ }
+
+ const std::string struct_name = pass_args.substr(0, separator_pos);
+ const std::string rule_name = pass_args.substr(separator_pos + 1);
+
+ RegisterPass(
+ CreateStructPackingPass(struct_name.c_str(), rule_name.c_str()));
} else if (pass_name == "switch-descriptorset") {
if (pass_args.size() == 0) {
Error(consumer(), nullptr, {},
@@ -627,6 +637,12 @@
}
} else if (pass_name == "trim-capabilities") {
RegisterPass(CreateTrimCapabilitiesPass());
+ } else if (pass_name == "split-combined-image-sampler") {
+ RegisterPass(CreateSplitCombinedImageSamplerPass());
+ } else if (pass_name == "resolve-binding-conflicts") {
+ RegisterPass(CreateResolveBindingConflictsPass());
+ } else if (pass_name == "canonicalize-ids") {
+ RegisterPass(CreateCanonicalizeIdsPass());
} else {
Errorf(consumer(), nullptr, {},
"Unknown flag '--%s'. Use --help for a list of valid flags",
@@ -1024,22 +1040,6 @@
MakeUnique<opt::UpgradeMemoryModel>());
}
-Optimizer::PassToken CreateInstBindlessCheckPass(uint32_t shader_id) {
- return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::InstBindlessCheckPass>(shader_id));
-}
-
-Optimizer::PassToken CreateInstDebugPrintfPass(uint32_t desc_set,
- uint32_t shader_id) {
- return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::InstDebugPrintfPass>(desc_set, shader_id));
-}
-
-Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t shader_id) {
- return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::InstBuffAddrCheckPass>(shader_id));
-}
-
Optimizer::PassToken CreateConvertRelaxedToHalfPass() {
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::ConvertToHalfPass>());
@@ -1077,7 +1077,20 @@
Optimizer::PassToken CreateDescriptorScalarReplacementPass() {
return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::DescriptorScalarReplacement>());
+ MakeUnique<opt::DescriptorScalarReplacement>(
+ /* flatten_composites= */ true, /* flatten_arrays= */ true));
+}
+
+Optimizer::PassToken CreateDescriptorCompositeScalarReplacementPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::DescriptorScalarReplacement>(
+ /* flatten_composites= */ true, /* flatten_arrays= */ false));
+}
+
+Optimizer::PassToken CreateDescriptorArrayScalarReplacementPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::DescriptorScalarReplacement>(
+ /* flatten_composites= */ false, /* flatten_arrays= */ true));
}
Optimizer::PassToken CreateWrapOpKillPass() {
@@ -1153,6 +1166,14 @@
MakeUnique<opt::TrimCapabilitiesPass>());
}
+Optimizer::PassToken CreateStructPackingPass(const char* structToPack,
+ const char* packingRule) {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::StructPackingPass>(
+ structToPack,
+ opt::StructPackingPass::ParsePackingRuleFromString(packingRule)));
+}
+
Optimizer::PassToken CreateSwitchDescriptorSetPass(uint32_t from, uint32_t to) {
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::SwitchDescriptorSetPass>(from, to));
@@ -1167,6 +1188,27 @@
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::ModifyMaximalReconvergence>(add));
}
+
+Optimizer::PassToken CreateOpExtInstWithForwardReferenceFixupPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::OpExtInstWithForwardReferenceFixupPass>());
+}
+
+Optimizer::PassToken CreateSplitCombinedImageSamplerPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::SplitCombinedImageSamplerPass>());
+}
+
+Optimizer::PassToken CreateResolveBindingConflictsPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::ResolveBindingConflictsPass>());
+}
+
+Optimizer::PassToken CreateCanonicalizeIdsPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::CanonicalizeIdsPass>());
+}
+
} // namespace spvtools
extern "C" {
diff --git a/third_party/SPIRV-Tools/source/opt/pass.cpp b/third_party/SPIRV-Tools/source/opt/pass.cpp
index 75c3740..0f260e2 100644
--- a/third_party/SPIRV-Tools/source/opt/pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/pass.cpp
@@ -83,7 +83,6 @@
uint32_t Pass::GenerateCopy(Instruction* object_to_copy, uint32_t new_type_id,
Instruction* insertion_position) {
- analysis::TypeManager* type_mgr = context()->get_type_mgr();
analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
uint32_t original_type_id = object_to_copy->type_id();
@@ -95,57 +94,63 @@
context(), insertion_position,
IRContext::kAnalysisInstrToBlockMapping | IRContext::kAnalysisDefUse);
- analysis::Type* original_type = type_mgr->GetType(original_type_id);
- analysis::Type* new_type = type_mgr->GetType(new_type_id);
+ Instruction* original_type = get_def_use_mgr()->GetDef(original_type_id);
+ Instruction* new_type = get_def_use_mgr()->GetDef(new_type_id);
- if (const analysis::Array* original_array_type = original_type->AsArray()) {
- uint32_t original_element_type_id =
- type_mgr->GetId(original_array_type->element_type());
-
- analysis::Array* new_array_type = new_type->AsArray();
- assert(new_array_type != nullptr && "Can't copy an array to a non-array.");
- uint32_t new_element_type_id =
- type_mgr->GetId(new_array_type->element_type());
-
- std::vector<uint32_t> element_ids;
- const analysis::Constant* length_const =
- const_mgr->FindDeclaredConstant(original_array_type->LengthId());
- assert(length_const->AsIntConstant());
- uint32_t array_length = length_const->AsIntConstant()->GetU32();
- for (uint32_t i = 0; i < array_length; i++) {
- Instruction* extract = ir_builder.AddCompositeExtract(
- original_element_type_id, object_to_copy->result_id(), {i});
- element_ids.push_back(
- GenerateCopy(extract, new_element_type_id, insertion_position));
- }
-
- return ir_builder.AddCompositeConstruct(new_type_id, element_ids)
- ->result_id();
- } else if (const analysis::Struct* original_struct_type =
- original_type->AsStruct()) {
- analysis::Struct* new_struct_type = new_type->AsStruct();
-
- const std::vector<const analysis::Type*>& original_types =
- original_struct_type->element_types();
- const std::vector<const analysis::Type*>& new_types =
- new_struct_type->element_types();
- std::vector<uint32_t> element_ids;
- for (uint32_t i = 0; i < original_types.size(); i++) {
- Instruction* extract = ir_builder.AddCompositeExtract(
- type_mgr->GetId(original_types[i]), object_to_copy->result_id(), {i});
- element_ids.push_back(GenerateCopy(extract, type_mgr->GetId(new_types[i]),
- insertion_position));
- }
- return ir_builder.AddCompositeConstruct(new_type_id, element_ids)
- ->result_id();
- } else {
- // If we do not have an aggregate type, then we have a problem. Either we
- // found multiple instances of the same type, or we are copying to an
- // incompatible type. Either way the code is illegal.
- assert(false &&
- "Don't know how to copy this type. Code is likely illegal.");
+ if (new_type->opcode() != original_type->opcode()) {
+ return 0;
}
- return 0;
+
+ switch (original_type->opcode()) {
+ case spv::Op::OpTypeArray: {
+ uint32_t original_element_type_id =
+ original_type->GetSingleWordInOperand(0);
+ uint32_t new_element_type_id = new_type->GetSingleWordInOperand(0);
+
+ std::vector<uint32_t> element_ids;
+ uint32_t length_id = original_type->GetSingleWordInOperand(1);
+ const analysis::Constant* length_const =
+ const_mgr->FindDeclaredConstant(length_id);
+ assert(length_const->AsIntConstant());
+ uint32_t array_length = length_const->AsIntConstant()->GetU32();
+ for (uint32_t i = 0; i < array_length; i++) {
+ Instruction* extract = ir_builder.AddCompositeExtract(
+ original_element_type_id, object_to_copy->result_id(), {i});
+ uint32_t new_id =
+ GenerateCopy(extract, new_element_type_id, insertion_position);
+ if (new_id == 0) {
+ return 0;
+ }
+ element_ids.push_back(new_id);
+ }
+
+ return ir_builder.AddCompositeConstruct(new_type_id, element_ids)
+ ->result_id();
+ }
+ case spv::Op::OpTypeStruct: {
+ std::vector<uint32_t> element_ids;
+ for (uint32_t i = 0; i < original_type->NumInOperands(); i++) {
+ uint32_t orig_member_type_id = original_type->GetSingleWordInOperand(i);
+ uint32_t new_member_type_id = new_type->GetSingleWordInOperand(i);
+ Instruction* extract = ir_builder.AddCompositeExtract(
+ orig_member_type_id, object_to_copy->result_id(), {i});
+ uint32_t new_id =
+ GenerateCopy(extract, new_member_type_id, insertion_position);
+ if (new_id == 0) {
+ return 0;
+ }
+ element_ids.push_back(new_id);
+ }
+ return ir_builder.AddCompositeConstruct(new_type_id, element_ids)
+ ->result_id();
+ }
+ default:
+ // If we do not have an aggregate type, then we have a problem. Either we
+ // found multiple instances of the same type, or we are copying to an
+ // incompatible type. Either way the code is illegal. Leave the code as
+ // is and let the caller deal with it.
+ return 0;
+ }
}
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/pass.h b/third_party/SPIRV-Tools/source/opt/pass.h
index b2303e2..3e6c4d0 100644
--- a/third_party/SPIRV-Tools/source/opt/pass.h
+++ b/third_party/SPIRV-Tools/source/opt/pass.h
@@ -145,7 +145,8 @@
// Returns the id whose value is the same as |object_to_copy| except its type
// is |new_type_id|. Any instructions needed to generate this value will be
- // inserted before |insertion_position|.
+ // inserted before |insertion_position|. Returns 0 if a copy could not be
+ // done.
uint32_t GenerateCopy(Instruction* object_to_copy, uint32_t new_type_id,
Instruction* insertion_position);
diff --git a/third_party/SPIRV-Tools/source/opt/passes.h b/third_party/SPIRV-Tools/source/opt/passes.h
index 9d027fb..d005377 100644
--- a/third_party/SPIRV-Tools/source/opt/passes.h
+++ b/third_party/SPIRV-Tools/source/opt/passes.h
@@ -21,6 +21,7 @@
#include "source/opt/amd_ext_to_khr.h"
#include "source/opt/analyze_live_input_pass.h"
#include "source/opt/block_merge_pass.h"
+#include "source/opt/canonicalize_ids_pass.h"
#include "source/opt/ccp_pass.h"
#include "source/opt/cfg_cleanup_pass.h"
#include "source/opt/code_sink.h"
@@ -48,9 +49,6 @@
#include "source/opt/if_conversion.h"
#include "source/opt/inline_exhaustive_pass.h"
#include "source/opt/inline_opaque_pass.h"
-#include "source/opt/inst_bindless_check_pass.h"
-#include "source/opt/inst_buff_addr_check_pass.h"
-#include "source/opt/inst_debug_printf_pass.h"
#include "source/opt/interface_var_sroa.h"
#include "source/opt/interp_fixup_pass.h"
#include "source/opt/invocation_interlock_placement_pass.h"
@@ -67,6 +65,7 @@
#include "source/opt/merge_return_pass.h"
#include "source/opt/modify_maximal_reconvergence.h"
#include "source/opt/null_pass.h"
+#include "source/opt/opextinst_forward_ref_fixup_pass.h"
#include "source/opt/private_to_local_pass.h"
#include "source/opt/reduce_load_size.h"
#include "source/opt/redundancy_elimination.h"
@@ -76,14 +75,17 @@
#include "source/opt/remove_unused_interface_variables_pass.h"
#include "source/opt/replace_desc_array_access_using_var_index.h"
#include "source/opt/replace_invalid_opc.h"
+#include "source/opt/resolve_binding_conflicts_pass.h"
#include "source/opt/scalar_replacement_pass.h"
#include "source/opt/set_spec_constant_default_value_pass.h"
#include "source/opt/simplification_pass.h"
+#include "source/opt/split_combined_image_sampler_pass.h"
#include "source/opt/spread_volatile_semantics.h"
#include "source/opt/ssa_rewrite_pass.h"
#include "source/opt/strength_reduction_pass.h"
#include "source/opt/strip_debug_info_pass.h"
#include "source/opt/strip_nonsemantic_info_pass.h"
+#include "source/opt/struct_packing_pass.h"
#include "source/opt/switch_descriptorset_pass.h"
#include "source/opt/trim_capabilities_pass.h"
#include "source/opt/unify_const_pass.h"
diff --git a/third_party/SPIRV-Tools/source/opt/private_to_local_pass.cpp b/third_party/SPIRV-Tools/source/opt/private_to_local_pass.cpp
index 4904e05..ac33dfb 100644
--- a/third_party/SPIRV-Tools/source/opt/private_to_local_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/private_to_local_pass.cpp
@@ -90,13 +90,13 @@
Function* target_function = nullptr;
context()->get_def_use_mgr()->ForEachUser(
inst.result_id(),
- [&target_function, &found_first_use, this](Instruction* use) {
+ [&target_function, &found_first_use, inst, this](Instruction* use) {
BasicBlock* current_block = context()->get_instr_block(use);
if (current_block == nullptr) {
return;
}
- if (!IsValidUse(use)) {
+ if (!IsValidUse(use, inst.result_id())) {
found_first_use = true;
target_function = nullptr;
return;
@@ -153,7 +153,8 @@
return new_type_id;
}
-bool PrivateToLocalPass::IsValidUse(const Instruction* inst) const {
+bool PrivateToLocalPass::IsValidUse(const Instruction* inst,
+ uint32_t private_variable_id) const {
// The cases in this switch have to match the cases in |UpdateUse|.
// If we don't know how to update it, it is not valid.
if (inst->GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) {
@@ -161,13 +162,14 @@
}
switch (inst->opcode()) {
case spv::Op::OpLoad:
- case spv::Op::OpStore:
case spv::Op::OpImageTexelPointer: // Treat like a load
return true;
+ case spv::Op::OpStore:
+ return inst->GetOperand(1).AsId() != private_variable_id;
case spv::Op::OpAccessChain:
return context()->get_def_use_mgr()->WhileEachUser(
- inst, [this](const Instruction* user) {
- if (!IsValidUse(user)) return false;
+ inst, [this, inst](const Instruction* user) {
+ if (!IsValidUse(user, inst->result_id())) return false;
return true;
});
case spv::Op::OpName:
diff --git a/third_party/SPIRV-Tools/source/opt/private_to_local_pass.h b/third_party/SPIRV-Tools/source/opt/private_to_local_pass.h
index e96a965..93c1c50 100644
--- a/third_party/SPIRV-Tools/source/opt/private_to_local_pass.h
+++ b/third_party/SPIRV-Tools/source/opt/private_to_local_pass.h
@@ -53,7 +53,7 @@
// Returns true is |inst| is a valid use of a pointer. In this case, a
// valid use is one where the transformation is able to rewrite the type to
// match a change in storage class of the original variable.
- bool IsValidUse(const Instruction* inst) const;
+ bool IsValidUse(const Instruction* inst, uint32_t private_variable_id) const;
// Given the result id of a pointer type, |old_type_id|, this function
// returns the id of a the same pointer type except the storage class has
diff --git a/third_party/SPIRV-Tools/source/opt/redundancy_elimination.cpp b/third_party/SPIRV-Tools/source/opt/redundancy_elimination.cpp
index 398225b..61234fa 100644
--- a/third_party/SPIRV-Tools/source/opt/redundancy_elimination.cpp
+++ b/third_party/SPIRV-Tools/source/opt/redundancy_elimination.cpp
@@ -33,12 +33,7 @@
DominatorTree& dom_tree =
context()->GetDominatorAnalysis(&func)->GetDomTree();
- // Keeps track of all ids that contain a given value number. We keep
- // track of multiple values because they could have the same value, but
- // different decorations.
- std::map<uint32_t, uint32_t> value_to_ids;
-
- if (EliminateRedundanciesFrom(dom_tree.GetRoot(), vnTable, value_to_ids)) {
+ if (EliminateRedundanciesFrom(dom_tree.GetRoot(), vnTable)) {
modified = true;
}
}
@@ -46,14 +41,21 @@
}
bool RedundancyEliminationPass::EliminateRedundanciesFrom(
- DominatorTreeNode* bb, const ValueNumberTable& vnTable,
- std::map<uint32_t, uint32_t> value_to_ids) {
- bool modified = EliminateRedundanciesInBB(bb->bb_, vnTable, &value_to_ids);
-
- for (auto dominated_bb : bb->children_) {
- modified |= EliminateRedundanciesFrom(dominated_bb, vnTable, value_to_ids);
+ DominatorTreeNode* bb, const ValueNumberTable& vnTable) {
+ struct State {
+ DominatorTreeNode* node;
+ std::map<uint32_t, uint32_t> value_to_id_map;
+ };
+ std::vector<State> todo;
+ todo.push_back({bb, std::map<uint32_t, uint32_t>()});
+ bool modified = false;
+ for (size_t next_node = 0; next_node < todo.size(); next_node++) {
+ modified |= EliminateRedundanciesInBB(todo[next_node].node->bb_, vnTable,
+ &todo[next_node].value_to_id_map);
+ for (DominatorTreeNode* child : todo[next_node].node->children_) {
+ todo.push_back({child, todo[next_node].value_to_id_map});
+ }
}
-
return modified;
}
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/redundancy_elimination.h b/third_party/SPIRV-Tools/source/opt/redundancy_elimination.h
index 40451f4..8c6e16a 100644
--- a/third_party/SPIRV-Tools/source/opt/redundancy_elimination.h
+++ b/third_party/SPIRV-Tools/source/opt/redundancy_elimination.h
@@ -46,8 +46,7 @@
//
// Returns true if at least one instruction is deleted.
bool EliminateRedundanciesFrom(DominatorTreeNode* bb,
- const ValueNumberTable& vnTable,
- std::map<uint32_t, uint32_t> value_to_ids);
+ const ValueNumberTable& vnTable);
};
} // namespace opt
diff --git a/third_party/SPIRV-Tools/source/opt/remove_unused_interface_variables_pass.cpp b/third_party/SPIRV-Tools/source/opt/remove_unused_interface_variables_pass.cpp
index d4df1b2..c3a4b77 100644
--- a/third_party/SPIRV-Tools/source/opt/remove_unused_interface_variables_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/remove_unused_interface_variables_pass.cpp
@@ -21,6 +21,8 @@
RemoveUnusedInterfaceVariablesPass& parent_;
Instruction& entry_;
std::unordered_set<uint32_t> used_variables_;
+ std::vector<uint32_t> operands_to_add_;
+
IRContext::ProcessFunction pfn_ =
std::bind(&RemoveUnusedInterfaceVariablesContext::processFunction, this,
std::placeholders::_1);
@@ -38,8 +40,10 @@
(parent_.get_module()->version() >=
SPV_SPIRV_VERSION_WORD(1, 4) ||
storage_class == spv::StorageClass::Input ||
- storage_class == spv::StorageClass::Output))
+ storage_class == spv::StorageClass::Output)) {
used_variables_.insert(*id);
+ operands_to_add_.push_back(*id);
+ }
});
return false;
}
@@ -71,7 +75,7 @@
void Modify() {
for (int i = entry_.NumInOperands() - 1; i >= 3; --i)
entry_.RemoveInOperand(i);
- for (auto id : used_variables_) {
+ for (auto id : operands_to_add_) {
entry_.AddOperand(Operand(SPV_OPERAND_TYPE_ID, {id}));
}
}
diff --git a/third_party/SPIRV-Tools/source/opt/replace_invalid_opc.cpp b/third_party/SPIRV-Tools/source/opt/replace_invalid_opc.cpp
index 1b97c0e..305f2b6 100644
--- a/third_party/SPIRV-Tools/source/opt/replace_invalid_opc.cpp
+++ b/third_party/SPIRV-Tools/source/opt/replace_invalid_opc.cpp
@@ -17,6 +17,8 @@
#include <bitset>
#include <vector>
+#include "source/table2.h"
+
namespace spvtools {
namespace opt {
@@ -207,10 +209,10 @@
}
std::string ReplaceInvalidOpcodePass::BuildWarningMessage(spv::Op opcode) {
- spv_opcode_desc opcode_info;
- context()->grammar().lookupOpcode(opcode, &opcode_info);
+ const spvtools::InstructionDesc* opcode_desc = nullptr;
+ spvtools::LookupOpcode(opcode, &opcode_desc);
std::string message = "Removing ";
- message += opcode_info->name;
+ message += opcode_desc->name().data();
message += " instruction because of incompatible execution model.";
return message;
}
diff --git a/third_party/SPIRV-Tools/source/opt/resolve_binding_conflicts_pass.cpp b/third_party/SPIRV-Tools/source/opt/resolve_binding_conflicts_pass.cpp
new file mode 100644
index 0000000..18ea2e5
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/resolve_binding_conflicts_pass.cpp
@@ -0,0 +1,328 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/opt/resolve_binding_conflicts_pass.h"
+
+#include <algorithm>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/instruction.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "spirv/unified1/spirv.h"
+
+namespace spvtools {
+namespace opt {
+
+// A VarBindingInfo contains the binding information for a single resource
+// variable.
+//
+// Exactly one such object is created per resource variable in the
+// module. In particular, when a resource variable is statically used by
+// more than one entry point, those entry points share the same VarBindingInfo
+// object for that variable.
+struct VarBindingInfo {
+ const Instruction* const var;
+ const uint32_t descriptor_set;
+ Instruction* const binding_decoration;
+
+ // Returns the binding number.
+ uint32_t binding() const {
+ return binding_decoration->GetSingleWordInOperand(2);
+ }
+ // Sets the binding number to 'b'.
+ void updateBinding(uint32_t b) { binding_decoration->SetOperand(2, {b}); }
+};
+
+// The bindings in the same descriptor set that are used by an entry point.
+using BindingList = std::vector<VarBindingInfo*>;
+// A map from descriptor set number to the list of bindings in that descriptor
+// set, as used by a particular entry point.
+using DescriptorSets = std::unordered_map<uint32_t, BindingList>;
+
+IRContext::Analysis ResolveBindingConflictsPass::GetPreservedAnalyses() {
+ // All analyses are kept up to date.
+ // At most this modifies the Binding numbers on variables.
+ return IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping |
+ IRContext::kAnalysisDecorations | IRContext::kAnalysisCombinators |
+ IRContext::kAnalysisCFG | IRContext::kAnalysisDominatorAnalysis |
+ IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap |
+ IRContext::kAnalysisScalarEvolution |
+ IRContext::kAnalysisRegisterPressure |
+ IRContext::kAnalysisValueNumberTable |
+ IRContext::kAnalysisStructuredCFG | IRContext::kAnalysisBuiltinVarId |
+ IRContext::kAnalysisIdToFuncMapping | IRContext::kAnalysisConstants |
+ IRContext::kAnalysisTypes | IRContext::kAnalysisDebugInfo |
+ IRContext::kAnalysisLiveness;
+}
+
+// Orders variable binding info objects.
+// * The binding number is most signficant;
+// * Then a sampler-like object compares greater than non-sampler like object.
+// * Otherwise compare based on variable ID.
+// This provides a total order among bindings in a descriptor set for a valid
+// Vulkan module.
+bool Less(const VarBindingInfo* const lhs, const VarBindingInfo* const rhs) {
+ if (lhs->binding() < rhs->binding()) return true;
+ if (lhs->binding() > rhs->binding()) return false;
+
+ // Examine types.
+ // In valid Vulkan the only conflict can occur between
+ // images and samplers. We only care about a specific
+ // comparison when one is a image-like thing and the other
+ // is a sampler-like thing of the same shape. So unwrap
+ // types until we hit one of those two.
+
+ auto* def_use_mgr = lhs->var->context()->get_def_use_mgr();
+
+ // Returns the type found by iteratively following pointer pointee type,
+ // or array element type.
+ auto unwrap = [&def_use_mgr](Instruction* ty) {
+ bool keep_going = true;
+ do {
+ switch (ty->opcode()) {
+ case spv::Op::OpTypePointer:
+ ty = def_use_mgr->GetDef(ty->GetSingleWordInOperand(1));
+ break;
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeRuntimeArray:
+ ty = def_use_mgr->GetDef(ty->GetSingleWordInOperand(0));
+ break;
+ default:
+ keep_going = false;
+ break;
+ }
+ } while (keep_going);
+ return ty;
+ };
+
+ auto* lhs_ty = unwrap(def_use_mgr->GetDef(lhs->var->type_id()));
+ auto* rhs_ty = unwrap(def_use_mgr->GetDef(rhs->var->type_id()));
+ if (lhs_ty->opcode() == rhs_ty->opcode()) {
+ // Pick based on variable ID.
+ return lhs->var->result_id() < rhs->var->result_id();
+ }
+ // A sampler is always greater than an image.
+ if (lhs_ty->opcode() == spv::Op::OpTypeSampler) {
+ return false;
+ }
+ if (rhs_ty->opcode() == spv::Op::OpTypeSampler) {
+ return true;
+ }
+ // Pick based on variable ID.
+ return lhs->var->result_id() < rhs->var->result_id();
+}
+
+// Summarizes the caller-callee relationships between functions in a module.
+class CallGraph {
+ public:
+ // Returns the list of all functions statically reachable from entry points,
+ // where callees precede callers.
+ const std::vector<uint32_t>& CalleesBeforeCallers() const {
+ return visit_order_;
+ }
+ // Returns the list functions called from a given function.
+ const std::unordered_set<uint32_t>& Callees(uint32_t caller) {
+ return calls_[caller];
+ }
+
+ CallGraph(IRContext& context) {
+ // Populate calls_.
+ std::queue<uint32_t> callee_queue;
+ for (const auto& fn : *context.module()) {
+ auto& callees = calls_[fn.result_id()];
+ context.AddCalls(&fn, &callee_queue);
+ while (!callee_queue.empty()) {
+ callees.insert(callee_queue.front());
+ callee_queue.pop();
+ }
+ }
+
+ // Perform depth-first search, starting from each entry point.
+ // Populates visit_order_.
+ for (const auto& ep : context.module()->entry_points()) {
+ Visit(ep.GetSingleWordInOperand(1));
+ }
+ }
+
+ private:
+ // Visits a function, recursively visiting its callees. Adds this ID
+ // to the visit_order after all callees have been visited.
+ void Visit(uint32_t func_id) {
+ if (visited_.count(func_id)) {
+ return;
+ }
+ visited_.insert(func_id);
+ for (auto callee_id : calls_[func_id]) {
+ Visit(callee_id);
+ }
+ visit_order_.push_back(func_id);
+ }
+
+ // Maps the ID of a function to the IDs of functions it calls.
+ std::unordered_map<uint32_t, std::unordered_set<uint32_t>> calls_;
+
+ // IDs of visited functions;
+ std::unordered_set<uint32_t> visited_;
+ // IDs of functions, where callees precede callers.
+ std::vector<uint32_t> visit_order_;
+};
+
+// Returns vector binding info for all resource variables in the module.
+auto GetVarBindings(IRContext& context) {
+ std::vector<VarBindingInfo> vars;
+ auto* deco_mgr = context.get_decoration_mgr();
+ for (auto& inst : context.module()->types_values()) {
+ if (inst.opcode() == spv::Op::OpVariable) {
+ Instruction* descriptor_set_deco = nullptr;
+ Instruction* binding_deco = nullptr;
+ for (auto* deco : deco_mgr->GetDecorationsFor(inst.result_id(), false)) {
+ switch (static_cast<spv::Decoration>(deco->GetSingleWordInOperand(1))) {
+ case spv::Decoration::DescriptorSet:
+ assert(!descriptor_set_deco);
+ descriptor_set_deco = deco;
+ break;
+ case spv::Decoration::Binding:
+ assert(!binding_deco);
+ binding_deco = deco;
+ break;
+ default:
+ break;
+ }
+ }
+ if (descriptor_set_deco && binding_deco) {
+ vars.push_back({&inst, descriptor_set_deco->GetSingleWordInOperand(2),
+ binding_deco});
+ }
+ }
+ }
+ return vars;
+}
+
+// Merges the bindings from source into sink. Maintains order and uniqueness
+// within a list of bindings.
+void Merge(DescriptorSets& sink, const DescriptorSets& source) {
+ for (auto index_and_bindings : source) {
+ const uint32_t index = index_and_bindings.first;
+ const BindingList& src1 = index_and_bindings.second;
+ const BindingList& src2 = sink[index];
+ BindingList merged;
+ merged.resize(src1.size() + src2.size());
+ auto merged_end = std::merge(src1.begin(), src1.end(), src2.begin(),
+ src2.end(), merged.begin(), Less);
+ auto unique_end = std::unique(merged.begin(), merged_end);
+ merged.resize(unique_end - merged.begin());
+ sink[index] = std::move(merged);
+ }
+}
+
+// Resolves conflicts within this binding list, so the binding number on an
+// item is at least one more than the binding number on the previous item.
+// When this does not yet hold, increase the binding number on the second
+// item in the pair. Returns true if any changes were applied.
+bool ResolveConflicts(BindingList& bl) {
+ bool changed = false;
+ for (size_t i = 1; i < bl.size(); i++) {
+ const auto prev_num = bl[i - 1]->binding();
+ if (prev_num >= bl[i]->binding()) {
+ bl[i]->updateBinding(prev_num + 1);
+ changed = true;
+ }
+ }
+ return changed;
+}
+
+Pass::Status ResolveBindingConflictsPass::Process() {
+ // Assumes the descriptor set and binding decorations are not provided
+ // via decoration groups. Decoration groups were deprecated in SPIR-V 1.3
+ // Revision 6. I have not seen any compiler generate them. --dneto
+
+ auto vars = GetVarBindings(*context());
+
+ // Maps a function ID to the variables used directly or indirectly by the
+ // function, organized into descriptor sets. Each descriptor set
+ // consists of a BindingList of distinct variables.
+ std::unordered_map<uint32_t, DescriptorSets> used_vars;
+
+ // Determine variables directly used by functions.
+ auto* def_use_mgr = context()->get_def_use_mgr();
+ for (auto& var : vars) {
+ std::unordered_set<uint32_t> visited_functions_for_var;
+ def_use_mgr->ForEachUser(var.var, [&](Instruction* user) {
+ if (auto* block = context()->get_instr_block(user)) {
+ auto* fn = block->GetParent();
+ assert(fn);
+ const auto fn_id = fn->result_id();
+ if (visited_functions_for_var.insert(fn_id).second) {
+ used_vars[fn_id][var.descriptor_set].push_back(&var);
+ }
+ }
+ });
+ }
+
+ // Sort within a descriptor set by binding number.
+ for (auto& sets_for_fn : used_vars) {
+ for (auto& ds : sets_for_fn.second) {
+ BindingList& bindings = ds.second;
+ std::stable_sort(bindings.begin(), bindings.end(), Less);
+ }
+ }
+
+ // Propagate from callees to callers.
+ CallGraph call_graph(*context());
+ for (const uint32_t caller : call_graph.CalleesBeforeCallers()) {
+ DescriptorSets& caller_ds = used_vars[caller];
+ for (const uint32_t callee : call_graph.Callees(caller)) {
+ Merge(caller_ds, used_vars[callee]);
+ }
+ }
+
+ // At this point, the descriptor sets associated with each entry point
+ // capture exactly the set of resource variables statically used
+ // by the static call tree of that entry point.
+
+ // Resolve conflicts.
+ // VarBindingInfo objects may be shared between the bindings lists.
+ // Updating a binding in one list can require updating another list later.
+ // So repeat updates until settling.
+
+ // The union of BindingLists across all entry points.
+ std::vector<BindingList*> ep_bindings;
+
+ for (auto& ep : context()->module()->entry_points()) {
+ for (auto& ds : used_vars[ep.GetSingleWordInOperand(1)]) {
+ BindingList& bindings = ds.second;
+ ep_bindings.push_back(&bindings);
+ }
+ }
+ bool modified = false;
+ bool found_conflict;
+ do {
+ found_conflict = false;
+ for (BindingList* bl : ep_bindings) {
+ found_conflict |= ResolveConflicts(*bl);
+ }
+ modified |= found_conflict;
+ } while (found_conflict);
+
+ return modified ? Pass::Status::SuccessWithChange
+ : Pass::Status::SuccessWithoutChange;
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/resolve_binding_conflicts_pass.h b/third_party/SPIRV-Tools/source/opt/resolve_binding_conflicts_pass.h
new file mode 100644
index 0000000..d1ab433
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/resolve_binding_conflicts_pass.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef LIBSPIRV_OPT_RESOLVE_BINDING_CONFLICTS_PASS_H_
+#define LIBSPIRV_OPT_RESOLVE_BINDING_CONFLICTS_PASS_H_
+
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include "source/diagnostic.h"
+#include "source/opt/pass.h"
+#include "source/util/small_vector.h"
+
+namespace spvtools {
+namespace opt {
+class ResolveBindingConflictsPass : public Pass {
+ public:
+ virtual ~ResolveBindingConflictsPass() override = default;
+ const char* name() const override { return "resolve-binding-conflicts"; }
+ IRContext::Analysis GetPreservedAnalyses() override;
+ Status Process() override;
+};
+} // namespace opt
+} // namespace spvtools
+
+#endif // LIBSPIRV_OPT_RESOLVE_BINDING_CONFLICTS_PASS_H_
diff --git a/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.cpp b/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.cpp
index 38c8aec..fc15b75 100644
--- a/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2017 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -184,7 +186,7 @@
Instruction* added_dbg_value =
context()->get_debug_info_mgr()->AddDebugValueForDecl(
dbg_decl, /*value_id=*/var->result_id(),
- /*insert_before=*/insert_before, /*scope_and_line=*/dbg_decl);
+ /*insert_before=*/insert_before, /*line=*/dbg_decl);
if (added_dbg_value == nullptr) return false;
added_dbg_value->AddOperand(
@@ -671,7 +673,8 @@
for (auto inst :
get_decoration_mgr()->GetDecorationsFor(typeInst->result_id(), false)) {
uint32_t decoration;
- if (inst->opcode() == spv::Op::OpDecorate) {
+ if (inst->opcode() == spv::Op::OpDecorate ||
+ inst->opcode() == spv::Op::OpDecorateId) {
decoration = inst->GetSingleWordInOperand(1u);
} else {
assert(inst->opcode() == spv::Op::OpMemberDecorate);
diff --git a/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.h b/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.h
index c73ecfd..61d341e 100644
--- a/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.h
+++ b/third_party/SPIRV-Tools/source/opt/scalar_replacement_pass.h
@@ -33,7 +33,7 @@
// Documented in optimizer.hpp
class ScalarReplacementPass : public MemPass {
private:
- static constexpr uint32_t kDefaultLimit = 100;
+ static constexpr uint32_t kDefaultLimit = 0;
public:
ScalarReplacementPass(uint32_t limit = kDefaultLimit)
diff --git a/third_party/SPIRV-Tools/source/opt/split_combined_image_sampler_pass.cpp b/third_party/SPIRV-Tools/source/opt/split_combined_image_sampler_pass.cpp
new file mode 100644
index 0000000..0af4dba
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/split_combined_image_sampler_pass.cpp
@@ -0,0 +1,648 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/opt/split_combined_image_sampler_pass.h"
+
+#include <algorithm>
+#include <cassert>
+#include <memory>
+
+#include "source/opt/instruction.h"
+#include "source/opt/ir_builder.h"
+#include "source/opt/ir_context.h"
+#include "source/opt/type_manager.h"
+#include "source/opt/types.h"
+#include "source/util/make_unique.h"
+#include "source/util/string_utils.h"
+#include "spirv/unified1/spirv.h"
+
+namespace spvtools {
+namespace opt {
+
+#define CHECK(cond) \
+ { \
+ if ((cond) != SPV_SUCCESS) return Pass::Status::Failure; \
+ }
+
+#define CHECK_STATUS(cond) \
+ { \
+ if (auto c = (cond); c != SPV_SUCCESS) return c; \
+ }
+
+IRContext::Analysis SplitCombinedImageSamplerPass::GetPreservedAnalyses() {
+ return
+ // def use manager is updated
+ IRContext::kAnalysisDefUse
+
+ // decorations are updated
+ | IRContext::kAnalysisDecorations
+
+ // control flow is not changed
+ | IRContext::kAnalysisCFG //
+ | IRContext::kAnalysisLoopAnalysis //
+ | IRContext::kAnalysisStructuredCFG
+
+ // type manager is updated
+ | IRContext::kAnalysisTypes;
+}
+
+Pass::Status SplitCombinedImageSamplerPass::Process() {
+ def_use_mgr_ = context()->get_def_use_mgr();
+ type_mgr_ = context()->get_type_mgr();
+
+ FindCombinedTextureSamplers();
+ if (combined_types_to_remove_.empty() && !sampled_image_used_as_param_) {
+ return Ok();
+ }
+
+ CHECK(RemapFunctions());
+ CHECK(RemapVars());
+ CHECK(RemoveDeadTypes());
+
+ def_use_mgr_ = nullptr;
+ type_mgr_ = nullptr;
+
+ return Ok();
+}
+
+spvtools::DiagnosticStream SplitCombinedImageSamplerPass::Fail() {
+ return std::move(
+ spvtools::DiagnosticStream({}, consumer(), "", SPV_ERROR_INVALID_BINARY)
+ << "split-combined-image-sampler: ");
+}
+
+void SplitCombinedImageSamplerPass::FindCombinedTextureSamplers() {
+ for (auto& inst : context()->types_values()) {
+ RegisterGlobal(inst.result_id());
+ switch (inst.opcode()) {
+ case spv::Op::OpTypeSampler:
+ // Modules can't have duplicate sampler types.
+ assert(!sampler_type_);
+ sampler_type_ = &inst;
+ break;
+
+ case spv::Op::OpTypeSampledImage:
+ if (!first_sampled_image_type_) {
+ first_sampled_image_type_ = &inst;
+ }
+ combined_types_.insert(inst.result_id());
+ def_use_mgr_->WhileEachUser(inst.result_id(), [&](Instruction* i) {
+ sampled_image_used_as_param_ |=
+ i->opcode() == spv::Op::OpTypeFunction;
+ return !sampled_image_used_as_param_;
+ });
+ break;
+
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeRuntimeArray: {
+ auto pointee_id = inst.GetSingleWordInOperand(0);
+ if (combined_types_.find(pointee_id) != combined_types_.end()) {
+ combined_types_.insert(inst.result_id());
+ combined_types_to_remove_.push_back(inst.result_id());
+ }
+ } break;
+
+ case spv::Op::OpTypePointer: {
+ auto sc =
+ static_cast<spv::StorageClass>(inst.GetSingleWordInOperand(0));
+ if (sc == spv::StorageClass::UniformConstant) {
+ auto pointee_id = inst.GetSingleWordInOperand(1);
+ if (combined_types_.find(pointee_id) != combined_types_.end()) {
+ combined_types_.insert(inst.result_id());
+ combined_types_to_remove_.push_back(inst.result_id());
+ }
+ }
+ } break;
+
+ case spv::Op::OpVariable:
+ if (combined_types_.find(inst.type_id()) != combined_types_.end()) {
+ ordered_vars_.push_back(&inst);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+Instruction* SplitCombinedImageSamplerPass::GetSamplerType() {
+ if (!sampler_type_) {
+ analysis::Sampler s;
+ uint32_t sampler_type_id = type_mgr_->GetTypeInstruction(&s);
+ sampler_type_ = def_use_mgr_->GetDef(sampler_type_id);
+ assert(first_sampled_image_type_);
+ sampler_type_->InsertBefore(first_sampled_image_type_);
+ RegisterNewGlobal(sampler_type_->result_id());
+ }
+ return sampler_type_;
+}
+
+spv_result_t SplitCombinedImageSamplerPass::RemapVars() {
+ for (Instruction* var : ordered_vars_) {
+ CHECK_STATUS(RemapVar(var));
+ }
+ return SPV_SUCCESS;
+}
+
+std::pair<Instruction*, Instruction*> SplitCombinedImageSamplerPass::SplitType(
+ Instruction& combined_kind_type) {
+ if (auto where = type_remap_.find(combined_kind_type.result_id());
+ where != type_remap_.end()) {
+ auto& type_remap = where->second;
+ return {type_remap.image_kind_type, type_remap.sampler_kind_type};
+ }
+
+ switch (combined_kind_type.opcode()) {
+ case spv::Op::OpTypeSampledImage: {
+ auto* image_type =
+ def_use_mgr_->GetDef(combined_kind_type.GetSingleWordInOperand(0));
+ auto* sampler_type = GetSamplerType();
+ type_remap_[combined_kind_type.result_id()] = {&combined_kind_type,
+ image_type, sampler_type};
+ return {image_type, sampler_type};
+ break;
+ }
+ case spv::Op::OpTypePointer: {
+ auto sc = static_cast<spv::StorageClass>(
+ combined_kind_type.GetSingleWordInOperand(0));
+ if (sc == spv::StorageClass::UniformConstant) {
+ auto* pointee =
+ def_use_mgr_->GetDef(combined_kind_type.GetSingleWordInOperand(1));
+ auto [image_pointee, sampler_pointee] = SplitType(*pointee);
+ // These would be null if the pointee is an image type or a sampler
+ // type. Don't decompose them. Currently this method does not check the
+ // assumption that it is being only called on combined types. So code
+ // this defensively.
+ if (image_pointee && sampler_pointee) {
+ auto* ptr_image = MakeUniformConstantPointer(image_pointee);
+ auto* ptr_sampler = MakeUniformConstantPointer(sampler_pointee);
+ type_remap_[combined_kind_type.result_id()] = {
+ &combined_kind_type, ptr_image, ptr_sampler};
+ return {ptr_image, ptr_sampler};
+ }
+ }
+ break;
+ }
+ case spv::Op::OpTypeArray: {
+ const auto* array_ty =
+ type_mgr_->GetType(combined_kind_type.result_id())->AsArray();
+ assert(array_ty);
+ const auto* sampled_image_ty = array_ty->element_type()->AsSampledImage();
+ assert(sampled_image_ty);
+
+ const analysis::Type* image_ty = sampled_image_ty->image_type();
+ assert(image_ty);
+ analysis::Array array_image_ty(image_ty, array_ty->length_info());
+ const uint32_t array_image_ty_id =
+ type_mgr_->GetTypeInstruction(&array_image_ty);
+ auto* array_image_ty_inst = def_use_mgr_->GetDef(array_image_ty_id);
+ if (!IsKnownGlobal(array_image_ty_id)) {
+ array_image_ty_inst->InsertBefore(&combined_kind_type);
+ RegisterNewGlobal(array_image_ty_id);
+ // GetTypeInstruction also updated the def-use manager.
+ }
+
+ analysis::Array sampler_array_ty(
+ type_mgr_->GetType(GetSamplerType()->result_id()),
+ array_ty->length_info());
+ const uint32_t array_sampler_ty_id =
+ type_mgr_->GetTypeInstruction(&sampler_array_ty);
+ auto* array_sampler_ty_inst = def_use_mgr_->GetDef(array_sampler_ty_id);
+ if (!IsKnownGlobal(array_sampler_ty_id)) {
+ array_sampler_ty_inst->InsertBefore(&combined_kind_type);
+ RegisterNewGlobal(array_sampler_ty_id);
+ // GetTypeInstruction also updated the def-use manager.
+ }
+ return {array_image_ty_inst, array_sampler_ty_inst};
+ }
+ case spv::Op::OpTypeRuntimeArray: {
+ // This is like the sized-array case, but there is no length parameter.
+ auto* array_ty =
+ type_mgr_->GetType(combined_kind_type.result_id())->AsRuntimeArray();
+ assert(array_ty);
+ auto* sampled_image_ty = array_ty->element_type()->AsSampledImage();
+ assert(sampled_image_ty);
+
+ const analysis::Type* image_ty = sampled_image_ty->image_type();
+ assert(image_ty);
+ analysis::RuntimeArray array_image_ty(image_ty);
+ const uint32_t array_image_ty_id =
+ type_mgr_->GetTypeInstruction(&array_image_ty);
+ auto* array_image_ty_inst = def_use_mgr_->GetDef(array_image_ty_id);
+ if (!IsKnownGlobal(array_image_ty_id)) {
+ array_image_ty_inst->InsertBefore(&combined_kind_type);
+ RegisterNewGlobal(array_image_ty_id);
+ // GetTypeInstruction also updated the def-use manager.
+ }
+
+ analysis::RuntimeArray sampler_array_ty(
+ type_mgr_->GetType(GetSamplerType()->result_id()));
+ const uint32_t array_sampler_ty_id =
+ type_mgr_->GetTypeInstruction(&sampler_array_ty);
+ auto* array_sampler_ty_inst = def_use_mgr_->GetDef(array_sampler_ty_id);
+ if (!IsKnownGlobal(array_sampler_ty_id)) {
+ array_sampler_ty_inst->InsertBefore(&combined_kind_type);
+ RegisterNewGlobal(array_sampler_ty_id);
+ // GetTypeInstruction also updated the def-use manager.
+ }
+ return {array_image_ty_inst, array_sampler_ty_inst};
+ }
+ default:
+ break;
+ }
+ return {nullptr, nullptr};
+}
+
+spv_result_t SplitCombinedImageSamplerPass::RemapVar(
+ Instruction* combined_var) {
+ InstructionBuilder builder(context(), combined_var,
+ IRContext::kAnalysisDefUse);
+
+ // Create an image variable, and a sampler variable.
+ auto* combined_var_type = def_use_mgr_->GetDef(combined_var->type_id());
+ auto [ptr_image_ty, ptr_sampler_ty] = SplitType(*combined_var_type);
+ assert(ptr_image_ty);
+ assert(ptr_sampler_ty);
+ Instruction* sampler_var = builder.AddVariable(
+ ptr_sampler_ty->result_id(), SpvStorageClassUniformConstant);
+ Instruction* image_var = builder.AddVariable(ptr_image_ty->result_id(),
+ SpvStorageClassUniformConstant);
+ modified_ = true;
+ return RemapUses(combined_var, image_var, sampler_var);
+}
+
+spv_result_t SplitCombinedImageSamplerPass::RemapUses(
+ Instruction* combined, Instruction* image_part, Instruction* sampler_part) {
+ // The instructions to delete.
+ std::unordered_set<Instruction*> dead_insts;
+ // The insertion point should be updated before using this builder.
+ // We needed *something* here.
+ InstructionBuilder builder(context(), combined, IRContext::kAnalysisDefUse);
+
+ // This code must maintain the SPIR-V "Data rule" about sampled image values:
+ // > All OpSampledImage instructions, or instructions that load an image or
+ // > sampler reference, must be in the same block in which their Result <id>
+ // > are consumed.
+ //
+ // When the code below inserts OpSampledImage instructions, it is always
+ // either:
+ // - in the same block as the previous OpSampledImage instruction it is
+ // replacing, or
+ // - in the same block as the instruction using sampled image value it is
+ // replacing.
+ //
+ // Assuming that rule is already honoured by the module, these updates will
+ // continue to honour the rule.
+
+ // Represents a single use of a value to be remapped.
+ struct RemapUse {
+ uint32_t used_id; // The ID that is being used.
+ Instruction* user;
+ uint32_t index;
+ Instruction* image_part; // The image part of the replacement.
+ Instruction* sampler_part; // The sampler part of the replacement.
+ };
+ // The work list of uses to be remapped.
+ std::vector<RemapUse> uses;
+
+ // Adds remap records for each use of a value to be remapped.
+ // Also schedules the original value for deletion.
+ auto add_remap = [this, &dead_insts, &uses](Instruction* combined_arg,
+ Instruction* image_part_arg,
+ Instruction* sampler_part_arg) {
+ const uint32_t used_combined_id = combined_arg->result_id();
+
+ def_use_mgr_->ForEachUse(
+ combined_arg, [&](Instruction* user, uint32_t use_index) {
+ uses.push_back({used_combined_id, user, use_index, image_part_arg,
+ sampler_part_arg});
+ });
+ dead_insts.insert(combined_arg);
+ };
+
+ add_remap(combined, image_part, sampler_part);
+
+ // Use index-based iteration because we can add to the work list as we go
+ // along, and reallocation would invalidate ordinary iterators.
+ for (size_t use_index = 0; use_index < uses.size(); ++use_index) {
+ auto& use = uses[use_index];
+ switch (use.user->opcode()) {
+ case spv::Op::OpCopyObject: {
+ // Append the uses of this OpCopyObject to the work list.
+ add_remap(use.user, image_part, sampler_part);
+ break;
+ }
+ case spv::Op::OpLoad: {
+ assert(use.index == 2 && "variable used as non-pointer index on load");
+ Instruction* load = use.user;
+
+ // Assume the loaded value is a sampled image.
+ assert(def_use_mgr_->GetDef(load->type_id())->opcode() ==
+ spv::Op::OpTypeSampledImage);
+
+ // Create loads for the image part and sampler part.
+ builder.SetInsertPoint(load);
+ auto* image = builder.AddLoad(PointeeTypeId(use.image_part),
+ use.image_part->result_id());
+ auto* sampler = builder.AddLoad(PointeeTypeId(use.sampler_part),
+ use.sampler_part->result_id());
+
+ // Move decorations, such as RelaxedPrecision.
+ auto* deco_mgr = context()->get_decoration_mgr();
+ deco_mgr->CloneDecorations(load->result_id(), image->result_id());
+ deco_mgr->CloneDecorations(load->result_id(), sampler->result_id());
+ deco_mgr->RemoveDecorationsFrom(load->result_id());
+
+ // Create a sampled image from the loads of the two parts.
+ auto* sampled_image = builder.AddSampledImage(
+ load->type_id(), image->result_id(), sampler->result_id());
+ // Replace the original sampled image value with the new one.
+ std::unordered_set<Instruction*> users;
+ def_use_mgr_->ForEachUse(
+ load, [&users, sampled_image](Instruction* user, uint32_t index) {
+ user->SetOperand(index, {sampled_image->result_id()});
+ users.insert(user);
+ });
+ for (auto* user : users) {
+ def_use_mgr_->AnalyzeInstUse(user);
+ }
+ dead_insts.insert(load);
+ break;
+ }
+ case spv::Op::OpDecorate: {
+ assert(use.index == 0 && "variable used as non-target index");
+ builder.SetInsertPoint(use.user);
+ spv::Decoration deco{use.user->GetSingleWordInOperand(1)};
+ std::vector<uint32_t> literals;
+ for (uint32_t i = 2; i < use.user->NumInOperands(); i++) {
+ literals.push_back(use.user->GetSingleWordInOperand(i));
+ }
+ builder.AddDecoration(use.image_part->result_id(), deco, literals);
+ builder.AddDecoration(use.sampler_part->result_id(), deco, literals);
+ // KillInst will delete names and decorations, so don't schedule a
+ // deletion of this instruction.
+ break;
+ }
+ case spv::Op::OpEntryPoint: {
+ // The entry point lists variables in the shader interface, i.e.
+ // module-scope variables referenced by the static call tree rooted
+ // at the entry point. (It can be a proper superset). Before SPIR-V
+ // 1.4, only Input and Output variables are listed; in 1.4 and later,
+ // module-scope variables in all storage classes are listed.
+ // If a combined image+sampler is listed by the entry point, then
+ // the separated image and sampler variables should be.
+ assert(use.index >= 3 &&
+ "variable used in OpEntryPoint but not as an interface ID");
+ use.user->SetOperand(use.index, {use.image_part->result_id()});
+ use.user->InsertOperand(
+ use.user->NumOperands(),
+ {SPV_OPERAND_TYPE_ID, {use.sampler_part->result_id()}});
+ def_use_mgr_->AnalyzeInstUse(use.user);
+ break;
+ }
+ case spv::Op::OpName: {
+ // Synthesize new names from the old.
+ const auto name = use.user->GetOperand(1).AsString();
+ AddOpName(use.image_part->result_id(), name + "_image");
+ AddOpName(use.sampler_part->result_id(), name + "_sampler");
+
+ // KillInst will delete names and decorations, so don't schedule a
+ // deletion of this instruction.
+ break;
+ }
+ case spv::Op::OpFunctionCall: {
+ // Replace each combined arg with two args: the image part, then the
+ // sampler part.
+ // The combined value could have been used twice in the argument list.
+ // Moving things around now will invalidate the 'use' list above.
+ // So don't trust the use index value.
+ auto& call = *use.user;
+ // The insert API only takes absolute arg IDs, not "in" arg IDs.
+ const auto first_arg_operand_index = 3; // Skip the callee ID
+ for (uint32_t i = first_arg_operand_index; i < call.NumOperands();
+ ++i) {
+ if (use.used_id == call.GetSingleWordOperand(i)) {
+ call.SetOperand(i, {use.sampler_part->result_id()});
+ call.InsertOperand(
+ i, {SPV_OPERAND_TYPE_ID, {use.image_part->result_id()}});
+ ++i;
+ }
+ }
+ def_use_mgr_->AnalyzeInstUse(&call);
+ break;
+ }
+ case spv::Op::OpAccessChain:
+ case spv::Op::OpInBoundsAccessChain: {
+ auto* original_access_chain = use.user;
+ builder.SetInsertPoint(original_access_chain);
+ // It can only be the base pointer
+ assert(use.index == 2);
+
+ // Replace the original access chain with access chains for the image
+ // part and the sampler part.
+ std::vector<uint32_t> indices;
+ for (uint32_t i = 3; i < original_access_chain->NumOperands(); i++) {
+ indices.push_back(original_access_chain->GetSingleWordOperand(i));
+ }
+
+ auto [result_image_part_ty, result_sampler_part_ty] =
+ SplitType(*def_use_mgr_->GetDef(original_access_chain->type_id()));
+ auto* result_image_part = builder.AddOpcodeAccessChain(
+ use.user->opcode(), result_image_part_ty->result_id(),
+ use.image_part->result_id(), indices);
+ auto* result_sampler_part = builder.AddOpcodeAccessChain(
+ use.user->opcode(), result_sampler_part_ty->result_id(),
+ use.sampler_part->result_id(), indices);
+
+ // Remap uses of the original access chain.
+ add_remap(original_access_chain, result_image_part,
+ result_sampler_part);
+ break;
+ }
+ default: {
+ uint32_t used_type_id = def_use_mgr_->GetDef(use.used_id)->type_id();
+ auto* used_type = def_use_mgr_->GetDef(used_type_id);
+ if (used_type->opcode() == spv::Op::OpTypeSampledImage) {
+ // This value being used is a sampled image value. But it's
+ // being replaced, so recreate it here.
+ // Example: used by OpImage, OpImageSampleExplicitLod, etc.
+ builder.SetInsertPoint(use.user);
+ auto* sampled_image =
+ builder.AddSampledImage(used_type_id, use.image_part->result_id(),
+ use.sampler_part->result_id());
+ use.user->SetOperand(use.index, {sampled_image->result_id()});
+ def_use_mgr_->AnalyzeInstUse(use.user);
+ break;
+ }
+ return Fail() << "unhandled user: " << *use.user;
+ }
+ }
+ }
+
+ for (auto* inst : dead_insts) {
+ KillInst(inst);
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t SplitCombinedImageSamplerPass::RemapFunctions() {
+ // Remap function types. A combined type can appear as a parameter, but not as
+ // the return type.
+ {
+ std::unordered_set<Instruction*> dead_insts;
+ for (auto& inst : context()->types_values()) {
+ if (inst.opcode() != spv::Op::OpTypeFunction) {
+ continue;
+ }
+ analysis::Function* f_ty =
+ type_mgr_->GetType(inst.result_id())->AsFunction();
+ std::vector<const analysis::Type*> new_params;
+ for (const auto* param_ty : f_ty->param_types()) {
+ const auto param_ty_id = type_mgr_->GetId(param_ty);
+ if (combined_types_.find(param_ty_id) != combined_types_.end()) {
+ auto* param_type = def_use_mgr_->GetDef(param_ty_id);
+ auto [image_type, sampler_type] = SplitType(*param_type);
+ assert(image_type);
+ assert(sampler_type);
+ // The image and sampler types must already exist, so there is no
+ // need to move them to the right spot.
+ new_params.push_back(type_mgr_->GetType(image_type->result_id()));
+ new_params.push_back(type_mgr_->GetType(sampler_type->result_id()));
+ } else {
+ new_params.push_back(param_ty);
+ }
+ }
+ if (new_params.size() != f_ty->param_types().size()) {
+ // Replace this type.
+ analysis::Function new_f_ty(f_ty->return_type(), new_params);
+ const uint32_t new_f_ty_id = type_mgr_->GetTypeInstruction(&new_f_ty);
+ std::unordered_set<Instruction*> users;
+ def_use_mgr_->ForEachUse(
+ &inst,
+ [&users, new_f_ty_id](Instruction* user, uint32_t use_index) {
+ user->SetOperand(use_index, {new_f_ty_id});
+ users.insert(user);
+ });
+ for (auto* user : users) {
+ def_use_mgr_->AnalyzeInstUse(user);
+ }
+ dead_insts.insert(&inst);
+ }
+ }
+ for (auto* inst : dead_insts) {
+ KillInst(inst);
+ }
+ }
+
+ // Rewite OpFunctionParameter in function definitions.
+ for (Function& fn : *context()->module()) {
+ // Rewrite the function parameters and record their replacements.
+ struct Replacement {
+ Instruction* combined;
+ Instruction* image;
+ Instruction* sampler;
+ };
+ std::vector<Replacement> replacements;
+
+ Function::RewriteParamFn rewriter =
+ [&](std::unique_ptr<Instruction>&& param,
+ std::back_insert_iterator<Function::ParamList>& appender) {
+ if (combined_types_.count(param->type_id()) == 0) {
+ appender = std::move(param);
+ return;
+ }
+
+ // Replace this parameter with two new parameters.
+ auto* combined_inst = param.release();
+ auto* combined_type = def_use_mgr_->GetDef(combined_inst->type_id());
+ auto [image_type, sampler_type] = SplitType(*combined_type);
+ auto image_param = MakeUnique<Instruction>(
+ context(), spv::Op::OpFunctionParameter, image_type->result_id(),
+ context()->TakeNextId(), Instruction::OperandList{});
+ auto sampler_param = MakeUnique<Instruction>(
+ context(), spv::Op::OpFunctionParameter,
+ sampler_type->result_id(), context()->TakeNextId(),
+ Instruction::OperandList{});
+ replacements.push_back(
+ {combined_inst, image_param.get(), sampler_param.get()});
+ appender = std::move(image_param);
+ appender = std::move(sampler_param);
+ };
+ fn.RewriteParams(rewriter);
+
+ for (auto& r : replacements) {
+ modified_ = true;
+ def_use_mgr_->AnalyzeInstDefUse(r.image);
+ def_use_mgr_->AnalyzeInstDefUse(r.sampler);
+ CHECK_STATUS(RemapUses(r.combined, r.image, r.sampler));
+ }
+ }
+ return SPV_SUCCESS;
+}
+
+Instruction* SplitCombinedImageSamplerPass::MakeUniformConstantPointer(
+ Instruction* pointee) {
+ uint32_t ptr_id = type_mgr_->FindPointerToType(
+ pointee->result_id(), spv::StorageClass::UniformConstant);
+ auto* ptr = def_use_mgr_->GetDef(ptr_id);
+ if (!IsKnownGlobal(ptr_id)) {
+ // The pointer type was created at the end. Put it right after the
+ // pointee.
+ ptr->InsertBefore(pointee);
+ pointee->InsertBefore(ptr);
+ RegisterNewGlobal(ptr_id);
+ // FindPointerToType also updated the def-use manager.
+ }
+ return ptr;
+}
+
+void SplitCombinedImageSamplerPass::AddOpName(uint32_t id,
+ const std::string& name) {
+ std::unique_ptr<Instruction> opname{new Instruction{
+ context(),
+ spv::Op::OpName,
+ 0u,
+ 0u,
+ {{SPV_OPERAND_TYPE_ID, {id}},
+ {SPV_OPERAND_TYPE_LITERAL_STRING,
+ utils::MakeVector<spvtools::opt::Operand::OperandData>(name)}}}};
+
+ context()->AddDebug2Inst(std::move(opname));
+}
+
+spv_result_t SplitCombinedImageSamplerPass::RemoveDeadTypes() {
+ for (auto dead_type_id : combined_types_to_remove_) {
+ if (auto* ty = def_use_mgr_->GetDef(dead_type_id)) {
+ KillInst(ty);
+ }
+ }
+ return SPV_SUCCESS;
+}
+
+void SplitCombinedImageSamplerPass::KillInst(Instruction* inst) {
+ // IRContext::KillInst will remove associated debug instructions and
+ // decorations. It will delete the object only if it is already in a list.
+ const bool was_in_list = inst->IsInAList();
+ context()->KillInst(inst);
+ if (!was_in_list) {
+ // Avoid leaking
+ delete inst;
+ }
+ modified_ = true;
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/split_combined_image_sampler_pass.h b/third_party/SPIRV-Tools/source/opt/split_combined_image_sampler_pass.h
new file mode 100644
index 0000000..253f34a
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/split_combined_image_sampler_pass.h
@@ -0,0 +1,169 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef LIBSPIRV_OPT_SPLIT_COMBINED_IMAGE_SAMPLER_PASS_H_
+#define LIBSPIRV_OPT_SPLIT_COMBINED_IMAGE_SAMPLER_PASS_H_
+
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include "source/diagnostic.h"
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/pass.h"
+#include "source/opt/type_manager.h"
+
+namespace spvtools {
+namespace opt {
+
+// Replaces each combined-image sampler variable with an image variable
+// and a sampler variable. Similar for function parameters.
+//
+// Copy the descriptor set and binding number. Vulkan allows this, surprisingly.
+class SplitCombinedImageSamplerPass : public Pass {
+ public:
+ virtual ~SplitCombinedImageSamplerPass() override = default;
+ const char* name() const override { return "split-combined-image-sampler"; }
+ IRContext::Analysis GetPreservedAnalyses() override;
+ Status Process() override;
+
+ private:
+ // Records failure for the current module, and returns a stream
+ // that can be used to provide user error information to the message
+ // consumer.
+ spvtools::DiagnosticStream Fail();
+
+ // Find variables that contain combined texture-samplers, or arrays of them.
+ // Also populate known_globals_.
+ void FindCombinedTextureSamplers();
+
+ // Returns the sampler type. If it does not yet exist, then it is created
+ // and placed before the first sampled image type.
+ Instruction* GetSamplerType();
+
+ // Remaps function types and function declarations. Each
+ // pointer-to-sampled-image-type operand is replaced with a pair of
+ // pointer-to-image-type and pointer-to-sampler-type pair.
+ // Updates the def-use manager and type manager.
+ spv_result_t RemapFunctions();
+ // Remap resource variables.
+ // Updates the def-use manager.
+ spv_result_t RemapVars();
+ // Remap a single resource variable for combined var.
+ // Updates the def-use manager and the decorations manager.
+ spv_result_t RemapVar(Instruction* combined_var);
+ // Transitively remaps uses of the combined object with uses of the
+ // decomposed image and sampler parts. The combined object can be sampled
+ // image value, a pointer to one, an array of one, or a pointer to an array
+ // of one. The image and sampler parts have corresponding shapes.
+ // Updates the def-use manager and the decorations manager.
+ spv_result_t RemapUses(Instruction* combined, Instruction* image_part,
+ Instruction* sampler_part);
+ // Removes types that are no longer referenced.
+ spv_result_t RemoveDeadTypes();
+
+ // Returns the type instruction for a UniformConstant pointer to the given
+ // pointee type. If it does not yet exist, the new type instruction is created
+ // and placed immediately after the pointee type instruction. Updates def-use
+ // and type managers, and the set of known globals.
+ Instruction* MakeUniformConstantPointer(Instruction* pointee);
+
+ // Returns the ID of the pointee type for a pointer value instruction.
+ uint32_t PointeeTypeId(Instruction* ptr_value) {
+ auto* ptr_ty = def_use_mgr_->GetDef(ptr_value->type_id());
+ assert(ptr_ty->opcode() == spv::Op::OpTypePointer);
+ return ptr_ty->GetSingleWordInOperand(1);
+ }
+
+ // Creates a new OpName instruction mapping the given name to the given
+ // string, and adds it to the module at the end of the OpName and OpMemberName
+ // section.
+ void AddOpName(uint32_t id, const std::string& name);
+
+ // Cached from the IRContext. Valid while Process() is running.
+ analysis::DefUseManager* def_use_mgr_ = nullptr;
+ // Cached from the IRContext. Valid while Process() is running.
+ analysis::TypeManager* type_mgr_ = nullptr;
+
+ // Did processing modify the module?
+ bool modified_ = false;
+ Pass::Status Ok() {
+ return modified_ ? Pass::Status::SuccessWithChange
+ : Pass::Status::SuccessWithoutChange;
+ }
+
+ // The first OpTypeSampledImage instruction in the module, if one exists.
+ Instruction* first_sampled_image_type_ = nullptr;
+ // An OpTypeSampler instruction, if one existed already, or if we created one.
+ Instruction* sampler_type_ = nullptr;
+
+ // The known types and module-scope values.
+ // We use this to know when a new such value was created.
+ std::unordered_set<uint32_t> known_globals_;
+ bool IsKnownGlobal(uint32_t id) const {
+ return known_globals_.find(id) != known_globals_.end();
+ }
+ void RegisterGlobal(uint32_t id) { known_globals_.insert(id); }
+ void RegisterNewGlobal(uint32_t id) {
+ modified_ = true;
+ RegisterGlobal(id);
+ }
+
+ // Deletes an instruction and associated debug and decoration instructions.
+ // Updates the def-use manager.
+ void KillInst(Instruction* inst);
+
+ // Combined types. The known combined sampled-image type,
+ // and recursively pointers or arrays of them.
+ std::unordered_set<uint32_t> combined_types_;
+ // The pre-existing types this pass should remove: pointer to
+ // combined type, array of combined type, pointer to array of combined type.
+ std::vector<uint32_t> combined_types_to_remove_;
+ // Is an OpTypeSampledImage used as a function parameter? Those should be
+ // transformed.
+ bool sampled_image_used_as_param_ = false;
+
+ // Remaps a combined-kind type to corresponding sampler-kind and image-kind
+ // of type.
+ struct TypeRemapInfo {
+ // The instruction for the combined type, pointer to combined type,
+ // or point to array of combined type.
+ Instruction* combined_kind_type;
+ // The corresponding image type, with the same shape of indirection as the
+ // combined_kind_type.
+ Instruction* image_kind_type;
+ // The corresponding sampler type, with the same shape of indirection as the
+ // combined_kind_type.
+ Instruction* sampler_kind_type;
+ };
+ // Maps the ID of a combined-image-sampler type kind to its corresponding
+ // split parts.
+ std::unordered_map<uint32_t, TypeRemapInfo> type_remap_;
+
+ // Returns the image-like and sampler-like types of the same indirection shape
+ // as the given combined-like type. If combined_kind_type is not a combined
+ // type or a pointer to one, or an array of one or a pointer to an array of
+ // one, then returns a pair of null pointer. Either both components are
+ // non-null, or both components are null. Updates the def-use manager and the
+ // type manager if new instructions are created.
+ std::pair<Instruction*, Instruction*> SplitType(
+ Instruction& combined_kind_type);
+
+ // The combined-image-sampler variables to be replaced.
+ std::vector<Instruction*> ordered_vars_;
+};
+} // namespace opt
+} // namespace spvtools
+#endif // LIBSPIRV_OPT_SPLIT_COMBINED_IMAGE_SAMPLER_PASS_H_
diff --git a/third_party/SPIRV-Tools/source/opt/strip_debug_info_pass.cpp b/third_party/SPIRV-Tools/source/opt/strip_debug_info_pass.cpp
index f81bced..118d846 100644
--- a/third_party/SPIRV-Tools/source/opt/strip_debug_info_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/strip_debug_info_pass.cpp
@@ -43,7 +43,7 @@
// see if this string is used anywhere by a non-semantic instruction
bool no_nonsemantic_use =
def_use->WhileEachUser(&inst, [def_use](Instruction* use) {
- if (use->opcode() == spv::Op::OpExtInst) {
+ if (spvIsExtendedInstruction(use->opcode())) {
auto ext_inst_set =
def_use->GetDef(use->GetSingleWordInOperand(0u));
const std::string extension_name =
diff --git a/third_party/SPIRV-Tools/source/opt/strip_nonsemantic_info_pass.cpp b/third_party/SPIRV-Tools/source/opt/strip_nonsemantic_info_pass.cpp
index 3886835..659849e 100644
--- a/third_party/SPIRV-Tools/source/opt/strip_nonsemantic_info_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/strip_nonsemantic_info_pass.cpp
@@ -96,7 +96,7 @@
if (!non_semantic_sets.empty()) {
context()->module()->ForEachInst(
[&non_semantic_sets, &to_remove](Instruction* inst) {
- if (inst->opcode() == spv::Op::OpExtInst) {
+ if (spvIsExtendedInstruction(inst->opcode())) {
if (non_semantic_sets.find(inst->GetSingleWordInOperand(0)) !=
non_semantic_sets.end()) {
to_remove.push_back(inst);
diff --git a/third_party/SPIRV-Tools/source/opt/struct_packing_pass.cpp b/third_party/SPIRV-Tools/source/opt/struct_packing_pass.cpp
new file mode 100644
index 0000000..3bf2b2a
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/struct_packing_pass.cpp
@@ -0,0 +1,482 @@
+// Copyright (c) 2024 Epic Games, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "struct_packing_pass.h"
+
+#include <algorithm>
+
+#include "source/opt/instruction.h"
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace opt {
+
+/*
+Std140 packing rules from the original GLSL 140 specification (see
+https://registry.khronos.org/OpenGL/extensions/ARB/ARB_uniform_buffer_object.txt)
+
+When using the "std140" storage layout, structures will be laid out in
+buffer storage with its members stored in monotonically increasing order
+based on their location in the declaration. A structure and each
+structure member have a base offset and a base alignment, from which an
+aligned offset is computed by rounding the base offset up to a multiple of
+the base alignment. The base offset of the first member of a structure is
+taken from the aligned offset of the structure itself. The base offset of
+all other structure members is derived by taking the offset of the last
+basic machine unit consumed by the previous member and adding one. Each
+structure member is stored in memory at its aligned offset. The members
+of a top-level uniform block are laid out in buffer storage by treating
+the uniform block as a structure with a base offset of zero.
+
+(1) If the member is a scalar consuming <N> basic machine units, the
+ base alignment is <N>.
+
+(2) If the member is a two- or four-component vector with components
+ consuming <N> basic machine units, the base alignment is 2<N> or
+ 4<N>, respectively.
+
+(3) If the member is a three-component vector with components consuming
+ <N> basic machine units, the base alignment is 4<N>.
+
+(4) If the member is an array of scalars or vectors, the base alignment
+ and array stride are set to match the base alignment of a single
+ array element, according to rules (1), (2), and (3), and rounded up
+ to the base alignment of a vec4. The array may have padding at the
+ end; the base offset of the member following the array is rounded up
+ to the next multiple of the base alignment.
+
+(5) If the member is a column-major matrix with <C> columns and <R>
+ rows, the matrix is stored identically to an array of <C> column
+ vectors with <R> components each, according to rule (4).
+
+(6) If the member is an array of <S> column-major matrices with <C>
+ columns and <R> rows, the matrix is stored identically to a row of
+ <S>*<C> column vectors with <R> components each, according to rule
+ (4).
+
+(7) If the member is a row-major matrix with <C> columns and <R> rows,
+ the matrix is stored identically to an array of <R> row vectors
+ with <C> components each, according to rule (4).
+
+(8) If the member is an array of <S> row-major matrices with <C> columns
+ and <R> rows, the matrix is stored identically to a row of <S>*<R>
+ row vectors with <C> components each, according to rule (4).
+
+(9) If the member is a structure, the base alignment of the structure is
+ <N>, where <N> is the largest base alignment value of any of its
+ members, and rounded up to the base alignment of a vec4. The
+ individual members of this sub-structure are then assigned offsets
+ by applying this set of rules recursively, where the base offset of
+ the first member of the sub-structure is equal to the aligned offset
+ of the structure. The structure may have padding at the end; the
+ base offset of the member following the sub-structure is rounded up
+ to the next multiple of the base alignment of the structure.
+
+(10) If the member is an array of <S> structures, the <S> elements of
+ the array are laid out in order, according to rule (9).
+*/
+
+static bool isPackingVec4Padded(StructPackingPass::PackingRules rules) {
+ switch (rules) {
+ case StructPackingPass::PackingRules::Std140:
+ case StructPackingPass::PackingRules::Std140EnhancedLayout:
+ case StructPackingPass::PackingRules::HlslCbuffer:
+ case StructPackingPass::PackingRules::HlslCbufferPackOffset:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool isPackingScalar(StructPackingPass::PackingRules rules) {
+ switch (rules) {
+ case StructPackingPass::PackingRules::Scalar:
+ case StructPackingPass::PackingRules::ScalarEnhancedLayout:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool isPackingHlsl(StructPackingPass::PackingRules rules) {
+ switch (rules) {
+ case StructPackingPass::PackingRules::HlslCbuffer:
+ case StructPackingPass::PackingRules::HlslCbufferPackOffset:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static uint32_t getPackedBaseSize(const analysis::Type& type) {
+ switch (type.kind()) {
+ case analysis::Type::kBool:
+ return 1;
+ case analysis::Type::kInteger:
+ return type.AsInteger()->width() / 8;
+ case analysis::Type::kFloat:
+ return type.AsFloat()->width() / 8;
+ case analysis::Type::kVector:
+ return getPackedBaseSize(*type.AsVector()->element_type());
+ case analysis::Type::kMatrix:
+ return getPackedBaseSize(*type.AsMatrix()->element_type());
+ default:
+ break; // we only expect bool, int, float, vec, and mat here
+ }
+ assert(0 && "Unrecognized type to get base size");
+ return 0;
+}
+
+static uint32_t getScalarElementCount(const analysis::Type& type) {
+ switch (type.kind()) {
+ case analysis::Type::kVector:
+ return type.AsVector()->element_count();
+ case analysis::Type::kMatrix:
+ return getScalarElementCount(*type.AsMatrix()->element_type());
+ case analysis::Type::kStruct:
+ assert(0 && "getScalarElementCount() does not recognized struct types");
+ return 0;
+ default:
+ return 1;
+ }
+}
+
+// Aligns the specified value to a multiple of alignment, whereas the
+// alignment must be a power-of-two.
+static uint32_t alignPow2(uint32_t value, uint32_t alignment) {
+ return (value + alignment - 1) & ~(alignment - 1);
+}
+
+void StructPackingPass::buildConstantsMap() {
+ constantsMap_.clear();
+ for (Instruction* instr : context()->module()->GetConstants()) {
+ constantsMap_[instr->result_id()] = instr;
+ }
+}
+
+uint32_t StructPackingPass::getPackedAlignment(
+ const analysis::Type& type) const {
+ switch (type.kind()) {
+ case analysis::Type::kArray: {
+ // Get alignment of base type and round up to minimum alignment
+ const uint32_t minAlignment = isPackingVec4Padded(packingRules_) ? 16 : 1;
+ return std::max<uint32_t>(
+ minAlignment, getPackedAlignment(*type.AsArray()->element_type()));
+ }
+ case analysis::Type::kStruct: {
+ // Rule 9. Struct alignment is maximum alignmnet of its members
+ uint32_t alignment = 1;
+
+ for (const analysis::Type* elementType :
+ type.AsStruct()->element_types()) {
+ alignment =
+ std::max<uint32_t>(alignment, getPackedAlignment(*elementType));
+ }
+
+ if (isPackingVec4Padded(packingRules_))
+ alignment = std::max<uint32_t>(alignment, 16u);
+
+ return alignment;
+ }
+ default: {
+ const uint32_t baseAlignment = getPackedBaseSize(type);
+
+ // Scalar block layout always uses alignment for the most basic component
+ if (isPackingScalar(packingRules_)) return baseAlignment;
+
+ if (const analysis::Matrix* matrixType = type.AsMatrix()) {
+ // Rule 5/7
+ if (isPackingVec4Padded(packingRules_) ||
+ matrixType->element_count() == 3)
+ return baseAlignment * 4;
+ else
+ return baseAlignment * matrixType->element_count();
+ } else if (const analysis::Vector* vectorType = type.AsVector()) {
+ // Rule 1
+ if (vectorType->element_count() == 1) return baseAlignment;
+
+ // Rule 2
+ if (vectorType->element_count() == 2 ||
+ vectorType->element_count() == 4)
+ return baseAlignment * vectorType->element_count();
+
+ // Rule 3
+ if (vectorType->element_count() == 3) return baseAlignment * 4;
+ } else {
+ // Rule 1
+ return baseAlignment;
+ }
+ }
+ }
+ assert(0 && "Unrecognized type to get packed alignment");
+ return 0;
+}
+
+static uint32_t getPadAlignment(const analysis::Type& type,
+ uint32_t packedAlignment) {
+ // The next member following a struct member is aligned to the base alignment
+ // of a previous struct member.
+ return type.kind() == analysis::Type::kStruct ? packedAlignment : 1;
+}
+
+uint32_t StructPackingPass::getPackedSize(const analysis::Type& type) const {
+ switch (type.kind()) {
+ case analysis::Type::kArray: {
+ if (const analysis::Array* arrayType = type.AsArray()) {
+ uint32_t size =
+ getPackedArrayStride(*arrayType) * getArrayLength(*arrayType);
+
+ // For arrays of vector and matrices in HLSL, the last element has a
+ // size depending on its vector/matrix size to allow packing other
+ // vectors in the last element.
+ const analysis::Type* arraySubType = arrayType->element_type();
+ if (isPackingHlsl(packingRules_) &&
+ arraySubType->kind() != analysis::Type::kStruct) {
+ size -= (4 - getScalarElementCount(*arraySubType)) *
+ getPackedBaseSize(*arraySubType);
+ }
+ return size;
+ }
+ break;
+ }
+ case analysis::Type::kStruct: {
+ uint32_t size = 0;
+ uint32_t padAlignment = 1;
+ for (const analysis::Type* memberType :
+ type.AsStruct()->element_types()) {
+ const uint32_t packedAlignment = getPackedAlignment(*memberType);
+ const uint32_t alignment =
+ std::max<uint32_t>(packedAlignment, padAlignment);
+ padAlignment = getPadAlignment(*memberType, packedAlignment);
+ size = alignPow2(size, alignment);
+ size += getPackedSize(*memberType);
+ }
+ return size;
+ }
+ default: {
+ const uint32_t baseAlignment = getPackedBaseSize(type);
+ if (isPackingScalar(packingRules_)) {
+ return getScalarElementCount(type) * baseAlignment;
+ } else {
+ uint32_t size = 0;
+ if (const analysis::Matrix* matrixType = type.AsMatrix()) {
+ const analysis::Vector* matrixSubType =
+ matrixType->element_type()->AsVector();
+ assert(matrixSubType != nullptr &&
+ "Matrix sub-type is expected to be a vector type");
+ if (isPackingVec4Padded(packingRules_) ||
+ matrixType->element_count() == 3)
+ size = matrixSubType->element_count() * baseAlignment * 4;
+ else
+ size = matrixSubType->element_count() * baseAlignment *
+ matrixType->element_count();
+
+ // For matrices in HLSL, the last element has a size depending on its
+ // vector size to allow packing other vectors in the last element.
+ if (isPackingHlsl(packingRules_)) {
+ size -= (4 - matrixSubType->element_count()) *
+ getPackedBaseSize(*matrixSubType);
+ }
+ } else if (const analysis::Vector* vectorType = type.AsVector()) {
+ size = vectorType->element_count() * baseAlignment;
+ } else {
+ size = baseAlignment;
+ }
+ return size;
+ }
+ }
+ }
+ assert(0 && "Unrecognized type to get packed size");
+ return 0;
+}
+
+uint32_t StructPackingPass::getPackedArrayStride(
+ const analysis::Array& arrayType) const {
+ // Array stride is equal to aligned size of element type
+ const uint32_t elementSize = getPackedSize(*arrayType.element_type());
+ const uint32_t alignment = getPackedAlignment(arrayType);
+ return alignPow2(elementSize, alignment);
+}
+
+uint32_t StructPackingPass::getArrayLength(
+ const analysis::Array& arrayType) const {
+ return getConstantInt(arrayType.LengthId());
+}
+
+uint32_t StructPackingPass::getConstantInt(spv::Id id) const {
+ auto it = constantsMap_.find(id);
+ assert(it != constantsMap_.end() &&
+ "Failed to map SPIR-V instruction ID to constant value");
+ [[maybe_unused]] const analysis::Type* constType =
+ context()->get_type_mgr()->GetType(it->second->type_id());
+ assert(constType != nullptr &&
+ "Failed to map SPIR-V instruction result type to definition");
+ assert(constType->kind() == analysis::Type::kInteger &&
+ "Failed to map SPIR-V instruction result type to integer type");
+ return it->second->GetOperand(2).words[0];
+}
+
+StructPackingPass::PackingRules StructPackingPass::ParsePackingRuleFromString(
+ const std::string& s) {
+ if (s == "std140") return PackingRules::Std140;
+ if (s == "std140EnhancedLayout") return PackingRules::Std140EnhancedLayout;
+ if (s == "std430") return PackingRules::Std430;
+ if (s == "std430EnhancedLayout") return PackingRules::Std430EnhancedLayout;
+ if (s == "hlslCbuffer") return PackingRules::HlslCbuffer;
+ if (s == "hlslCbufferPackOffset") return PackingRules::HlslCbufferPackOffset;
+ if (s == "scalar") return PackingRules::Scalar;
+ if (s == "scalarEnhancedLayout") return PackingRules::ScalarEnhancedLayout;
+ return PackingRules::Undefined;
+}
+
+StructPackingPass::StructPackingPass(const char* structToPack,
+ PackingRules rules)
+ : structToPack_{structToPack != nullptr ? structToPack : ""},
+ packingRules_{rules} {}
+
+Pass::Status StructPackingPass::Process() {
+ if (packingRules_ == PackingRules::Undefined) {
+ if (consumer()) {
+ consumer()(SPV_MSG_ERROR, "", {0, 0, 0},
+ "Cannot pack struct with undefined rule");
+ }
+ return Status::Failure;
+ }
+
+ // Build Id-to-instruction map for easier access
+ buildConstantsMap();
+
+ // Find structure of interest
+ const uint32_t structIdToPack = findStructIdByName(structToPack_.c_str());
+
+ const Instruction* structDef =
+ context()->get_def_use_mgr()->GetDef(structIdToPack);
+ if (structDef == nullptr || structDef->opcode() != spv::Op::OpTypeStruct) {
+ if (consumer()) {
+ const std::string message =
+ "Failed to find struct with name " + structToPack_;
+ consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+ }
+ return Status::Failure;
+ }
+
+ // Find all struct member types
+ std::vector<const analysis::Type*> structMemberTypes =
+ findStructMemberTypes(*structDef);
+
+ return assignStructMemberOffsets(structIdToPack, structMemberTypes);
+}
+
+uint32_t StructPackingPass::findStructIdByName(const char* structName) const {
+ for (Instruction& instr : context()->module()->debugs2()) {
+ if (instr.opcode() == spv::Op::OpName &&
+ instr.GetOperand(1).AsString() == structName) {
+ return instr.GetOperand(0).AsId();
+ }
+ }
+ return 0;
+}
+
+std::vector<const analysis::Type*> StructPackingPass::findStructMemberTypes(
+ const Instruction& structDef) const {
+ // Found struct type to pack, now collect all types of its members
+ assert(structDef.NumOperands() > 0 &&
+ "Number of operands in OpTypeStruct instruction must not be zero");
+ const uint32_t numMembers = structDef.NumOperands() - 1;
+ std::vector<const analysis::Type*> structMemberTypes;
+ structMemberTypes.resize(numMembers);
+ for (uint32_t i = 0; i < numMembers; ++i) {
+ const spv::Id memberTypeId = structDef.GetOperand(1 + i).AsId();
+ if (const analysis::Type* memberType =
+ context()->get_type_mgr()->GetType(memberTypeId)) {
+ structMemberTypes[i] = memberType;
+ }
+ }
+ return structMemberTypes;
+}
+
+Pass::Status StructPackingPass::assignStructMemberOffsets(
+ uint32_t structIdToPack,
+ const std::vector<const analysis::Type*>& structMemberTypes) {
+ // Returns true if the specified instruction is a OpMemberDecorate for the
+ // struct we're looking for with an offset decoration
+ auto isMemberOffsetDecoration =
+ [structIdToPack](const Instruction& instr) -> bool {
+ return instr.opcode() == spv::Op::OpMemberDecorate &&
+ instr.GetOperand(0).AsId() == structIdToPack &&
+ static_cast<spv::Decoration>(instr.GetOperand(2).words[0]) ==
+ spv::Decoration::Offset;
+ };
+
+ bool modified = false;
+
+ // Find and re-assign all member offset decorations
+ for (auto it = context()->module()->annotation_begin(),
+ itEnd = context()->module()->annotation_end();
+ it != itEnd; ++it) {
+ if (isMemberOffsetDecoration(*it)) {
+ // Found first member decoration with offset, we expect all other
+ // offsets right after the first one
+ uint32_t prevMemberIndex = 0;
+ uint32_t currentOffset = 0;
+ uint32_t padAlignment = 1;
+ do {
+ const uint32_t memberIndex = it->GetOperand(1).words[0];
+ if (memberIndex < prevMemberIndex) {
+ // Failure: we expect all members to appear in consecutive order
+ return Status::Failure;
+ }
+
+ // Apply alignment rules to current offset
+ const analysis::Type& memberType = *structMemberTypes[memberIndex];
+ uint32_t packedAlignment = getPackedAlignment(memberType);
+ uint32_t packedSize = getPackedSize(memberType);
+
+ if (isPackingHlsl(packingRules_)) {
+ // If a member crosses vec4 boundaries, alignment is size of vec4
+ if (currentOffset / 16 != (currentOffset + packedSize - 1) / 16)
+ packedAlignment = std::max<uint32_t>(packedAlignment, 16u);
+ }
+
+ const uint32_t alignment =
+ std::max<uint32_t>(packedAlignment, padAlignment);
+ currentOffset = alignPow2(currentOffset, alignment);
+ padAlignment = getPadAlignment(memberType, packedAlignment);
+
+ // Override packed offset in instruction
+ if (it->GetOperand(3).words[0] < currentOffset) {
+ // Failure: packing resulted in higher offset for member than
+ // previously generated
+ return Status::Failure;
+ }
+
+ it->GetOperand(3).words[0] = currentOffset;
+ modified = true;
+
+ // Move to next member
+ ++it;
+ prevMemberIndex = memberIndex;
+ currentOffset += packedSize;
+ } while (it != itEnd && isMemberOffsetDecoration(*it));
+
+ // We're done with all decorations for the struct of interest
+ break;
+ }
+ }
+
+ return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/opt/struct_packing_pass.h b/third_party/SPIRV-Tools/source/opt/struct_packing_pass.h
new file mode 100644
index 0000000..3f30f98
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/opt/struct_packing_pass.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2024 Epic Games, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_OPT_STRUCT_PACKING_PASS_
+#define SOURCE_OPT_STRUCT_PACKING_PASS_
+
+#include <unordered_map>
+
+#include "source/opt/ir_context.h"
+#include "source/opt/module.h"
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+// This pass re-assigns all field offsets under the specified packing rules.
+class StructPackingPass final : public Pass {
+ public:
+ enum class PackingRules {
+ Undefined,
+ Std140,
+ Std140EnhancedLayout,
+ Std430,
+ Std430EnhancedLayout,
+ HlslCbuffer,
+ HlslCbufferPackOffset,
+ Scalar,
+ ScalarEnhancedLayout,
+ };
+
+ static PackingRules ParsePackingRuleFromString(const std::string& s);
+
+ StructPackingPass(const char* structToPack, PackingRules rules);
+ const char* name() const override { return "struct-packing"; }
+ Status Process() override;
+
+ IRContext::Analysis GetPreservedAnalyses() override {
+ return IRContext::kAnalysisCombinators | IRContext::kAnalysisCFG |
+ IRContext::kAnalysisDominatorAnalysis |
+ IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap |
+ IRContext::kAnalysisScalarEvolution |
+ IRContext::kAnalysisStructuredCFG | IRContext::kAnalysisConstants |
+ IRContext::kAnalysisDebugInfo | IRContext::kAnalysisLiveness;
+ }
+
+ private:
+ void buildConstantsMap();
+ uint32_t findStructIdByName(const char* structName) const;
+ std::vector<const analysis::Type*> findStructMemberTypes(
+ const Instruction& structDef) const;
+ Status assignStructMemberOffsets(
+ uint32_t structIdToPack,
+ const std::vector<const analysis::Type*>& structMemberTypes);
+
+ uint32_t getPackedAlignment(const analysis::Type& type) const;
+ uint32_t getPackedSize(const analysis::Type& type) const;
+ uint32_t getPackedArrayStride(const analysis::Array& arrayType) const;
+ uint32_t getArrayLength(const analysis::Array& arrayType) const;
+ uint32_t getConstantInt(spv::Id id) const;
+
+ private:
+ std::string structToPack_;
+ PackingRules packingRules_ = PackingRules::Undefined;
+ std::unordered_map<spv::Id, Instruction*> constantsMap_;
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_STRUCT_PACKING_PASS_
diff --git a/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.cpp b/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.cpp
index 24f9e46..cc0e331 100644
--- a/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.cpp
+++ b/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.cpp
@@ -26,10 +26,11 @@
#include <vector>
#include "source/enum_set.h"
-#include "source/enum_string_mapping.h"
+#include "source/ext_inst.h"
#include "source/opt/ir_context.h"
#include "source/opt/reflect.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "source/util/string_utils.h"
namespace spvtools {
@@ -48,7 +49,11 @@
constexpr uint32_t kOpTypeImageSampledIndex = kOpTypeImageMSIndex + 1;
constexpr uint32_t kOpTypeImageFormatIndex = kOpTypeImageSampledIndex + 1;
constexpr uint32_t kOpImageReadImageIndex = 0;
+constexpr uint32_t kOpImageWriteImageIndex = 0;
constexpr uint32_t kOpImageSparseReadImageIndex = 0;
+constexpr uint32_t kOpExtInstSetInIndex = 0;
+constexpr uint32_t kOpExtInstInstructionInIndex = 1;
+constexpr uint32_t kOpExtInstImportNameInIndex = 0;
// DFS visit of the type defined by `instruction`.
// If `condition` is true, children of the current node are visited.
@@ -56,6 +61,7 @@
template <class UnaryPredicate>
static void DFSWhile(const Instruction* instruction, UnaryPredicate condition) {
std::stack<uint32_t> instructions_to_visit;
+ std::unordered_set<uint32_t> visited_instructions;
instructions_to_visit.push(instruction->result_id());
const auto* def_use_mgr = instruction->context()->get_def_use_mgr();
@@ -63,6 +69,11 @@
const Instruction* item = def_use_mgr->GetDef(instructions_to_visit.top());
instructions_to_visit.pop();
+ // Forward references can be allowed, meaning we can have cycles
+ // between ID uses. Need to keep track of this.
+ if (visited_instructions.count(item->result_id())) continue;
+ visited_instructions.insert(item->result_id());
+
if (!condition(item)) {
continue;
}
@@ -236,6 +247,37 @@
: std::nullopt;
}
+static std::optional<spv::Capability>
+Handler_OpTypePointer_StorageBuffer16BitAccess(const Instruction* instruction) {
+ assert(instruction->opcode() == spv::Op::OpTypePointer &&
+ "This handler only support OpTypePointer opcodes.");
+
+ // Requires StorageBuffer, ShaderRecordBufferKHR or PhysicalStorageBuffer
+ // storage classes.
+ spv::StorageClass storage_class = spv::StorageClass(
+ instruction->GetSingleWordInOperand(kOpTypePointerStorageClassIndex));
+ if (storage_class != spv::StorageClass::StorageBuffer &&
+ storage_class != spv::StorageClass::ShaderRecordBufferKHR &&
+ storage_class != spv::StorageClass::PhysicalStorageBuffer) {
+ return std::nullopt;
+ }
+
+ const auto* decoration_mgr = instruction->context()->get_decoration_mgr();
+ const bool matchesCondition =
+ AnyTypeOf(instruction, [decoration_mgr](const Instruction* item) {
+ if (!decoration_mgr->HasDecoration(item->result_id(),
+ spv::Decoration::Block)) {
+ return false;
+ }
+
+ return AnyTypeOf(item, is16bitType);
+ });
+
+ return matchesCondition
+ ? std::optional(spv::Capability::StorageBuffer16BitAccess)
+ : std::nullopt;
+}
+
static std::optional<spv::Capability> Handler_OpTypePointer_StorageUniform16(
const Instruction* instruction) {
assert(instruction->opcode() == spv::Op::OpTypePointer &&
@@ -334,6 +376,8 @@
const uint32_t dim = type->GetSingleWordInOperand(kOpTypeImageDimIndex);
const uint32_t format = type->GetSingleWordInOperand(kOpTypeImageFormatIndex);
+ // If the Image Format is Unknown and Dim is SubpassData,
+ // StorageImageReadWithoutFormat is required.
const bool is_unknown = spv::ImageFormat(format) == spv::ImageFormat::Unknown;
const bool requires_capability_for_unknown =
spv::Dim(dim) != spv::Dim::SubpassData;
@@ -343,6 +387,26 @@
}
static std::optional<spv::Capability>
+Handler_OpImageWrite_StorageImageWriteWithoutFormat(
+ const Instruction* instruction) {
+ assert(instruction->opcode() == spv::Op::OpImageWrite &&
+ "This handler only support OpImageWrite opcodes.");
+ const auto* def_use_mgr = instruction->context()->get_def_use_mgr();
+
+ const uint32_t image_index =
+ instruction->GetSingleWordInOperand(kOpImageWriteImageIndex);
+ const uint32_t type_index = def_use_mgr->GetDef(image_index)->type_id();
+
+ // If the Image Format is Unknown, StorageImageWriteWithoutFormat is required.
+ const Instruction* type = def_use_mgr->GetDef(type_index);
+ const uint32_t format = type->GetSingleWordInOperand(kOpTypeImageFormatIndex);
+ const bool is_unknown = spv::ImageFormat(format) == spv::ImageFormat::Unknown;
+ return is_unknown
+ ? std::optional(spv::Capability::StorageImageWriteWithoutFormat)
+ : std::nullopt;
+}
+
+static std::optional<spv::Capability>
Handler_OpImageSparseRead_StorageImageReadWithoutFormat(
const Instruction* instruction) {
assert(instruction->opcode() == spv::Op::OpImageSparseRead &&
@@ -361,9 +425,10 @@
}
// Opcode of interest to determine capabilities requirements.
-constexpr std::array<std::pair<spv::Op, OpcodeHandler>, 12> kOpcodeHandlers{{
+constexpr std::array<std::pair<spv::Op, OpcodeHandler>, 14> kOpcodeHandlers{{
// clang-format off
{spv::Op::OpImageRead, Handler_OpImageRead_StorageImageReadWithoutFormat},
+ {spv::Op::OpImageWrite, Handler_OpImageWrite_StorageImageWriteWithoutFormat},
{spv::Op::OpImageSparseRead, Handler_OpImageSparseRead_StorageImageReadWithoutFormat},
{spv::Op::OpTypeFloat, Handler_OpTypeFloat_Float16 },
{spv::Op::OpTypeFloat, Handler_OpTypeFloat_Float64 },
@@ -375,30 +440,57 @@
{spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniform16},
{spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniform16},
{spv::Op::OpTypePointer, Handler_OpTypePointer_StorageUniformBufferBlock16},
+ {spv::Op::OpTypePointer, Handler_OpTypePointer_StorageBuffer16BitAccess},
// clang-format on
}};
// ============== End opcode handler implementations. =======================
namespace {
-ExtensionSet getExtensionsRelatedTo(const CapabilitySet& capabilities,
- const AssemblyGrammar& grammar) {
+ExtensionSet getExtensionsRelatedTo(const CapabilitySet& capabilities) {
ExtensionSet output;
- const spv_operand_desc_t* desc = nullptr;
+ const spvtools::OperandDesc* desc = nullptr;
for (auto capability : capabilities) {
- if (SPV_SUCCESS != grammar.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
- static_cast<uint32_t>(capability),
- &desc)) {
+ if (SPV_SUCCESS !=
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
+ static_cast<uint32_t>(capability), &desc)) {
continue;
}
- for (uint32_t i = 0; i < desc->numExtensions; ++i) {
- output.insert(desc->extensions[i]);
+ for (auto extension : desc->extensions()) {
+ output.insert(extension);
}
}
return output;
}
+
+bool hasOpcodeConflictingCapabilities(spv::Op opcode) {
+ switch (opcode) {
+ case spv::Op::OpBeginInvocationInterlockEXT:
+ case spv::Op::OpEndInvocationInterlockEXT:
+ case spv::Op::OpGroupNonUniformIAdd:
+ case spv::Op::OpGroupNonUniformFAdd:
+ case spv::Op::OpGroupNonUniformIMul:
+ case spv::Op::OpGroupNonUniformFMul:
+ case spv::Op::OpGroupNonUniformSMin:
+ case spv::Op::OpGroupNonUniformUMin:
+ case spv::Op::OpGroupNonUniformFMin:
+ case spv::Op::OpGroupNonUniformSMax:
+ case spv::Op::OpGroupNonUniformUMax:
+ case spv::Op::OpGroupNonUniformFMax:
+ case spv::Op::OpGroupNonUniformBitwiseAnd:
+ case spv::Op::OpGroupNonUniformBitwiseOr:
+ case spv::Op::OpGroupNonUniformBitwiseXor:
+ case spv::Op::OpGroupNonUniformLogicalAnd:
+ case spv::Op::OpGroupNonUniformLogicalOr:
+ case spv::Op::OpGroupNonUniformLogicalXor:
+ return true;
+ default:
+ return false;
+ }
+}
+
} // namespace
TrimCapabilitiesPass::TrimCapabilitiesPass()
@@ -416,15 +508,12 @@
void TrimCapabilitiesPass::addInstructionRequirementsForOpcode(
spv::Op opcode, CapabilitySet* capabilities,
ExtensionSet* extensions) const {
- // Ignoring OpBeginInvocationInterlockEXT and OpEndInvocationInterlockEXT
- // because they have three possible capabilities, only one of which is needed
- if (opcode == spv::Op::OpBeginInvocationInterlockEXT ||
- opcode == spv::Op::OpEndInvocationInterlockEXT) {
+ if (hasOpcodeConflictingCapabilities(opcode)) {
return;
}
- const spv_opcode_desc_t* desc = {};
- auto result = context()->grammar().lookupOpcode(opcode, &desc);
+ const spvtools::InstructionDesc* desc;
+ auto result = spvtools::LookupOpcode(opcode, &desc);
if (result != SPV_SUCCESS) {
return;
}
@@ -461,9 +550,9 @@
// case 1: Operand is a single value, can directly lookup.
if (!spvOperandIsConcreteMask(operand.type)) {
- const spv_operand_desc_t* desc = {};
- auto result = context()->grammar().lookupOperand(operand.type,
- operand.words[0], &desc);
+ const spvtools::OperandDesc* desc = nullptr;
+ auto result =
+ spvtools::LookupOperand(operand.type, operand.words[0], &desc);
if (result != SPV_SUCCESS) {
return;
}
@@ -479,8 +568,8 @@
continue;
}
- const spv_operand_desc_t* desc = {};
- auto result = context()->grammar().lookupOperand(operand.type, mask, &desc);
+ const spvtools::OperandDesc* desc = nullptr;
+ auto result = spvtools::LookupOperand(operand.type, mask, &desc);
if (result != SPV_SUCCESS) {
continue;
}
@@ -490,6 +579,34 @@
}
}
+void TrimCapabilitiesPass::addInstructionRequirementsForExtInst(
+ Instruction* instruction, CapabilitySet* capabilities) const {
+ assert(instruction->opcode() == spv::Op::OpExtInst &&
+ "addInstructionRequirementsForExtInst must be passed an OpExtInst "
+ "instruction");
+
+ const auto* def_use_mgr = context()->get_def_use_mgr();
+
+ const Instruction* extInstImport = def_use_mgr->GetDef(
+ instruction->GetSingleWordInOperand(kOpExtInstSetInIndex));
+ uint32_t extInstruction =
+ instruction->GetSingleWordInOperand(kOpExtInstInstructionInIndex);
+
+ const Operand& extInstSet =
+ extInstImport->GetInOperand(kOpExtInstImportNameInIndex);
+
+ spv_ext_inst_type_t instructionSet =
+ spvExtInstImportTypeGet(extInstSet.AsString().c_str());
+
+ const ExtInstDesc* desc = nullptr;
+ auto result = LookupExtInst(instructionSet, extInstruction, &desc);
+ if (result != SPV_SUCCESS) {
+ return;
+ }
+
+ addSupportedCapabilitiesToSet(desc, capabilities);
+}
+
void TrimCapabilitiesPass::addInstructionRequirements(
Instruction* instruction, CapabilitySet* capabilities,
ExtensionSet* extensions) const {
@@ -499,8 +616,12 @@
return;
}
- addInstructionRequirementsForOpcode(instruction->opcode(), capabilities,
- extensions);
+ if (instruction->opcode() == spv::Op::OpExtInst) {
+ addInstructionRequirementsForExtInst(instruction, capabilities);
+ } else {
+ addInstructionRequirementsForOpcode(instruction->opcode(), capabilities,
+ extensions);
+ }
// Second case: one of the opcode operand is gated by a capability.
const uint32_t operandCount = instruction->NumOperands();
@@ -525,8 +646,8 @@
void TrimCapabilitiesPass::AddExtensionsForOperand(
const spv_operand_type_t type, const uint32_t value,
ExtensionSet* extensions) const {
- const spv_operand_desc_t* desc = nullptr;
- spv_result_t result = context()->grammar().lookupOperand(type, value, &desc);
+ const spvtools::OperandDesc* desc = nullptr;
+ spv_result_t result = spvtools::LookupOperand(type, value, &desc);
if (result != SPV_SUCCESS) {
return;
}
@@ -601,7 +722,7 @@
Pass::Status TrimCapabilitiesPass::TrimUnrequiredExtensions(
const ExtensionSet& required_extensions) const {
const auto supported_extensions =
- getExtensionsRelatedTo(supportedCapabilities_, context()->grammar());
+ getExtensionsRelatedTo(supportedCapabilities_);
bool modified_module = false;
for (auto extension : supported_extensions) {
diff --git a/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.h b/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.h
index 81c07b8..d2369b1 100644
--- a/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.h
+++ b/third_party/SPIRV-Tools/source/opt/trim_capabilities_pass.h
@@ -28,6 +28,7 @@
#include "source/opt/module.h"
#include "source/opt/pass.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
namespace spvtools {
namespace opt {
@@ -74,17 +75,23 @@
// contains unsupported instruction, the pass could yield bad results.
static constexpr std::array kSupportedCapabilities{
// clang-format off
- spv::Capability::ComputeDerivativeGroupLinearNV,
- spv::Capability::ComputeDerivativeGroupQuadsNV,
+ spv::Capability::ComputeDerivativeGroupLinearKHR,
+ spv::Capability::ComputeDerivativeGroupQuadsKHR,
spv::Capability::Float16,
spv::Capability::Float64,
spv::Capability::FragmentShaderPixelInterlockEXT,
spv::Capability::FragmentShaderSampleInterlockEXT,
spv::Capability::FragmentShaderShadingRateInterlockEXT,
+ spv::Capability::GroupNonUniform,
+ spv::Capability::GroupNonUniformArithmetic,
+ spv::Capability::GroupNonUniformClustered,
+ spv::Capability::GroupNonUniformPartitionedNV,
+ spv::Capability::GroupNonUniformVote,
spv::Capability::Groups,
spv::Capability::ImageMSArray,
spv::Capability::Int16,
spv::Capability::Int64,
+ spv::Capability::InterpolationFunction,
spv::Capability::Linkage,
spv::Capability::MinLod,
spv::Capability::PhysicalStorageBufferAddresses,
@@ -93,13 +100,15 @@
spv::Capability::RayTraversalPrimitiveCullingKHR,
spv::Capability::Shader,
spv::Capability::ShaderClockKHR,
+ spv::Capability::StorageBuffer16BitAccess,
spv::Capability::StorageImageReadWithoutFormat,
+ spv::Capability::StorageImageWriteWithoutFormat,
spv::Capability::StorageInputOutput16,
spv::Capability::StoragePushConstant16,
spv::Capability::StorageUniform16,
spv::Capability::StorageUniformBufferBlock16,
spv::Capability::VulkanMemoryModelDeviceScope,
- spv::Capability::GroupNonUniformPartitionedNV
+ spv::Capability::QuadControlKHR,
// clang-format on
};
@@ -121,14 +130,11 @@
private:
// Inserts every capability listed by `descriptor` this pass supports into
- // `output`. Expects a Descriptor like `spv_opcode_desc_t` or
- // `spv_operand_desc_t`.
- template <class Descriptor>
- inline void addSupportedCapabilitiesToSet(const Descriptor* const descriptor,
- CapabilitySet* output) const {
- const uint32_t capabilityCount = descriptor->numCapabilities;
- for (uint32_t i = 0; i < capabilityCount; ++i) {
- const auto capability = descriptor->capabilities[i];
+ // `output`.
+ template <typename Descriptor>
+ void addSupportedCapabilitiesToSet(const Descriptor* const descriptor,
+ CapabilitySet* output) const {
+ for (auto capability : descriptor->capabilities()) {
if (supportedCapabilities_.contains(capability)) {
output->insert(capability);
}
@@ -136,8 +142,8 @@
}
// Inserts every extension listed by `descriptor` required by the module into
- // `output`. Expects a Descriptor like `spv_opcode_desc_t` or
- // `spv_operand_desc_t`.
+ // `output`. Expects a Descriptor like spvtools::OperandDesc or
+ // spvtools::InstructionDesc.
template <class Descriptor>
inline void addSupportedExtensionsToSet(const Descriptor* const descriptor,
ExtensionSet* output) const {
@@ -145,8 +151,8 @@
spvVersionForTargetEnv(context()->GetTargetEnv())) {
return;
}
- output->insert(descriptor->extensions,
- descriptor->extensions + descriptor->numExtensions);
+ output->insert(descriptor->extensions().begin(),
+ descriptor->extensions().end());
}
void addInstructionRequirementsForOpcode(spv::Op opcode,
@@ -156,6 +162,9 @@
CapabilitySet* capabilities,
ExtensionSet* extensions) const;
+ void addInstructionRequirementsForExtInst(Instruction* instruction,
+ CapabilitySet* capabilities) const;
+
// Given an `instruction`, determines the capabilities it requires, and output
// them in `capabilities`. The returned capabilities form a subset of
// kSupportedCapabilities.
diff --git a/third_party/SPIRV-Tools/source/opt/type_manager.cpp b/third_party/SPIRV-Tools/source/opt/type_manager.cpp
index 7b609bc..7eec9f3 100644
--- a/third_party/SPIRV-Tools/source/opt/type_manager.cpp
+++ b/third_party/SPIRV-Tools/source/opt/type_manager.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2016 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -245,6 +247,7 @@
{(type->AsInteger()->IsSigned() ? 1u : 0u)}}});
break;
case Type::kFloat:
+ // TODO: Handle FP encoding enums once actually used.
typeInst = MakeUnique<Instruction>(
context(), spv::Op::OpTypeFloat, 0, id,
std::initializer_list<Operand>{
@@ -334,6 +337,17 @@
std::initializer_list<Operand>{{SPV_OPERAND_TYPE_ID, {subtype}}});
break;
}
+ case Type::kNodePayloadArrayAMDX: {
+ uint32_t subtype =
+ GetTypeInstruction(type->AsNodePayloadArrayAMDX()->element_type());
+ if (subtype == 0) {
+ return 0;
+ }
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypeNodePayloadArrayAMDX, 0, id,
+ std::initializer_list<Operand>{{SPV_OPERAND_TYPE_ID, {subtype}}});
+ break;
+ }
case Type::kStruct: {
std::vector<Operand> ops;
const Struct* structTy = type->AsStruct();
@@ -360,16 +374,21 @@
}
case Type::kPointer: {
const Pointer* pointer = type->AsPointer();
- uint32_t subtype = GetTypeInstruction(pointer->pointee_type());
- if (subtype == 0) {
- return 0;
+ if (pointer->is_untyped()) {
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypeUntypedPointerKHR, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_STORAGE_CLASS,
+ {static_cast<uint32_t>(pointer->storage_class())}}});
+ } else {
+ uint32_t subtype = GetTypeInstruction(pointer->pointee_type());
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypePointer, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_STORAGE_CLASS,
+ {static_cast<uint32_t>(pointer->storage_class())}},
+ {SPV_OPERAND_TYPE_ID, {subtype}}});
}
- typeInst = MakeUnique<Instruction>(
- context(), spv::Op::OpTypePointer, 0, id,
- std::initializer_list<Operand>{
- {SPV_OPERAND_TYPE_STORAGE_CLASS,
- {static_cast<uint32_t>(pointer->storage_class())}},
- {SPV_OPERAND_TYPE_ID, {subtype}}});
break;
}
case Type::kFunction: {
@@ -440,11 +459,79 @@
{SPV_OPERAND_TYPE_ID, {coop_mat->use_id()}}});
break;
}
+ case Type::kTensorLayoutNV: {
+ auto tensor_layout = type->AsTensorLayoutNV();
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypeTensorLayoutNV, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {tensor_layout->dim_id()}},
+ {SPV_OPERAND_TYPE_ID, {tensor_layout->clamp_mode_id()}}});
+ break;
+ }
+ case Type::kTensorViewNV: {
+ auto tensor_view = type->AsTensorViewNV();
+ std::vector<Operand> operands;
+ operands.push_back(Operand{SPV_OPERAND_TYPE_ID, {tensor_view->dim_id()}});
+ operands.push_back(
+ Operand{SPV_OPERAND_TYPE_ID, {tensor_view->has_dimensions_id()}});
+ for (auto p : tensor_view->perm()) {
+ operands.push_back(Operand{SPV_OPERAND_TYPE_ID, {p}});
+ }
+ typeInst = MakeUnique<Instruction>(context(), spv::Op::OpTypeTensorViewNV,
+ 0, id, operands);
+ break;
+ }
+ case Type::kCooperativeVectorNV: {
+ auto coop_vec = type->AsCooperativeVectorNV();
+ uint32_t const component_type =
+ GetTypeInstruction(coop_vec->component_type());
+ if (component_type == 0) {
+ return 0;
+ }
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypeCooperativeVectorNV, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {component_type}},
+ {SPV_OPERAND_TYPE_ID, {coop_vec->components()}}});
+ break;
+ }
+ case Type::kTensorARM: {
+ auto tensor_type = type->AsTensorARM();
+ uint32_t const element_type =
+ GetTypeInstruction(tensor_type->element_type());
+ if (element_type == 0) {
+ return 0;
+ }
+ if (tensor_type->rank_id() != 0) {
+ if (tensor_type->shape_id() != 0) {
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypeTensorARM, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {element_type}},
+ {SPV_OPERAND_TYPE_ID, {tensor_type->rank_id()}},
+ {SPV_OPERAND_TYPE_ID, {tensor_type->shape_id()}}});
+ } else {
+ typeInst = MakeUnique<Instruction>(
+ context(), spv::Op::OpTypeTensorARM, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {element_type}},
+ {SPV_OPERAND_TYPE_ID, {tensor_type->rank_id()}}});
+ }
+ } else {
+ typeInst =
+ MakeUnique<Instruction>(context(), spv::Op::OpTypeTensorARM, 0, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {element_type}}});
+ }
+ break;
+ }
default:
assert(false && "Unexpected type");
break;
}
context()->AddType(std::move(typeInst));
+ // TODO(dneto): This next call to AnalyzeDefUse is redundant becaues
+ // IRContext::AddType already does it.
context()->AnalyzeDefUse(&*--context()->types_values_end());
AttachDecorations(id, type);
return id;
@@ -454,12 +541,7 @@
spv::StorageClass storage_class) {
Type* pointeeTy = GetType(type_id);
Pointer pointerTy(pointeeTy, storage_class);
- if (pointeeTy->IsUniqueType()) {
- // Non-ambiguous type. Get the pointer type through the type manager.
- return GetTypeInstruction(&pointerTy);
- }
- // Ambiguous type, do a linear search.
Module::inst_iterator type_itr = context()->module()->types_values_begin();
for (; type_itr != context()->module()->types_values_end(); ++type_itr) {
const Instruction* type_inst = &*type_itr;
@@ -472,8 +554,10 @@
}
// Must create the pointer type.
- // TODO(1841): Handle id overflow.
uint32_t resultId = context()->TakeNextId();
+ if (resultId == 0) {
+ return 0;
+ }
std::unique_ptr<Instruction> type_inst(
new Instruction(context(), spv::Op::OpTypePointer, 0, resultId,
{{spv_operand_type_t::SPV_OPERAND_TYPE_STORAGE_CLASS,
@@ -603,6 +687,13 @@
MakeUnique<RuntimeArray>(RebuildType(GetId(ele_ty), *ele_ty));
break;
}
+ case Type::kNodePayloadArrayAMDX: {
+ const NodePayloadArrayAMDX* array_ty = type.AsNodePayloadArrayAMDX();
+ const Type* ele_ty = array_ty->element_type();
+ rebuilt_ty =
+ MakeUnique<NodePayloadArrayAMDX>(RebuildType(GetId(ele_ty), *ele_ty));
+ break;
+ }
case Type::kStruct: {
const Struct* struct_ty = type.AsStruct();
std::vector<const Type*> subtypes;
@@ -624,9 +715,13 @@
}
case Type::kPointer: {
const Pointer* pointer_ty = type.AsPointer();
- const Type* ele_ty = pointer_ty->pointee_type();
- rebuilt_ty = MakeUnique<Pointer>(RebuildType(GetId(ele_ty), *ele_ty),
- pointer_ty->storage_class());
+ if (pointer_ty->pointee_type()) {
+ const Type* ele_ty = pointer_ty->pointee_type();
+ rebuilt_ty = MakeUnique<Pointer>(RebuildType(GetId(ele_ty), *ele_ty),
+ pointer_ty->storage_class());
+ } else {
+ rebuilt_ty = MakeUnique<Pointer>(nullptr, pointer_ty->storage_class());
+ }
break;
}
case Type::kFunction: {
@@ -669,6 +764,34 @@
cm_type->use_id());
break;
}
+ case Type::kTensorLayoutNV: {
+ const TensorLayoutNV* tl_type = type.AsTensorLayoutNV();
+ rebuilt_ty = MakeUnique<TensorLayoutNV>(tl_type->dim_id(),
+ tl_type->clamp_mode_id());
+ break;
+ }
+ case Type::kTensorViewNV: {
+ const TensorViewNV* tv_type = type.AsTensorViewNV();
+ rebuilt_ty = MakeUnique<TensorViewNV>(
+ tv_type->dim_id(), tv_type->has_dimensions_id(), tv_type->perm());
+ break;
+ }
+ case Type::kCooperativeVectorNV: {
+ const CooperativeVectorNV* cv_type = type.AsCooperativeVectorNV();
+ const Type* component_type = cv_type->component_type();
+ rebuilt_ty = MakeUnique<CooperativeVectorNV>(
+ RebuildType(GetId(component_type), *component_type),
+ cv_type->components());
+ break;
+ }
+ case Type::kTensorARM: {
+ const TensorARM* tensor_type = type.AsTensorARM();
+ const Type* element_type = tensor_type->element_type();
+ rebuilt_ty = MakeUnique<TensorARM>(
+ RebuildType(GetId(element_type), *element_type),
+ tensor_type->rank_id(), tensor_type->shape_id());
+ break;
+ }
default:
assert(false && "Unhandled type");
return nullptr;
@@ -716,9 +839,13 @@
type = new Integer(inst.GetSingleWordInOperand(0),
inst.GetSingleWordInOperand(1));
break;
- case spv::Op::OpTypeFloat:
- type = new Float(inst.GetSingleWordInOperand(0));
- break;
+ case spv::Op::OpTypeFloat: {
+ const spv::FPEncoding encoding =
+ inst.NumInOperands() > 1
+ ? static_cast<spv::FPEncoding>(inst.GetSingleWordInOperand(1))
+ : spv::FPEncoding::Max;
+ type = new Float(inst.GetSingleWordInOperand(0), encoding);
+ } break;
case spv::Op::OpTypeVector:
type = new Vector(GetType(inst.GetSingleWordInOperand(0)),
inst.GetSingleWordInOperand(1));
@@ -805,6 +932,14 @@
return type;
}
break;
+ case spv::Op::OpTypeNodePayloadArrayAMDX:
+ type = new NodePayloadArrayAMDX(GetType(inst.GetSingleWordInOperand(0)));
+ if (id_to_incomplete_type_.count(inst.GetSingleWordInOperand(0))) {
+ incomplete_types_.emplace_back(inst.result_id(), type);
+ id_to_incomplete_type_[inst.result_id()] = type;
+ return type;
+ }
+ break;
case spv::Op::OpTypeStruct: {
std::vector<const Type*> element_types;
bool incomplete_type = false;
@@ -840,6 +975,11 @@
id_to_incomplete_type_.erase(inst.result_id());
} break;
+ case spv::Op::OpTypeUntypedPointerKHR: {
+ type = new Pointer(nullptr, static_cast<spv::StorageClass>(
+ inst.GetSingleWordInOperand(0)));
+ id_to_incomplete_type_.erase(inst.result_id());
+ } break;
case spv::Op::OpTypeFunction: {
bool incomplete_type = false;
uint32_t return_type_id = inst.GetSingleWordInOperand(0);
@@ -910,12 +1050,47 @@
inst.GetSingleWordInOperand(1), inst.GetSingleWordInOperand(2),
inst.GetSingleWordInOperand(3), inst.GetSingleWordInOperand(4));
break;
+ case spv::Op::OpTypeCooperativeVectorNV:
+ type = new CooperativeVectorNV(GetType(inst.GetSingleWordInOperand(0)),
+ inst.GetSingleWordInOperand(1));
+ break;
case spv::Op::OpTypeRayQueryKHR:
type = new RayQueryKHR();
break;
case spv::Op::OpTypeHitObjectNV:
type = new HitObjectNV();
break;
+ case spv::Op::OpTypeTensorLayoutNV:
+ type = new TensorLayoutNV(inst.GetSingleWordInOperand(0),
+ inst.GetSingleWordInOperand(1));
+ break;
+ case spv::Op::OpTypeTensorViewNV: {
+ const auto count = inst.NumOperands();
+ std::vector<uint32_t> perm;
+ for (uint32_t i = 2; i < count; ++i) {
+ perm.push_back(inst.GetSingleWordOperand(i));
+ }
+ type = new TensorViewNV(inst.GetSingleWordInOperand(0),
+ inst.GetSingleWordInOperand(1), perm);
+ break;
+ }
+ case spv::Op::OpTypeTensorARM: {
+ switch (inst.NumInOperands()) {
+ case 1:
+ type = new TensorARM(GetType(inst.GetSingleWordInOperand(0)));
+ break;
+ case 2:
+ type = new TensorARM(GetType(inst.GetSingleWordInOperand(0)),
+ inst.GetSingleWordInOperand(1));
+ break;
+ case 3:
+ type = new TensorARM(GetType(inst.GetSingleWordInOperand(0)),
+ inst.GetSingleWordInOperand(1),
+ inst.GetSingleWordInOperand(2));
+ break;
+ }
+ break;
+ }
default:
assert(false && "Type not handled by the type manager.");
break;
@@ -942,11 +1117,16 @@
if (!IsAnnotationInst(opcode)) return;
switch (opcode) {
- case spv::Op::OpDecorate: {
+ case spv::Op::OpDecorate:
+ case spv::Op::OpDecorateId: {
const auto count = inst.NumOperands();
std::vector<uint32_t> data;
for (uint32_t i = 1; i < count; ++i) {
- data.push_back(inst.GetSingleWordOperand(i));
+ // LinkageAttributes has a literal string as an operand, which is a
+ // varible length word. We cannot assume that all operands are single
+ // word.
+ const Operand::OperandData& words = inst.GetOperand(i).words;
+ data.insert(data.end(), words.begin(), words.end());
}
type->AddDecoration(std::move(data));
} break;
diff --git a/third_party/SPIRV-Tools/source/opt/type_manager.h b/third_party/SPIRV-Tools/source/opt/type_manager.h
index 948b691..d1e6fc1 100644
--- a/third_party/SPIRV-Tools/source/opt/type_manager.h
+++ b/third_party/SPIRV-Tools/source/opt/type_manager.h
@@ -34,7 +34,7 @@
// Hashing functor.
//
-// All type pointers must be non-null.
+// All type pointers must be non-null to reach here.
struct HashTypePointer {
size_t operator()(const Type* type) const {
assert(type);
diff --git a/third_party/SPIRV-Tools/source/opt/types.cpp b/third_party/SPIRV-Tools/source/opt/types.cpp
index b18b8cb..83e0534 100644
--- a/third_party/SPIRV-Tools/source/opt/types.cpp
+++ b/third_party/SPIRV-Tools/source/opt/types.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2016 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -90,6 +92,7 @@
case kStruct:
case kArray:
case kRuntimeArray:
+ case kNodePayloadArrayAMDX:
return false;
default:
return true;
@@ -129,8 +132,10 @@
DeclareKindCase(AccelerationStructureNV);
DeclareKindCase(CooperativeMatrixNV);
DeclareKindCase(CooperativeMatrixKHR);
+ DeclareKindCase(CooperativeVectorNV);
DeclareKindCase(RayQueryKHR);
DeclareKindCase(HitObjectNV);
+ DeclareKindCase(TensorARM);
#undef DeclareKindCase
default:
assert(false && "Unhandled type");
@@ -162,6 +167,7 @@
DeclareKindCase(SampledImage);
DeclareKindCase(Array);
DeclareKindCase(RuntimeArray);
+ DeclareKindCase(NodePayloadArrayAMDX);
DeclareKindCase(Struct);
DeclareKindCase(Opaque);
DeclareKindCase(Pointer);
@@ -177,8 +183,12 @@
DeclareKindCase(AccelerationStructureNV);
DeclareKindCase(CooperativeMatrixNV);
DeclareKindCase(CooperativeMatrixKHR);
+ DeclareKindCase(CooperativeVectorNV);
DeclareKindCase(RayQueryKHR);
DeclareKindCase(HitObjectNV);
+ DeclareKindCase(TensorLayoutNV);
+ DeclareKindCase(TensorViewNV);
+ DeclareKindCase(TensorARM);
#undef DeclareKindCase
default:
assert(false && "Unhandled type");
@@ -218,6 +228,7 @@
DeclareKindCase(SampledImage);
DeclareKindCase(Array);
DeclareKindCase(RuntimeArray);
+ DeclareKindCase(NodePayloadArrayAMDX);
DeclareKindCase(Struct);
DeclareKindCase(Opaque);
DeclareKindCase(Pointer);
@@ -233,8 +244,12 @@
DeclareKindCase(AccelerationStructureNV);
DeclareKindCase(CooperativeMatrixNV);
DeclareKindCase(CooperativeMatrixKHR);
+ DeclareKindCase(CooperativeVectorNV);
DeclareKindCase(RayQueryKHR);
DeclareKindCase(HitObjectNV);
+ DeclareKindCase(TensorLayoutNV);
+ DeclareKindCase(TensorViewNV);
+ DeclareKindCase(TensorARM);
#undef DeclareKindCase
default:
assert(false && "Unhandled type");
@@ -297,17 +312,34 @@
bool Float::IsSameImpl(const Type* that, IsSameCache*) const {
const Float* ft = that->AsFloat();
- return ft && width_ == ft->width_ && HasSameDecorations(that);
+ return ft && width_ == ft->width_ && encoding_ == ft->encoding_ &&
+ HasSameDecorations(that);
}
std::string Float::str() const {
std::ostringstream oss;
- oss << "float" << width_;
+ switch (encoding_) {
+ case spv::FPEncoding::BFloat16KHR:
+ assert(width_ == 16);
+ oss << "bfloat16";
+ break;
+ case spv::FPEncoding::Float8E4M3EXT:
+ assert(width_ == 8);
+ oss << "fp8e4m3";
+ break;
+ case spv::FPEncoding::Float8E5M2EXT:
+ assert(width_ == 8);
+ oss << "fp8e5m2";
+ break;
+ default:
+ oss << "float" << width_;
+ break;
+ }
return oss.str();
}
size_t Float::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
- return hash_combine(hash, width_);
+ return hash_combine(hash, width_, encoding_);
}
Vector::Vector(const Type* type, uint32_t count)
@@ -485,6 +517,34 @@
element_type_ = type;
}
+NodePayloadArrayAMDX::NodePayloadArrayAMDX(const Type* type)
+ : Type(kNodePayloadArrayAMDX), element_type_(type) {
+ assert(!type->AsVoid());
+}
+
+bool NodePayloadArrayAMDX::IsSameImpl(const Type* that,
+ IsSameCache* seen) const {
+ const NodePayloadArrayAMDX* rat = that->AsNodePayloadArrayAMDX();
+ if (!rat) return false;
+ return element_type_->IsSameImpl(rat->element_type_, seen) &&
+ HasSameDecorations(that);
+}
+
+std::string NodePayloadArrayAMDX::str() const {
+ std::ostringstream oss;
+ oss << "[" << element_type_->str() << "]";
+ return oss.str();
+}
+
+size_t NodePayloadArrayAMDX::ComputeExtraStateHash(size_t hash,
+ SeenTypes* seen) const {
+ return element_type_->ComputeHashValue(hash, seen);
+}
+
+void NodePayloadArrayAMDX::ReplaceElementType(const Type* type) {
+ element_type_ = type;
+}
+
Struct::Struct(const std::vector<const Type*>& types)
: Type(kStruct), element_types_(types) {
for (const auto* t : types) {
@@ -572,24 +632,39 @@
if (!p.second) {
return true;
}
- bool same_pointee = pointee_type_->IsSameImpl(pt->pointee_type_, seen);
- seen->erase(p.first);
- if (!same_pointee) {
- return false;
+ if (pointee_type_ != nullptr && pt->pointee_type_ != nullptr) {
+ bool same_pointee = pointee_type_->IsSameImpl(pt->pointee_type_, seen);
+ seen->erase(p.first);
+ if (!same_pointee) {
+ return false;
+ }
+ } else {
+ seen->erase(p.first);
+ // Either both are untyped or it is mixed typed and untyped.
+ if (pointee_type_ != pt->pointee_type_) {
+ return false;
+ }
}
return HasSameDecorations(that);
}
std::string Pointer::str() const {
std::ostringstream os;
- os << pointee_type_->str() << " " << static_cast<uint32_t>(storage_class_)
- << "*";
+ if (pointee_type_) {
+ os << pointee_type_->str();
+ } else {
+ os << "untyped_ptr";
+ }
+ os << " " << static_cast<uint32_t>(storage_class_) << "*";
return os.str();
}
size_t Pointer::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
hash = hash_combine(hash, uint32_t(storage_class_));
- return pointee_type_->ComputeHashValue(hash, seen);
+ if (pointee_type_) {
+ hash = pointee_type_->ComputeHashValue(hash, seen);
+ }
+ return hash;
}
void Pointer::SetPointeeType(const Type* type) { pointee_type_ = type; }
@@ -747,7 +822,114 @@
if (!mt) return false;
return component_type_->IsSameImpl(mt->component_type_, seen) &&
scope_id_ == mt->scope_id_ && rows_id_ == mt->rows_id_ &&
- columns_id_ == mt->columns_id_ && HasSameDecorations(that);
+ columns_id_ == mt->columns_id_ && use_id_ == mt->use_id_ &&
+ HasSameDecorations(that);
+}
+
+TensorLayoutNV::TensorLayoutNV(const uint32_t dim, const uint32_t clamp_mode)
+ : Type(kTensorLayoutNV), dim_id_(dim), clamp_mode_id_(clamp_mode) {}
+
+std::string TensorLayoutNV::str() const {
+ std::ostringstream oss;
+ oss << "<" << dim_id_ << ", " << clamp_mode_id_ << ">";
+ return oss.str();
+}
+
+size_t TensorLayoutNV::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
+ return hash_combine(hash, dim_id_, clamp_mode_id_);
+}
+
+bool TensorLayoutNV::IsSameImpl(const Type* that, IsSameCache*) const {
+ const TensorLayoutNV* tl = that->AsTensorLayoutNV();
+ if (!tl) return false;
+ return dim_id_ == tl->dim_id_ && clamp_mode_id_ == tl->clamp_mode_id_;
+}
+
+TensorViewNV::TensorViewNV(const uint32_t dim, const uint32_t clamp_mode,
+ const std::vector<uint32_t>& perm)
+ : Type(kTensorViewNV),
+ dim_id_(dim),
+ has_dimensions_id_(clamp_mode),
+ perm_(perm) {}
+
+std::string TensorViewNV::str() const {
+ std::ostringstream oss;
+ oss << "<" << dim_id_ << ", " << has_dimensions_id_;
+ for (auto p : perm_) {
+ oss << ", " << p;
+ }
+ oss << ">";
+ return oss.str();
+}
+
+size_t TensorViewNV::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
+ return hash_combine(hash, dim_id_, has_dimensions_id_, perm_);
+}
+
+bool TensorViewNV::IsSameImpl(const Type* that, IsSameCache*) const {
+ const TensorViewNV* tv = that->AsTensorViewNV();
+ if (!tv) return false;
+ return dim_id_ == tv->dim_id_ &&
+ has_dimensions_id_ == tv->has_dimensions_id_ && perm_ == tv->perm_;
+}
+
+CooperativeVectorNV::CooperativeVectorNV(const Type* type,
+ const uint32_t components)
+ : Type(kCooperativeVectorNV),
+ component_type_(type),
+ components_(components) {
+ assert(type != nullptr);
+ assert(components != 0);
+}
+
+std::string CooperativeVectorNV::str() const {
+ std::ostringstream oss;
+ oss << "<" << component_type_->str() << ", " << components_ << ">";
+ return oss.str();
+}
+
+size_t CooperativeVectorNV::ComputeExtraStateHash(size_t hash,
+ SeenTypes* seen) const {
+ hash = hash_combine(hash, components_);
+ return component_type_->ComputeHashValue(hash, seen);
+}
+
+bool CooperativeVectorNV::IsSameImpl(const Type* that,
+ IsSameCache* seen) const {
+ const CooperativeVectorNV* mt = that->AsCooperativeVectorNV();
+ if (!mt) return false;
+ return component_type_->IsSameImpl(mt->component_type_, seen) &&
+ components_ == mt->components_ && HasSameDecorations(that);
+}
+
+TensorARM::TensorARM(const Type* elty, const uint32_t rank,
+ const uint32_t shape)
+ : Type(kTensorARM), element_type_(elty), rank_id_(rank), shape_id_(shape) {
+ assert(elty != nullptr);
+ if (shape != 0) {
+ assert(rank != 0);
+ }
+}
+
+std::string TensorARM::str() const {
+ std::ostringstream oss;
+ oss << "tensor<" << element_type_->str() << ", id(" << rank_id_ << "), id("
+ << shape_id_ << ")>";
+ return oss.str();
+}
+
+size_t TensorARM::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ hash = hash_combine(hash, rank_id_);
+ hash = hash_combine(hash, shape_id_);
+ return element_type_->ComputeHashValue(hash, seen);
+}
+
+bool TensorARM::IsSameImpl(const Type* that, IsSameCache* seen) const {
+ const TensorARM* tt = that->AsTensorARM();
+ if (!tt) return false;
+ return element_type_->IsSameImpl(tt->element_type_, seen) &&
+ rank_id_ == tt->rank_id_ && shape_id_ == tt->shape_id_ &&
+ HasSameDecorations(that);
}
} // namespace analysis
diff --git a/third_party/SPIRV-Tools/source/opt/types.h b/third_party/SPIRV-Tools/source/opt/types.h
index 16a948c..72acdb0 100644
--- a/third_party/SPIRV-Tools/source/opt/types.h
+++ b/third_party/SPIRV-Tools/source/opt/types.h
@@ -1,4 +1,6 @@
// Copyright (c) 2016 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -46,6 +48,7 @@
class SampledImage;
class Array;
class RuntimeArray;
+class NodePayloadArrayAMDX;
class Struct;
class Opaque;
class Pointer;
@@ -61,8 +64,12 @@
class AccelerationStructureNV;
class CooperativeMatrixNV;
class CooperativeMatrixKHR;
+class CooperativeVectorNV;
class RayQueryKHR;
class HitObjectNV;
+class TensorLayoutNV;
+class TensorViewNV;
+class TensorARM;
// Abstract class for a SPIR-V type. It has a bunch of As<sublcass>() methods,
// which is used as a way to probe the actual <subclass>.
@@ -87,6 +94,7 @@
kSampledImage,
kArray,
kRuntimeArray,
+ kNodePayloadArrayAMDX,
kStruct,
kOpaque,
kPointer,
@@ -102,8 +110,12 @@
kAccelerationStructureNV,
kCooperativeMatrixNV,
kCooperativeMatrixKHR,
+ kCooperativeVectorNV,
kRayQueryKHR,
kHitObjectNV,
+ kTensorLayoutNV,
+ kTensorViewNV,
+ kTensorARM,
kLast
};
@@ -172,9 +184,9 @@
// non-composite type.
uint64_t NumberOfComponents() const;
-// A bunch of methods for casting this type to a given type. Returns this if the
-// cast can be done, nullptr otherwise.
-// clang-format off
+ // A bunch of methods for casting this type to a given type. Returns this if
+ // the cast can be done, nullptr otherwise.
+ // clang-format off
#define DeclareCastMethod(target) \
virtual target* As##target() { return nullptr; } \
virtual const target* As##target() const { return nullptr; }
@@ -189,6 +201,7 @@
DeclareCastMethod(SampledImage)
DeclareCastMethod(Array)
DeclareCastMethod(RuntimeArray)
+ DeclareCastMethod(NodePayloadArrayAMDX)
DeclareCastMethod(Struct)
DeclareCastMethod(Opaque)
DeclareCastMethod(Pointer)
@@ -204,8 +217,12 @@
DeclareCastMethod(AccelerationStructureNV)
DeclareCastMethod(CooperativeMatrixNV)
DeclareCastMethod(CooperativeMatrixKHR)
+ DeclareCastMethod(CooperativeVectorNV)
DeclareCastMethod(RayQueryKHR)
DeclareCastMethod(HitObjectNV)
+ DeclareCastMethod(TensorLayoutNV)
+ DeclareCastMethod(TensorViewNV)
+ DeclareCastMethod(TensorARM)
#undef DeclareCastMethod
protected:
@@ -215,7 +232,9 @@
protected:
// Decorations attached to this type. Each decoration is encoded as a vector
// of uint32_t numbers. The first uint32_t number is the decoration value,
- // and the rest are the parameters to the decoration (if exists).
+ // and the rest are the parameters to the decoration (if any exist).
+ // The parameters can be either all literals or all ids depending on the
+ // decoration value.
std::vector<std::vector<uint32_t>> decorations_;
private:
@@ -251,7 +270,8 @@
class Float : public Type {
public:
- Float(uint32_t w) : Type(kFloat), width_(w) {}
+ Float(uint32_t w, spv::FPEncoding encoding = spv::FPEncoding::Max)
+ : Type(kFloat), width_(w), encoding_(encoding) {}
Float(const Float&) = default;
std::string str() const override;
@@ -259,13 +279,15 @@
Float* AsFloat() override { return this; }
const Float* AsFloat() const override { return this; }
uint32_t width() const { return width_; }
+ spv::FPEncoding encoding() const { return encoding_; }
size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
- uint32_t width_; // bit width
+ uint32_t width_; // bit width
+ spv::FPEncoding encoding_; // FPEncoding
};
class Vector : public Type {
@@ -434,6 +456,29 @@
const Type* element_type_;
};
+class NodePayloadArrayAMDX : public Type {
+ public:
+ NodePayloadArrayAMDX(const Type* element_type);
+ NodePayloadArrayAMDX(const NodePayloadArrayAMDX&) = default;
+
+ std::string str() const override;
+ const Type* element_type() const { return element_type_; }
+
+ NodePayloadArrayAMDX* AsNodePayloadArrayAMDX() override { return this; }
+ const NodePayloadArrayAMDX* AsNodePayloadArrayAMDX() const override {
+ return this;
+ }
+
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
+
+ void ReplaceElementType(const Type* element_type);
+
+ private:
+ bool IsSameImpl(const Type* that, IsSameCache*) const override;
+
+ const Type* element_type_;
+};
+
class Struct : public Type {
public:
Struct(const std::vector<const Type*>& element_types);
@@ -508,6 +553,8 @@
const Type* pointee_type() const { return pointee_type_; }
spv::StorageClass storage_class() const { return storage_class_; }
+ bool is_untyped() const { return pointee_type_ == nullptr; }
+
Pointer* AsPointer() override { return this; }
const Pointer* AsPointer() const override { return this; }
@@ -659,6 +706,102 @@
const uint32_t use_id_;
};
+class TensorLayoutNV : public Type {
+ public:
+ TensorLayoutNV(const uint32_t dim, const uint32_t clamp_mode);
+ TensorLayoutNV(const TensorLayoutNV&) = default;
+
+ std::string str() const override;
+
+ TensorLayoutNV* AsTensorLayoutNV() override { return this; }
+ const TensorLayoutNV* AsTensorLayoutNV() const override { return this; }
+
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
+
+ uint32_t dim_id() const { return dim_id_; }
+ uint32_t clamp_mode_id() const { return clamp_mode_id_; }
+
+ private:
+ bool IsSameImpl(const Type* that, IsSameCache*) const override;
+
+ const uint32_t dim_id_;
+ const uint32_t clamp_mode_id_;
+};
+
+class TensorViewNV : public Type {
+ public:
+ TensorViewNV(const uint32_t dim, const uint32_t clamp_mode,
+ const std::vector<uint32_t>& perm);
+ TensorViewNV(const TensorViewNV&) = default;
+
+ std::string str() const override;
+
+ TensorViewNV* AsTensorViewNV() override { return this; }
+ const TensorViewNV* AsTensorViewNV() const override { return this; }
+
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
+
+ uint32_t dim_id() const { return dim_id_; }
+ uint32_t has_dimensions_id() const { return has_dimensions_id_; }
+ const std::vector<uint32_t>& perm() const { return perm_; }
+
+ private:
+ bool IsSameImpl(const Type* that, IsSameCache*) const override;
+
+ const uint32_t dim_id_;
+ const uint32_t has_dimensions_id_;
+ std::vector<uint32_t> perm_;
+};
+
+class CooperativeVectorNV : public Type {
+ public:
+ CooperativeVectorNV(const Type* type, const uint32_t components);
+ CooperativeVectorNV(const CooperativeVectorNV&) = default;
+
+ std::string str() const override;
+
+ CooperativeVectorNV* AsCooperativeVectorNV() override { return this; }
+ const CooperativeVectorNV* AsCooperativeVectorNV() const override {
+ return this;
+ }
+
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
+
+ const Type* component_type() const { return component_type_; }
+ uint32_t components() const { return components_; }
+
+ private:
+ bool IsSameImpl(const Type* that, IsSameCache*) const override;
+
+ const Type* component_type_;
+ const uint32_t components_;
+};
+
+class TensorARM : public Type {
+ public:
+ TensorARM(const Type* elty, const uint32_t rank = 0,
+ const uint32_t shape = 0);
+ TensorARM(const TensorARM&) = default;
+
+ std::string str() const override;
+
+ TensorARM* AsTensorARM() override { return this; }
+ const TensorARM* AsTensorARM() const override { return this; }
+
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
+
+ const Type* element_type() const { return element_type_; }
+ uint32_t rank_id() const { return rank_id_; }
+ uint32_t shape_id() const { return shape_id_; }
+
+ private:
+ bool IsSameImpl(const Type* that, IsSameCache*) const override;
+
+ const Type* element_type_;
+ const uint32_t rank_id_;
+ const uint32_t shape_id_;
+};
+
#define DefineParameterlessType(type, name) \
class type : public Type { \
public: \
diff --git a/third_party/SPIRV-Tools/source/opt/upgrade_memory_model.cpp b/third_party/SPIRV-Tools/source/opt/upgrade_memory_model.cpp
index 1b439a6..97b5ed3 100644
--- a/third_party/SPIRV-Tools/source/opt/upgrade_memory_model.cpp
+++ b/third_party/SPIRV-Tools/source/opt/upgrade_memory_model.cpp
@@ -160,14 +160,38 @@
}
switch (inst->opcode()) {
- case spv::Op::OpLoad:
+ case spv::Op::OpLoad: {
+ Instruction* src_pointer = context()->get_def_use_mgr()->GetDef(
+ inst->GetSingleWordInOperand(0u));
+ analysis::Type* src_type =
+ context()->get_type_mgr()->GetType(src_pointer->type_id());
+ auto storage_class = src_type->AsPointer()->storage_class();
+ if (storage_class == spv::StorageClass::Function ||
+ storage_class == spv::StorageClass::Private) {
+ // If the buffer from function variable or private variable, flag
+ // NonPrivatePointer is unnecessary.
+ is_coherent = false;
+ }
UpgradeFlags(inst, 1u, is_coherent, is_volatile, kVisibility,
kMemory);
break;
- case spv::Op::OpStore:
+ }
+ case spv::Op::OpStore: {
+ Instruction* src_pointer = context()->get_def_use_mgr()->GetDef(
+ inst->GetSingleWordInOperand(0u));
+ analysis::Type* src_type =
+ context()->get_type_mgr()->GetType(src_pointer->type_id());
+ auto storage_class = src_type->AsPointer()->storage_class();
+ if (storage_class == spv::StorageClass::Function ||
+ storage_class == spv::StorageClass::Private) {
+ // If the buffer from function variable or private variable, flag
+ // NonPrivatePointer is unnecessary.
+ is_coherent = false;
+ }
UpgradeFlags(inst, 2u, is_coherent, is_volatile, kAvailability,
kMemory);
break;
+ }
case spv::Op::OpCopyMemory:
case spv::Op::OpCopyMemorySized:
start_operand = inst->opcode() == spv::Op::OpCopyMemory ? 2u : 3u;
@@ -366,6 +390,21 @@
indices.push_back(inst->GetSingleWordInOperand(i));
}
break;
+ case spv::Op::OpLoad:
+ if (context()->get_type_mgr()->GetType(inst->type_id())->AsPointer()) {
+ analysis::Integer int_ty(32, false);
+ uint32_t int_id =
+ context()->get_type_mgr()->GetTypeInstruction(&int_ty);
+ const analysis::Constant* constant =
+ context()->get_constant_mgr()->GetConstant(
+ context()->get_type_mgr()->GetType(int_id), {0u});
+ uint32_t constant_id = context()
+ ->get_constant_mgr()
+ ->GetDefiningInstruction(constant)
+ ->result_id();
+
+ indices.push_back(constant_id);
+ }
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/opt/value_number_table.cpp b/third_party/SPIRV-Tools/source/opt/value_number_table.cpp
index 743dc52..0c7e575 100644
--- a/third_party/SPIRV-Tools/source/opt/value_number_table.cpp
+++ b/third_party/SPIRV-Tools/source/opt/value_number_table.cpp
@@ -45,28 +45,43 @@
return value;
}
+ auto assign_new_number = [this](Instruction* i) {
+ const auto new_value = TakeNextValueNumber();
+ id_to_value_[i->result_id()] = new_value;
+ return new_value;
+ };
+
// If the instruction has other side effects, then it must
// have its own value number.
- // OpSampledImage and OpImage must remain in the same basic block in which
- // they are used, because of this we will assign each one it own value number.
if (!context()->IsCombinatorInstruction(inst) &&
!inst->IsCommonDebugInstr()) {
- value = TakeNextValueNumber();
- id_to_value_[inst->result_id()] = value;
- return value;
+ return assign_new_number(inst);
}
+ // OpSampledImage and OpImage must remain in the same basic block in which
+ // they are used, because of this we will assign each one it own value number.
switch (inst->opcode()) {
case spv::Op::OpSampledImage:
case spv::Op::OpImage:
case spv::Op::OpVariable:
- value = TakeNextValueNumber();
- id_to_value_[inst->result_id()] = value;
- return value;
+ return assign_new_number(inst);
default:
break;
}
+ // A load that yields an image, sampler, or sampled image must remain in
+ // the same basic block. So assign it its own value number.
+ if (inst->IsLoad()) {
+ switch (context()->get_def_use_mgr()->GetDef(inst->type_id())->opcode()) {
+ case spv::Op::OpTypeSampledImage:
+ case spv::Op::OpTypeImage:
+ case spv::Op::OpTypeSampler:
+ return assign_new_number(inst);
+ default:
+ break;
+ }
+ }
+
// If it is a load from memory that can be modified, we have to assume the
// memory has been modified, so we give it a new value number.
//
@@ -74,9 +89,7 @@
// read only. However, if this is ever relaxed because we analyze stores, we
// will have to add a new case for volatile loads.
if (inst->IsLoad() && !inst->IsReadOnlyLoad()) {
- value = TakeNextValueNumber();
- id_to_value_[inst->result_id()] = value;
- return value;
+ return assign_new_number(inst);
}
analysis::DecorationManager* dec_mgr = context()->get_decoration_mgr();
diff --git a/third_party/SPIRV-Tools/source/parsed_operand.cpp b/third_party/SPIRV-Tools/source/parsed_operand.cpp
index cc33f8b..649b9d6 100644
--- a/third_party/SPIRV-Tools/source/parsed_operand.cpp
+++ b/third_party/SPIRV-Tools/source/parsed_operand.cpp
@@ -43,12 +43,35 @@
*out << word;
break;
case SPV_NUMBER_FLOATING:
- if (operand.number_bit_width == 16) {
- *out << spvtools::utils::FloatProxy<spvtools::utils::Float16>(
- uint16_t(word & 0xFFFF));
- } else {
- // Assume 32-bit floats.
- *out << spvtools::utils::FloatProxy<float>(word);
+ switch (operand.fp_encoding) {
+ case SPV_FP_ENCODING_IEEE754_BINARY16:
+ *out << spvtools::utils::FloatProxy<spvtools::utils::Float16>(
+ uint16_t(word & 0xFFFF));
+ break;
+ case SPV_FP_ENCODING_IEEE754_BINARY32:
+ *out << spvtools::utils::FloatProxy<float>(word);
+ break;
+ case SPV_FP_ENCODING_FLOAT8_E4M3:
+ *out << spvtools::utils::FloatProxy<spvtools::utils::Float8_E4M3>(
+ uint8_t(word & 0xFF));
+ break;
+ case SPV_FP_ENCODING_FLOAT8_E5M2:
+ *out << spvtools::utils::FloatProxy<spvtools::utils::Float8_E5M2>(
+ uint8_t(word & 0xFF));
+ break;
+ // TODO Bfloat16
+ case SPV_FP_ENCODING_UNKNOWN:
+ switch (operand.number_bit_width) {
+ case 16:
+ *out << spvtools::utils::FloatProxy<spvtools::utils::Float16>(
+ uint16_t(word & 0xFFFF));
+ break;
+ case 32:
+ *out << spvtools::utils::FloatProxy<float>(word);
+ break;
+ }
+ default:
+ break;
}
break;
default:
diff --git a/third_party/SPIRV-Tools/source/print.cpp b/third_party/SPIRV-Tools/source/print.cpp
index f36812e..3143db1 100644
--- a/third_party/SPIRV-Tools/source/print.cpp
+++ b/third_party/SPIRV-Tools/source/print.cpp
@@ -14,26 +14,7 @@
#include "source/print.h"
-#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \
- defined(SPIRV_IOS) || defined(SPIRV_TVOS) || defined(SPIRV_FREEBSD) || \
- defined(SPIRV_OPENBSD) || defined(SPIRV_EMSCRIPTEN) || \
- defined(SPIRV_FUCHSIA) || defined(SPIRV_GNU) || defined(SPIRV_QNX)
-namespace spvtools {
-
-clr::reset::operator const char*() { return "\x1b[0m"; }
-
-clr::grey::operator const char*() { return "\x1b[1;30m"; }
-
-clr::red::operator const char*() { return "\x1b[31m"; }
-
-clr::green::operator const char*() { return "\x1b[32m"; }
-
-clr::yellow::operator const char*() { return "\x1b[33m"; }
-
-clr::blue::operator const char*() { return "\x1b[34m"; }
-
-} // namespace spvtools
-#elif defined(SPIRV_WINDOWS)
+#if defined(SPIRV_WINDOWS)
#include <windows.h>
namespace spvtools {
@@ -111,17 +92,17 @@
#else
namespace spvtools {
-clr::reset::operator const char*() { return ""; }
+clr::reset::operator const char*() { return "\x1b[0m"; }
-clr::grey::operator const char*() { return ""; }
+clr::grey::operator const char*() { return "\x1b[1;30m"; }
-clr::red::operator const char*() { return ""; }
+clr::red::operator const char*() { return "\x1b[31m"; }
-clr::green::operator const char*() { return ""; }
+clr::green::operator const char*() { return "\x1b[32m"; }
-clr::yellow::operator const char*() { return ""; }
+clr::yellow::operator const char*() { return "\x1b[33m"; }
-clr::blue::operator const char*() { return ""; }
+clr::blue::operator const char*() { return "\x1b[34m"; }
} // namespace spvtools
#endif
diff --git a/third_party/SPIRV-Tools/source/spirv_target_env.cpp b/third_party/SPIRV-Tools/source/spirv_target_env.cpp
index 585f8b6..fe23fa6 100644
--- a/third_party/SPIRV-Tools/source/spirv_target_env.cpp
+++ b/third_party/SPIRV-Tools/source/spirv_target_env.cpp
@@ -14,11 +14,13 @@
#include "source/spirv_target_env.h"
+#include <array>
#include <cassert>
+#include <cctype>
#include <cstring>
#include <string>
-#include <utility>
+#include "source/latest_version_spirv_header.h"
#include "source/spirv_constant.h"
#include "spirv-tools/libspirv.h"
@@ -77,6 +79,8 @@
return "SPIR-V 1.6";
case SPV_ENV_VULKAN_1_3:
return "SPIR-V 1.6 (under Vulkan 1.3 semantics)";
+ case SPV_ENV_VULKAN_1_4:
+ return "SPIR-V 1.6 (under Vulkan 1.4 semantics)";
case SPV_ENV_MAX:
assert(false && "Invalid target environment value.");
break;
@@ -120,6 +124,7 @@
return SPV_SPIRV_VERSION_WORD(1, 5);
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
return SPV_SPIRV_VERSION_WORD(1, 6);
case SPV_ENV_MAX:
assert(false && "Invalid target environment value.");
@@ -128,32 +133,53 @@
return SPV_SPIRV_VERSION_WORD(0, 0);
}
-static const std::pair<const char*, spv_target_env> spvTargetEnvNameMap[] = {
- {"vulkan1.1spv1.4", SPV_ENV_VULKAN_1_1_SPIRV_1_4},
- {"vulkan1.0", SPV_ENV_VULKAN_1_0},
- {"vulkan1.1", SPV_ENV_VULKAN_1_1},
- {"vulkan1.2", SPV_ENV_VULKAN_1_2},
- {"vulkan1.3", SPV_ENV_VULKAN_1_3},
- {"spv1.0", SPV_ENV_UNIVERSAL_1_0},
- {"spv1.1", SPV_ENV_UNIVERSAL_1_1},
- {"spv1.2", SPV_ENV_UNIVERSAL_1_2},
- {"spv1.3", SPV_ENV_UNIVERSAL_1_3},
- {"spv1.4", SPV_ENV_UNIVERSAL_1_4},
- {"spv1.5", SPV_ENV_UNIVERSAL_1_5},
- {"spv1.6", SPV_ENV_UNIVERSAL_1_6},
- {"opencl1.2embedded", SPV_ENV_OPENCL_EMBEDDED_1_2},
- {"opencl1.2", SPV_ENV_OPENCL_1_2},
- {"opencl2.0embedded", SPV_ENV_OPENCL_EMBEDDED_2_0},
- {"opencl2.0", SPV_ENV_OPENCL_2_0},
- {"opencl2.1embedded", SPV_ENV_OPENCL_EMBEDDED_2_1},
- {"opencl2.1", SPV_ENV_OPENCL_2_1},
- {"opencl2.2embedded", SPV_ENV_OPENCL_EMBEDDED_2_2},
- {"opencl2.2", SPV_ENV_OPENCL_2_2},
- {"opengl4.0", SPV_ENV_OPENGL_4_0},
- {"opengl4.1", SPV_ENV_OPENGL_4_1},
- {"opengl4.2", SPV_ENV_OPENGL_4_2},
- {"opengl4.3", SPV_ENV_OPENGL_4_3},
- {"opengl4.5", SPV_ENV_OPENGL_4_5},
+// When a new SPIR-V version is released, update this table.
+static_assert(spv::Version == 0x10600);
+constexpr auto ordered_universal_envs = std::array<spv_target_env, 7>{
+ SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, SPV_ENV_UNIVERSAL_1_2,
+ SPV_ENV_UNIVERSAL_1_3, SPV_ENV_UNIVERSAL_1_4, SPV_ENV_UNIVERSAL_1_5,
+ SPV_ENV_UNIVERSAL_1_6,
+};
+
+// When a new SPIR-V version is released, update this table.
+// Users see this ordered list when running 'spirv-val --help'. Order
+// matters for readability.
+static_assert(spv::Version == 0x10600);
+inline constexpr std::pair<const char*, spv_target_env> spvTargetEnvNameMap[] =
+ {
+ // Do not reorder blindly. The algorithm to find the target looks for
+ // the first entry where the key is a prefix of the string provided by
+ // the user. For example, if the user provides `vulkan1.2spv1.5`, it
+ // will match `vulkan1.2`. If this feature is to work correctly, the
+ // keys must be ordered so that a string is before its prefix. For
+ // example, `vulkan1.1spv1.4` must be before `vulkan1.1`. Otherwise,
+ // `vulkan1.1` will be returned when looking for `vulkan1.1spv1.4`.
+ {"vulkan1.0", SPV_ENV_VULKAN_1_0},
+ {"vulkan1.1spv1.4", SPV_ENV_VULKAN_1_1_SPIRV_1_4},
+ {"vulkan1.1", SPV_ENV_VULKAN_1_1},
+ {"vulkan1.2", SPV_ENV_VULKAN_1_2},
+ {"vulkan1.3", SPV_ENV_VULKAN_1_3},
+ {"vulkan1.4", SPV_ENV_VULKAN_1_4},
+ {"spv1.0", SPV_ENV_UNIVERSAL_1_0},
+ {"spv1.1", SPV_ENV_UNIVERSAL_1_1},
+ {"spv1.2", SPV_ENV_UNIVERSAL_1_2},
+ {"spv1.3", SPV_ENV_UNIVERSAL_1_3},
+ {"spv1.4", SPV_ENV_UNIVERSAL_1_4},
+ {"spv1.5", SPV_ENV_UNIVERSAL_1_5},
+ {"spv1.6", SPV_ENV_UNIVERSAL_1_6},
+ {"opencl1.2embedded", SPV_ENV_OPENCL_EMBEDDED_1_2},
+ {"opencl1.2", SPV_ENV_OPENCL_1_2},
+ {"opencl2.0embedded", SPV_ENV_OPENCL_EMBEDDED_2_0},
+ {"opencl2.0", SPV_ENV_OPENCL_2_0},
+ {"opencl2.1embedded", SPV_ENV_OPENCL_EMBEDDED_2_1},
+ {"opencl2.1", SPV_ENV_OPENCL_2_1},
+ {"opencl2.2embedded", SPV_ENV_OPENCL_EMBEDDED_2_2},
+ {"opencl2.2", SPV_ENV_OPENCL_2_2},
+ {"opengl4.0", SPV_ENV_OPENGL_4_0},
+ {"opengl4.1", SPV_ENV_OPENGL_4_1},
+ {"opengl4.2", SPV_ENV_OPENGL_4_2},
+ {"opengl4.3", SPV_ENV_OPENGL_4_3},
+ {"opengl4.5", SPV_ENV_OPENGL_4_5},
};
bool spvParseTargetEnv(const char* s, spv_target_env* env) {
@@ -172,6 +198,59 @@
return false;
}
+bool spvReadEnvironmentFromText(const std::vector<char>& text,
+ spv_target_env* env) {
+ // Version is expected to match "; Version: 1.X"
+ // Version string must occur in header, that is, initial lines of comments
+ // Once a non-comment line occurs, the header has ended
+ for (std::size_t i = 0; i < text.size(); ++i) {
+ char c = text[i];
+
+ if (c == ';') {
+ // Try to match against the expected version string
+ constexpr const char* kVersionPrefix = "; Version: 1.";
+ constexpr const auto kPrefixLength = 13;
+ // 'minor_digit_pos' is the expected position of the version digit.
+ const auto minor_digit_pos = i + kPrefixLength;
+ if (minor_digit_pos >= text.size()) return false;
+
+ // Match the prefix.
+ auto j = 1;
+ for (; j < kPrefixLength; ++j) {
+ if (kVersionPrefix[j] != text[i + j]) break;
+ }
+ // j will match the prefix length if all characters before matched
+ if (j == kPrefixLength) {
+ // This expects only one digit in the minor number.
+ static_assert(((spv::Version >> 8) & 0xff) < 10);
+ char minor = text[minor_digit_pos];
+ char next_char =
+ minor_digit_pos + 1 < text.size() ? text[minor_digit_pos + 1] : 0;
+ if (std::isdigit(minor) && !std::isdigit(next_char)) {
+ const auto index = minor - '0';
+ assert(index >= 0);
+ if (static_cast<size_t>(index) < ordered_universal_envs.size()) {
+ *env = ordered_universal_envs[index];
+ return true;
+ }
+ }
+ }
+
+ // If no match, determine whether the header has ended (in which case,
+ // assumption has failed.)
+ // Skip until the next line.
+ i += j;
+ for (; i < text.size(); ++i) {
+ if (text[i] == '\n') break;
+ }
+ } else if (!std::isspace(c)) {
+ // Allow blanks, but end the search if we find something else.
+ break;
+ }
+ }
+ return false;
+}
+
#define VULKAN_VER(MAJOR, MINOR) ((MAJOR << 22) | (MINOR << 12))
#define SPIRV_VER(MAJOR, MINOR) ((MAJOR << 16) | (MINOR << 8))
@@ -188,7 +267,8 @@
{SPV_ENV_VULKAN_1_1, VULKAN_VER(1, 1), SPIRV_VER(1, 3)},
{SPV_ENV_VULKAN_1_1_SPIRV_1_4, VULKAN_VER(1, 1), SPIRV_VER(1, 4)},
{SPV_ENV_VULKAN_1_2, VULKAN_VER(1, 2), SPIRV_VER(1, 5)},
- {SPV_ENV_VULKAN_1_3, VULKAN_VER(1, 3), SPIRV_VER(1, 6)}};
+ {SPV_ENV_VULKAN_1_3, VULKAN_VER(1, 3), SPIRV_VER(1, 6)},
+ {SPV_ENV_VULKAN_1_4, VULKAN_VER(1, 4), SPIRV_VER(1, 6)}};
bool spvParseVulkanEnv(uint32_t vulkan_ver, uint32_t spirv_ver,
spv_target_env* env) {
@@ -229,6 +309,7 @@
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
return true;
case SPV_ENV_WEBGPU_0:
assert(false && "Deprecated target environment value.");
@@ -259,6 +340,7 @@
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
return false;
case SPV_ENV_OPENCL_1_2:
case SPV_ENV_OPENCL_EMBEDDED_1_2:
@@ -301,6 +383,7 @@
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
return false;
case SPV_ENV_OPENGL_4_0:
case SPV_ENV_OPENGL_4_1:
@@ -340,6 +423,7 @@
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
case SPV_ENV_OPENGL_4_0:
case SPV_ENV_OPENGL_4_1:
case SPV_ENV_OPENGL_4_2:
@@ -376,7 +460,8 @@
case SPV_ENV_VULKAN_1_1:
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_VULKAN_1_2:
- case SPV_ENV_VULKAN_1_3: {
+ case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4: {
return "Vulkan";
}
case SPV_ENV_UNIVERSAL_1_0:
diff --git a/third_party/SPIRV-Tools/source/spirv_target_env.h b/third_party/SPIRV-Tools/source/spirv_target_env.h
index f3b0c2f..4378f06 100644
--- a/third_party/SPIRV-Tools/source/spirv_target_env.h
+++ b/third_party/SPIRV-Tools/source/spirv_target_env.h
@@ -16,6 +16,8 @@
#define SOURCE_SPIRV_TARGET_ENV_H_
#include <string>
+#include <utility>
+#include <vector>
#include "spirv-tools/libspirv.h"
@@ -46,4 +48,9 @@
// occur to satisfy this limit.
std::string spvTargetEnvList(const int pad, const int wrap);
+// Reads the target environment from the header comments of disassembly. Returns
+// true if valid name found, false otherwise.
+bool spvReadEnvironmentFromText(const std::vector<char>& text,
+ spv_target_env* env);
+
#endif // SOURCE_SPIRV_TARGET_ENV_H_
diff --git a/third_party/SPIRV-Tools/source/spirv_validator_options.cpp b/third_party/SPIRV-Tools/source/spirv_validator_options.cpp
index b72a644..a9591f6 100644
--- a/third_party/SPIRV-Tools/source/spirv_validator_options.cpp
+++ b/third_party/SPIRV-Tools/source/spirv_validator_options.cpp
@@ -126,6 +126,16 @@
options->allow_localsizeid = val;
}
+void spvValidatorOptionsSetAllowOffsetTextureOperand(
+ spv_validator_options options, bool val) {
+ options->allow_offset_texture_operand = val;
+}
+
+void spvValidatorOptionsSetAllowVulkan32BitBitwise(
+ spv_validator_options options, bool val) {
+ options->allow_vulkan_32_bit_bitwise = val;
+}
+
void spvValidatorOptionsSetFriendlyNames(spv_validator_options options,
bool val) {
options->use_friendly_names = val;
diff --git a/third_party/SPIRV-Tools/source/spirv_validator_options.h b/third_party/SPIRV-Tools/source/spirv_validator_options.h
index 0145048..9f0c125 100644
--- a/third_party/SPIRV-Tools/source/spirv_validator_options.h
+++ b/third_party/SPIRV-Tools/source/spirv_validator_options.h
@@ -48,6 +48,8 @@
workgroup_scalar_block_layout(false),
skip_block_layout(false),
allow_localsizeid(false),
+ allow_offset_texture_operand(false),
+ allow_vulkan_32_bit_bitwise(false),
before_hlsl_legalization(false),
use_friendly_names(true) {}
@@ -60,6 +62,8 @@
bool workgroup_scalar_block_layout;
bool skip_block_layout;
bool allow_localsizeid;
+ bool allow_offset_texture_operand;
+ bool allow_vulkan_32_bit_bitwise;
bool before_hlsl_legalization;
bool use_friendly_names;
};
diff --git a/third_party/SPIRV-Tools/source/table.cpp b/third_party/SPIRV-Tools/source/table.cpp
index 822cefe..3f31373 100644
--- a/third_party/SPIRV-Tools/source/table.cpp
+++ b/third_party/SPIRV-Tools/source/table.cpp
@@ -43,21 +43,13 @@
case SPV_ENV_VULKAN_1_2:
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
break;
default:
return nullptr;
}
- spv_opcode_table opcode_table;
- spv_operand_table operand_table;
- spv_ext_inst_table ext_inst_table;
-
- spvOpcodeTableGet(&opcode_table, env);
- spvOperandTableGet(&operand_table, env);
- spvExtInstTableGet(&ext_inst_table, env);
-
- return new spv_context_t{env, opcode_table, operand_table, ext_inst_table,
- nullptr /* a null default consumer */};
+ return new spv_context_t{env, nullptr /* a null default consumer */};
}
void spvContextDestroy(spv_context context) { delete context; }
diff --git a/third_party/SPIRV-Tools/source/table.h b/third_party/SPIRV-Tools/source/table.h
index 4f1dc1f..e61a4d4 100644
--- a/third_party/SPIRV-Tools/source/table.h
+++ b/third_party/SPIRV-Tools/source/table.h
@@ -17,100 +17,14 @@
#include "source/extensions.h"
#include "source/latest_version_spirv_header.h"
+#include "source/util/index_range.h"
#include "spirv-tools/libspirv.hpp"
-typedef struct spv_opcode_desc_t {
- const char* name;
- const spv::Op opcode;
- const uint32_t numCapabilities;
- const spv::Capability* capabilities;
- // operandTypes[0..numTypes-1] describe logical operands for the instruction.
- // The operand types include result id and result-type id, followed by
- // the types of arguments.
- const uint16_t numTypes;
- spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger?
- const bool hasResult; // Does the instruction have a result ID operand?
- const bool hasType; // Does the instruction have a type ID operand?
- // A set of extensions that enable this feature. If empty then this operand
- // value is in core and its availability is subject to minVersion. The
- // assembler, binary parser, and disassembler ignore this rule, so you can
- // freely process invalid modules.
- const uint32_t numExtensions;
- const spvtools::Extension* extensions;
- // Minimal core SPIR-V version required for this feature, if without
- // extensions. ~0u means reserved for future use. ~0u and non-empty extension
- // lists means only available in extensions.
- const uint32_t minVersion;
- const uint32_t lastVersion;
-} spv_opcode_desc_t;
-
-typedef struct spv_operand_desc_t {
- const char* name;
- const uint32_t value;
- const uint32_t numCapabilities;
- const spv::Capability* capabilities;
- // A set of extensions that enable this feature. If empty then this operand
- // value is in core and its availability is subject to minVersion. The
- // assembler, binary parser, and disassembler ignore this rule, so you can
- // freely process invalid modules.
- const uint32_t numExtensions;
- const spvtools::Extension* extensions;
- const spv_operand_type_t operandTypes[16]; // TODO: Smaller/larger?
- // Minimal core SPIR-V version required for this feature, if without
- // extensions. ~0u means reserved for future use. ~0u and non-empty extension
- // lists means only available in extensions.
- const uint32_t minVersion;
- const uint32_t lastVersion;
-} spv_operand_desc_t;
-
-typedef struct spv_operand_desc_group_t {
- const spv_operand_type_t type;
- const uint32_t count;
- const spv_operand_desc_t* entries;
-} spv_operand_desc_group_t;
-
-typedef struct spv_ext_inst_desc_t {
- const char* name;
- const uint32_t ext_inst;
- const uint32_t numCapabilities;
- const spv::Capability* capabilities;
- const spv_operand_type_t operandTypes[40]; // vksp needs at least 40
-} spv_ext_inst_desc_t;
-
-typedef struct spv_ext_inst_group_t {
- const spv_ext_inst_type_t type;
- const uint32_t count;
- const spv_ext_inst_desc_t* entries;
-} spv_ext_inst_group_t;
-
-typedef struct spv_opcode_table_t {
- const uint32_t count;
- const spv_opcode_desc_t* entries;
-} spv_opcode_table_t;
-
-typedef struct spv_operand_table_t {
- const uint32_t count;
- const spv_operand_desc_group_t* types;
-} spv_operand_table_t;
-
-typedef struct spv_ext_inst_table_t {
- const uint32_t count;
- const spv_ext_inst_group_t* groups;
-} spv_ext_inst_table_t;
-
-typedef const spv_opcode_desc_t* spv_opcode_desc;
-typedef const spv_operand_desc_t* spv_operand_desc;
-typedef const spv_ext_inst_desc_t* spv_ext_inst_desc;
-
-typedef const spv_opcode_table_t* spv_opcode_table;
-typedef const spv_operand_table_t* spv_operand_table;
-typedef const spv_ext_inst_table_t* spv_ext_inst_table;
+// NOTE: Instruction and operand tables have moved to table2.{h|cpp},
+// where they are represented more compactly.
struct spv_context_t {
const spv_target_env target_env;
- const spv_opcode_table opcode_table;
- const spv_operand_table operand_table;
- const spv_ext_inst_table ext_inst_table;
spvtools::MessageConsumer consumer;
};
@@ -121,13 +35,4 @@
void SetContextMessageConsumer(spv_context context, MessageConsumer consumer);
} // namespace spvtools
-// Populates *table with entries for env.
-spv_result_t spvOpcodeTableGet(spv_opcode_table* table, spv_target_env env);
-
-// Populates *table with entries for env.
-spv_result_t spvOperandTableGet(spv_operand_table* table, spv_target_env env);
-
-// Populates *table with entries for env.
-spv_result_t spvExtInstTableGet(spv_ext_inst_table* table, spv_target_env env);
-
#endif // SOURCE_TABLE_H_
diff --git a/third_party/SPIRV-Tools/source/table2.cpp b/third_party/SPIRV-Tools/source/table2.cpp
new file mode 100644
index 0000000..4559d77
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/table2.cpp
@@ -0,0 +1,375 @@
+// Copyright (c) 2025 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.
+
+// Compressed grammar tables.
+
+#include "source/table2.h"
+
+#include <algorithm>
+#include <array>
+#include <cstring>
+
+#include "source/extensions.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/spirv_constant.h"
+#include "source/spirv_target_env.h"
+#include "spirv-tools/libspirv.hpp"
+
+namespace spvtools {
+namespace {
+
+// This is used in the source for the generated tables.
+constexpr inline IndexRange IR(uint32_t first, uint32_t count) {
+ return IndexRange{first, count};
+}
+
+struct NameIndex {
+ // Location of the null-terminated name in the global string table kStrings.
+ IndexRange name;
+ // Index of this name's entry in the corresponding by-value table.
+ uint32_t index;
+};
+
+struct NameValue {
+ // Location of the null-terminated name in the global string table kStrings.
+ IndexRange name;
+ // Enum value in the binary format.
+ uint32_t value;
+};
+
+// The generated include file contains variables:
+//
+// std::array<NameIndex,...> kOperandNames:
+// Operand names and index, ordered by (operand kind, name)
+// The index part is the named entry's index in kOperandsByValue array.
+// Aliases are included as their own entries.
+//
+// std::array<OperandDesc, ...> kOperandsByValue:
+// Operand descriptions, ordered by (operand kind, operand enum value).
+//
+// std::array<NameIndex,...> kInstructionNames:
+// Instruction names and index, ordered by (name, value)
+// The index part is the named entry's index in kInstructionDesc array.
+// Aliases are included as their own entries.
+//
+// std::array<InstructionDesc, ...> kInstructionDesc
+// Instruction descriptions, ordered by opcode.
+//
+// const char kStrings[]
+// Array of characters, referenced by IndexRanges elsewhere.
+// Each IndexRange denotes a string.
+//
+// const IndexRange kAliasSpans[]
+// Array of IndexRanges, where each represents a string by referencing
+// the kStrings table.
+// This array contains all sequences of alias strings used in the grammar.
+// This table is referenced by an IndexRange elsewhere, i.e. by the
+// 'aliases' field of an instruction or operand description.
+//
+// const spv::Capability kCapabilitySpans[]
+// Array of capabilities, referenced by IndexRanges elsewhere.
+// Contains all sequences of capabilities used in the grammar.
+//
+// const spvtools::Extension kExtensionSpans[] = {
+// Array of extensions, referenced by IndexRanges elsewhere.
+// Contains all sequences of extensions used in the grammar.
+//
+// const spv_operand_type_t kOperandSpans[] = {
+// Array of operand types, referenced by IndexRanges elsewhere.
+// Contains all sequences of operand types used in the grammar.
+
+// Maps an operand kind to NameValue entries for that kind.
+// The result is an IndexRange into kOperandNames, and are sorted
+// by string name within that span.
+IndexRange OperandNameRangeForKind(spv_operand_type_t type);
+
+// Maps an operand kind to possible operands for that kind.
+// The result is an IndexRange into kOperandsByValue, and the operands
+// are sorted by value within that span.
+IndexRange OperandByValueRangeForKind(spv_operand_type_t type);
+
+// Maps an extended instruction set kind to NameValue entries for that kind.
+// The result is an IndexRange into kExtIntNames, and are sorted
+// by string name within that span.
+IndexRange ExtInstNameRangeForKind(spv_ext_inst_type_t type);
+
+// Maps an extended instruction set kind to possible operands for that kind.
+// The result is an IndexRange into kExtInstByValue, and the instructions
+// are sorted by opcode value within that span.
+IndexRange ExtInstByValueRangeForKind(spv_ext_inst_type_t type);
+
+// Returns the name of an extension, as an index into kStrings
+IndexRange ExtensionToIndexRange(Extension extension);
+
+#include "core_tables_body.inc"
+
+// Returns a pointer to the null-terminated C-style string in the global
+// strings table, as referenced by 'ir'. Assumes the given range is valid.
+const char* getChars(IndexRange ir) {
+ assert(ir.first() < sizeof(kStrings));
+ return ir.apply(kStrings).data();
+}
+
+} // anonymous namespace
+
+utils::Span<const spv_operand_type_t> OperandDesc::operands() const {
+ return operands_range.apply(kOperandSpans);
+}
+utils::Span<const char> OperandDesc::name() const {
+ return name_range.apply(kStrings);
+}
+utils::Span<const IndexRange> OperandDesc::aliases() const {
+ return name_range.apply(kAliasSpans);
+}
+utils::Span<const spv::Capability> OperandDesc::capabilities() const {
+ return capabilities_range.apply(kCapabilitySpans);
+}
+utils::Span<const spvtools::Extension> OperandDesc::extensions() const {
+ return extensions_range.apply(kExtensionSpans);
+}
+
+utils::Span<const spv_operand_type_t> InstructionDesc::operands() const {
+ return operands_range.apply(kOperandSpans);
+}
+utils::Span<const char> InstructionDesc::name() const {
+ return name_range.apply(kStrings);
+}
+utils::Span<const IndexRange> InstructionDesc::aliases() const {
+ return name_range.apply(kAliasSpans);
+}
+utils::Span<const spv::Capability> InstructionDesc::capabilities() const {
+ return capabilities_range.apply(kCapabilitySpans);
+}
+utils::Span<const spvtools::Extension> InstructionDesc::extensions() const {
+ return extensions_range.apply(kExtensionSpans);
+}
+
+utils::Span<const spv_operand_type_t> ExtInstDesc::operands() const {
+ return operands_range.apply(kOperandSpans);
+}
+utils::Span<const char> ExtInstDesc::name() const {
+ return name_range.apply(kStrings);
+}
+utils::Span<const spv::Capability> ExtInstDesc::capabilities() const {
+ return capabilities_range.apply(kCapabilitySpans);
+}
+
+spv_result_t LookupOpcode(spv::Op opcode, const InstructionDesc** desc) {
+ // Metaphor: Look for the needle in the haystack.
+ const InstructionDesc needle(opcode);
+ auto where = std::lower_bound(
+ kInstructionDesc.begin(), kInstructionDesc.end(), needle,
+ [&](const InstructionDesc& lhs, const InstructionDesc& rhs) {
+ return uint32_t(lhs.opcode) < uint32_t(rhs.opcode);
+ });
+ if (where != kInstructionDesc.end() && where->opcode == opcode) {
+ *desc = &*where;
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+
+spv_result_t LookupOpcode(const char* name, const InstructionDesc** desc) {
+ // The comparison function knows to use 'name' string to compare against
+ // when the value is kSentinel.
+ const auto kSentinel = uint32_t(-1);
+ const NameIndex needle{{}, kSentinel};
+ auto less = [&](const NameIndex& lhs, const NameIndex& rhs) {
+ const char* lhs_chars = lhs.index == kSentinel ? name : getChars(lhs.name);
+ const char* rhs_chars = rhs.index == kSentinel ? name : getChars(rhs.name);
+ return std::strcmp(lhs_chars, rhs_chars) < 0;
+ };
+
+ auto where = std::lower_bound(kInstructionNames.begin(),
+ kInstructionNames.end(), needle, less);
+ if (where != kInstructionNames.end() &&
+ std::strcmp(getChars(where->name), name) == 0) {
+ *desc = &kInstructionDesc[where->index];
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+
+namespace {
+template <typename KEY_TYPE>
+spv_result_t LookupOpcodeForEnvInternal(spv_target_env env, KEY_TYPE key,
+ const InstructionDesc** desc) {
+ const InstructionDesc* desc_proxy;
+ auto status = LookupOpcode(key, &desc_proxy);
+ if (status != SPV_SUCCESS) {
+ return status;
+ }
+ const auto& entry = *desc_proxy;
+ const auto version = spvVersionForTargetEnv(env);
+ if ((version >= entry.minVersion && version <= entry.lastVersion) ||
+ entry.extensions_range.count() > 0 ||
+ entry.capabilities_range.count() > 0) {
+ *desc = desc_proxy;
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+} // namespace
+
+spv_result_t LookupOpcodeForEnv(spv_target_env env, const char* name,
+ const InstructionDesc** desc) {
+ return LookupOpcodeForEnvInternal(env, name, desc);
+}
+
+spv_result_t LookupOpcodeForEnv(spv_target_env env, spv::Op opcode,
+ const InstructionDesc** desc) {
+ return LookupOpcodeForEnvInternal(env, opcode, desc);
+}
+
+spv_result_t LookupOperand(spv_operand_type_t type, uint32_t value,
+ const OperandDesc** desc) {
+ auto ir = OperandByValueRangeForKind(type);
+ if (ir.empty()) {
+ return SPV_ERROR_INVALID_LOOKUP;
+ }
+
+ auto span = ir.apply(kOperandsByValue.data());
+
+ // Metaphor: Look for the needle in the haystack.
+ // The operand value is the first member.
+ const OperandDesc needle{value};
+ auto where =
+ std::lower_bound(span.begin(), span.end(), needle,
+ [&](const OperandDesc& lhs, const OperandDesc& rhs) {
+ return lhs.value < rhs.value;
+ });
+ if (where != span.end() && where->value == value) {
+ *desc = &*where;
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+
+spv_result_t LookupOperand(spv_operand_type_t type, const char* name,
+ size_t name_len, const OperandDesc** desc) {
+ auto ir = OperandNameRangeForKind(type);
+ if (ir.empty()) {
+ return SPV_ERROR_INVALID_LOOKUP;
+ }
+
+ auto span = ir.apply(kOperandNames.data());
+
+ // The comparison function knows to use (name, name_len) as the
+ // string to compare against when the value is kSentinel.
+ const auto kSentinel = uint32_t(-1);
+ const NameIndex needle{{}, kSentinel};
+ // The strings in the global string table are null-terminated, and the count
+ // reflects that. So always deduct 1 from its length.
+ auto less = [&](const NameIndex& lhs, const NameIndex& rhs) {
+ const char* lhs_chars = lhs.index == kSentinel ? name : getChars(lhs.name);
+ const char* rhs_chars = rhs.index == kSentinel ? name : getChars(rhs.name);
+ const auto content_cmp = std::strncmp(lhs_chars, rhs_chars, name_len);
+ if (content_cmp != 0) {
+ return content_cmp < 0;
+ }
+ const auto lhs_len =
+ lhs.index == kSentinel ? name_len : lhs.name.count() - 1;
+ const auto rhs_len =
+ rhs.index == kSentinel ? name_len : rhs.name.count() - 1;
+ return lhs_len < rhs_len;
+ };
+
+ auto where = std::lower_bound(span.begin(), span.end(), needle, less);
+ if (where != span.end() && where->name.count() - 1 == name_len &&
+ std::strncmp(getChars(where->name), name, name_len) == 0) {
+ *desc = &kOperandsByValue[where->index];
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+
+spv_result_t LookupExtInst(spv_ext_inst_type_t type, const char* name,
+ const ExtInstDesc** desc) {
+ auto ir = ExtInstNameRangeForKind(type);
+ if (ir.empty()) {
+ return SPV_ERROR_INVALID_LOOKUP;
+ }
+
+ auto span = ir.apply(kExtInstNames.data());
+
+ // The comparison function knows to use 'name' string to compare against
+ // when the value is kSentinel.
+ const auto kSentinel = uint32_t(-1);
+ const NameIndex needle{{}, kSentinel};
+ auto less = [&](const NameIndex& lhs, const NameIndex& rhs) {
+ const char* lhs_chars = lhs.index == kSentinel ? name : getChars(lhs.name);
+ const char* rhs_chars = rhs.index == kSentinel ? name : getChars(rhs.name);
+ return std::strcmp(lhs_chars, rhs_chars) < 0;
+ };
+
+ auto where = std::lower_bound(span.begin(), span.end(), needle, less);
+ if (where != span.end() && std::strcmp(getChars(where->name), name) == 0) {
+ *desc = &kExtInstByValue[where->index];
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+
+// Finds the extended instruction description by opcode value.
+// On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupExtInst(spv_ext_inst_type_t type, uint32_t value,
+ const ExtInstDesc** desc) {
+ auto ir = ExtInstByValueRangeForKind(type);
+ if (ir.empty()) {
+ return SPV_ERROR_INVALID_LOOKUP;
+ }
+
+ auto span = ir.apply(kExtInstByValue.data());
+
+ // Metaphor: Look for the needle in the haystack.
+ // The operand value is the first member.
+ const ExtInstDesc needle(value);
+ auto where =
+ std::lower_bound(span.begin(), span.end(), needle,
+ [&](const ExtInstDesc& lhs, const ExtInstDesc& rhs) {
+ return lhs.value < rhs.value;
+ });
+ if (where != span.end() && where->value == value) {
+ *desc = &*where;
+ return SPV_SUCCESS;
+ }
+ return SPV_ERROR_INVALID_LOOKUP;
+}
+
+const char* ExtensionToString(Extension extension) {
+ return getChars(ExtensionToIndexRange(extension));
+}
+
+bool GetExtensionFromString(const char* name, Extension* extension) {
+ // The comparison function knows to use 'name' string to compare against
+ // when the value is kSentinel.
+ const auto kSentinel = uint32_t(-1);
+ const NameValue needle{{}, kSentinel};
+ auto less = [&](const NameValue& lhs, const NameValue& rhs) {
+ const char* lhs_chars = lhs.value == kSentinel ? name : getChars(lhs.name);
+ const char* rhs_chars = rhs.value == kSentinel ? name : getChars(rhs.name);
+ return std::strcmp(lhs_chars, rhs_chars) < 0;
+ };
+
+ auto where = std::lower_bound(kExtensionNames.begin(), kExtensionNames.end(),
+ needle, less);
+ if (where != kExtensionNames.end() &&
+ std::strcmp(getChars(where->name), name) == 0) {
+ *extension = static_cast<Extension>(where->value);
+ return true;
+ }
+ return false;
+}
+
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/table2.h b/third_party/SPIRV-Tools/source/table2.h
new file mode 100644
index 0000000..e3731c4
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/table2.h
@@ -0,0 +1,260 @@
+// Copyright (c) 2025 The Khronos Group Inc.
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_TABLE2_H_
+#define SOURCE_TABLE2_H_
+
+#include "source/latest_version_spirv_header.h"
+#include "source/util/index_range.h"
+#include "spirv-tools/libspirv.hpp"
+
+// Define the objects that describe the grammatical structure of SPIR-V
+// instructions and their operands. The objects are owned by static
+// tables populated at C++ build time from the grammar files from SPIRV-Headers.
+//
+// Clients use freestanding methods to lookup an opcode or an operand, either
+// by numeric value (in the binary), or by name.
+//
+// For historical reasons, the opcode lookup can also use a target enviroment
+// enum to filter for opcodes supported in that environment.
+//
+// It should be very fast for the system loader to load (and possibly relocate)
+// the static tables. In particular, there should be very few global symbols
+// with independent addresses. Prefer a very few large tables of items rather
+// than dozens or hundreds of global symbols.
+//
+// The overall structure among containers (i.e. skipping scalar data members)
+// is as follows:
+//
+// An OperandDesc describes an operand.
+// An InstructionDesc desribes an instruction.
+// An ExtInstDesc describes an extended intruction.
+//
+// Both OperandDesc and InstructionDesc have members:
+// - a name string
+// - array of alias strings
+// - array of spv::Capability (as an enum)
+// - array of spv_operand_type_t (as an enum)
+// - array of spvtools::Extension (as an enum)
+// - a minVersion
+// - a lastVersion
+//
+// An OperandDesc also has:
+// - a uint32_t value.
+//
+// An InstructionDesc also has:
+// - a spv::Op opcode
+// - a bool hasResult
+// - a bool hasType
+// - a printing class
+//
+// An ExtInstDesc has:
+// - a name
+// - array of spv::Capability (as an enum)
+// - array of spv_operand_type_t (as an enum)
+//
+// The arrays are represented by spans into a global static array, with one
+// array for each of:
+// - null-terminated strings, for names
+// - arrays of null-terminated strings, for alias lists
+// - spv_operand_type_t
+// - spv::Capability
+// - spvtools::Extension
+//
+// Note: Currently alias lists never have more than one element.
+// The data structures and code do not assume this.
+
+// TODO(dneto): convert the tables for extended instructions
+// Currently (as defined in table.h):
+// An spv_ext_inst_group_t has:
+// - array of spv_ext_inst_desc_t
+//
+// An spv_ext_inst_desc_t has:
+// - a name string
+// - array of spv::Capability
+// - array of spv_operand_type_t
+
+namespace spvtools {
+
+#include "core_tables_header.inc"
+
+using IndexRange = utils::IndexRange<uint32_t, uint32_t>;
+
+// Describes a SPIR-V operand.
+struct OperandDesc {
+ const uint32_t value;
+
+ const IndexRange operands_range; // Indexes kOperandSpans
+ const IndexRange name_range; // Indexes kStrings
+ const IndexRange aliases_range; // Indexes kAliasSpans
+ const IndexRange capabilities_range; // Indexes kCapabilitySpans
+ // A set of extensions that enable this feature. If empty then this operand
+ // value is in core and its availability is subject to minVersion. The
+ // assembler, binary parser, and disassembler ignore this rule, so you can
+ // freely process invalid modules.
+ const IndexRange extensions_range; // Indexes kExtensionSpans
+ // Minimal core SPIR-V version required for this feature, if without
+ // extensions. ~0u means reserved for future use. ~0u and non-empty
+ // extension lists means only available in extensions.
+ const uint32_t minVersion = 0xFFFFFFFFu;
+ const uint32_t lastVersion = 0xFFFFFFFFu;
+ utils::Span<const spv_operand_type_t> operands() const;
+ utils::Span<const char> name() const;
+ utils::Span<const IndexRange> aliases() const;
+ utils::Span<const spv::Capability> capabilities() const;
+ utils::Span<const spvtools::Extension> extensions() const;
+
+ constexpr OperandDesc(uint32_t v, IndexRange o, IndexRange n, IndexRange a,
+ IndexRange c, IndexRange e, uint32_t mv, uint32_t lv)
+ : value(v),
+ operands_range(o),
+ name_range(n),
+ aliases_range(a),
+ capabilities_range(c),
+ extensions_range(e),
+ minVersion(mv),
+ lastVersion(lv) {}
+
+ constexpr OperandDesc(uint32_t v) : value(v) {}
+
+ OperandDesc(const OperandDesc&) = delete;
+ OperandDesc(OperandDesc&&) = delete;
+};
+
+// Describes an Instruction
+struct InstructionDesc {
+ const spv::Op opcode;
+ const bool hasResult = false;
+ const bool hasType = false;
+
+ const IndexRange operands_range; // Indexes kOperandSpans
+ const IndexRange name_range; // Indexes kStrings
+ const IndexRange aliases_range; // Indexes kAliasSpans
+ const IndexRange capabilities_range; // Indexes kCapbilitySpans
+ // A set of extensions that enable this feature. If empty then this operand
+ // value is in core and its availability is subject to minVersion. The
+ // assembler, binary parser, and disassembler ignore this rule, so you can
+ // freely process invalid modules.
+ const IndexRange extensions_range; // Indexes kExtensionSpans
+ // Minimal core SPIR-V version required for this feature, if without
+ // extensions. ~0u means reserved for future use. ~0u and non-empty
+ // extension lists means only available in extensions.
+ const uint32_t minVersion = 0xFFFFFFFFu;
+ const uint32_t lastVersion = 0xFFFFFFFFu;
+ // The printing class specifies what kind of instruction it is, e.g. what
+ // section of the SPIR-V spec. E.g. kImage, kComposite
+ const PrintingClass printingClass = PrintingClass::kReserved;
+ // Returns the span of elements in the global grammar tables corresponding
+ // to the privately-stored index ranges
+ utils::Span<const spv_operand_type_t> operands() const;
+ utils::Span<const char> name() const;
+ utils::Span<const IndexRange> aliases() const;
+ utils::Span<const spv::Capability> capabilities() const;
+ utils::Span<const spvtools::Extension> extensions() const;
+
+ constexpr InstructionDesc(spv::Op oc, bool hr, bool ht, IndexRange o,
+ IndexRange n, IndexRange a, IndexRange c,
+ IndexRange e, uint32_t mv, uint32_t lv,
+ PrintingClass pc)
+ : opcode(oc),
+ hasResult(hr),
+ hasType(ht),
+ operands_range(o),
+ name_range(n),
+ aliases_range(a),
+ capabilities_range(c),
+ extensions_range(e),
+ minVersion(mv),
+ lastVersion(lv),
+ printingClass(pc) {}
+
+ constexpr InstructionDesc(spv::Op oc) : opcode(oc) {}
+
+ InstructionDesc(const InstructionDesc&) = delete;
+ InstructionDesc(InstructionDesc&&) = delete;
+};
+
+// Describes an extended instruction
+struct ExtInstDesc {
+ const uint32_t value;
+ const IndexRange operands_range; // Indexes kOperandSpans
+ const IndexRange name_range; // Indexes kStrings
+ const IndexRange capabilities_range; // Indexes kCapbilitySpans
+ // Returns the span of elements in the global grammar tables corresponding
+ // to the privately-stored index ranges
+ utils::Span<const spv_operand_type_t> operands() const;
+ utils::Span<const char> name() const;
+ utils::Span<const spv::Capability> capabilities() const;
+
+ constexpr ExtInstDesc(uint32_t v, IndexRange o, IndexRange n, IndexRange c)
+ : value(v), operands_range(o), name_range(n), capabilities_range(c) {}
+
+ constexpr ExtInstDesc(uint32_t v) : value(v) {}
+
+ ExtInstDesc(const ExtInstDesc&) = delete;
+ ExtInstDesc(ExtInstDesc&&) = delete;
+};
+
+// Finds the instruction description by opcode name. The name should not
+// have the "Op" prefix. On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupOpcode(const char* name, const InstructionDesc** desc);
+// Finds the instruction description by opcode value.
+// On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupOpcode(spv::Op opcode, const InstructionDesc** desc);
+
+// Finds the instruction description by opcode name, without the "Op" prefix.
+// A lookup will succeed if:
+// - The instruction exists, and
+// - Either the target environment supports the SPIR-V version of the
+// instruction,
+// or the instruction is enabled by at least one extension,
+// or the instruction is enabled by at least one capability.,
+// On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupOpcodeForEnv(spv_target_env env, const char* name,
+ const InstructionDesc** desc);
+
+// Finds the instruction description by opcode value.
+// A lookup will succeed if:
+// - The instruction exists, and
+// - Either the target environment supports the SPIR-V version of the
+// instruction,
+// or the instruction is enabled by at least one extension,
+// or the instruction is enabled by at least one capability.,
+// On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupOpcodeForEnv(spv_target_env env, spv::Op,
+ const InstructionDesc** desc);
+
+spv_result_t LookupOperand(spv_operand_type_t type, const char* name,
+ size_t name_len, const OperandDesc** desc);
+spv_result_t LookupOperand(spv_operand_type_t type, uint32_t operand,
+ const OperandDesc** desc);
+
+// Finds the extended instruction description by opcode name.
+// On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupExtInst(spv_ext_inst_type_t type, const char* name,
+ const ExtInstDesc** desc);
+// Finds the extended instruction description by opcode value.
+// On success, returns SPV_SUCCESS and updates *desc.
+spv_result_t LookupExtInst(spv_ext_inst_type_t type, uint32_t value,
+ const ExtInstDesc** desc);
+
+// Finds Extension enum corresponding to |str|. Returns false if not found.
+bool GetExtensionFromString(const char* str, Extension* extension);
+
+// Returns text string corresponding to |extension|.
+const char* ExtensionToString(Extension extension);
+
+} // namespace spvtools
+#endif // SOURCE_TABLE2_H_
diff --git a/third_party/SPIRV-Tools/source/text.cpp b/third_party/SPIRV-Tools/source/text.cpp
index 263bacd..b91ae2a 100644
--- a/third_party/SPIRV-Tools/source/text.cpp
+++ b/third_party/SPIRV-Tools/source/text.cpp
@@ -38,6 +38,7 @@
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/table.h"
+#include "source/table2.h"
#include "source/text_handler.h"
#include "source/util/bitutils.h"
#include "source/util/parse_number.h"
@@ -201,7 +202,7 @@
}
// Optional literal operands can fail to parse. In that case use
- // SPV_FAILED_MATCH to avoid emitting a diagostic. Use the following
+ // SPV_FAILED_MATCH to avoid emitting a diagnostic. Use the following
// for those situations.
spv_result_t error_code_for_literals =
spvOperandIsOptional(type) ? SPV_FAILED_MATCH : SPV_ERROR_INVALID_TEXT;
@@ -227,8 +228,7 @@
// Set the extended instruction type.
// The import set id is the 3rd operand of OpExtInst.
- if (spv::Op(pInst->opcode) == spv::Op::OpExtInst &&
- pInst->words.size() == 4) {
+ if (spvIsExtendedInstruction(pInst->opcode) && pInst->words.size() == 4) {
auto ext_inst_type = context->getExtInstTypeForId(pInst->words[3]);
if (ext_inst_type == SPV_EXT_INST_TYPE_NONE) {
return context->diagnostic()
@@ -242,14 +242,14 @@
case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: {
// The assembler accepts the symbolic name for an extended instruction,
// and emits its corresponding number.
- spv_ext_inst_desc extInst;
- if (grammar.lookupExtInst(pInst->extInstType, textValue, &extInst) ==
+ const spvtools::ExtInstDesc* desc = nullptr;
+ if (spvtools::LookupExtInst(pInst->extInstType, textValue, &desc) ==
SPV_SUCCESS) {
// if we know about this extended instruction, push the numeric value
- spvInstructionAddWord(pInst, extInst->ext_inst);
+ spvInstructionAddWord(pInst, desc->value);
// Prepare to parse the operands for the extended instructions.
- spvPushOperandTypes(extInst->operandTypes, pExpectedOperands);
+ spvPushOperandTypes(desc->operands(), pExpectedOperands);
} else {
// if we don't know this extended instruction and the set isn't
// non-semantic, we cannot process further
@@ -285,8 +285,8 @@
return context->diagnostic() << "Invalid " << spvOperandTypeStr(type)
<< " '" << textValue << "'.";
}
- spv_opcode_desc opcodeEntry = nullptr;
- if (grammar.lookupOpcode(opcode, &opcodeEntry)) {
+ const spvtools::InstructionDesc* opcodeEntry = nullptr;
+ if (LookupOpcodeForEnv(grammar.target_env(), opcode, &opcodeEntry)) {
return context->diagnostic(SPV_ERROR_INTERNAL)
<< "OpSpecConstant opcode table out of sync";
}
@@ -296,8 +296,9 @@
// type Id and result Id, since they've already been processed.
assert(opcodeEntry->hasType);
assert(opcodeEntry->hasResult);
- assert(opcodeEntry->numTypes >= 2);
- spvPushOperandTypes(opcodeEntry->operandTypes + 2, pExpectedOperands);
+ assert(opcodeEntry->operands().size() >= 2);
+ spvPushOperandTypes(opcodeEntry->operands().subspan(2),
+ pExpectedOperands);
} break;
case SPV_OPERAND_TYPE_LITERAL_INTEGER:
@@ -347,10 +348,11 @@
context->getTypeOfTypeGeneratingValue(pInst->resultTypeId);
if (!spvtools::isScalarFloating(expected_type) &&
!spvtools::isScalarIntegral(expected_type)) {
- spv_opcode_desc d;
+ const spvtools::InstructionDesc* opcodeEntry = nullptr;
const char* opcode_name = "opcode";
- if (SPV_SUCCESS == grammar.lookupOpcode(pInst->opcode, &d)) {
- opcode_name = d->name;
+ if (SPV_SUCCESS == LookupOpcode(pInst->opcode, &opcodeEntry)) {
+ opcode_name =
+ opcodeEntry->name().data(); // assumes it's null-terminated
}
return context->diagnostic()
<< "Type for " << opcode_name
@@ -410,12 +412,17 @@
case SPV_OPERAND_TYPE_LOOP_CONTROL:
case SPV_OPERAND_TYPE_IMAGE:
case SPV_OPERAND_TYPE_OPTIONAL_IMAGE:
+ case SPV_OPERAND_TYPE_TENSOR_OPERANDS:
+ case SPV_OPERAND_TYPE_OPTIONAL_TENSOR_OPERANDS:
case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS:
case SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS:
case SPV_OPERAND_TYPE_SELECTION_CONTROL:
case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
- case SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS: {
+ case SPV_OPERAND_TYPE_OPTIONAL_COOPERATIVE_MATRIX_OPERANDS:
+ case SPV_OPERAND_TYPE_TENSOR_ADDRESSING_OPERANDS:
+ case SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_REDUCE:
+ case SPV_OPERAND_TYPE_OPTIONAL_MATRIX_MULTIPLY_ACCUMULATE_OPERANDS: {
uint32_t value;
if (auto error = grammar.parseMaskOperand(type, textValue, &value)) {
return context->diagnostic(error)
@@ -453,8 +460,8 @@
default: {
// NOTE: All non literal operands are handled here using the operand
// table.
- spv_operand_desc entry;
- if (grammar.lookupOperand(type, textValue, strlen(textValue), &entry)) {
+ const spvtools::OperandDesc* entry = nullptr;
+ if (spvtools::LookupOperand(type, textValue, strlen(textValue), &entry)) {
return context->diagnostic() << "Invalid " << spvOperandTypeStr(type)
<< " '" << textValue << "'.";
}
@@ -464,7 +471,7 @@
}
// Prepare to parse the operands for this logical operand.
- spvPushOperandTypes(entry->operandTypes, pExpectedOperands);
+ spvPushOperandTypes(entry->operands(), pExpectedOperands);
} break;
}
return SPV_SUCCESS;
@@ -501,7 +508,7 @@
if (operandValue == "=")
return context->diagnostic() << firstWord << " not allowed before =.";
- // Needed to pass to spvTextEncodeOpcode(), but it shouldn't ever be
+ // Needed to pass to spvTextEncodeOperand(), but it shouldn't ever be
// expanded.
spv_operand_pattern_t dummyExpectedOperands;
error = spvTextEncodeOperand(
@@ -513,6 +520,124 @@
return SPV_SUCCESS;
}
+/// @brief Translate an instruction started by OpUnknown and the following
+/// operands to binary form
+///
+/// @param[in] grammar the grammar to use for compilation
+/// @param[in, out] context the dynamic compilation info
+/// @param[out] pInst returned binary Opcode
+///
+/// @return result code
+spv_result_t encodeInstructionStartingWithOpUnknown(
+ const spvtools::AssemblyGrammar& grammar,
+ spvtools::AssemblyContext* context, spv_instruction_t* pInst) {
+ spv_position_t nextPosition = {};
+
+ uint16_t opcode;
+ uint16_t wordCount;
+
+ // The '(' character.
+ if (context->advance())
+ return context->diagnostic() << "Expected '(', found end of stream.";
+ if ('(' != context->peek()) {
+ return context->diagnostic() << "'(' expected after OpUnknown but found '"
+ << context->peek() << "'.";
+ }
+ context->seekForward(1);
+
+ // The opcode enumerant.
+ if (context->advance())
+ return context->diagnostic()
+ << "Expected opcode enumerant, found end of stream.";
+ std::string opcodeString;
+ spv_result_t error = context->getWord(&opcodeString, &nextPosition);
+ if (error) return context->diagnostic(error) << "Internal Error";
+
+ if (!spvtools::utils::ParseNumber(opcodeString.c_str(), &opcode)) {
+ return context->diagnostic()
+ << "Invalid opcode enumerant: \"" << opcodeString << "\".";
+ }
+
+ context->setPosition(nextPosition);
+
+ // The ',' character.
+ if (context->advance())
+ return context->diagnostic() << "Expected ',', found end of stream.";
+ if (',' != context->peek()) {
+ return context->diagnostic()
+ << "',' expected after opcode enumerant but found '"
+ << context->peek() << "'.";
+ }
+ context->seekForward(1);
+
+ // The number of words.
+ if (context->advance())
+ return context->diagnostic()
+ << "Expected number of words, found end of stream.";
+ std::string wordCountString;
+ error = context->getWord(&wordCountString, &nextPosition);
+ if (error) return context->diagnostic(error) << "Internal Error";
+
+ if (!spvtools::utils::ParseNumber(wordCountString.c_str(), &wordCount)) {
+ return context->diagnostic()
+ << "Invalid number of words: \"" << wordCountString << "\".";
+ }
+
+ if (wordCount == 0) {
+ return context->diagnostic() << "Number of words (which includes the "
+ "opcode) must be greater than zero.";
+ }
+
+ context->setPosition(nextPosition);
+
+ // The ')' character.
+ if (context->advance())
+ return context->diagnostic() << "Expected ')', found end of stream.";
+ if (')' != context->peek()) {
+ return context->diagnostic()
+ << "')' expected after number of words but found '"
+ << context->peek() << "'.";
+ }
+ context->seekForward(1);
+
+ pInst->opcode = static_cast<spv::Op>(opcode);
+ context->binaryEncodeU32(spvOpcodeMake(wordCount, pInst->opcode), pInst);
+
+ wordCount--; // Subtract the opcode from the number of words left to read.
+
+ while (wordCount-- > 0) {
+ if (context->advance() == SPV_END_OF_STREAM) {
+ return context->diagnostic() << "Expected " << wordCount + 1
+ << " more operands, found end of stream.";
+ }
+ if (context->isStartOfNewInst()) {
+ std::string invalid;
+ context->getWord(&invalid, &nextPosition);
+ return context->diagnostic()
+ << "Unexpected start of new instruction: \"" << invalid
+ << "\". Expected " << wordCount + 1 << " more operands";
+ }
+
+ std::string operandValue;
+ if ((error = context->getWord(&operandValue, &nextPosition)))
+ return context->diagnostic(error) << "Internal Error";
+
+ if (operandValue == "=")
+ return context->diagnostic() << "OpUnknown not allowed before =.";
+
+ // Needed to pass to spvTextEncodeOperand(), but it shouldn't ever be
+ // expanded.
+ spv_operand_pattern_t dummyExpectedOperands;
+ error = spvTextEncodeOperand(
+ grammar, context, SPV_OPERAND_TYPE_OPTIONAL_CIV, operandValue.c_str(),
+ pInst, &dummyExpectedOperands);
+ if (error) return error;
+ context->setPosition(nextPosition);
+ }
+
+ return SPV_SUCCESS;
+}
+
/// @brief Translate single Opcode and operands to binary form
///
/// @param[in] grammar the grammar to use for compilation
@@ -572,11 +697,21 @@
}
}
+ if (opcodeName == "OpUnknown") {
+ if (!result_id.empty()) {
+ return context->diagnostic()
+ << "OpUnknown not allowed in assignment. Use an explicit result "
+ "id operand instead.";
+ }
+ context->setPosition(nextPosition);
+ return encodeInstructionStartingWithOpUnknown(grammar, context, pInst);
+ }
+
// NOTE: The table contains Opcode names without the "Op" prefix.
const char* pInstName = opcodeName.data() + 2;
- spv_opcode_desc opcodeEntry;
- error = grammar.lookupOpcode(pInstName, &opcodeEntry);
+ const spvtools::InstructionDesc* opcodeEntry = nullptr;
+ error = LookupOpcodeForEnv(grammar.target_env(), pInstName, &opcodeEntry);
if (error) {
return context->diagnostic(error)
<< "Invalid Opcode name '" << opcodeName << "'";
@@ -604,10 +739,15 @@
// ExecutionMode), or for extended instructions that may have their
// own operands depending on the selected extended instruction.
spv_operand_pattern_t expectedOperands;
- expectedOperands.reserve(opcodeEntry->numTypes);
- for (auto i = 0; i < opcodeEntry->numTypes; i++)
- expectedOperands.push_back(
- opcodeEntry->operandTypes[opcodeEntry->numTypes - i - 1]);
+ {
+ const auto operands = opcodeEntry->operands();
+ const auto n = operands.size();
+ expectedOperands.reserve(n);
+ for (auto i = 0u; i < n; i++) {
+ auto ty = operands[n - i - 1];
+ expectedOperands.push_back(ty);
+ }
+ }
while (!expectedOperands.empty()) {
const spv_operand_type_t type = expectedOperands.back();
@@ -723,10 +863,6 @@
if (!text->str) return context.diagnostic() << "Missing assembly text.";
- if (!grammar.isValid()) {
- return SPV_ERROR_INVALID_TABLE;
- }
-
// Skip past whitespace and comments.
context.advance();
@@ -772,10 +908,6 @@
spvtools::AssemblyContext context(text, consumer, std::move(ids_to_preserve));
if (!text->str) return context.diagnostic() << "Missing assembly text.";
-
- if (!grammar.isValid()) {
- return SPV_ERROR_INVALID_TABLE;
- }
if (!pBinary) return SPV_ERROR_INVALID_POINTER;
std::vector<spv_instruction_t> instructions;
diff --git a/third_party/SPIRV-Tools/source/text_handler.cpp b/third_party/SPIRV-Tools/source/text_handler.cpp
index 35c4b83..df0cc39 100644
--- a/third_party/SPIRV-Tools/source/text_handler.cpp
+++ b/third_party/SPIRV-Tools/source/text_handler.cpp
@@ -118,6 +118,9 @@
break;
case ' ':
case ';':
+ case ',':
+ case '(':
+ case ')':
case '\t':
case '\n':
case '\r':
@@ -251,13 +254,13 @@
<< "Unexpected numeric literal type";
case IdTypeClass::kScalarIntegerType:
if (type.isSigned) {
- number_type = {type.bitwidth, SPV_NUMBER_SIGNED_INT};
+ number_type = {type.bitwidth, SPV_NUMBER_SIGNED_INT, type.encoding};
} else {
- number_type = {type.bitwidth, SPV_NUMBER_UNSIGNED_INT};
+ number_type = {type.bitwidth, SPV_NUMBER_UNSIGNED_INT, type.encoding};
}
break;
case IdTypeClass::kScalarFloatType:
- number_type = {type.bitwidth, SPV_NUMBER_FLOATING};
+ number_type = {type.bitwidth, SPV_NUMBER_FLOATING, type.encoding};
break;
case IdTypeClass::kBottom:
// kBottom means the type is unknown and we need to infer the type before
@@ -267,11 +270,11 @@
// signed integer, otherwise an unsigned integer.
uint32_t bitwidth = static_cast<uint32_t>(assumedBitWidth(type));
if (strchr(val, '.')) {
- number_type = {bitwidth, SPV_NUMBER_FLOATING};
+ number_type = {bitwidth, SPV_NUMBER_FLOATING, type.encoding};
} else if (type.isSigned || val[0] == '-') {
- number_type = {bitwidth, SPV_NUMBER_SIGNED_INT};
+ number_type = {bitwidth, SPV_NUMBER_SIGNED_INT, type.encoding};
} else {
- number_type = {bitwidth, SPV_NUMBER_UNSIGNED_INT};
+ number_type = {bitwidth, SPV_NUMBER_UNSIGNED_INT, type.encoding};
}
break;
}
@@ -327,13 +330,27 @@
if (pInst->words.size() != 4)
return diagnostic() << "Invalid OpTypeInt instruction";
types_[value] = {pInst->words[2], pInst->words[3] != 0,
- IdTypeClass::kScalarIntegerType};
+ IdTypeClass::kScalarIntegerType, SPV_FP_ENCODING_UNKNOWN};
} else if (pInst->opcode == spv::Op::OpTypeFloat) {
- if (pInst->words.size() != 3)
+ if ((pInst->words.size() != 3) && (pInst->words.size() != 4))
return diagnostic() << "Invalid OpTypeFloat instruction";
- types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType};
+ spv_fp_encoding_t enc = SPV_FP_ENCODING_UNKNOWN;
+ if (pInst->words.size() >= 4) {
+ const spvtools::OperandDesc* desc = nullptr;
+ spv_result_t status = spvtools::LookupOperand(SPV_OPERAND_TYPE_FPENCODING,
+ pInst->words[3], &desc);
+ if (status == SPV_SUCCESS) {
+ enc = spvFPEncodingFromOperandFPEncoding(
+ static_cast<spv::FPEncoding>(desc->value));
+ } else {
+ return diagnostic() << "Invalid OpTypeFloat encoding";
+ }
+ }
+ types_[value] = {pInst->words[2], false, IdTypeClass::kScalarFloatType,
+ enc};
} else {
- types_[value] = {0, false, IdTypeClass::kOtherType};
+ types_[value] = {0, false, IdTypeClass::kOtherType,
+ SPV_FP_ENCODING_UNKNOWN};
}
return SPV_SUCCESS;
}
diff --git a/third_party/SPIRV-Tools/source/text_handler.h b/third_party/SPIRV-Tools/source/text_handler.h
index 19972e9..54ffe61 100644
--- a/third_party/SPIRV-Tools/source/text_handler.h
+++ b/third_party/SPIRV-Tools/source/text_handler.h
@@ -47,6 +47,7 @@
uint32_t bitwidth; // Safe to assume that we will not have > 2^32 bits.
bool isSigned; // This is only significant if type_class is integral.
IdTypeClass type_class;
+ spv_fp_encoding_t encoding;
};
// Default equality operator for IdType. Tests if all members are the same.
@@ -141,7 +142,14 @@
spv_result_t advance();
// Sets word to the next word in the input text. Fills next_position with
- // the next location past the end of the word.
+ // the next location past the end of the word. Returns an error if the
+ // context is invalid or has no more text. Otherwise returns SPV_SUCCESS.
+ // Assumes the next part of the input is not whitespace.
+ //
+ // A word ends at the next comment or whitespace. However, double-quoted
+ // strings remain intact, and a backslash always escapes the next character.
+ // The input stream may end before a matching double-quote, or immediately
+ // after a backslash. Both such cases still count as success.
spv_result_t getWord(std::string* word, spv_position next_position);
// Returns true if the next word in the input is the start of a new Opcode.
diff --git a/third_party/SPIRV-Tools/source/to_string.cpp b/third_party/SPIRV-Tools/source/to_string.cpp
new file mode 100644
index 0000000..b707070
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/to_string.cpp
@@ -0,0 +1,44 @@
+// Copyright (c) 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/to_string.h"
+
+#include <cassert>
+
+namespace spvtools {
+
+std::string to_string(uint32_t n) {
+ // This implementation avoids using standard library features that access
+ // the locale. Using the locale requires taking a mutex which causes
+ // annoying serialization.
+
+ constexpr int max_digits = 10; // max uint has 10 digits
+ // Contains the resulting digits, with least significant digit in the last
+ // entry.
+ char buf[max_digits];
+ int write_index = max_digits - 1;
+ if (n == 0) {
+ buf[write_index] = '0';
+ } else {
+ while (n > 0) {
+ int units = n % 10;
+ buf[write_index--] = "0123456789"[units];
+ n = (n - units) / 10;
+ }
+ write_index++;
+ }
+ assert(write_index >= 0);
+ return std::string(buf + write_index, max_digits - write_index);
+}
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/enum_string_mapping.cpp b/third_party/SPIRV-Tools/source/to_string.h
similarity index 70%
rename from third_party/SPIRV-Tools/source/enum_string_mapping.cpp
rename to third_party/SPIRV-Tools/source/to_string.h
index 32361a0..83702f9 100644
--- a/third_party/SPIRV-Tools/source/enum_string_mapping.cpp
+++ b/third_party/SPIRV-Tools/source/to_string.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2017 Google Inc.
+// Copyright (c) 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "source/enum_string_mapping.h"
+#ifndef SOURCE_TO_STRING_H_
+#define SOURCE_TO_STRING_H_
-#include <algorithm>
-#include <cassert>
-#include <cstring>
+#include <cstdint>
#include <string>
-#include <unordered_map>
-
-#include "source/extensions.h"
namespace spvtools {
-#include "enum_string_mapping.inc"
+// Returns the decimal representation of a number as a string,
+// without using the locale.
+std::string to_string(uint32_t n);
} // namespace spvtools
+
+#endif // SOURCE_TO_STRING_H_
diff --git a/third_party/SPIRV-Tools/source/util/bitutils.h b/third_party/SPIRV-Tools/source/util/bitutils.h
index 9ced2f9..2763bc2 100644
--- a/third_party/SPIRV-Tools/source/util/bitutils.h
+++ b/third_party/SPIRV-Tools/source/util/bitutils.h
@@ -97,7 +97,7 @@
size_t CountSetBits(T word) {
static_assert(std::is_integral<T>::value,
"CountSetBits requires integer type");
- size_t count = 0;
+ uint32_t count = 0;
while (word) {
word &= word - 1;
++count;
@@ -181,6 +181,31 @@
false);
}
+// Returns the value obtained by extracting the |number_of_bits| least
+// significant bits from |value|, and sign-extending it to 64-bits.
+template <typename T>
+T SignExtendValue(T value, uint32_t number_of_bits) {
+ const uint32_t bit_width = sizeof(value) * 8;
+ if (number_of_bits == bit_width) return value;
+
+ bool is_negative = utils::IsBitAtPositionSet(value, number_of_bits - 1);
+ if (is_negative) {
+ value = utils::SetHighBits(value, bit_width - number_of_bits);
+ } else {
+ value = utils::ClearHighBits(value, bit_width - number_of_bits);
+ }
+ return value;
+}
+
+// Returns the value obtained by extracting the |number_of_bits| least
+// significant bits from |value|, and zero-extending it to 64-bits.
+template <typename T>
+T ZeroExtendValue(T value, uint32_t number_of_bits) {
+ const uint32_t bit_width = sizeof(value) * 8;
+ if (number_of_bits == bit_width) return value;
+ return utils::ClearHighBits(value, bit_width - number_of_bits);
+}
+
} // namespace utils
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/util/hex_float.h b/third_party/SPIRV-Tools/source/util/hex_float.h
index 98353a4..83b1c09 100644
--- a/third_party/SPIRV-Tools/source/util/hex_float.h
+++ b/third_party/SPIRV-Tools/source/util/hex_float.h
@@ -36,6 +36,50 @@
namespace spvtools {
namespace utils {
+class Float8_E4M3 {
+ public:
+ Float8_E4M3(uint8_t v) : val(v) {}
+ Float8_E4M3() = default;
+ static bool isNan(const Float8_E4M3& val) { return (val.val & 0x7f) == 0x7f; }
+ // Returns true if the given value is any kind of infinity.
+ static bool isInfinity(const Float8_E4M3&) {
+ return false; // E4M3 has no infinity representation
+ }
+ Float8_E4M3(const Float8_E4M3& other) { val = other.val; }
+ uint8_t get_value() const { return val; }
+
+ // Returns the maximum normal value.
+ static Float8_E4M3 max() { return Float8_E4M3(0x7e); }
+ // Returns the lowest normal value.
+ static Float8_E4M3 lowest() { return Float8_E4M3(0x8); }
+
+ private:
+ uint8_t val;
+};
+
+class Float8_E5M2 {
+ public:
+ Float8_E5M2(uint8_t v) : val(v) {}
+ Float8_E5M2() = default;
+ static bool isNan(const Float8_E5M2& val) {
+ return ((val.val & 0x7c) == 0x7c) && ((val.val & 0x3) != 0);
+ }
+ // Returns true if the given value is any kind of infinity.
+ static bool isInfinity(const Float8_E5M2& val) {
+ return (val.val & 0x7f) == 0x7c;
+ }
+ Float8_E5M2(const Float8_E5M2& other) { val = other.val; }
+ uint8_t get_value() const { return val; }
+
+ // Returns the maximum normal value.
+ static Float8_E5M2 max() { return Float8_E5M2(0x7b); }
+ // Returns the lowest normal value.
+ static Float8_E5M2 lowest() { return Float8_E5M2(0x4); }
+
+ private:
+ uint8_t val;
+};
+
class Float16 {
public:
Float16(uint16_t v) : val(v) {}
@@ -111,6 +155,46 @@
};
template <>
+struct FloatProxyTraits<Float8_E4M3> {
+ using uint_type = uint8_t;
+ static bool isNan(Float8_E4M3 f) { return Float8_E4M3::isNan(f); }
+ // Returns true if the given value is any kind of infinity.
+ static bool isInfinity(Float8_E4M3 f) { return Float8_E4M3::isInfinity(f); }
+ // Returns the maximum normal value.
+ static Float8_E4M3 max() { return Float8_E4M3::max(); }
+ // Returns the lowest normal value.
+ static Float8_E4M3 lowest() { return Float8_E4M3::lowest(); }
+ // Returns the value as the native floating point format.
+ static Float8_E4M3 getAsFloat(const uint_type& t) { return Float8_E4M3(t); }
+ // Returns the bits from the given floating pointer number.
+ static uint_type getBitsFromFloat(const Float8_E4M3& t) {
+ return t.get_value();
+ }
+ // Returns the bitwidth.
+ static uint32_t width() { return 8u; }
+};
+
+template <>
+struct FloatProxyTraits<Float8_E5M2> {
+ using uint_type = uint8_t;
+ static bool isNan(Float8_E5M2 f) { return Float8_E5M2::isNan(f); }
+ // Returns true if the given value is any kind of infinity.
+ static bool isInfinity(Float8_E5M2 f) { return Float8_E5M2::isInfinity(f); }
+ // Returns the maximum normal value.
+ static Float8_E5M2 max() { return Float8_E5M2::max(); }
+ // Returns the lowest normal value.
+ static Float8_E5M2 lowest() { return Float8_E5M2::lowest(); }
+ // Returns the value as the native floating point format.
+ static Float8_E5M2 getAsFloat(const uint_type& t) { return Float8_E5M2(t); }
+ // Returns the bits from the given floating pointer number.
+ static uint_type getBitsFromFloat(const Float8_E5M2& t) {
+ return t.get_value();
+ }
+ // Returns the bitwidth.
+ static uint32_t width() { return 8u; }
+};
+
+template <>
struct FloatProxyTraits<Float16> {
using uint_type = uint16_t;
static bool isNan(Float16 f) { return Float16::isNan(f); }
@@ -216,6 +300,7 @@
using int_type = void;
// The numerical type that this HexFloat represents.
using underlying_type = void;
+ using underlying_typetraits = void;
// The type needed to construct the underlying type.
using native_type = void;
// The number of bits that are actually relevant in the uint_type.
@@ -229,6 +314,8 @@
// The bias of the exponent. (How much we need to subtract from the stored
// value to get the correct value.)
static const uint32_t exponent_bias = 0;
+ static const bool has_infinity = true;
+ static const uint32_t NaN_pattern = 0;
};
// Traits for IEEE float.
@@ -238,11 +325,14 @@
using uint_type = uint32_t;
using int_type = int32_t;
using underlying_type = FloatProxy<float>;
+ using underlying_typetraits = FloatProxyTraits<float>;
using native_type = float;
static const uint_type num_used_bits = 32;
static const uint_type num_exponent_bits = 8;
static const uint_type num_fraction_bits = 23;
static const uint_type exponent_bias = 127;
+ static const bool has_infinity = true;
+ static const uint_type NaN_pattern = 0x7f80000;
};
// Traits for IEEE double.
@@ -252,11 +342,48 @@
using uint_type = uint64_t;
using int_type = int64_t;
using underlying_type = FloatProxy<double>;
+ using underlying_typetraits = FloatProxyTraits<double>;
using native_type = double;
static const uint_type num_used_bits = 64;
static const uint_type num_exponent_bits = 11;
static const uint_type num_fraction_bits = 52;
static const uint_type exponent_bias = 1023;
+ static const bool has_infinity = true;
+ static const uint_type NaN_pattern = 0x7FF0000000000000;
+};
+
+// Traits for FP8 E4M3.
+// 1 sign bit, 4 exponent bits, 3 fractional bits.
+template <>
+struct HexFloatTraits<FloatProxy<Float8_E4M3>> {
+ using uint_type = uint8_t;
+ using int_type = int8_t;
+ using underlying_type = FloatProxy<Float8_E4M3>;
+ using underlying_typetraits = FloatProxyTraits<Float8_E4M3>;
+ using native_type = uint8_t;
+ static const uint_type num_used_bits = 8;
+ static const uint_type num_exponent_bits = 4;
+ static const uint_type num_fraction_bits = 3;
+ static const uint_type exponent_bias = 7;
+ static const bool has_infinity = false;
+ static const uint_type NaN_pattern = 0x7F;
+};
+
+// Traits for FP8 E5M2.
+// 1 sign bit, 4 exponent bits, 3 fractional bits.
+template <>
+struct HexFloatTraits<FloatProxy<Float8_E5M2>> {
+ using uint_type = uint8_t;
+ using int_type = int8_t;
+ using underlying_type = FloatProxy<Float8_E5M2>;
+ using underlying_typetraits = FloatProxyTraits<Float8_E5M2>;
+ using native_type = uint8_t;
+ static const uint_type num_used_bits = 8;
+ static const uint_type num_exponent_bits = 5;
+ static const uint_type num_fraction_bits = 2;
+ static const uint_type exponent_bias = 15;
+ static const bool has_infinity = true;
+ static const uint_type NaN_pattern = 0x7c;
};
// Traits for IEEE half.
@@ -265,12 +392,15 @@
struct HexFloatTraits<FloatProxy<Float16>> {
using uint_type = uint16_t;
using int_type = int16_t;
- using underlying_type = uint16_t;
+ using underlying_type = FloatProxy<Float16>;
+ using underlying_typetraits = FloatProxyTraits<Float16>;
using native_type = uint16_t;
static const uint_type num_used_bits = 16;
static const uint_type num_exponent_bits = 5;
static const uint_type num_fraction_bits = 10;
static const uint_type exponent_bias = 15;
+ static const bool has_infinity = true;
+ static const uint_type NaN_pattern = 0x7c00;
};
enum class round_direction {
@@ -291,6 +421,7 @@
using int_type = typename Traits::int_type;
using underlying_type = typename Traits::underlying_type;
using native_type = typename Traits::native_type;
+ using traits = Traits;
explicit HexFloat(T f) : value_(f) {}
@@ -493,9 +624,9 @@
struct negatable_left_shift {
static uint_type val(uint_type val) {
if (N > 0) {
- return static_cast<uint_type>(val << N);
+ return static_cast<uint_type>(static_cast<uint64_t>(val) << N);
} else {
- return static_cast<uint_type>(val >> N);
+ return static_cast<uint_type>(static_cast<uint64_t>(val) >> N);
}
}
};
@@ -519,28 +650,28 @@
template <int_type N, typename enable = void>
struct negatable_left_shift {
static uint_type val(uint_type val) {
- return static_cast<uint_type>(val >> -N);
+ return static_cast<uint_type>(static_cast<uint64_t>(val) >> -N);
}
};
template <int_type N>
struct negatable_left_shift<N, typename std::enable_if<N >= 0>::type> {
static uint_type val(uint_type val) {
- return static_cast<uint_type>(val << N);
+ return static_cast<uint_type>(static_cast<uint64_t>(val) << N);
}
};
template <int_type N, typename enable = void>
struct negatable_right_shift {
static uint_type val(uint_type val) {
- return static_cast<uint_type>(val << -N);
+ return static_cast<uint_type>(static_cast<uint64_t>(val) << -N);
}
};
template <int_type N>
struct negatable_right_shift<N, typename std::enable_if<N >= 0>::type> {
static uint_type val(uint_type val) {
- return static_cast<uint_type>(val >> N);
+ return static_cast<uint_type>(static_cast<uint64_t>(val) >> N);
}
};
#endif
@@ -639,6 +770,9 @@
// underflow to (0 or min depending on rounding) if the number underflows.
template <typename other_T>
void castTo(other_T& other, round_direction round_dir) {
+ using other_traits = typename other_T::traits;
+ using other_underlyingtraits = typename other_traits::underlying_typetraits;
+
other = other_T(static_cast<typename other_T::native_type>(0));
bool negate = isNegative();
if (getUnsignedBits() == 0) {
@@ -664,18 +798,24 @@
}
}
- bool is_nan =
- (getBits() & exponent_mask) == exponent_mask && significand != 0;
+ bool is_nan = T(getBits()).isNan();
bool is_inf =
!is_nan &&
((exponent + carried) > static_cast<int_type>(other_T::exponent_bias) ||
- (significand == 0 && (getBits() & exponent_mask) == exponent_mask));
+ T(getBits()).isInfinity());
// If we are Nan or Inf we should pass that through.
if (is_inf) {
- other.set_value(typename other_T::underlying_type(
- static_cast<typename other_T::uint_type>(
- (negate ? other_T::sign_mask : 0) | other_T::exponent_mask)));
+ if (other_traits::has_infinity)
+ other.set_value(typename other_T::underlying_type(
+ static_cast<typename other_T::uint_type>(
+ (negate ? other_T::sign_mask : 0) | other_T::exponent_mask)));
+ else // if the type doesnt use infinity, set it to max value (E4M3)
+ other.set_value(typename other_T::underlying_type(
+ static_cast<typename other_T::uint_type>(
+ (negate ? other_T::sign_mask : 0) |
+ other_underlyingtraits::getBitsFromFloat(
+ other_underlyingtraits::max()))));
return;
}
if (is_nan) {
@@ -690,7 +830,8 @@
// just set the last bit.
other.set_value(typename other_T::underlying_type(
static_cast<typename other_T::uint_type>(
- (negate ? other_T::sign_mask : 0) | other_T::exponent_mask |
+ other_traits::NaN_pattern | (negate ? other_T::sign_mask : 0) |
+ other_T::exponent_mask |
(shifted_significand == 0 ? 0x1 : shifted_significand))));
return;
}
@@ -738,8 +879,8 @@
template <typename T, typename Traits>
std::ostream& operator<<(std::ostream& os, const HexFloat<T, Traits>& value) {
using HF = HexFloat<T, Traits>;
- using uint_type = typename HF::uint_type;
- using int_type = typename HF::int_type;
+ using uint_type = uint64_t;
+ using int_type = int64_t;
static_assert(HF::num_used_bits != 0,
"num_used_bits must be non-zero for a valid float");
@@ -889,12 +1030,86 @@
// Overflow on 16-bit behaves the same as for 32- and 64-bit: set the
// fail bit and set the lowest or highest value.
+ // /!\ We get an error if there is no overflow but the value is infinity.
+ // Is it what we want?
if (Float16::isInfinity(value.value().getAsFloat())) {
value.set_value(value.isNegative() ? Float16::lowest() : Float16::max());
is.setstate(std::ios_base::failbit);
}
return is;
}
+// Specialization of ParseNormalFloat for FloatProxy<Float8_E4M3> values.
+// This will parse the float as it were a 32-bit floating point number,
+// and then round it down to fit into a Float8_E4M3 value.
+// The number is rounded towards zero.
+// If negate_value is true then the number may not have a leading minus or
+// plus, and if it successfully parses, then the number is negated before
+// being stored into the value parameter.
+// If the value cannot be correctly parsed or overflows the target floating
+// point type, then set the fail bit on the stream.
+// TODO(dneto): Promise C++11 standard behavior in how the value is set in
+// the error case, but only after all target platforms implement it correctly.
+// In particular, the Microsoft C++ runtime appears to be out of spec.
+template <>
+inline std::istream& ParseNormalFloat<FloatProxy<Float8_E4M3>,
+ HexFloatTraits<FloatProxy<Float8_E4M3>>>(
+ std::istream& is, bool negate_value,
+ HexFloat<FloatProxy<Float8_E4M3>, HexFloatTraits<FloatProxy<Float8_E4M3>>>&
+ value) {
+ // First parse as a 32-bit float.
+ HexFloat<FloatProxy<float>> float_val(0.0f);
+ ParseNormalFloat(is, negate_value, float_val);
+
+ if (float_val.value().getAsFloat() > 448.0f) {
+ is.setstate(std::ios_base::failbit);
+ value.set_value(Float8_E4M3::max());
+ return is;
+ } else if (float_val.value().getAsFloat() < -448.0f) {
+ is.setstate(std::ios_base::failbit);
+ value.set_value(0x80 | Float8_E4M3::max().get_value());
+ return is;
+ }
+ // Then convert to E4M3 float, saturating at infinities, and
+ // rounding toward zero.
+ float_val.castTo(value, round_direction::kToZero);
+
+ return is;
+}
+// Specialization of ParseNormalFloat for FloatProxy<Float8_E5M2> values.
+// This will parse the float as it were a Float8_E5M2 floating point number,
+// and then round it down to fit into a Float16 value.
+// The number is rounded towards zero.
+// If negate_value is true then the number may not have a leading minus or
+// plus, and if it successfully parses, then the number is negated before
+// being stored into the value parameter.
+// If the value cannot be correctly parsed or overflows the target floating
+// point type, then set the fail bit on the stream.
+// TODO(dneto): Promise C++11 standard behavior in how the value is set in
+// the error case, but only after all target platforms implement it correctly.
+// In particular, the Microsoft C++ runtime appears to be out of spec.
+template <>
+inline std::istream& ParseNormalFloat<FloatProxy<Float8_E5M2>,
+ HexFloatTraits<FloatProxy<Float8_E5M2>>>(
+ std::istream& is, bool negate_value,
+ HexFloat<FloatProxy<Float8_E5M2>, HexFloatTraits<FloatProxy<Float8_E5M2>>>&
+ value) {
+ // First parse as a 32-bit float.
+ HexFloat<FloatProxy<float>> float_val(0.0f);
+ ParseNormalFloat(is, negate_value, float_val);
+
+ // Then convert to Float8_E5M2 float, saturating at infinities, and
+ // rounding toward zero.
+ float_val.castTo(value, round_direction::kToZero);
+
+ // Overflow on Float8_E5M2 behaves the same as for 32- and 64-bit: set the
+ // fail bit and set the lowest or highest value.
+ if (Float8_E5M2::isInfinity(value.value().getAsFloat())) {
+ value.set_value(value.isNegative() ? Float8_E5M2::lowest()
+ : Float8_E5M2::max());
+ is.setstate(std::ios_base::failbit);
+ }
+ return is;
+}
namespace detail {
@@ -1253,6 +1468,20 @@
return os;
}
+template <>
+inline std::ostream& operator<< <Float8_E4M3>(
+ std::ostream& os, const FloatProxy<Float8_E4M3>& value) {
+ os << HexFloat<FloatProxy<Float8_E4M3>>(value);
+ return os;
+}
+
+template <>
+inline std::ostream& operator<< <Float8_E5M2>(
+ std::ostream& os, const FloatProxy<Float8_E5M2>& value) {
+ os << HexFloat<FloatProxy<Float8_E5M2>>(value);
+ return os;
+}
+
} // namespace utils
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/util/index_range.h b/third_party/SPIRV-Tools/source/util/index_range.h
new file mode 100644
index 0000000..d256bde
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/util/index_range.h
@@ -0,0 +1,71 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_UTIL_INDEX_RANGE_H_
+#define SOURCE_UTIL_INDEX_RANGE_H_
+
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+
+#include "source/util/span.h"
+
+namespace spvtools {
+namespace utils {
+
+// Implement a range of indicies, to index over an array of values of type T,
+// but whose base pointer is supplied externally. Think of this as a span
+// but without the base pointer, which is to be applied later. Parameterization
+// by T makes usage more readable and less error-prone.
+template <typename T, class IndexType = uint32_t, class CountType = IndexType>
+class IndexRange {
+ public:
+ static_assert(std::is_integral<IndexType>::value);
+ static_assert(std::is_unsigned<IndexType>::value);
+ static_assert(std::is_integral<CountType>::value);
+ static_assert(std::is_unsigned<CountType>::value);
+ using value_type = T;
+ using index_type = IndexType;
+ using size_type = CountType;
+
+ constexpr IndexRange() {}
+ constexpr IndexRange(index_type first, size_type count)
+ : first_(first), count_(count) {}
+
+ size_type count() const { return count_; }
+ bool empty() const { return count() == size_type(0); }
+
+ IndexType first() const { return first_; }
+
+ // Returns the span of indexed elements using the given base pointer.
+ template <typename E>
+ spvtools::utils::Span<E> apply(E* base) const {
+ using span_type = spvtools::utils::Span<E>;
+ return base ? span_type(base + first_, count_) : span_type();
+ }
+ template <typename E = int>
+ spvtools::utils::Span<E> apply(std::nullptr_t) const {
+ using span_type = spvtools::utils::Span<E>;
+ return span_type();
+ }
+
+ private:
+ index_type first_ = 0;
+ size_type count_ = 0;
+};
+
+} // namespace utils
+} // namespace spvtools
+
+#endif // SOURCE_UTIL_INDEX_RANGE_H_
diff --git a/third_party/SPIRV-Tools/source/util/parse_number.cpp b/third_party/SPIRV-Tools/source/util/parse_number.cpp
index c3351c2..3aa0752 100644
--- a/third_party/SPIRV-Tools/source/util/parse_number.cpp
+++ b/third_party/SPIRV-Tools/source/util/parse_number.cpp
@@ -131,6 +131,19 @@
return EncodeNumberStatus::kSuccess;
}
+spv_fp_encoding_t DeduceEncoding(const NumberType& type) {
+ if (type.encoding != SPV_FP_ENCODING_UNKNOWN) return type.encoding;
+ switch (type.bitwidth) {
+ case 16:
+ return SPV_FP_ENCODING_IEEE754_BINARY16;
+ case 32:
+ return SPV_FP_ENCODING_IEEE754_BINARY32;
+ case 64:
+ return SPV_FP_ENCODING_IEEE754_BINARY64;
+ default:
+ return SPV_FP_ENCODING_UNKNOWN;
+ }
+}
EncodeNumberStatus ParseAndEncodeFloatingPointNumber(
const char* text, const NumberType& type,
std::function<void(uint32_t)> emit, std::string* error_msg) {
@@ -145,8 +158,35 @@
}
const auto bit_width = AssumedBitWidth(type);
- switch (bit_width) {
- case 16: {
+ switch (DeduceEncoding(type)) {
+ case SPV_FP_ENCODING_FLOAT8_E4M3: {
+ HexFloat<FloatProxy<Float8_E4M3>> hVal(0);
+ if (!ParseNumber(text, &hVal)) {
+ ErrorMsgStream(error_msg) << "Invalid E4M3 float literal: " << text;
+ return EncodeNumberStatus::kInvalidText;
+ }
+ // getAsFloat will return the Float16 value, and get_value
+ // will return a uint16_t representing the bits of the float.
+ // The encoding is therefore correct from the perspective of the SPIR-V
+ // spec since the top 16 bits will be 0.
+ emit(static_cast<uint32_t>(hVal.value().getAsFloat().get_value()));
+ return EncodeNumberStatus::kSuccess;
+ } break;
+ case SPV_FP_ENCODING_FLOAT8_E5M2: {
+ HexFloat<FloatProxy<Float8_E5M2>> hVal(0);
+ if (!ParseNumber(text, &hVal)) {
+ ErrorMsgStream(error_msg) << "Invalid E5M2 float literal: " << text;
+ return EncodeNumberStatus::kInvalidText;
+ }
+ // getAsFloat will return the Float16 value, and get_value
+ // will return a uint16_t representing the bits of the float.
+ // The encoding is therefore correct from the perspective of the SPIR-V
+ // spec since the top 16 bits will be 0.
+ emit(static_cast<uint32_t>(hVal.value().getAsFloat().get_value()));
+ return EncodeNumberStatus::kSuccess;
+ } break;
+ case SPV_FP_ENCODING_BFLOAT16: // FIXME this likely needs separate handling
+ case SPV_FP_ENCODING_IEEE754_BINARY16: {
HexFloat<FloatProxy<Float16>> hVal(0);
if (!ParseNumber(text, &hVal)) {
ErrorMsgStream(error_msg) << "Invalid 16-bit float literal: " << text;
@@ -159,7 +199,7 @@
emit(static_cast<uint32_t>(hVal.value().getAsFloat().get_value()));
return EncodeNumberStatus::kSuccess;
} break;
- case 32: {
+ case SPV_FP_ENCODING_IEEE754_BINARY32: {
HexFloat<FloatProxy<float>> fVal(0.0f);
if (!ParseNumber(text, &fVal)) {
ErrorMsgStream(error_msg) << "Invalid 32-bit float literal: " << text;
@@ -168,7 +208,7 @@
emit(BitwiseCast<uint32_t>(fVal));
return EncodeNumberStatus::kSuccess;
} break;
- case 64: {
+ case SPV_FP_ENCODING_IEEE754_BINARY64: {
HexFloat<FloatProxy<double>> dVal(0.0);
if (!ParseNumber(text, &dVal)) {
ErrorMsgStream(error_msg) << "Invalid 64-bit float literal: " << text;
diff --git a/third_party/SPIRV-Tools/source/util/parse_number.h b/third_party/SPIRV-Tools/source/util/parse_number.h
index d0f2a09..27a0327 100644
--- a/third_party/SPIRV-Tools/source/util/parse_number.h
+++ b/third_party/SPIRV-Tools/source/util/parse_number.h
@@ -32,6 +32,7 @@
// SPV_NUMBER_NONE means the type is unknown and is invalid to be used with
// ParseAndEncode{|Integer|Floating}Number().
spv_number_kind_t kind;
+ spv_fp_encoding_t encoding;
};
// Returns true if the type is a scalar integer type.
@@ -160,6 +161,14 @@
return true;
}
+template <typename T>
+struct IsHexFloat {
+ static const bool value = false;
+};
+template <typename T>
+struct IsHexFloat<HexFloat<T>> {
+ static const bool value = true;
+};
// Parses a numeric value of a given type from the given text. The number
// should take up the entire string, and should be within bounds for the target
// type. On success, returns true and populates the object referenced by
@@ -169,8 +178,10 @@
// C++11 doesn't define std::istringstream(int8_t&), so calling this method
// with a single-byte type leads to implementation-defined behaviour.
// Similarly for uint8_t.
- static_assert(sizeof(T) > 1,
- "Single-byte types are not supported in this parse method");
+ // HexFloat<T> overloads the operator
+ static_assert(sizeof(T) > 1 || IsHexFloat<T>::value,
+ "Single-byte types other than HexFloat<> are not supported in "
+ "this parse method");
if (!text) return false;
std::istringstream text_stream(text);
diff --git a/third_party/SPIRV-Tools/source/util/small_vector.h b/third_party/SPIRV-Tools/source/util/small_vector.h
index 1351475..1838843 100644
--- a/third_party/SPIRV-Tools/source/util/small_vector.h
+++ b/third_party/SPIRV-Tools/source/util/small_vector.h
@@ -43,6 +43,7 @@
template <class T, size_t small_size>
class SmallVector {
public:
+ using value_type = T;
using iterator = T*;
using const_iterator = const T*;
diff --git a/third_party/SPIRV-Tools/source/util/span.h b/third_party/SPIRV-Tools/source/util/span.h
new file mode 100644
index 0000000..1e29017
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/util/span.h
@@ -0,0 +1,72 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_UTIL_SPAN_H_
+#define SOURCE_UTIL_SPAN_H_
+
+#include <cstddef>
+#include <iterator>
+#include <type_traits>
+
+namespace spvtools {
+namespace utils {
+
+// Implement a subset of the C++20 std::span, using at most C++17 functionality.
+// Replace this when SPIRV-Tools can use C++20.
+template <class T>
+class Span {
+ public:
+ using element_type = T;
+ using value_type = std::remove_cv_t<T>;
+ using size_type = std::size_t;
+ using difference_type = std::ptrdiff_t;
+ using pointer = T*;
+ using const_pointer = const T*;
+ using reference = T&;
+ using const_reference = const T&;
+ using iterator = T*;
+ using const_iterator = const T*;
+
+ Span() {}
+ Span(iterator first, size_type count) : first_(first), count_(count) {}
+
+ iterator begin() const { return first_; }
+ iterator end() const { return first_ ? first_ + count_ : nullptr; }
+ const_iterator cbegin() const { return first_; }
+ const_iterator cend() const { return first_ ? first_ + count_ : nullptr; }
+
+ size_type size() const { return count_; }
+ size_type size_bytes() const { return count_ * sizeof(T); }
+ bool empty() const { return first_ == nullptr || count_ == 0; }
+
+ reference front() const { return *first_; }
+ reference back() const { return *(first_ + count_ - 1); }
+ pointer data() const { return first_; }
+ reference operator[](size_type idx) const { return first_[idx]; }
+ Span<T> subspan(size_type offset) const {
+ if (count_ > offset) {
+ return Span(first_ + offset, count_ - offset);
+ }
+ return Span<T>();
+ }
+
+ private:
+ T* first_ = nullptr;
+ size_type count_ = 0;
+};
+
+} // namespace utils
+} // namespace spvtools
+
+#endif // SOURCE_UTIL_SPAN_H_
diff --git a/third_party/SPIRV-Tools/source/util/string_utils.h b/third_party/SPIRV-Tools/source/util/string_utils.h
index 03e20b3..590f8cf 100644
--- a/third_party/SPIRV-Tools/source/util/string_utils.h
+++ b/third_party/SPIRV-Tools/source/util/string_utils.h
@@ -17,13 +17,12 @@
#include <assert.h>
+#include <cstdint>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
-#include "source/util/string_utils.h"
-
namespace spvtools {
namespace utils {
@@ -48,8 +47,9 @@
// Encodes a string as a sequence of words, using the SPIR-V encoding, appending
// to an existing vector.
-inline void AppendToVector(const std::string& input,
- std::vector<uint32_t>* result) {
+template <class VectorType = std::vector<uint32_t>>
+inline void AppendToVector(const std::string& input, VectorType* result) {
+ static_assert(std::is_same<uint32_t, typename VectorType::value_type>::value);
uint32_t word = 0;
size_t num_bytes = input.size();
// SPIR-V strings are null-terminated. The byte_index == num_bytes
@@ -70,8 +70,10 @@
}
// Encodes a string as a sequence of words, using the SPIR-V encoding.
-inline std::vector<uint32_t> MakeVector(const std::string& input) {
- std::vector<uint32_t> result;
+template <class VectorType = std::vector<uint32_t>>
+inline VectorType MakeVector(const std::string& input) {
+ static_assert(std::is_same<uint32_t, typename VectorType::value_type>::value);
+ VectorType result;
AppendToVector(input, &result);
return result;
}
diff --git a/third_party/SPIRV-Tools/source/val/decoration.h b/third_party/SPIRV-Tools/source/val/decoration.h
index 384cc57..77e0f61 100644
--- a/third_party/SPIRV-Tools/source/val/decoration.h
+++ b/third_party/SPIRV-Tools/source/val/decoration.h
@@ -15,6 +15,7 @@
#ifndef SOURCE_VAL_DECORATION_H_
#define SOURCE_VAL_DECORATION_H_
+#include <cassert>
#include <cstdint>
#include <unordered_map>
#include <vector>
@@ -55,6 +56,12 @@
// params_ = vector { 2 }
// struct_member_index_ = 2
//
+// Example 4: Decoration for a Builtin:
+// OpDecorate %var BuiltIn FragDepth
+// dec_type_ = spv::Decoration::BuiltIn
+// params_ = vector { FragDepth }
+// struct_member_index_ = kInvalidMember
+//
class Decoration {
public:
enum { kInvalidMember = -1 };
@@ -68,6 +75,10 @@
spv::Decoration dec_type() const { return dec_type_; }
std::vector<uint32_t>& params() { return params_; }
const std::vector<uint32_t>& params() const { return params_; }
+ spv::BuiltIn builtin() const {
+ assert(dec_type_ == spv::Decoration::BuiltIn);
+ return spv::BuiltIn(params_[0]);
+ }
inline bool operator<(const Decoration& rhs) const {
// Note: Sort by struct_member_index_ first, then type, so look up can be
diff --git a/third_party/SPIRV-Tools/source/val/function.h b/third_party/SPIRV-Tools/source/val/function.h
index 55641ff..d3dd639 100644
--- a/third_party/SPIRV-Tools/source/val/function.h
+++ b/third_party/SPIRV-Tools/source/val/function.h
@@ -279,7 +279,7 @@
Construct& FindConstructForEntryBlock(const BasicBlock* entry_block,
ConstructType t);
- /// The result id of the OpLabel that defined this block
+ /// The result id of OpFunction
uint32_t id_;
/// The type of the function
diff --git a/third_party/SPIRV-Tools/source/val/instruction.h b/third_party/SPIRV-Tools/source/val/instruction.h
index c524bd3..6b42489 100644
--- a/third_party/SPIRV-Tools/source/val/instruction.h
+++ b/third_party/SPIRV-Tools/source/val/instruction.h
@@ -22,7 +22,9 @@
#include <vector>
#include "source/ext_inst.h"
+#include "source/opcode.h"
#include "source/table.h"
+#include "source/table2.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
@@ -82,18 +84,16 @@
const spv_parsed_instruction_t& c_inst() const { return inst_; }
/// Provides direct access to instructions spv_ext_inst_type_t object.
- const spv_ext_inst_type_t& ext_inst_type() const {
- return inst_.ext_inst_type;
- }
+ spv_ext_inst_type_t ext_inst_type() const { return inst_.ext_inst_type; }
bool IsNonSemantic() const {
- return opcode() == spv::Op::OpExtInst &&
+ return spvIsExtendedInstruction(opcode()) &&
spvExtInstIsNonSemantic(inst_.ext_inst_type);
}
/// True if this is an OpExtInst for debug info extension.
bool IsDebugInfo() const {
- return opcode() == spv::Op::OpExtInst &&
+ return spvIsExtendedInstruction(opcode()) &&
spvExtInstIsDebugInfo(inst_.ext_inst_type);
}
@@ -112,7 +112,7 @@
private:
const std::vector<uint32_t> words_;
const std::vector<spv_parsed_operand_t> operands_;
- spv_parsed_instruction_t inst_;
+ const spv_parsed_instruction_t inst_;
size_t line_num_ = 0;
/// The function in which this instruction was declared
diff --git a/third_party/SPIRV-Tools/source/val/validate.cpp b/third_party/SPIRV-Tools/source/val/validate.cpp
index 3236807..f553a26 100644
--- a/third_party/SPIRV-Tools/source/val/validate.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate.cpp
@@ -22,12 +22,12 @@
#include "source/binary.h"
#include "source/diagnostic.h"
-#include "source/enum_string_mapping.h"
#include "source/extensions.h"
#include "source/opcode.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "source/val/construct.h"
#include "source/val/instruction.h"
#include "source/val/validation_state.h"
@@ -366,6 +366,9 @@
if (auto error = RayTracingPass(*vstate, &instruction)) return error;
if (auto error = RayReorderNVPass(*vstate, &instruction)) return error;
if (auto error = MeshShadingPass(*vstate, &instruction)) return error;
+ if (auto error = TensorLayoutPass(*vstate, &instruction)) return error;
+ if (auto error = TensorPass(*vstate, &instruction)) return error;
+ if (auto error = InvalidTypePass(*vstate, &instruction)) return error;
}
// Validate the preconditions involving adjacent instructions. e.g.
diff --git a/third_party/SPIRV-Tools/source/val/validate.h b/third_party/SPIRV-Tools/source/val/validate.h
index 78093ce..2b4dee2 100644
--- a/third_party/SPIRV-Tools/source/val/validate.h
+++ b/third_party/SPIRV-Tools/source/val/validate.h
@@ -223,9 +223,18 @@
/// Validates correctness of mesh shading instructions.
spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst);
+/// Validates correctness of tensor instructions.
+spv_result_t TensorPass(ValidationState_t& _, const Instruction* inst);
+
+/// Validates correctness of certain special type instructions.
+spv_result_t InvalidTypePass(ValidationState_t& _, const Instruction* inst);
+
/// Calculates the reachability of basic blocks.
void ReachabilityPass(ValidationState_t& _);
+/// Validates tensor layout and view instructions.
+spv_result_t TensorLayoutPass(ValidationState_t& _, const Instruction* inst);
+
/// Validates execution limitations.
///
/// Verifies execution models are allowed for all functionality they contain.
diff --git a/third_party/SPIRV-Tools/source/val/validate_adjacency.cpp b/third_party/SPIRV-Tools/source/val/validate_adjacency.cpp
index 7e371c2..52519bf 100644
--- a/third_party/SPIRV-Tools/source/val/validate_adjacency.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_adjacency.cpp
@@ -52,6 +52,7 @@
adjacency_status == IN_NEW_FUNCTION ? IN_ENTRY_BLOCK : PHI_VALID;
break;
case spv::Op::OpExtInst:
+ case spv::Op::OpExtInstWithForwardRefsKHR:
// If it is a debug info instruction, we do not change the status to
// allow debug info instructions before OpVariable in a function.
// TODO(https://gitlab.khronos.org/spirv/SPIR-V/issues/533): We need
@@ -116,6 +117,15 @@
"first instructions in the first block.";
}
break;
+ case spv::Op::OpUntypedVariableKHR:
+ if (inst.GetOperandAs<spv::StorageClass>(2) ==
+ spv::StorageClass::Function &&
+ adjacency_status != IN_ENTRY_BLOCK) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << "All OpUntypedVariableKHR instructions in a function must "
+ "be the first instructions in the first block.";
+ }
+ break;
default:
adjacency_status = PHI_AND_VAR_INVALID;
break;
diff --git a/third_party/SPIRV-Tools/source/val/validate_annotation.cpp b/third_party/SPIRV-Tools/source/val/validate_annotation.cpp
index dac3585..2545f2f 100644
--- a/third_party/SPIRV-Tools/source/val/validate_annotation.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_annotation.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2018 Google LLC.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -30,6 +32,11 @@
case spv::Decoration::AlignmentId:
case spv::Decoration::MaxByteOffsetId:
case spv::Decoration::HlslCounterBufferGOOGLE:
+ case spv::Decoration::NodeMaxPayloadsAMDX:
+ case spv::Decoration::NodeSharesPayloadLimitsWithAMDX:
+ case spv::Decoration::PayloadNodeArraySizeAMDX:
+ case spv::Decoration::PayloadNodeNameAMDX:
+ case spv::Decoration::PayloadNodeBaseIndexAMDX:
return true;
default:
break;
@@ -123,12 +130,14 @@
case spv::Decoration::ArrayStride:
if (target->opcode() != spv::Op::OpTypeArray &&
target->opcode() != spv::Op::OpTypeRuntimeArray &&
- target->opcode() != spv::Op::OpTypePointer) {
+ target->opcode() != spv::Op::OpTypePointer &&
+ target->opcode() != spv::Op::OpTypeUntypedPointerKHR) {
return fail(0) << "must be an array or pointer type";
}
break;
case spv::Decoration::BuiltIn:
if (target->opcode() != spv::Op::OpVariable &&
+ target->opcode() != spv::Op::OpUntypedVariableKHR &&
!spvOpcodeIsConstant(target->opcode())) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "BuiltIns can only target variables, structure members or "
@@ -139,7 +148,8 @@
if (!spvOpcodeIsConstant(target->opcode())) {
return fail(0) << "must be a constant for WorkgroupSize";
}
- } else if (target->opcode() != spv::Op::OpVariable) {
+ } else if (target->opcode() != spv::Op::OpVariable &&
+ target->opcode() != spv::Op::OpUntypedVariableKHR) {
return fail(0) << "must be a variable";
}
break;
@@ -160,12 +170,14 @@
case spv::Decoration::Stream:
case spv::Decoration::RestrictPointer:
case spv::Decoration::AliasedPointer:
+ case spv::Decoration::PerPrimitiveEXT:
if (target->opcode() != spv::Op::OpVariable &&
+ target->opcode() != spv::Op::OpUntypedVariableKHR &&
target->opcode() != spv::Op::OpFunctionParameter &&
target->opcode() != spv::Op::OpRawAccessChainNV) {
return fail(0) << "must be a memory object declaration";
}
- if (_.GetIdOpcode(target->type_id()) != spv::Op::OpTypePointer) {
+ if (!_.IsPointerType(target->type_id())) {
return fail(0) << "must be a pointer type";
}
break;
@@ -176,7 +188,8 @@
case spv::Decoration::Binding:
case spv::Decoration::DescriptorSet:
case spv::Decoration::InputAttachmentIndex:
- if (target->opcode() != spv::Op::OpVariable) {
+ if (target->opcode() != spv::Op::OpVariable &&
+ target->opcode() != spv::Op::OpUntypedVariableKHR) {
return fail(0) << "must be a variable";
}
break;
@@ -220,7 +233,8 @@
case spv::Decoration::DescriptorSet:
if (sc != spv::StorageClass::StorageBuffer &&
sc != spv::StorageClass::Uniform &&
- sc != spv::StorageClass::UniformConstant) {
+ sc != spv::StorageClass::UniformConstant &&
+ sc != spv::StorageClass::TileAttachmentQCOM) {
return fail(6491) << "must be in the StorageBuffer, Uniform, or "
"UniformConstant storage class";
}
@@ -319,6 +333,14 @@
}
spv_result_t ValidateDecorateId(ValidationState_t& _, const Instruction* inst) {
+ const auto target_id = inst->GetOperandAs<uint32_t>(0);
+ const auto target = _.FindDef(target_id);
+ if (target && spv::Op::OpDecorationGroup == target->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpMemberDecorate Target <id> " << _.getIdName(target_id)
+ << " must not be an OpDecorationGroup instruction.";
+ }
+
const auto decoration = inst->GetOperandAs<spv::Decoration>(1);
if (!DecorationTakesIdParameters(decoration)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -326,6 +348,20 @@
"OpDecorateId";
}
+ for (uint32_t i = 2; i < inst->operands().size(); ++i) {
+ const auto param_id = inst->GetOperandAs<uint32_t>(i);
+ const auto param = _.FindDef(param_id);
+
+ // Both target and param are elements of ordered_instructions we can
+ // determine their relative positions in the SPIR-V module by comparing
+ // pointers.
+ if (target <= param) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Parameter <ID> " << _.getIdName(param_id)
+ << " must appear earlier in the binary than the target";
+ }
+ }
+
// No member decorations take id parameters, so we don't bother checking if
// we are using a member only decoration here.
@@ -374,8 +410,7 @@
if (use->opcode() != spv::Op::OpDecorate &&
use->opcode() != spv::Op::OpGroupDecorate &&
use->opcode() != spv::Op::OpGroupMemberDecorate &&
- use->opcode() != spv::Op::OpName &&
- use->opcode() != spv::Op::OpDecorateId && !use->IsNonSemantic()) {
+ use->opcode() != spv::Op::OpName && !use->IsNonSemantic()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Result id of OpDecorationGroup can only "
<< "be targeted by OpName, OpGroupDecorate, "
diff --git a/third_party/SPIRV-Tools/source/val/validate_arithmetics.cpp b/third_party/SPIRV-Tools/source/val/validate_arithmetics.cpp
index b608a85..38281be 100644
--- a/third_party/SPIRV-Tools/source/val/validate_arithmetics.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_arithmetics.cpp
@@ -40,19 +40,34 @@
bool supportsCoopMat =
(opcode != spv::Op::OpFMul && opcode != spv::Op::OpFRem &&
opcode != spv::Op::OpFMod);
+ bool supportsCoopVec =
+ (opcode != spv::Op::OpFRem && opcode != spv::Op::OpFMod);
if (!_.IsFloatScalarType(result_type) &&
!_.IsFloatVectorType(result_type) &&
!(supportsCoopMat && _.IsFloatCooperativeMatrixType(result_type)) &&
!(opcode == spv::Op::OpFMul &&
_.IsCooperativeMatrixKHRType(result_type) &&
- _.IsFloatCooperativeMatrixType(result_type)))
+ _.IsFloatCooperativeMatrixType(result_type)) &&
+ !(supportsCoopVec && _.IsFloatCooperativeVectorNVType(result_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected floating scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
for (size_t operand_index = 2; operand_index < inst->operands().size();
++operand_index) {
- if (supportsCoopMat && _.IsCooperativeMatrixKHRType(result_type)) {
+ if (supportsCoopVec && _.IsCooperativeVectorNVType(result_type)) {
+ const uint32_t type_id = _.GetOperandTypeId(inst, operand_index);
+ if (!_.IsCooperativeVectorNVType(type_id)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected arithmetic operands to be of Result Type: "
+ << spvOpcodeString(opcode) << " operand index "
+ << operand_index;
+ }
+ spv_result_t ret =
+ _.CooperativeVectorDimensionsMatch(inst, type_id, result_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (supportsCoopMat &&
+ _.IsCooperativeMatrixKHRType(result_type)) {
const uint32_t type_id = _.GetOperandTypeId(inst, operand_index);
if (!_.IsCooperativeMatrixKHRType(type_id) ||
!_.IsFloatCooperativeMatrixType(type_id)) {
@@ -62,7 +77,7 @@
<< operand_index;
}
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, type_id, result_type);
+ _.CooperativeMatrixShapesMatch(inst, result_type, type_id, false);
if (ret != SPV_SUCCESS) return ret;
} else if (_.GetOperandTypeId(inst, operand_index) != result_type)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -76,17 +91,32 @@
case spv::Op::OpUDiv:
case spv::Op::OpUMod: {
bool supportsCoopMat = (opcode == spv::Op::OpUDiv);
+ bool supportsCoopVec = (opcode == spv::Op::OpUDiv);
if (!_.IsUnsignedIntScalarType(result_type) &&
!_.IsUnsignedIntVectorType(result_type) &&
!(supportsCoopMat &&
- _.IsUnsignedIntCooperativeMatrixType(result_type)))
+ _.IsUnsignedIntCooperativeMatrixType(result_type)) &&
+ !(supportsCoopVec &&
+ _.IsUnsignedIntCooperativeVectorNVType(result_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected unsigned int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
for (size_t operand_index = 2; operand_index < inst->operands().size();
++operand_index) {
- if (supportsCoopMat && _.IsCooperativeMatrixKHRType(result_type)) {
+ if (supportsCoopVec && _.IsCooperativeVectorNVType(result_type)) {
+ const uint32_t type_id = _.GetOperandTypeId(inst, operand_index);
+ if (!_.IsCooperativeVectorNVType(type_id)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected arithmetic operands to be of Result Type: "
+ << spvOpcodeString(opcode) << " operand index "
+ << operand_index;
+ }
+ spv_result_t ret =
+ _.CooperativeVectorDimensionsMatch(inst, type_id, result_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (supportsCoopMat &&
+ _.IsCooperativeMatrixKHRType(result_type)) {
const uint32_t type_id = _.GetOperandTypeId(inst, operand_index);
if (!_.IsCooperativeMatrixKHRType(type_id) ||
!_.IsUnsignedIntCooperativeMatrixType(type_id)) {
@@ -96,7 +126,7 @@
<< operand_index;
}
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, type_id, result_type);
+ _.CooperativeMatrixShapesMatch(inst, result_type, type_id, false);
if (ret != SPV_SUCCESS) return ret;
} else if (_.GetOperandTypeId(inst, operand_index) != result_type)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -117,11 +147,14 @@
bool supportsCoopMat =
(opcode != spv::Op::OpIMul && opcode != spv::Op::OpSRem &&
opcode != spv::Op::OpSMod);
+ bool supportsCoopVec =
+ (opcode != spv::Op::OpSRem && opcode != spv::Op::OpSMod);
if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) &&
!(supportsCoopMat && _.IsIntCooperativeMatrixType(result_type)) &&
!(opcode == spv::Op::OpIMul &&
_.IsCooperativeMatrixKHRType(result_type) &&
- _.IsIntCooperativeMatrixType(result_type)))
+ _.IsIntCooperativeMatrixType(result_type)) &&
+ !(supportsCoopVec && _.IsIntCooperativeVectorNVType(result_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -133,6 +166,18 @@
++operand_index) {
const uint32_t type_id = _.GetOperandTypeId(inst, operand_index);
+ if (supportsCoopVec && _.IsCooperativeVectorNVType(result_type)) {
+ if (!_.IsCooperativeVectorNVType(type_id)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected arithmetic operands to be of Result Type: "
+ << spvOpcodeString(opcode) << " operand index "
+ << operand_index;
+ }
+ spv_result_t ret =
+ _.CooperativeVectorDimensionsMatch(inst, type_id, result_type);
+ if (ret != SPV_SUCCESS) return ret;
+ }
+
if (supportsCoopMat && _.IsCooperativeMatrixKHRType(result_type)) {
if (!_.IsCooperativeMatrixKHRType(type_id) ||
!_.IsIntCooperativeMatrixType(type_id)) {
@@ -142,7 +187,7 @@
<< operand_index;
}
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, type_id, result_type);
+ _.CooperativeMatrixShapesMatch(inst, result_type, type_id, false);
if (ret != SPV_SUCCESS) return ret;
}
@@ -151,7 +196,8 @@
!(supportsCoopMat && _.IsIntCooperativeMatrixType(result_type)) &&
!(opcode == spv::Op::OpIMul &&
_.IsCooperativeMatrixKHRType(result_type) &&
- _.IsIntCooperativeMatrixType(result_type))))
+ _.IsIntCooperativeMatrixType(result_type)) &&
+ !(supportsCoopVec && _.IsIntCooperativeVectorNVType(result_type))))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector type as operand: "
<< spvOpcodeString(opcode) << " operand index "
@@ -178,6 +224,14 @@
<< "Expected float scalar type as Result Type: "
<< spvOpcodeString(opcode);
+ if (_.IsBfloat16ScalarType(result_type)) {
+ if (!_.HasCapability(spv::Capability::BFloat16DotProductKHR)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "OpDot Result Type <id> " << _.getIdName(result_type)
+ << "requires BFloat16DotProductKHR be declared.";
+ }
+ }
+
uint32_t first_vector_num_components = 0;
for (size_t operand_index = 2; operand_index < inst->operands().size();
@@ -210,7 +264,8 @@
}
case spv::Op::OpVectorTimesScalar: {
- if (!_.IsFloatVectorType(result_type))
+ if (!_.IsFloatVectorType(result_type) &&
+ !_.IsFloatCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected float vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -672,6 +727,128 @@
break;
}
+ case spv::Op::OpCooperativeMatrixReduceNV: {
+ if (!_.IsCooperativeMatrixKHRType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type must be a cooperative matrix type: "
+ << spvOpcodeString(opcode);
+ }
+
+ const auto result_comp_type_id =
+ _.FindDef(result_type)->GetOperandAs<uint32_t>(1);
+
+ const auto matrix_id = inst->GetOperandAs<uint32_t>(2);
+ const auto matrix = _.FindDef(matrix_id);
+ const auto matrix_type_id = matrix->type_id();
+ if (!_.IsCooperativeMatrixKHRType(matrix_type_id)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Matrix must have a cooperative matrix type: "
+ << spvOpcodeString(opcode);
+ }
+ const auto matrix_type = _.FindDef(matrix_type_id);
+ const auto matrix_comp_type_id = matrix_type->GetOperandAs<uint32_t>(1);
+ if (matrix_comp_type_id != result_comp_type_id) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type and Matrix type must have the same component "
+ "type: "
+ << spvOpcodeString(opcode);
+ }
+ if (_.FindDef(result_type)->GetOperandAs<uint32_t>(2) !=
+ matrix_type->GetOperandAs<uint32_t>(2)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type and Matrix type must have the same scope: "
+ << spvOpcodeString(opcode);
+ }
+
+ if (!_.IsCooperativeMatrixAccType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type must have UseAccumulator: "
+ << spvOpcodeString(opcode);
+ }
+ if (!_.IsCooperativeMatrixAccType(matrix_type_id)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Matrix type must have UseAccumulator: "
+ << spvOpcodeString(opcode);
+ }
+
+ const auto reduce_value = inst->GetOperandAs<uint32_t>(3);
+
+ if ((reduce_value &
+ uint32_t(
+ spv::CooperativeMatrixReduceMask::CooperativeMatrixReduce2x2)) &&
+ (reduce_value & uint32_t(spv::CooperativeMatrixReduceMask::Row |
+ spv::CooperativeMatrixReduceMask::Column))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Reduce 2x2 must not be used with Row/Column: "
+ << spvOpcodeString(opcode);
+ }
+
+ std::tuple<bool, bool, uint32_t> result_rows, result_cols, matrix_rows,
+ matrix_cols;
+ result_rows =
+ _.EvalInt32IfConst(_.FindDef(result_type)->GetOperandAs<uint32_t>(3));
+ result_cols =
+ _.EvalInt32IfConst(_.FindDef(result_type)->GetOperandAs<uint32_t>(4));
+ matrix_rows = _.EvalInt32IfConst(matrix_type->GetOperandAs<uint32_t>(3));
+ matrix_cols = _.EvalInt32IfConst(matrix_type->GetOperandAs<uint32_t>(4));
+
+ if (reduce_value &
+ uint32_t(
+ spv::CooperativeMatrixReduceMask::CooperativeMatrixReduce2x2)) {
+ if (std::get<1>(result_rows) && std::get<1>(result_cols) &&
+ std::get<1>(matrix_rows) && std::get<1>(matrix_cols) &&
+ (std::get<2>(result_rows) != std::get<2>(matrix_rows) / 2 ||
+ std::get<2>(result_cols) != std::get<2>(matrix_cols) / 2)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "For Reduce2x2, result rows/cols must be half of matrix "
+ "rows/cols: "
+ << spvOpcodeString(opcode);
+ }
+ }
+ if (reduce_value == uint32_t(spv::CooperativeMatrixReduceMask::Row)) {
+ if (std::get<1>(result_rows) && std::get<1>(matrix_rows) &&
+ std::get<2>(result_rows) != std::get<2>(matrix_rows)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "For ReduceRow, result rows must match matrix rows: "
+ << spvOpcodeString(opcode);
+ }
+ }
+ if (reduce_value == uint32_t(spv::CooperativeMatrixReduceMask::Column)) {
+ if (std::get<1>(result_cols) && std::get<1>(matrix_cols) &&
+ std::get<2>(result_cols) != std::get<2>(matrix_cols)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "For ReduceColumn, result cols must match matrix cols: "
+ << spvOpcodeString(opcode);
+ }
+ }
+
+ const auto combine_func_id = inst->GetOperandAs<uint32_t>(4);
+ const auto combine_func = _.FindDef(combine_func_id);
+ if (!combine_func || combine_func->opcode() != spv::Op::OpFunction) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "CombineFunc must be a function: " << spvOpcodeString(opcode);
+ }
+ const auto function_type_id = combine_func->GetOperandAs<uint32_t>(3);
+ const auto function_type = _.FindDef(function_type_id);
+ if (function_type->operands().size() != 4) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "CombineFunc must have two parameters: "
+ << spvOpcodeString(opcode);
+ }
+ for (uint32_t i = 0; i < 3; ++i) {
+ // checks return type and two params
+ const auto param_type_id = function_type->GetOperandAs<uint32_t>(i + 1);
+ if (param_type_id != matrix_comp_type_id) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "CombineFunc return type and parameters must match matrix "
+ "component type: "
+ << spvOpcodeString(opcode);
+ }
+ }
+
+ break;
+ }
+
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_atomics.cpp b/third_party/SPIRV-Tools/source/val/validate_atomics.cpp
index 8ddef17..990ed31 100644
--- a/third_party/SPIRV-Tools/source/val/validate_atomics.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_atomics.cpp
@@ -183,7 +183,44 @@
if (!_.GetPointerTypeInfo(pointer_type, &data_type, &storage_class)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< spvOpcodeString(opcode)
- << ": expected Pointer to be of type OpTypePointer";
+ << ": expected Pointer to be a pointer type";
+ }
+
+ // If the pointer is an untyped pointer, get the data type elsewhere.
+ if (data_type == 0) {
+ switch (opcode) {
+ case spv::Op::OpAtomicLoad:
+ case spv::Op::OpAtomicExchange:
+ case spv::Op::OpAtomicFAddEXT:
+ 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::OpAtomicFMinEXT:
+ case spv::Op::OpAtomicSMax:
+ case spv::Op::OpAtomicUMax:
+ case spv::Op::OpAtomicFMaxEXT:
+ case spv::Op::OpAtomicAnd:
+ case spv::Op::OpAtomicOr:
+ case spv::Op::OpAtomicXor:
+ data_type = inst->type_id();
+ break;
+ case spv::Op::OpAtomicFlagTestAndSet:
+ case spv::Op::OpAtomicFlagClear:
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Untyped pointers are not supported by atomic flag "
+ "instructions";
+ break;
+ case spv::Op::OpAtomicStore:
+ data_type = _.FindDef(inst->GetOperandAs<uint32_t>(3))->type_id();
+ break;
+ default:
+ break;
+ }
}
// Can't use result_type because OpAtomicStore doesn't have a result
diff --git a/third_party/SPIRV-Tools/source/val/validate_bitwise.cpp b/third_party/SPIRV-Tools/source/val/validate_bitwise.cpp
index d8d9958..3f739b4 100644
--- a/third_party/SPIRV-Tools/source/val/validate_bitwise.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_bitwise.cpp
@@ -30,18 +30,20 @@
if (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4781)
<< "Expected int scalar or vector type for Base operand: "
<< spvOpcodeString(opcode);
}
// Vulkan has a restriction to 32 bit for base
if (spvIsVulkanEnv(_.context()->target_env)) {
- if (_.GetBitWidth(base_type) != 32) {
+ if (_.GetBitWidth(base_type) != 32 &&
+ !_.options()->allow_vulkan_32_bit_bitwise) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4781)
+ << _.VkErrorID(10824)
<< "Expected 32-bit int type for Base operand: "
- << spvOpcodeString(opcode);
+ << spvOpcodeString(opcode)
+ << _.MissingFeature("maintenance9 feature",
+ "--allow-vulkan-32-bit-bitwise", false);
}
}
@@ -64,7 +66,8 @@
case spv::Op::OpShiftRightLogical:
case spv::Op::OpShiftRightArithmetic:
case spv::Op::OpShiftLeftLogical: {
- if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type))
+ if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) &&
+ !_.IsIntCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -74,7 +77,8 @@
const uint32_t shift_type = _.GetOperandTypeId(inst, 3);
if (!base_type ||
- (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type)))
+ (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type) &&
+ !_.IsIntCooperativeVectorNVType(base_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Base to be int scalar or vector: "
<< spvOpcodeString(opcode);
@@ -90,7 +94,8 @@
<< "as Result Type: " << spvOpcodeString(opcode);
if (!shift_type ||
- (!_.IsIntScalarType(shift_type) && !_.IsIntVectorType(shift_type)))
+ (!_.IsIntScalarType(shift_type) && !_.IsIntVectorType(shift_type) &&
+ !_.IsIntCooperativeVectorNVType(shift_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Shift to be int scalar or vector: "
<< spvOpcodeString(opcode);
@@ -106,7 +111,8 @@
case spv::Op::OpBitwiseXor:
case spv::Op::OpBitwiseAnd:
case spv::Op::OpNot: {
- if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type))
+ if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) &&
+ !_.IsIntCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -118,7 +124,8 @@
++operand_index) {
const uint32_t type_id = _.GetOperandTypeId(inst, operand_index);
if (!type_id ||
- (!_.IsIntScalarType(type_id) && !_.IsIntVectorType(type_id)))
+ (!_.IsIntScalarType(type_id) && !_.IsIntVectorType(type_id) &&
+ !_.IsIntCooperativeVectorNVType(type_id)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector as operand: "
<< spvOpcodeString(opcode) << " operand index "
diff --git a/third_party/SPIRV-Tools/source/val/validate_builtins.cpp b/third_party/SPIRV-Tools/source/val/validate_builtins.cpp
index a7e9942..bbc229c 100644
--- a/third_party/SPIRV-Tools/source/val/validate_builtins.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_builtins.cpp
@@ -22,16 +22,16 @@
#include <map>
#include <set>
#include <sstream>
-#include <stack>
#include <string>
+#include <unordered_map>
#include <vector>
#include "source/opcode.h"
#include "source/spirv_target_env.h"
-#include "source/util/bitutils.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
+#include "spirv/unified1/spirv.hpp11"
namespace spvtools {
namespace val {
@@ -97,12 +97,16 @@
spv::StorageClass GetStorageClass(const Instruction& inst) {
switch (inst.opcode()) {
case spv::Op::OpTypePointer:
+ case spv::Op::OpTypeUntypedPointerKHR:
case spv::Op::OpTypeForwardPointer: {
return spv::StorageClass(inst.word(2));
}
case spv::Op::OpVariable: {
return spv::StorageClass(inst.word(3));
}
+ case spv::Op::OpUntypedVariableKHR: {
+ return spv::StorageClass(inst.word(4));
+ }
case spv::Op::OpGenericCastToPtrExplicit: {
return spv::StorageClass(inst.word(4));
}
@@ -118,7 +122,7 @@
VUIDErrorMax,
} VUIDError;
-const static uint32_t NumVUIDBuiltins = 39;
+const static uint32_t NumVUIDBuiltins = 40;
typedef struct {
spv::BuiltIn builtIn;
@@ -168,6 +172,8 @@
{spv::BuiltIn::PrimitivePointIndicesEXT, {7041, 7043, 7044}},
{spv::BuiltIn::PrimitiveLineIndicesEXT, {7047, 7049, 7050}},
{spv::BuiltIn::PrimitiveTriangleIndicesEXT, {7053, 7055, 7056}},
+ {spv::BuiltIn::CullPrimitiveEXT, {7034, 7035, 7036}},
+
// clang-format on
}};
@@ -265,6 +271,9 @@
// specified. Seeds id_to_at_reference_checks_ with decorated ids if needed.
spv_result_t ValidateSingleBuiltInAtDefinition(const Decoration& decoration,
const Instruction& inst);
+ spv_result_t ValidateSingleBuiltInAtDefinitionVulkan(
+ const Decoration& decoration, const Instruction& inst,
+ const spv::BuiltIn label);
// The following section contains functions which are called when id defined
// by |inst| is decorated with BuiltIn |decoration|.
@@ -364,6 +373,18 @@
spv_result_t ValidateMeshShadingEXTBuiltinsAtDefinition(
const Decoration& decoration, const Instruction& inst);
+ // Used as a common method for validating MeshEXT builtins
+ spv_result_t ValidateMeshBuiltinInterfaceRules(
+ const Decoration& decoration, const Instruction& inst,
+ spv::Op scalar_type, const Instruction& referenced_from_inst);
+ spv_result_t ValidatePrimitiveShadingRateInterfaceRules(
+ const Decoration& decoration, const Instruction& inst,
+ const Instruction& referenced_from_inst);
+ // Builtin that needs check incase **not** used with MeshEXT
+ spv_result_t ValidateNonMeshInterfaceRules(
+ const Decoration& decoration, const Instruction& inst,
+ const Instruction& referenced_from_inst);
+
// The following section contains functions which are called when id defined
// by |referenced_inst| is
// 1. referenced by |referenced_from_inst|
@@ -581,6 +602,10 @@
spv_result_t ValidateBool(
const Decoration& decoration, const Instruction& inst,
const std::function<spv_result_t(const std::string& message)>& diag);
+ spv_result_t ValidateBlockTypeOrArrayedType(
+ const Decoration& decoration, const Instruction& inst,
+ bool& present_in_block, spv::Op expected_scalar_type,
+ const std::function<spv_result_t(const std::string& message)>& diag);
spv_result_t ValidateI(
const Decoration& decoration, const Instruction& inst,
const std::function<spv_result_t(const std::string& message)>& diag);
@@ -663,10 +688,79 @@
// UniformConstant".
std::string GetStorageClassDesc(const Instruction& inst) const;
+ uint64_t GetArrayLength(uint32_t interface_var_id);
+
// Updates inner working of the class. Is called sequentially for every
// instruction.
void Update(const Instruction& inst);
+ bool IsBulitinInEntryPoint(const Instruction& inst, uint32_t entry_point) {
+ auto getUnderlyingTypeId = [&](const Instruction* ifxVar) {
+ auto pointerTypeInst = _.FindDef(ifxVar->type_id());
+ auto typeInst = _.FindDef(pointerTypeInst->GetOperandAs<uint32_t>(2));
+ while (typeInst->opcode() == spv::Op::OpTypeArray) {
+ typeInst = _.FindDef(typeInst->GetOperandAs<uint32_t>(1));
+ };
+ return typeInst->id();
+ };
+
+ const auto* models = _.GetExecutionModels(entry_point);
+ if (models->find(spv::ExecutionModel::MeshEXT) != models->end() ||
+ models->find(spv::ExecutionModel::MeshNV) != models->end()) {
+ for (const auto& desc : _.entry_point_descriptions(entry_point)) {
+ for (auto interface : desc.interfaces) {
+ if (inst.opcode() == spv::Op::OpTypeStruct) {
+ auto varInst = _.FindDef(interface);
+ if (inst.id() == getUnderlyingTypeId(varInst)) {
+ return true;
+ }
+ } else if (inst.id() == interface) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ // Check if "inst" is an interface variable or type of a interface varibale
+ // of any mesh entry point. Populate entry_point_interface_id with all
+ // entry points and interface variables that refer to the "inst"
+ bool isMeshInterfaceVar(
+ const Instruction& inst,
+ std::map<uint32_t, uint32_t>& entry_point_interface_id) {
+ auto getUnderlyingTypeId = [&](const Instruction* ifxVar) {
+ auto pointerTypeInst = _.FindDef(ifxVar->type_id());
+ auto typeInst = _.FindDef(pointerTypeInst->GetOperandAs<uint32_t>(2));
+ while (typeInst->opcode() == spv::Op::OpTypeArray) {
+ typeInst = _.FindDef(typeInst->GetOperandAs<uint32_t>(1));
+ };
+ return typeInst->id();
+ };
+
+ for (const uint32_t entry_point : _.entry_points()) {
+ const auto* models = _.GetExecutionModels(entry_point);
+ if (models->find(spv::ExecutionModel::MeshEXT) != models->end() ||
+ models->find(spv::ExecutionModel::MeshNV) != models->end()) {
+ for (const auto& desc : _.entry_point_descriptions(entry_point)) {
+ for (auto interface : desc.interfaces) {
+ if (inst.opcode() == spv::Op::OpTypeStruct) {
+ auto varInst = _.FindDef(interface);
+ if (inst.id() == getUnderlyingTypeId(varInst)) {
+ entry_point_interface_id[entry_point] = interface;
+ break;
+ }
+ } else if (inst.id() == interface) {
+ entry_point_interface_id[entry_point] = interface;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return !entry_point_interface_id.empty();
+ }
+
ValidationState_t& _;
// Mapping id -> list of rules which validate instruction referencing the
@@ -687,6 +781,10 @@
// Execution models with which the current function can be called.
std::set<spv::ExecutionModel> execution_models_;
+
+ // For Builtin that can only be declared once in an entry point, keep track if
+ // the entry point has it already
+ std::set<uint32_t> cull_primitive_entry_points_;
};
void BuiltInsValidator::Update(const Instruction& inst) {
@@ -741,7 +839,7 @@
ss << " which is decorated with BuiltIn ";
ss << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0]);
+ (uint32_t)decoration.builtin());
if (function_id_) {
ss << " in function <" << function_id_ << ">";
if (execution_model != spv::ExecutionModel::Max) {
@@ -764,6 +862,29 @@
return ss.str();
}
+uint64_t BuiltInsValidator::GetArrayLength(uint32_t interface_var_id) {
+ uint32_t underlying_type;
+ spv::StorageClass storage_class;
+ uint64_t array_len = -1;
+ const Instruction* inst = _.FindDef(interface_var_id);
+ if (inst->opcode() != spv::Op::OpVariable) {
+ return -1;
+ }
+
+ if (!_.GetPointerTypeInfo(inst->type_id(), &underlying_type,
+ &storage_class)) {
+ return 0;
+ }
+ if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) {
+ // Get the array length
+ const auto length_id = _.FindDef(underlying_type)->word(3u);
+ if (!_.EvalConstantValUint64(length_id, &array_len)) {
+ return 0;
+ }
+ }
+ return array_len;
+}
+
spv_result_t BuiltInsValidator::ValidateBool(
const Decoration& decoration, const Instruction& inst,
const std::function<spv_result_t(const std::string& message)>& diag) {
@@ -780,6 +901,55 @@
return SPV_SUCCESS;
}
+spv_result_t BuiltInsValidator::ValidateBlockTypeOrArrayedType(
+ const Decoration& decoration, const Instruction& inst, bool& isBlock,
+ spv::Op expected_scalar_type,
+ const std::function<spv_result_t(const std::string& message)>& diag) {
+ uint32_t underlying_type = 0;
+ int64_t array_len = -1;
+ isBlock = true;
+ if (spv_result_t error =
+ GetUnderlyingType(_, decoration, inst, &underlying_type)) {
+ return error;
+ }
+ // Strip the array, if present.
+ if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) {
+ // Get the array length
+ const auto length_id = _.FindDef(underlying_type)->word(3u);
+ if (!_.EvalConstantValInt64(length_id, &array_len)) {
+ return diag(GetDefinitionDesc(decoration, inst) +
+ " Failed to find the array length.");
+ }
+ underlying_type = _.FindDef(underlying_type)->word(2u);
+ isBlock = false;
+ } else if (!_.HasDecoration(inst.id(), spv::Decoration::Block)) {
+ // If not in array, and bool is in a struct, must be in a Block struct
+ return diag(GetDefinitionDesc(decoration, inst) +
+ " Scalar boolean must be in a Block.");
+ }
+
+ switch (expected_scalar_type) {
+ case spv::Op::OpTypeBool:
+ if (!_.IsBoolScalarType(underlying_type)) {
+ return diag(GetDefinitionDesc(decoration, inst) +
+ " is not a bool scalar.");
+ }
+ break;
+ case spv::Op::OpTypeInt:
+ if (!_.IsIntScalarType(underlying_type)) {
+ return diag(GetDefinitionDesc(decoration, inst) +
+ " is not an integer scalar.");
+ }
+ break;
+ default:
+ assert(0 && "Unhandled scalar type");
+ return diag(GetDefinitionDesc(decoration, inst) +
+ " is not a recognized scalar type.");
+ }
+
+ return SPV_SUCCESS;
+}
+
spv_result_t BuiltInsValidator::ValidateI(
const Decoration& decoration, const Instruction& inst,
const std::function<spv_result_t(const std::string& message)>& diag) {
@@ -1170,7 +1340,7 @@
const char* execution_model_str = _.grammar().lookupOperandName(
SPV_OPERAND_TYPE_EXECUTION_MODEL, uint32_t(execution_model));
const char* built_in_str = _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0]);
+ SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)decoration.builtin());
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< (vuid < 0 ? std::string("") : _.VkErrorID(vuid)) << comment
<< " " << GetIdDesc(referenced_inst) << " depends on "
@@ -1201,13 +1371,14 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input &&
storage_class != spv::StorageClass::Output) {
- uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4190 : 4199;
+ uint32_t vuid =
+ (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4190 : 4199;
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
@@ -1221,7 +1392,8 @@
if (storage_class == spv::StorageClass::Input) {
assert(function_id_ == 0);
- uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4188 : 4197;
+ uint32_t vuid =
+ (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4188 : 4197;
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid,
"Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be "
@@ -1247,7 +1419,8 @@
if (storage_class == spv::StorageClass::Output) {
assert(function_id_ == 0);
- uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4189 : 4198;
+ uint32_t vuid =
+ (decoration.builtin() == spv::BuiltIn::ClipDistance) ? 4189 : 4198;
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid,
"Vulkan spec doesn't allow BuiltIn ClipDistance/CullDistance to be "
@@ -1266,7 +1439,7 @@
[this, &decoration, &referenced_from_inst](
const std::string& message) -> spv_result_t {
uint32_t vuid =
- (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance)
+ (decoration.builtin() == spv::BuiltIn::ClipDistance)
? 4191
: 4200;
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
@@ -1274,7 +1447,7 @@
<< "According to the Vulkan spec BuiltIn "
<< _.grammar().lookupOperandName(
SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit float array. "
<< message;
})) {
@@ -1294,7 +1467,7 @@
[this, &decoration, &referenced_from_inst](
const std::string& message) -> spv_result_t {
uint32_t vuid =
- (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance)
+ (decoration.builtin() == spv::BuiltIn::ClipDistance)
? 4191
: 4200;
return _.diag(SPV_ERROR_INVALID_DATA,
@@ -1303,7 +1476,7 @@
<< "According to the Vulkan spec BuiltIn "
<< _.grammar().lookupOperandName(
SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit float array. "
<< message;
})) {
@@ -1315,7 +1488,7 @@
[this, &decoration, &referenced_from_inst](
const std::string& message) -> spv_result_t {
uint32_t vuid =
- (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance)
+ (decoration.builtin() == spv::BuiltIn::ClipDistance)
? 4191
: 4200;
return _.diag(SPV_ERROR_INVALID_DATA,
@@ -1324,7 +1497,7 @@
<< "According to the Vulkan spec BuiltIn "
<< _.grammar().lookupOperandName(
SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit float array. "
<< message;
})) {
@@ -1335,8 +1508,9 @@
}
default: {
- uint32_t vuid =
- (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::ClipDistance) ? 4187 : 4196;
+ uint32_t vuid = (decoration.builtin() == spv::BuiltIn::ClipDistance)
+ ? 4187
+ : 4196;
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
@@ -2117,38 +2291,6 @@
spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtDefinition(
const Decoration& decoration, const Instruction& inst) {
- if (spvIsVulkanEnv(_.context()->target_env)) {
- // PrimitiveId can be a per-primitive variable for mesh shader stage.
- // In such cases variable will have an array of 32-bit integers.
- if (decoration.struct_member_index() != Decoration::kInvalidMember) {
- // This must be a 32-bit int scalar.
- if (spv_result_t error = ValidateI32(
- decoration, inst,
- [this, &inst](const std::string& message) -> spv_result_t {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(4337)
- << "According to the Vulkan spec BuiltIn PrimitiveId "
- "variable needs to be a 32-bit int scalar. "
- << message;
- })) {
- return error;
- }
- } else {
- if (spv_result_t error = ValidateOptionalArrayedI32(
- decoration, inst,
- [this, &inst](const std::string& message) -> spv_result_t {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(4337)
- << "According to the Vulkan spec BuiltIn PrimitiveId "
- "variable needs to be a 32-bit int scalar. "
- << message;
- })) {
- return error;
- }
- }
- }
-
- // Seed at reference checks with this built-in.
return ValidatePrimitiveIdAtReference(decoration, inst, inst, inst);
}
@@ -2215,6 +2357,27 @@
referenced_from_inst, std::placeholders::_1));
}
+ if (!_.HasCapability(spv::Capability::MeshShadingEXT) &&
+ !_.HasCapability(spv::Capability::MeshShadingNV) &&
+ !_.HasCapability(spv::Capability::Geometry) &&
+ !_.HasCapability(spv::Capability::Tessellation)) {
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, 4333,
+ "Vulkan spec doesn't allow BuiltIn PrimitiveId to be used for "
+ "variables in the Fragment execution model unless it declares "
+ "Geometry, Tessellation, or MeshShader capabilities.",
+ spv::ExecutionModel::Fragment, decoration, built_in_inst,
+ referenced_from_inst, std::placeholders::_1));
+ }
+
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidateMeshBuiltinInterfaceRules, this, decoration,
+ built_in_inst, spv::Op::OpTypeInt, std::placeholders::_1));
+
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
+ std::bind(&BuiltInsValidator::ValidateNonMeshInterfaceRules, this,
+ decoration, built_in_inst, std::placeholders::_1));
+
for (const spv::ExecutionModel execution_model : execution_models_) {
switch (execution_model) {
case spv::ExecutionModel::Fragment:
@@ -2511,6 +2674,13 @@
})) {
return error;
}
+
+ if (!_.HasDecoration(inst.id(), spv::Decoration::Patch)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(10880)
+ << "BuiltIn TessLevelOuter variable needs to also have a Patch "
+ "decoration.";
+ }
}
// Seed at reference checks with this built-in.
@@ -2525,13 +2695,20 @@
[this, &inst](const std::string& message) -> spv_result_t {
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< _.VkErrorID(4397)
- << "According to the Vulkan spec BuiltIn TessLevelOuter "
+ << "According to the Vulkan spec BuiltIn TessLevelInner "
"variable needs to be a 2-component 32-bit float "
"array. "
<< message;
})) {
return error;
}
+
+ if (!_.HasDecoration(inst.id(), spv::Decoration::Patch)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(10880)
+ << "BuiltIn TessLevelInner variable needs to also have a Patch "
+ "decoration.";
+ }
}
// Seed at reference checks with this built-in.
@@ -2542,7 +2719,7 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -2561,7 +2738,8 @@
if (storage_class == spv::StorageClass::Input) {
assert(function_id_ == 0);
- uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::TessLevelOuter) ? 4391 : 4395;
+ uint32_t vuid =
+ (decoration.builtin() == spv::BuiltIn::TessLevelOuter) ? 4391 : 4395;
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid,
"Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be "
@@ -2574,7 +2752,8 @@
if (storage_class == spv::StorageClass::Output) {
assert(function_id_ == 0);
- uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::TessLevelOuter) ? 4392 : 4396;
+ uint32_t vuid =
+ (decoration.builtin() == spv::BuiltIn::TessLevelOuter) ? 4392 : 4396;
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this, vuid,
"Vulkan spec doesn't allow TessLevelOuter/TessLevelInner to be "
@@ -2712,50 +2891,180 @@
return SPV_SUCCESS;
}
-spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition(
- const Decoration& decoration, const Instruction& inst) {
- if (spvIsVulkanEnv(_.context()->target_env)) {
- // This can be a per-primitive variable for mesh shader stage.
- // In such cases variable will have an array of 32-bit integers.
- if (decoration.struct_member_index() != Decoration::kInvalidMember) {
- // This must be a 32-bit int scalar.
- if (spv_result_t error = ValidateI32(
- decoration, inst,
- [this, &decoration,
- &inst](const std::string& message) -> spv_result_t {
- uint32_t vuid =
- (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::Layer) ? 4276 : 4408;
+typedef struct {
+ uint32_t array_type;
+ uint32_t array_size;
+ uint32_t block_array_size;
+ uint32_t perprim_deco;
+} MeshBuiltinVUIDs;
+
+spv_result_t BuiltInsValidator::ValidateMeshBuiltinInterfaceRules(
+ const Decoration& decoration, const Instruction& inst, spv::Op scalar_type,
+ const Instruction& referenced_from_inst) {
+ if (function_id_) {
+ if (execution_models_.count(spv::ExecutionModel::MeshEXT)) {
+ bool is_block = false;
+ const spv::BuiltIn builtin = decoration.builtin();
+
+ static const std::unordered_map<spv::BuiltIn, MeshBuiltinVUIDs>
+ mesh_vuid_map = {{
+ {spv::BuiltIn::CullPrimitiveEXT, {7036, 10589, 10590, 7038}},
+ {spv::BuiltIn::PrimitiveId, {10595, 10596, 10597, 7040}},
+ {spv::BuiltIn::Layer, {10592, 10593, 10594, 7039}},
+ {spv::BuiltIn::ViewportIndex, {10601, 10602, 10603, 7060}},
+ {spv::BuiltIn::PrimitiveShadingRateKHR,
+ {10598, 10599, 10600, 7059}},
+ }};
+ const MeshBuiltinVUIDs& vuids = mesh_vuid_map.at(builtin);
+ if (spv_result_t error = ValidateBlockTypeOrArrayedType(
+ decoration, inst, is_block, scalar_type,
+ [this, &inst, &builtin, &scalar_type,
+ &vuids](const std::string& message) -> spv_result_t {
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(vuid)
- << "According to the Vulkan spec BuiltIn "
+ << _.VkErrorID(vuids.array_type)
+ << "According to the Vulkan specspec BuiltIn "
<< _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0])
- << "variable needs to be a 32-bit int scalar. "
- << message;
+ SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)builtin)
+ << " variable needs to be a either a "
+ << spvOpcodeString(scalar_type)
+ << " or an "
+ "array of "
+ << spvOpcodeString(scalar_type) << ". " << message;
})) {
return error;
}
- } else {
- if (spv_result_t error = ValidateOptionalArrayedI32(
+
+ if (!_.HasDecoration(inst.id(), spv::Decoration::PerPrimitiveEXT)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuids.perprim_deco)
+ << "According to the Vulkan spec the variable decorated with "
+ "Builtin "
+ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)builtin)
+ << " within the MeshEXT Execution Model must also be "
+ << "decorated with the PerPrimitiveEXT decoration. ";
+ }
+
+ // These builtin have the ability to be an array with MeshEXT
+ // When an array, we need to make sure the array size lines up
+ std::map<uint32_t, uint32_t> entry_interface_id_map;
+ bool found = isMeshInterfaceVar(inst, entry_interface_id_map);
+ if (found) {
+ for (const auto& id : entry_interface_id_map) {
+ uint32_t entry_point_id = id.first;
+ uint32_t interface_var_id = id.second;
+
+ const uint64_t interface_size = GetArrayLength(interface_var_id);
+ const uint32_t output_prim_size =
+ _.GetOutputPrimitivesEXT(entry_point_id);
+ if (interface_size != output_prim_size) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(is_block ? vuids.block_array_size
+ : vuids.array_size)
+ << " The size of the array decorated with "
+ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)builtin)
+ << " (" << interface_size
+ << ") must match the value specified by OutputPrimitivesEXT "
+ "("
+ << output_prim_size << "). ";
+ }
+ }
+ }
+ }
+ } else {
+ // Propagate this rule to all dependant ids in the global scope.
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
+ std::bind(&BuiltInsValidator::ValidateMeshBuiltinInterfaceRules, this,
+ decoration, inst, scalar_type, std::placeholders::_1));
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateInterfaceRules(
+ const Decoration& decoration, const Instruction& inst,
+ const Instruction& referenced_from_inst) {
+ if (function_id_) {
+ if (!execution_models_.count(spv::ExecutionModel::MeshEXT)) {
+ if (spv_result_t error = ValidateI32(
decoration, inst,
- [this, &decoration,
- &inst](const std::string& message) -> spv_result_t {
- uint32_t vuid =
- (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::Layer) ? 4276 : 4408;
+ [this, &inst,
+ &decoration](const std::string& message) -> spv_result_t {
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(vuid)
+ << _.VkErrorID(4486)
<< "According to the Vulkan spec BuiltIn "
<< _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0])
- << "variable needs to be a 32-bit int scalar. "
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
+ << " variable needs to be a 32-bit int scalar. "
<< message;
})) {
return error;
}
}
+ } else {
+ // Propagate this rule to all dependant ids in the global scope.
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidatePrimitiveShadingRateInterfaceRules, this,
+ decoration, inst, std::placeholders::_1));
}
+ return SPV_SUCCESS;
+}
- // Seed at reference checks with this built-in.
+// For Layer, ViewportIndex, and PrimitiveId
+spv_result_t BuiltInsValidator::ValidateNonMeshInterfaceRules(
+ const Decoration& decoration, const Instruction& inst,
+ const Instruction& referenced_from_inst) {
+ if (function_id_) {
+ // This can be a per-primitive variable for NV mesh shader stage.
+ // In such cases variable will have an array of 32-bit integers.
+ if (!execution_models_.count(spv::ExecutionModel::MeshEXT)) {
+ const spv::BuiltIn builtin = decoration.builtin();
+ const uint32_t vuid = (builtin == spv::BuiltIn::Layer) ? 4276
+ : (builtin == spv::BuiltIn::ViewportIndex) ? 4408
+ : 4337;
+ if (decoration.struct_member_index() != Decoration::kInvalidMember) {
+ if (spv_result_t error = ValidateI32(
+ decoration, inst,
+ [this, &vuid, builtin,
+ &inst](const std::string& message) -> spv_result_t {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuid)
+ << "According to the Vulkan spec BuiltIn "
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)builtin)
+ << "variable needs to be a 32-bit int scalar. "
+ << message;
+ })) {
+ return error;
+ }
+ } else if (spv_result_t error = ValidateOptionalArrayedI32(
+ decoration, inst,
+ [this, &vuid, builtin,
+ &inst](const std::string& message) -> spv_result_t {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuid)
+ << "According to the Vulkan spec BuiltIn "
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)builtin)
+ << "variable needs to be a 32-bit int scalar. "
+ << message;
+ })) {
+ return error;
+ }
+ }
+ } else {
+ // Propagate this rule to all dependant ids in the global scope.
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
+ std::bind(&BuiltInsValidator::ValidateNonMeshInterfaceRules, this,
+ decoration, inst, std::placeholders::_1));
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtDefinition(
+ const Decoration& decoration, const Instruction& inst) {
return ValidateLayerOrViewportIndexAtReference(decoration, inst, inst, inst);
}
@@ -2763,7 +3072,7 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -2813,6 +3122,14 @@
referenced_from_inst, std::placeholders::_1));
}
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidateMeshBuiltinInterfaceRules, this, decoration,
+ built_in_inst, spv::Op::OpTypeInt, std::placeholders::_1));
+
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
+ std::bind(&BuiltInsValidator::ValidateNonMeshInterfaceRules, this,
+ decoration, built_in_inst, std::placeholders::_1));
+
for (const spv::ExecutionModel execution_model : execution_models_) {
switch (execution_model) {
case spv::ExecutionModel::Geometry:
@@ -2877,7 +3194,7 @@
spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (spv_result_t error = ValidateF32Vec(
decoration, inst, 3,
[this, &inst, builtin](const std::string& message) -> spv_result_t {
@@ -2907,7 +3224,7 @@
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -2951,7 +3268,7 @@
spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (spv_result_t error = ValidateI32Vec(
decoration, inst, 3,
[this, &inst, builtin](const std::string& message) -> spv_result_t {
@@ -2980,7 +3297,7 @@
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -3031,7 +3348,7 @@
spv_result_t BuiltInsValidator::ValidateComputeI32InputAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (decoration.struct_member_index() != Decoration::kInvalidMember) {
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< "BuiltIn "
@@ -3065,7 +3382,7 @@
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -3116,7 +3433,7 @@
spv_result_t BuiltInsValidator::ValidateI32InputAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (decoration.struct_member_index() != Decoration::kInvalidMember) {
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< "BuiltIn "
@@ -3159,7 +3476,7 @@
spv_result_t BuiltInsValidator::ValidateI32Vec4InputAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (decoration.struct_member_index() != Decoration::kInvalidMember) {
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< "BuiltIn "
@@ -3203,16 +3520,8 @@
spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtDefinition(
const Decoration& decoration, const Instruction& inst) {
+ // Vulkan requires 32-bit int, but Universal has no restrictions
if (spvIsVulkanEnv(_.context()->target_env)) {
- if (spvIsVulkanEnv(_.context()->target_env) &&
- !spvOpcodeIsConstant(inst.opcode())) {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(4426)
- << "Vulkan spec requires BuiltIn WorkgroupSize to be a "
- "constant. "
- << GetIdDesc(inst) << " is not a constant.";
- }
-
if (spv_result_t error = ValidateI32Vec(
decoration, inst, 3,
[this, &inst](const std::string& message) -> spv_result_t {
@@ -3227,6 +3536,34 @@
}
}
+ if (!spvOpcodeIsConstant(inst.opcode())) {
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(4426)
+ << "Vulkan spec requires BuiltIn WorkgroupSize to be a "
+ "constant. "
+ << GetIdDesc(inst) << " is not a constant.";
+ }
+ } else if (inst.opcode() == spv::Op::OpConstantComposite) {
+ // can only validate product if static and not spec constant
+ if (_.FindDef(inst.word(3))->opcode() == spv::Op::OpConstant &&
+ _.FindDef(inst.word(4))->opcode() == spv::Op::OpConstant &&
+ _.FindDef(inst.word(5))->opcode() == spv::Op::OpConstant) {
+ uint64_t x_size, y_size, z_size;
+ // ValidateI32Vec above confirms there will be 3 words to read
+ bool static_x = _.EvalConstantValUint64(inst.word(3), &x_size);
+ bool static_y = _.EvalConstantValUint64(inst.word(4), &y_size);
+ bool static_z = _.EvalConstantValUint64(inst.word(5), &z_size);
+ if (static_x && static_y && static_z &&
+ ((x_size * y_size * z_size) == 0)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << "WorkgroupSize decorations must not have a static "
+ "product of zero (X = "
+ << x_size << ", Y = " << y_size << ", Z = " << z_size << ").";
+ }
+ }
+ }
+
// Seed at reference checks with this built-in.
return ValidateWorkgroupSizeAtReference(decoration, inst, inst, inst);
}
@@ -3247,7 +3584,7 @@
<< spvLogStringForEnv(_.context()->target_env)
<< " spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or "
<< "TaskEXT execution model. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
@@ -3273,14 +3610,15 @@
decoration, inst,
[this, &inst,
&decoration](const std::string& message) -> spv_result_t {
- uint32_t vuid = (spv::BuiltIn(decoration.params()[0]) == spv::BuiltIn::BaseInstance)
- ? 4183
- : 4186;
+ uint32_t vuid =
+ (decoration.builtin() == spv::BuiltIn::BaseInstance) ? 4183
+ : 4186;
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< _.VkErrorID(vuid)
<< "According to the Vulkan spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit int scalar. "
<< message;
})) {
@@ -3295,7 +3633,7 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -3346,8 +3684,9 @@
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< _.VkErrorID(4209)
<< "According to the Vulkan spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit int scalar. "
<< message;
})) {
@@ -3362,7 +3701,7 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -3416,8 +3755,9 @@
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< _.VkErrorID(4403)
<< "According to the Vulkan spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit int scalar. "
<< message;
})) {
@@ -3432,7 +3772,7 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -3480,8 +3820,9 @@
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< _.VkErrorID(4206)
<< "According to the Vulkan spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit int scalar. "
<< message;
})) {
@@ -3496,7 +3837,7 @@
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
- uint32_t operand = decoration.params()[0];
+ uint32_t operand = (uint32_t)decoration.builtin();
if (spvIsVulkanEnv(_.context()->target_env)) {
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -3526,7 +3867,7 @@
const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (spv_result_t error = ValidateI32(
decoration, inst,
[this, &inst, &builtin](const std::string& message) -> spv_result_t {
@@ -3553,7 +3894,7 @@
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -3596,7 +3937,7 @@
spv_result_t BuiltInsValidator::ValidateFragSizeAtDefinition(const Decoration& decoration,
const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (spv_result_t error = ValidateI32Vec(
decoration, inst, 2,
[this, &inst, &builtin](const std::string& message) -> spv_result_t {
@@ -3623,7 +3964,7 @@
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -3666,7 +4007,7 @@
spv_result_t BuiltInsValidator::ValidateFragStencilRefAtDefinition(const Decoration& decoration,
const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (spv_result_t error = ValidateI(
decoration, inst,
[this, &inst, &builtin](const std::string& message) -> spv_result_t {
@@ -3693,7 +4034,7 @@
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Output) {
@@ -3736,7 +4077,7 @@
spv_result_t BuiltInsValidator::ValidateFullyCoveredAtDefinition(const Decoration& decoration,
const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
if (spv_result_t error = ValidateBool(
decoration, inst,
[this, &inst, &builtin](const std::string& message) -> spv_result_t {
@@ -3763,7 +4104,7 @@
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -3814,8 +4155,9 @@
<< "According to the "
<< spvLogStringForEnv(_.context()->target_env)
<< " spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit int scalar. "
<< message;
})) {
@@ -3839,7 +4181,7 @@
<< spvLogStringForEnv(_.context()->target_env)
<< " spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be only used for "
"variables with Input storage class. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
@@ -3860,24 +4202,6 @@
spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtDefinition(
const Decoration& decoration, const Instruction& inst) {
- if (spvIsVulkanEnv(_.context()->target_env)) {
- if (spv_result_t error = ValidateI32(
- decoration, inst,
- [this, &inst,
- &decoration](const std::string& message) -> spv_result_t {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(4486)
- << "According to the Vulkan spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
- << " variable needs to be a 32-bit int scalar. "
- << message;
- })) {
- return error;
- }
- }
-
- // Seed at reference checks with this built-in.
return ValidatePrimitiveShadingRateAtReference(decoration, inst, inst, inst);
}
@@ -3892,13 +4216,21 @@
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(4485) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be only used for variables with Output storage class. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst)
<< " " << GetStorageClassDesc(referenced_from_inst);
}
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidateMeshBuiltinInterfaceRules, this, decoration,
+ built_in_inst, spv::Op::OpTypeInt, std::placeholders::_1));
+
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidatePrimitiveShadingRateInterfaceRules, this,
+ decoration, built_in_inst, std::placeholders::_1));
+
for (const spv::ExecutionModel execution_model : execution_models_) {
switch (execution_model) {
case spv::ExecutionModel::Vertex:
@@ -3909,9 +4241,10 @@
default: {
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(4484) << "Vulkan spec allows BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
- << " to be used only with Vertex, Geometry, or MeshNV "
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
+ << " to be used only with Vertex, Geometry, MeshNV or MeshEXT "
"execution models. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
@@ -3941,8 +4274,9 @@
return _.diag(SPV_ERROR_INVALID_DATA, &inst)
<< _.VkErrorID(4492)
<< "According to the Vulkan spec BuiltIn "
- << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
<< " variable needs to be a 32-bit int scalar. "
<< message;
})) {
@@ -3965,7 +4299,7 @@
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(4491) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be only used for variables with Input storage class. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst)
@@ -3977,7 +4311,7 @@
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(4490) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be used only with the Fragment execution model. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
@@ -3998,7 +4332,7 @@
spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
switch (builtin) {
case spv::BuiltIn::HitTNV:
case spv::BuiltIn::RayTminKHR:
@@ -4121,7 +4455,7 @@
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class = GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
storage_class != spv::StorageClass::Input) {
@@ -4129,7 +4463,7 @@
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(vuid) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be only used for variables with Input storage class. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst)
@@ -4142,10 +4476,11 @@
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(vuid) << "Vulkan spec does not allow BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
- decoration.params()[0])
+ (uint32_t)decoration.builtin())
<< " to be used with the execution model "
<< _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_EXECUTION_MODEL, uint32_t(execution_model))
+ SPV_OPERAND_TYPE_EXECUTION_MODEL,
+ uint32_t(execution_model))
<< ".\n"
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
@@ -4167,59 +4502,161 @@
spv_result_t BuiltInsValidator::ValidateMeshShadingEXTBuiltinsAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorType);
- if (builtin == spv::BuiltIn::PrimitivePointIndicesEXT) {
- if (spv_result_t error = ValidateI32Arr(
- decoration, inst,
- [this, &inst, &decoration,
- &vuid](const std::string& message) -> spv_result_t {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(vuid) << "According to the "
- << spvLogStringForEnv(_.context()->target_env)
- << " spec BuiltIn "
- << _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0])
- << " variable needs to be a 32-bit int array."
- << message;
- })) {
+ switch (builtin) {
+ case spv::BuiltIn::PrimitivePointIndicesEXT:
+ if (spv_result_t error = ValidateI32Arr(
+ decoration, inst,
+ [this, &inst, &decoration,
+ &vuid](const std::string& message) -> spv_result_t {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuid) << "According to the "
+ << spvLogStringForEnv(_.context()->target_env)
+ << " spec BuiltIn "
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
+ << " variable needs to be a 32-bit int array."
+ << message;
+ })) {
+ return error;
+ }
+ break;
+ case spv::BuiltIn::PrimitiveLineIndicesEXT:
+ if (spv_result_t error = ValidateArrayedI32Vec(
+ decoration, inst, 2,
+ [this, &inst, &decoration,
+ &vuid](const std::string& message) -> spv_result_t {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuid) << "According to the "
+ << spvLogStringForEnv(_.context()->target_env)
+ << " spec BuiltIn "
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
+ << " variable needs to be a 2-component 32-bit int "
+ "array."
+ << message;
+ })) {
+ return error;
+ }
+ break;
+ case spv::BuiltIn::PrimitiveTriangleIndicesEXT:
+ if (spv_result_t error = ValidateArrayedI32Vec(
+ decoration, inst, 3,
+ [this, &inst, &decoration,
+ &vuid](const std::string& message) -> spv_result_t {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuid) << "According to the "
+ << spvLogStringForEnv(_.context()->target_env)
+ << " spec BuiltIn "
+ << _.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN,
+ (uint32_t)decoration.builtin())
+ << " variable needs to be a 3-component 32-bit int "
+ "array."
+ << message;
+ })) {
+ return error;
+ }
+ break;
+ case spv::BuiltIn::CullPrimitiveEXT: {
+ // We know this only allowed for Mesh Execution Model
+ if (spv_result_t error = ValidateMeshBuiltinInterfaceRules(
+ decoration, inst, spv::Op::OpTypeBool, inst)) {
+ return error;
+ }
+
+ for (const uint32_t entry_point : _.entry_points()) {
+ if (IsBulitinInEntryPoint(inst, entry_point)) {
+ if (cull_primitive_entry_points_.find(entry_point) !=
+ cull_primitive_entry_points_.end()) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(10591)
+ << "There must be only one declaration of the "
+ "CullPrimitiveEXT associated in entry point's "
+ "interface. "
+ << GetIdDesc(*_.FindDef(entry_point));
+ } else {
+ cull_primitive_entry_points_.insert(entry_point);
+ }
+ }
+ }
+
+ break;
+ }
+ default:
+ assert(0 && "Unexpected mesh EXT builtin");
+ }
+ for (const uint32_t entry_point : _.entry_points()) {
+ const auto* modes = _.GetExecutionModes(entry_point);
+ uint64_t maxOutputPrimitives = _.GetOutputPrimitivesEXT(entry_point);
+ uint32_t underlying_type = 0;
+ if (spv_result_t error =
+ GetUnderlyingType(_, decoration, inst, &underlying_type)) {
return error;
}
- }
- if (builtin == spv::BuiltIn::PrimitiveLineIndicesEXT) {
- if (spv_result_t error = ValidateArrayedI32Vec(
- decoration, inst, 2,
- [this, &inst, &decoration,
- &vuid](const std::string& message) -> spv_result_t {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(vuid) << "According to the "
- << spvLogStringForEnv(_.context()->target_env)
- << " spec BuiltIn "
- << _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0])
- << " variable needs to be a 2-component 32-bit int "
- "array."
- << message;
- })) {
- return error;
+
+ uint64_t primitiveArrayDim = 0;
+ if (_.GetIdOpcode(underlying_type) == spv::Op::OpTypeArray) {
+ underlying_type = _.FindDef(underlying_type)->word(3u);
+ if (!_.EvalConstantValUint64(underlying_type, &primitiveArrayDim)) {
+ assert(0 && "Array type definition is corrupt");
+ }
}
- }
- if (builtin == spv::BuiltIn::PrimitiveTriangleIndicesEXT) {
- if (spv_result_t error = ValidateArrayedI32Vec(
- decoration, inst, 3,
- [this, &inst, &decoration,
- &vuid](const std::string& message) -> spv_result_t {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << _.VkErrorID(vuid) << "According to the "
- << spvLogStringForEnv(_.context()->target_env)
- << " spec BuiltIn "
- << _.grammar().lookupOperandName(
- SPV_OPERAND_TYPE_BUILT_IN, decoration.params()[0])
- << " variable needs to be a 3-component 32-bit int "
- "array."
- << message;
- })) {
- return error;
+ switch (builtin) {
+ case spv::BuiltIn::PrimitivePointIndicesEXT:
+ if (!modes || !modes->count(spv::ExecutionMode::OutputPoints)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(7042)
+ << "The PrimitivePointIndicesEXT decoration must be used "
+ "with "
+ "the OutputPoints Execution Mode. ";
+ }
+ if (primitiveArrayDim && primitiveArrayDim != maxOutputPrimitives) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(7046)
+ << "The size of the array decorated with "
+ "PrimitivePointIndicesEXT must match the value specified "
+ "by OutputPrimitivesEXT. ";
+ }
+ break;
+ case spv::BuiltIn::PrimitiveLineIndicesEXT:
+ if (!modes || !modes->count(spv::ExecutionMode::OutputLinesEXT)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(7048)
+ << "The PrimitiveLineIndicesEXT decoration must be used "
+ "with "
+ "the OutputLinesEXT Execution Mode. ";
+ }
+ if (primitiveArrayDim && primitiveArrayDim != maxOutputPrimitives) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(7052)
+ << "The size of the array decorated with "
+ "PrimitiveLineIndicesEXT must match the value specified "
+ "by OutputPrimitivesEXT. ";
+ }
+ break;
+ case spv::BuiltIn::PrimitiveTriangleIndicesEXT:
+ if (!modes || !modes->count(spv::ExecutionMode::OutputTrianglesEXT)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(7054)
+ << "The PrimitiveTriangleIndicesEXT decoration must be used "
+ "with "
+ "the OutputTrianglesEXT Execution Mode. ";
+ }
+ if (primitiveArrayDim && primitiveArrayDim != maxOutputPrimitives) {
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(7058)
+ << "The size of the array decorated with "
+ "PrimitiveTriangleIndicesEXT must match the value "
+ "specified "
+ "by OutputPrimitivesEXT. ";
+ }
+ break;
+ default:
+ break; // no validation rules
}
}
}
@@ -4233,7 +4670,7 @@
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
- const spv::BuiltIn builtin = spv::BuiltIn(decoration.params()[0]);
+ const spv::BuiltIn builtin = decoration.builtin();
const spv::StorageClass storage_class =
GetStorageClass(referenced_from_inst);
if (storage_class != spv::StorageClass::Max &&
@@ -4249,7 +4686,6 @@
referenced_from_inst)
<< " " << GetStorageClassDesc(referenced_from_inst);
}
-
for (const spv::ExecutionModel execution_model : execution_models_) {
if (execution_model != spv::ExecutionModel::MeshEXT) {
uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel);
@@ -4279,19 +4715,21 @@
spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
const Decoration& decoration, const Instruction& inst) {
- const spv::BuiltIn label = spv::BuiltIn(decoration.params()[0]);
-
- if (!spvIsVulkanEnv(_.context()->target_env)) {
- // Early return. All currently implemented rules are based on Vulkan spec.
- //
- // TODO: If you are adding validation rules for environments other than
- // Vulkan (or general rules which are not environment independent), then
- // you need to modify or remove this condition. Consider also adding early
- // returns into BuiltIn-specific rules, so that the system doesn't spawn new
- // rules which don't do anything.
- return SPV_SUCCESS;
+ const spv::BuiltIn label = decoration.builtin();
+ // Universial checks
+ if (label == spv::BuiltIn::WorkgroupSize) {
+ return ValidateWorkgroupSizeAtDefinition(decoration, inst);
}
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ return ValidateSingleBuiltInAtDefinitionVulkan(decoration, inst, label);
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinitionVulkan(
+ const Decoration& decoration, const Instruction& inst,
+ const spv::BuiltIn label) {
// If you are adding a new BuiltIn enum, please register it here.
// If the newly added enum has validation rules associated with it
// consider leaving a TODO and/or creating an issue.
@@ -4383,9 +4821,6 @@
case spv::BuiltIn::VertexIndex: {
return ValidateVertexIndexAtDefinition(decoration, inst);
}
- case spv::BuiltIn::WorkgroupSize: {
- return ValidateWorkgroupSizeAtDefinition(decoration, inst);
- }
case spv::BuiltIn::VertexId: {
return ValidateVertexIdAtDefinition(decoration, inst);
}
@@ -4452,6 +4887,7 @@
case spv::BuiltIn::CullMaskKHR: {
return ValidateRayTracingBuiltinsAtDefinition(decoration, inst);
}
+ case spv::BuiltIn::CullPrimitiveEXT:
case spv::BuiltIn::PrimitivePointIndicesEXT:
case spv::BuiltIn::PrimitiveLineIndicesEXT:
case spv::BuiltIn::PrimitiveTriangleIndicesEXT: {
diff --git a/third_party/SPIRV-Tools/source/val/validate_capability.cpp b/third_party/SPIRV-Tools/source/val/validate_capability.cpp
index 81d2ad5..05ccb11 100644
--- a/third_party/SPIRV-Tools/source/val/validate_capability.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_capability.cpp
@@ -18,6 +18,7 @@
#include <string>
#include "source/opcode.h"
+#include "source/table2.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
@@ -67,6 +68,50 @@
return false;
}
+bool IsSupportGuaranteedVulkan_1_3(uint32_t capability) {
+ if (IsSupportGuaranteedVulkan_1_2(capability)) return true;
+ switch (spv::Capability(capability)) {
+ case spv::Capability::DotProduct:
+ case spv::Capability::DotProductInputAll:
+ case spv::Capability::DotProductInput4x8Bit:
+ case spv::Capability::DotProductInput4x8BitPacked:
+ case spv::Capability::VulkanMemoryModel:
+ case spv::Capability::VulkanMemoryModelDeviceScope:
+ case spv::Capability::PhysicalStorageBufferAddresses:
+ case spv::Capability::DemoteToHelperInvocation:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+bool IsSupportGuaranteedVulkan_1_4(uint32_t capability) {
+ if (IsSupportGuaranteedVulkan_1_3(capability)) return true;
+ switch (spv::Capability(capability)) {
+ case spv::Capability::UniformBufferArrayDynamicIndexing:
+ case spv::Capability::SampledImageArrayDynamicIndexing:
+ case spv::Capability::StorageBufferArrayDynamicIndexing:
+ case spv::Capability::StorageImageArrayDynamicIndexing:
+ case spv::Capability::Int16:
+ case spv::Capability::StorageBuffer16BitAccess:
+ case spv::Capability::VariablePointers:
+ case spv::Capability::VariablePointersStorageBuffer:
+ case spv::Capability::UniformTexelBufferArrayDynamicIndexing:
+ case spv::Capability::StorageTexelBufferArrayDynamicIndexing:
+ case spv::Capability::Int8:
+ case spv::Capability::StorageBuffer8BitAccess:
+ case spv::Capability::FloatControls2:
+ case spv::Capability::SampleRateShading:
+ case spv::Capability::StorageImageExtendedFormats:
+ case spv::Capability::ImageGatherExtended:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
bool IsSupportOptionalVulkan_1_0(uint32_t capability) {
switch (spv::Capability(capability)) {
case spv::Capability::Geometry:
@@ -100,6 +145,8 @@
case spv::Capability::GeometryStreams:
case spv::Capability::Float16:
case spv::Capability::Int8:
+ case spv::Capability::BFloat16TypeKHR:
+ case spv::Capability::Float8EXT:
return true;
default:
break;
@@ -171,6 +218,16 @@
return false;
}
+// Vulkan 1.3 only added required features.
+bool IsSupportOptionalVulkan_1_3(uint32_t capability) {
+ return IsSupportOptionalVulkan_1_2(capability);
+}
+
+// Vulkan 1.4 only added required features.
+bool IsSupportOptionalVulkan_1_4(uint32_t capability) {
+ return IsSupportOptionalVulkan_1_3(capability);
+}
+
bool IsSupportGuaranteedOpenCL_1_2(uint32_t capability, bool embedded_profile) {
switch (spv::Capability(capability)) {
case spv::Capability::Addresses:
@@ -221,6 +278,7 @@
switch (spv::Capability(capability)) {
case spv::Capability::ImageBasic:
case spv::Capability::Float64:
+ case spv::Capability::Float16:
return true;
default:
break;
@@ -230,16 +288,16 @@
// Checks if |capability| was enabled by extension.
bool IsEnabledByExtension(ValidationState_t& _, uint32_t capability) {
- spv_operand_desc operand_desc = nullptr;
- _.grammar().lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability,
- &operand_desc);
+ const spvtools::OperandDesc* operand_desc = nullptr;
+ spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability,
+ &operand_desc);
// operand_desc is expected to be not null, otherwise validator would have
// failed at an earlier stage. This 'assert' is 'just in case'.
assert(operand_desc);
- ExtensionSet operand_exts(operand_desc->numExtensions,
- operand_desc->extensions);
+ ExtensionSet operand_exts(operand_desc->extensions_range.count(),
+ operand_desc->extensions().data());
if (operand_exts.empty()) return false;
return _.HasAnyOfExtensions(operand_exts);
@@ -297,14 +355,14 @@
assert(operand.offset < inst->words().size());
const uint32_t capability = inst->word(operand.offset);
- const auto capability_str = [&_, capability]() {
- spv_operand_desc desc = nullptr;
- if (_.grammar().lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability,
- &desc) != SPV_SUCCESS ||
+ const auto capability_str = [capability]() {
+ const spvtools::OperandDesc* desc = nullptr;
+ if (spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY, capability,
+ &desc) != SPV_SUCCESS ||
!desc) {
return std::string("Unknown");
}
- return std::string(desc->name);
+ return std::string(desc->name().data());
};
const auto env = _.context()->target_env;
@@ -340,6 +398,24 @@
<< " is not allowed by Vulkan 1.2 specification"
<< " (or requires extension)";
}
+ } else if (env == SPV_ENV_VULKAN_1_3) {
+ if (!IsSupportGuaranteedVulkan_1_3(capability) &&
+ !IsSupportOptionalVulkan_1_3(capability) &&
+ !IsEnabledByExtension(_, capability)) {
+ return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst)
+ << "Capability " << capability_str()
+ << " is not allowed by Vulkan 1.3 specification"
+ << " (or requires extension)";
+ }
+ } else if (env == SPV_ENV_VULKAN_1_4) {
+ if (!IsSupportGuaranteedVulkan_1_4(capability) &&
+ !IsSupportOptionalVulkan_1_4(capability) &&
+ !IsEnabledByExtension(_, capability)) {
+ return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst)
+ << "Capability " << capability_str()
+ << " is not allowed by Vulkan 1.4 specification"
+ << " (or requires extension)";
+ }
} else if (env == SPV_ENV_OPENCL_1_2 || env == SPV_ENV_OPENCL_EMBEDDED_1_2) {
if (!IsSupportGuaranteedOpenCL_1_2(capability, opencl_embedded) &&
!IsSupportOptionalOpenCL_1_2(capability) &&
diff --git a/third_party/SPIRV-Tools/source/val/validate_cfg.cpp b/third_party/SPIRV-Tools/source/val/validate_cfg.cpp
index 9b7161f..b7e570d 100644
--- a/third_party/SPIRV-Tools/source/val/validate_cfg.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_cfg.cpp
@@ -250,7 +250,8 @@
}
if (_.addressing_model() == spv::AddressingModel::Logical &&
- spv::Op::OpTypePointer == value_type->opcode() &&
+ (spv::Op::OpTypePointer == value_type->opcode() ||
+ spv::Op::OpTypeUntypedPointerKHR == value_type->opcode()) &&
!_.features().variable_pointers && !_.options()->relax_logical_pointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpReturnValue value's type <id> "
@@ -467,13 +468,13 @@
// headed by |target_block| branches to multiple case constructs.
spv_result_t FindCaseFallThrough(
ValidationState_t& _, BasicBlock* target_block, uint32_t* case_fall_through,
- const BasicBlock* merge, const std::unordered_set<uint32_t>& case_targets,
- Function* function) {
+ const Construct& switch_construct,
+ const std::unordered_set<uint32_t>& case_targets) {
+ const auto* merge = switch_construct.exit_block();
std::vector<BasicBlock*> stack;
stack.push_back(target_block);
std::unordered_set<const BasicBlock*> visited;
bool target_reachable = target_block->structurally_reachable();
- int target_depth = function->GetBlockDepth(target_block);
while (!stack.empty()) {
auto block = stack.back();
stack.pop_back();
@@ -491,9 +492,14 @@
} else {
// Exiting the case construct to non-merge block.
if (!case_targets.count(block->id())) {
- int depth = function->GetBlockDepth(block);
- if ((depth < target_depth) ||
- (depth == target_depth && block->is_type(kBlockTypeContinue))) {
+ // We have already filtered out the following:
+ // * The switch's merge
+ // * Other case targets
+ // * Blocks in the same case construct
+ //
+ // So the only remaining valid branches are the structured exits from
+ // the overall selection construct of the switch.
+ if (switch_construct.IsStructuredExit(_, block)) {
continue;
}
@@ -525,9 +531,10 @@
}
spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function,
- const Instruction* switch_inst,
- const BasicBlock* header,
- const BasicBlock* merge) {
+ const Construct& switch_construct) {
+ const auto* header = switch_construct.entry_block();
+ const auto* merge = switch_construct.exit_block();
+ const auto* switch_inst = header->terminator();
std::unordered_set<uint32_t> case_targets;
for (uint32_t i = 1; i < switch_inst->operands().size(); i += 2) {
uint32_t target = switch_inst->GetOperandAs<uint32_t>(i);
@@ -545,6 +552,7 @@
break;
}
}
+
std::unordered_map<uint32_t, uint32_t> seen_to_fall_through;
for (uint32_t i = 1; i < switch_inst->operands().size(); i += 2) {
uint32_t target = switch_inst->GetOperandAs<uint32_t>(i);
@@ -565,7 +573,7 @@
}
if (auto error = FindCaseFallThrough(_, target_block, &case_fall_through,
- merge, case_targets, function)) {
+ switch_construct, case_targets)) {
return error;
}
@@ -838,6 +846,9 @@
const auto* continue_target = next_inst.block();
if (header->id() != continue_id) {
for (auto pred : *continue_target->predecessors()) {
+ if (!pred->structurally_reachable()) {
+ continue;
+ }
// Ignore back-edges from within the continue construct.
bool is_back_edge = false;
for (auto back_edge : back_edges) {
@@ -862,9 +873,7 @@
// Checks rules for case constructs.
if (construct.type() == ConstructType::kSelection &&
header->terminator()->opcode() == spv::Op::OpSwitch) {
- const auto terminator = header->terminator();
- if (auto error =
- StructuredSwitchChecks(_, function, terminator, header, merge)) {
+ if (auto error = StructuredSwitchChecks(_, function, construct)) {
return error;
}
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_composites.cpp b/third_party/SPIRV-Tools/source/val/validate_composites.cpp
index 26486da..2afeae7 100644
--- a/third_party/SPIRV-Tools/source/val/validate_composites.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_composites.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2017 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -104,7 +106,8 @@
}
break;
}
- case spv::Op::OpTypeRuntimeArray: {
+ case spv::Op::OpTypeRuntimeArray:
+ case spv::Op::OpTypeNodePayloadArrayAMDX: {
*member_type = type_inst->word(2);
// Array size is unknown.
break;
@@ -122,6 +125,7 @@
*member_type = type_inst->word(component_index + 2);
break;
}
+ case spv::Op::OpTypeCooperativeVectorNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
case spv::Op::OpTypeCooperativeMatrixNV: {
*member_type = type_inst->word(2);
@@ -148,7 +152,8 @@
const uint32_t vector_type = _.GetOperandTypeId(inst, 2);
const spv::Op vector_opcode = _.GetIdOpcode(vector_type);
- if (vector_opcode != spv::Op::OpTypeVector) {
+ if (vector_opcode != spv::Op::OpTypeVector &&
+ vector_opcode != spv::Op::OpTypeCooperativeVectorNV) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Vector type to be OpTypeVector";
}
@@ -176,7 +181,8 @@
const Instruction* inst) {
const uint32_t result_type = inst->type_id();
const spv::Op result_opcode = _.GetIdOpcode(result_type);
- if (result_opcode != spv::Op::OpTypeVector) {
+ if (result_opcode != spv::Op::OpTypeVector &&
+ result_opcode != spv::Op::OpTypeCooperativeVectorNV) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Result Type to be OpTypeVector";
}
@@ -214,14 +220,24 @@
const uint32_t result_type = inst->type_id();
const spv::Op result_opcode = _.GetIdOpcode(result_type);
switch (result_opcode) {
- case spv::Op::OpTypeVector: {
- const uint32_t num_result_components = _.GetDimension(result_type);
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeCooperativeVectorNV: {
+ uint32_t num_result_components = _.GetDimension(result_type);
const uint32_t result_component_type = _.GetComponentType(result_type);
uint32_t given_component_count = 0;
- if (num_operands <= 3) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected number of constituents to be at least 2";
+ bool comp_is_int32 = true, comp_is_const_int32 = true;
+
+ if (result_opcode == spv::Op::OpTypeVector) {
+ if (num_operands <= 3) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected number of constituents to be at least 2";
+ }
+ } else {
+ uint32_t comp_count_id =
+ _.FindDef(result_type)->GetOperandAs<uint32_t>(2);
+ std::tie(comp_is_int32, comp_is_const_int32, num_result_components) =
+ _.EvalInt32IfConst(comp_count_id);
}
for (uint32_t operand_index = 2; operand_index < num_operands;
@@ -241,7 +257,8 @@
}
}
- if (num_result_components != given_component_count) {
+ if (comp_is_const_int32 &&
+ num_result_components != given_component_count) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected total number of given components to be equal "
<< "to the size of Result Type vector";
diff --git a/third_party/SPIRV-Tools/source/val/validate_constants.cpp b/third_party/SPIRV-Tools/source/val/validate_constants.cpp
index 4deaa49..08a1496 100644
--- a/third_party/SPIRV-Tools/source/val/validate_constants.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_constants.cpp
@@ -33,12 +33,19 @@
return SPV_SUCCESS;
}
+bool isCompositeType(const Instruction* inst) {
+ bool is_tensor = inst->opcode() == spv::Op::OpTypeTensorARM;
+ bool tensor_is_shaped = inst->words().size() == 5;
+ return spvOpcodeIsComposite(inst->opcode()) ||
+ (is_tensor && tensor_is_shaped);
+}
+
spv_result_t ValidateConstantComposite(ValidationState_t& _,
const Instruction* inst) {
std::string opcode_name = std::string("Op") + spvOpcodeString(inst->opcode());
const auto result_type = _.FindDef(inst->type_id());
- if (!result_type || !spvOpcodeIsComposite(result_type->opcode())) {
+ if (!result_type || !isCompositeType(result_type)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< opcode_name << " Result Type <id> "
<< _.getIdName(inst->type_id()) << " is not a composite type.";
@@ -46,9 +53,18 @@
const auto constituent_count = inst->words().size() - 3;
switch (result_type->opcode()) {
- case spv::Op::OpTypeVector: {
- const auto component_count = result_type->GetOperandAs<uint32_t>(2);
- if (component_count != constituent_count) {
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeCooperativeVectorNV: {
+ uint32_t num_result_components = _.GetDimension(result_type->id());
+ bool comp_is_int32 = true, comp_is_const_int32 = true;
+
+ if (result_type->opcode() == spv::Op::OpTypeCooperativeVectorNV) {
+ uint32_t comp_count_id = result_type->GetOperandAs<uint32_t>(2);
+ std::tie(comp_is_int32, comp_is_const_int32, num_result_components) =
+ _.EvalInt32IfConst(comp_count_id);
+ }
+
+ if (comp_is_const_int32 && num_result_components != constituent_count) {
// TODO: Output ID's on diagnostic
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< opcode_name
@@ -273,6 +289,141 @@
<< _.getIdName(result_type->id()) << "s component type.";
}
} break;
+ case spv::Op::OpTypeTensorARM: {
+ auto inst_element_type =
+ _.FindDef(result_type->GetOperandAs<uint32_t>(1));
+ if (!inst_element_type) {
+ return _.diag(SPV_ERROR_INVALID_ID, result_type)
+ << "Element type is not defined.";
+ }
+ const auto inst_rank = _.FindDef(result_type->GetOperandAs<uint32_t>(2));
+ if (!inst_rank) {
+ return _.diag(SPV_ERROR_INVALID_ID, result_type)
+ << "Rank is not defined.";
+ }
+ const auto inst_shape = _.FindDef(result_type->GetOperandAs<uint32_t>(3));
+ if (!inst_shape) {
+ return _.diag(SPV_ERROR_INVALID_ID, result_type)
+ << "Shape is not defined.";
+ }
+
+ uint64_t rank = 0;
+ _.EvalConstantValUint64(inst_rank->id(), &rank);
+
+ uint64_t outermost_shape = 0;
+ if (_.EvalConstantValUint64(inst_shape->GetOperandAs<uint32_t>(2),
+ &outermost_shape) &&
+ (outermost_shape != constituent_count)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name
+ << " Constituent count does not match "
+ "the shape of Result Type <id> "
+ << _.getIdName(result_type->id())
+ << " along its outermost dimension, " << "expected "
+ << outermost_shape << " but got " << constituent_count << ".";
+ }
+
+ for (size_t constituent_index = 2;
+ constituent_index < inst->operands().size(); constituent_index++) {
+ const auto constituent_id =
+ inst->GetOperandAs<uint32_t>(constituent_index);
+ const auto constituent = _.FindDef(constituent_id);
+ if (!constituent ||
+ !spvOpcodeIsConstantOrUndef(constituent->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id)
+ << " is not a constant or undef.";
+ }
+ const auto constituent_type = _.FindDef(constituent->type_id());
+ if (!constituent_type) {
+ return _.diag(SPV_ERROR_INVALID_ID, constituent)
+ << "Type of Constituent " << constituent_index - 2
+ << " is not defined.";
+ }
+
+ if (rank == 0) {
+ // The rank of the returned tensor constant is not known.
+ // Skip rank-dependent validation.
+ continue;
+ }
+
+ if (rank == 1) {
+ if (inst_element_type->id() != constituent_type->id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id)
+ << " type does not match the element type of the tensor ("
+ << _.getIdName(result_type->id()) << ").";
+ }
+ } else {
+ if (constituent_type->opcode() != spv::Op::OpTypeTensorARM) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id)
+ << " must be an OpTypeTensorARM.";
+ }
+ auto inst_constituent_element_type =
+ _.FindDef(constituent_type->GetOperandAs<uint32_t>(1));
+ if (!inst_constituent_element_type ||
+ inst_constituent_element_type->id() != inst_element_type->id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id)
+ << " must have the same Element Type as Result Type <id> "
+ << _.getIdName(result_type->id()) << ".";
+ }
+ auto inst_constituent_rank =
+ _.FindDef(constituent_type->GetOperandAs<uint32_t>(2));
+ uint64_t constituent_rank;
+ if (inst_constituent_rank &&
+ _.EvalConstantValUint64(inst_constituent_rank->id(),
+ &constituent_rank) &&
+ (constituent_rank != rank - 1)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id)
+ << " must have a Rank that is 1 less than the Rank of "
+ "Result Type <id> "
+ << _.getIdName(result_type->id()) << ", expected "
+ << rank - 1 << " but got " << constituent_rank << ".";
+ }
+
+ auto inst_constituent_shape =
+ _.FindDef(constituent_type->GetOperandAs<uint32_t>(3));
+ if (!inst_constituent_shape) {
+ return _.diag(SPV_ERROR_INVALID_ID, result_type)
+ << "Shape of Constituent " << constituent_index - 2
+ << " is not defined.";
+ }
+ for (size_t constituent_shape_index = 2;
+ constituent_shape_index <
+ inst_constituent_shape->operands().size();
+ constituent_shape_index++) {
+ size_t shape_index = constituent_shape_index + 1;
+ uint64_t constituent_shape = 0, shape = 1;
+ if (_.EvalConstantValUint64(
+ inst_constituent_shape->GetOperandAs<uint32_t>(
+ constituent_shape_index),
+ &constituent_shape) &&
+ _.EvalConstantValUint64(
+ inst_shape->GetOperandAs<uint32_t>(shape_index), &shape) &&
+ (constituent_shape != shape)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id)
+ << " must have a Shape that matches that of Result Type "
+ "<id> "
+ << _.getIdName(result_type->id())
+ << " along all inner dimensions of Result Type, expected "
+ << shape << " for dimension "
+ << constituent_shape_index - 2
+ << " of Constituent but got " << constituent_shape << ".";
+ }
+ }
+ }
+ }
+ } break;
default:
break;
}
@@ -312,6 +463,7 @@
case spv::Op::OpTypeMatrix:
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
case spv::Op::OpTypeVector: {
auto base_type = _.FindDef(instruction[2]);
return base_type && IsTypeNullable(base_type->words(), _);
@@ -324,12 +476,18 @@
}
return true;
}
+ case spv::Op::OpTypeUntypedPointerKHR:
case spv::Op::OpTypePointer:
if (spv::StorageClass(instruction[2]) ==
spv::StorageClass::PhysicalStorageBuffer) {
return false;
}
return true;
+ case spv::Op::OpTypeTensorARM: {
+ auto elem_type = _.FindDef(instruction[2]);
+ return (instruction.size() > 4) && elem_type &&
+ IsTypeNullable(elem_type->words(), _);
+ }
default:
return false;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_conversion.cpp b/third_party/SPIRV-Tools/source/val/validate_conversion.cpp
index b2892a8..be50a6f 100644
--- a/third_party/SPIRV-Tools/source/val/validate_conversion.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_conversion.cpp
@@ -33,7 +33,8 @@
case spv::Op::OpConvertFToU: {
if (!_.IsUnsignedIntScalarType(result_type) &&
!_.IsUnsignedIntVectorType(result_type) &&
- !_.IsUnsignedIntCooperativeMatrixType(result_type))
+ !_.IsUnsignedIntCooperativeMatrixType(result_type) &&
+ !_.IsUnsignedIntCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected unsigned int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -41,15 +42,21 @@
const uint32_t input_type = _.GetOperandTypeId(inst, 2);
if (!input_type || (!_.IsFloatScalarType(input_type) &&
!_.IsFloatVectorType(input_type) &&
- !_.IsFloatCooperativeMatrixType(input_type)))
+ !_.IsFloatCooperativeMatrixType(input_type) &&
+ !_.IsFloatCooperativeVectorNVType(input_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be float scalar or vector: "
<< spvOpcodeString(opcode);
- if (_.IsCooperativeMatrixType(result_type) ||
- _.IsCooperativeMatrixType(input_type)) {
+ if (_.IsCooperativeVectorNVType(result_type) ||
+ _.IsCooperativeVectorNVType(input_type)) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (_.IsCooperativeMatrixType(result_type) ||
+ _.IsCooperativeMatrixType(input_type)) {
+ spv_result_t ret =
+ _.CooperativeMatrixShapesMatch(inst, result_type, input_type, true);
if (ret != SPV_SUCCESS) return ret;
} else {
if (_.GetDimension(result_type) != _.GetDimension(input_type))
@@ -63,7 +70,8 @@
case spv::Op::OpConvertFToS: {
if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) &&
- !_.IsIntCooperativeMatrixType(result_type))
+ !_.IsIntCooperativeMatrixType(result_type) &&
+ !_.IsIntCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -71,15 +79,21 @@
const uint32_t input_type = _.GetOperandTypeId(inst, 2);
if (!input_type || (!_.IsFloatScalarType(input_type) &&
!_.IsFloatVectorType(input_type) &&
- !_.IsFloatCooperativeMatrixType(input_type)))
+ !_.IsFloatCooperativeMatrixType(input_type) &&
+ !_.IsFloatCooperativeVectorNVType(input_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be float scalar or vector: "
<< spvOpcodeString(opcode);
- if (_.IsCooperativeMatrixType(result_type) ||
- _.IsCooperativeMatrixType(input_type)) {
+ if (_.IsCooperativeVectorNVType(result_type) ||
+ _.IsCooperativeVectorNVType(input_type)) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (_.IsCooperativeMatrixType(result_type) ||
+ _.IsCooperativeMatrixType(input_type)) {
+ spv_result_t ret =
+ _.CooperativeMatrixShapesMatch(inst, result_type, input_type, true);
if (ret != SPV_SUCCESS) return ret;
} else {
if (_.GetDimension(result_type) != _.GetDimension(input_type))
@@ -95,7 +109,8 @@
case spv::Op::OpConvertUToF: {
if (!_.IsFloatScalarType(result_type) &&
!_.IsFloatVectorType(result_type) &&
- !_.IsFloatCooperativeMatrixType(result_type))
+ !_.IsFloatCooperativeMatrixType(result_type) &&
+ !_.IsFloatCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected float scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -103,15 +118,21 @@
const uint32_t input_type = _.GetOperandTypeId(inst, 2);
if (!input_type ||
(!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type) &&
- !_.IsIntCooperativeMatrixType(input_type)))
+ !_.IsIntCooperativeMatrixType(input_type) &&
+ !_.IsIntCooperativeVectorNVType(input_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be int scalar or vector: "
<< spvOpcodeString(opcode);
- if (_.IsCooperativeMatrixType(result_type) ||
- _.IsCooperativeMatrixType(input_type)) {
+ if (_.IsCooperativeVectorNVType(result_type) ||
+ _.IsCooperativeVectorNVType(input_type)) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (_.IsCooperativeMatrixType(result_type) ||
+ _.IsCooperativeMatrixType(input_type)) {
+ spv_result_t ret =
+ _.CooperativeMatrixShapesMatch(inst, result_type, input_type, true);
if (ret != SPV_SUCCESS) return ret;
} else {
if (_.GetDimension(result_type) != _.GetDimension(input_type))
@@ -126,7 +147,8 @@
case spv::Op::OpUConvert: {
if (!_.IsUnsignedIntScalarType(result_type) &&
!_.IsUnsignedIntVectorType(result_type) &&
- !_.IsUnsignedIntCooperativeMatrixType(result_type))
+ !_.IsUnsignedIntCooperativeMatrixType(result_type) &&
+ !_.IsUnsignedIntCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected unsigned int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -134,15 +156,21 @@
const uint32_t input_type = _.GetOperandTypeId(inst, 2);
if (!input_type ||
(!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type) &&
- !_.IsIntCooperativeMatrixType(input_type)))
+ !_.IsIntCooperativeMatrixType(input_type) &&
+ !_.IsIntCooperativeVectorNVType(input_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be int scalar or vector: "
<< spvOpcodeString(opcode);
- if (_.IsCooperativeMatrixType(result_type) ||
- _.IsCooperativeMatrixType(input_type)) {
+ if (_.IsCooperativeVectorNVType(result_type) ||
+ _.IsCooperativeVectorNVType(input_type)) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (_.IsCooperativeMatrixType(result_type) ||
+ _.IsCooperativeMatrixType(input_type)) {
+ spv_result_t ret =
+ _.CooperativeMatrixShapesMatch(inst, result_type, input_type, true);
if (ret != SPV_SUCCESS) return ret;
} else {
if (_.GetDimension(result_type) != _.GetDimension(input_type))
@@ -161,7 +189,8 @@
case spv::Op::OpSConvert: {
if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type) &&
- !_.IsIntCooperativeMatrixType(result_type))
+ !_.IsIntCooperativeMatrixType(result_type) &&
+ !_.IsIntCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected int scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -169,15 +198,21 @@
const uint32_t input_type = _.GetOperandTypeId(inst, 2);
if (!input_type ||
(!_.IsIntScalarType(input_type) && !_.IsIntVectorType(input_type) &&
- !_.IsIntCooperativeMatrixType(input_type)))
+ !_.IsIntCooperativeMatrixType(input_type) &&
+ !_.IsIntCooperativeVectorNVType(input_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be int scalar or vector: "
<< spvOpcodeString(opcode);
- if (_.IsCooperativeMatrixType(result_type) ||
- _.IsCooperativeMatrixType(input_type)) {
+ if (_.IsCooperativeVectorNVType(result_type) ||
+ _.IsCooperativeVectorNVType(input_type)) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (_.IsCooperativeMatrixType(result_type) ||
+ _.IsCooperativeMatrixType(input_type)) {
+ spv_result_t ret =
+ _.CooperativeMatrixShapesMatch(inst, result_type, input_type, true);
if (ret != SPV_SUCCESS) return ret;
} else {
if (_.GetDimension(result_type) != _.GetDimension(input_type))
@@ -197,7 +232,8 @@
case spv::Op::OpFConvert: {
if (!_.IsFloatScalarType(result_type) &&
!_.IsFloatVectorType(result_type) &&
- !_.IsFloatCooperativeMatrixType(result_type))
+ !_.IsFloatCooperativeMatrixType(result_type) &&
+ !_.IsFloatCooperativeVectorNVType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected float scalar or vector type as Result Type: "
<< spvOpcodeString(opcode);
@@ -205,15 +241,21 @@
const uint32_t input_type = _.GetOperandTypeId(inst, 2);
if (!input_type || (!_.IsFloatScalarType(input_type) &&
!_.IsFloatVectorType(input_type) &&
- !_.IsFloatCooperativeMatrixType(input_type)))
+ !_.IsFloatCooperativeMatrixType(input_type) &&
+ !_.IsFloatCooperativeVectorNVType(input_type)))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be float scalar or vector: "
<< spvOpcodeString(opcode);
- if (_.IsCooperativeMatrixType(result_type) ||
- _.IsCooperativeMatrixType(input_type)) {
+ if (_.IsCooperativeVectorNVType(result_type) ||
+ _.IsCooperativeVectorNVType(input_type)) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ } else if (_.IsCooperativeMatrixType(result_type) ||
+ _.IsCooperativeMatrixType(input_type)) {
+ spv_result_t ret =
+ _.CooperativeMatrixShapesMatch(inst, result_type, input_type, true);
if (ret != SPV_SUCCESS) return ret;
} else {
if (_.GetDimension(result_type) != _.GetDimension(input_type))
@@ -222,11 +264,15 @@
<< spvOpcodeString(opcode);
}
- if (_.GetBitWidth(result_type) == _.GetBitWidth(input_type))
+ // Scalar type
+ const uint32_t resScalarType = _.GetComponentType(result_type);
+ const uint32_t inputScalartype = _.GetComponentType(input_type);
+ if (resScalarType == inputScalartype) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected input to have different bit width from Result "
- "Type: "
+ << "Expected component type of Value to be different from "
+ "component type of Result Type: "
<< spvOpcodeString(opcode);
+ }
break;
}
@@ -475,9 +521,11 @@
const bool result_is_coopmat = _.IsCooperativeMatrixType(result_type);
const bool input_is_coopmat = _.IsCooperativeMatrixType(input_type);
+ const bool result_is_coopvec = _.IsCooperativeVectorNVType(result_type);
+ const bool input_is_coopvec = _.IsCooperativeVectorNVType(input_type);
if (!result_is_pointer && !result_is_int_scalar && !result_is_coopmat &&
- !_.IsIntVectorType(result_type) &&
+ !result_is_coopvec && !_.IsIntVectorType(result_type) &&
!_.IsFloatScalarType(result_type) &&
!_.IsFloatVectorType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -485,20 +533,31 @@
<< "or scalar type: " << spvOpcodeString(opcode);
if (!input_is_pointer && !input_is_int_scalar && !input_is_coopmat &&
- !_.IsIntVectorType(input_type) && !_.IsFloatScalarType(input_type) &&
- !_.IsFloatVectorType(input_type))
+ !input_is_coopvec && !_.IsIntVectorType(input_type) &&
+ !_.IsFloatScalarType(input_type) && !_.IsFloatVectorType(input_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected input to be a pointer or int or float vector "
<< "or scalar: " << spvOpcodeString(opcode);
+ if (result_is_coopvec != input_is_coopvec)
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Cooperative vector can only be cast to another cooperative "
+ << "vector: " << spvOpcodeString(opcode);
+
if (result_is_coopmat != input_is_coopmat)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Cooperative matrix can only be cast to another cooperative "
<< "matrix: " << spvOpcodeString(opcode);
- if (result_is_coopmat) {
+ if (result_is_coopvec) {
spv_result_t ret =
- _.CooperativeMatrixShapesMatch(inst, result_type, input_type);
+ _.CooperativeVectorDimensionsMatch(inst, result_type, input_type);
+ if (ret != SPV_SUCCESS) return ret;
+ }
+
+ if (result_is_coopmat) {
+ spv_result_t ret = _.CooperativeMatrixShapesMatch(inst, result_type,
+ input_type, false);
if (ret != SPV_SUCCESS) return ret;
}
@@ -568,6 +627,43 @@
break;
}
+ case spv::Op::OpCooperativeMatrixConvertNV:
+ case spv::Op::OpCooperativeMatrixTransposeNV: {
+ if (!_.IsCooperativeMatrixType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected cooperative matrix Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ const uint32_t input_type = _.GetOperandTypeId(inst, 2);
+ if (!_.IsCooperativeMatrixType(input_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected cooperative matrix type for Matrix input: "
+ << spvOpcodeString(opcode);
+ }
+
+ bool swap_row_col = (opcode == spv::Op::OpCooperativeMatrixTransposeNV);
+ if (auto error = _.CooperativeMatrixShapesMatch(
+ inst, result_type, input_type, true, swap_row_col))
+ return error;
+
+ if (opcode == spv::Op::OpCooperativeMatrixConvertNV) {
+ if (_.FindDef(result_type)->GetOperandAs<uint32_t>(1) !=
+ _.FindDef(input_type)->GetOperandAs<uint32_t>(1)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type and Matrix component types mismatch: "
+ << spvOpcodeString(opcode);
+ }
+ }
+
+ if (opcode == spv::Op::OpCooperativeMatrixTransposeNV) {
+ if (!_.IsCooperativeMatrixBType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type must have UseB: " << spvOpcodeString(opcode);
+ }
+ }
+ break;
+ }
+
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_decorations.cpp b/third_party/SPIRV-Tools/source/val/validate_decorations.cpp
index 0a7df65..f9a872d 100644
--- a/third_party/SPIRV-Tools/source/val/validate_decorations.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_decorations.cpp
@@ -71,26 +71,6 @@
return 0;
}
-// Returns true if the given variable has a BuiltIn decoration.
-bool isBuiltInVar(uint32_t var_id, ValidationState_t& vstate) {
- const auto& decorations = vstate.id_decorations(var_id);
- return std::any_of(decorations.begin(), decorations.end(),
- [](const Decoration& d) {
- return spv::Decoration::BuiltIn == d.dec_type();
- });
-}
-
-// Returns true if the given structure type has any members with BuiltIn
-// decoration.
-bool isBuiltInStruct(uint32_t struct_id, ValidationState_t& vstate) {
- const auto& decorations = vstate.id_decorations(struct_id);
- return std::any_of(
- decorations.begin(), decorations.end(), [](const Decoration& d) {
- return spv::Decoration::BuiltIn == d.dec_type() &&
- Decoration::kInvalidMember != d.struct_member_index();
- });
-}
-
// Returns true if the given structure type has a Block decoration.
bool isBlock(uint32_t struct_id, ValidationState_t& vstate) {
const auto& decorations = vstate.id_decorations(struct_id);
@@ -189,7 +169,7 @@
case spv::Op::OpTypeSampler:
case spv::Op::OpTypeImage:
if (vstate.HasCapability(spv::Capability::BindlessTextureNV))
- return baseAlignment = vstate.samplerimage_variable_address_mode() / 8;
+ return vstate.samplerimage_variable_address_mode() / 8;
assert(0);
return 0;
case spv::Op::OpTypeInt:
@@ -244,6 +224,7 @@
break;
}
case spv::Op::OpTypePointer:
+ case spv::Op::OpTypeUntypedPointerKHR:
baseAlignment = vstate.pointer_size_and_alignment();
break;
default:
@@ -290,6 +271,7 @@
return max_member_alignment;
} break;
case spv::Op::OpTypePointer:
+ case spv::Op::OpTypeUntypedPointerKHR:
return vstate.pointer_size_and_alignment();
default:
assert(0);
@@ -379,6 +361,7 @@
return offset + getSize(lastMember, constraint, constraints, vstate);
}
case spv::Op::OpTypePointer:
+ case spv::Op::OpTypeUntypedPointerKHR:
return vstate.pointer_size_and_alignment();
default:
assert(0);
@@ -415,14 +398,31 @@
return 0 == (offset % alignment);
}
+std::string getStorageClassString(spv::StorageClass sc) {
+ switch (sc) {
+ case spv::StorageClass::Uniform:
+ return "Uniform";
+ case spv::StorageClass::UniformConstant:
+ return "UniformConstant";
+ case spv::StorageClass::PushConstant:
+ return "PushConstant";
+ case spv::StorageClass::Workgroup:
+ return "Workgroup";
+ case spv::StorageClass::PhysicalStorageBuffer:
+ return "PhysicalStorageBuffer";
+ default:
+ // Only other valid storage class in these checks
+ return "StorageBuffer";
+ }
+}
+
// Returns SPV_SUCCESS if the given struct satisfies standard layout rules for
// Block or BufferBlocks in Vulkan. Otherwise emits a diagnostic and returns
// something other than SPV_SUCCESS. Matrices inherit the specified column
// or row major-ness.
-spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str,
+spv_result_t checkLayout(uint32_t struct_id, spv::StorageClass storage_class,
const char* decoration_str, bool blockRules,
- bool scalar_block_layout,
- uint32_t incoming_offset,
+ bool scalar_block_layout, uint32_t incoming_offset,
MemberConstraints& constraints,
ValidationState_t& vstate) {
if (vstate.options()->skip_block_layout) return SPV_SUCCESS;
@@ -436,25 +436,51 @@
// is more permissive than relaxed layout.
const bool relaxed_block_layout = vstate.IsRelaxedBlockLayout();
- auto fail = [&vstate, struct_id, storage_class_str, decoration_str,
- blockRules, relaxed_block_layout,
+ auto fail = [&vstate, struct_id, storage_class, decoration_str, blockRules,
+ relaxed_block_layout,
scalar_block_layout](uint32_t member_idx) -> DiagnosticStream {
- DiagnosticStream ds =
- std::move(vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(struct_id))
- << "Structure id " << struct_id << " decorated as "
- << decoration_str << " for variable in " << storage_class_str
- << " storage class must follow "
- << (scalar_block_layout
- ? "scalar "
- : (relaxed_block_layout ? "relaxed " : "standard "))
- << (blockRules ? "uniform buffer" : "storage buffer")
- << " layout rules: member " << member_idx << " ");
+ DiagnosticStream ds = std::move(
+ vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(struct_id))
+ << "Structure id " << struct_id << " decorated as " << decoration_str
+ << " for variable in " << getStorageClassString(storage_class)
+ << " storage class must follow "
+ << (scalar_block_layout
+ ? "scalar "
+ : (relaxed_block_layout ? "relaxed " : "standard "))
+ << (blockRules ? "uniform buffer" : "storage buffer")
+ << " layout rules: member " << member_idx << " ");
return ds;
};
- // If we are checking physical storage buffer pointers, we may not actually
- // have a struct here. Instead, pretend we have a struct with a single member
- // at offset 0.
+ // People often use spirv-val from Vulkan Validation Layers, it ends up
+ // mapping the various block layout rules from the enabled feature. This
+ // offers a hint to help the user understand possbily why things are not
+ // working when the shader itself "seems" valid, but just was a lack of adding
+ // a supported feature
+ auto extra = [&vstate, scalar_block_layout, storage_class,
+ relaxed_block_layout, blockRules]() {
+ if (!scalar_block_layout) {
+ if (storage_class == spv::StorageClass::Workgroup) {
+ return vstate.MissingFeature(
+ "workgroupMemoryExplicitLayoutScalarBlockLayout feature",
+ "--workgroup-scalar-block-layout", true);
+ } else if (!relaxed_block_layout) {
+ return vstate.MissingFeature("VK_KHR_relaxed_block_layout extension",
+ "--relax-block-layout", true);
+ } else if (blockRules) {
+ return vstate.MissingFeature("uniformBufferStandardLayout feature",
+ "--uniform-buffer-standard-layout", true);
+ } else {
+ return vstate.MissingFeature("scalarBlockLayout feature",
+ "--scalar-block-layout", true);
+ }
+ }
+ return std::string("");
+ };
+
+ // If we are checking the layout of untyped pointers or physical storage
+ // buffer pointers, we may not actually have a struct here. Instead, pretend
+ // we have a struct with a single member at offset 0.
const auto& struct_type = vstate.FindDef(struct_id);
std::vector<uint32_t> members;
if (struct_type->opcode() == spv::Op::OpTypeStruct) {
@@ -471,8 +497,8 @@
};
std::vector<MemberOffsetPair> member_offsets;
- // With physical storage buffers, we might be checking layouts that do not
- // originate from a structure.
+ // With untyped pointers or physical storage buffers, we might be checking
+ // layouts that do not originate from a structure.
if (struct_type->opcode() == spv::Op::OpTypeStruct) {
member_offsets.reserve(members.size());
for (uint32_t memberIdx = 0, numMembers = uint32_t(members.size());
@@ -525,7 +551,16 @@
const auto size = getSize(id, constraint, constraints, vstate);
// Check offset.
if (offset == 0xffffffff)
- return fail(memberIdx) << "is missing an Offset decoration";
+ return fail(memberIdx) << "is missing an Offset decoration" << extra();
+
+ if (opcode == spv::Op::OpTypeRuntimeArray &&
+ ordered_member_idx != member_offsets.size() - 1) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(struct_id))
+ << vstate.VkErrorID(4680) << "Structure id " << struct_id
+ << " has a runtime array at offset " << offset
+ << ", but other members at larger offsets";
+ }
+
if (!scalar_block_layout && relaxed_block_layout &&
opcode == spv::Op::OpTypeVector) {
// In relaxed block layout, the vector offset must be aligned to the
@@ -533,42 +568,44 @@
const auto componentId = inst->words()[2];
const auto scalar_alignment = getScalarAlignment(componentId, vstate);
if (!IsAlignedTo(offset, scalar_alignment)) {
- return fail(memberIdx)
- << "at offset " << offset
- << " is not aligned to scalar element size " << scalar_alignment;
+ return fail(memberIdx) << "at offset " << offset
+ << " is not aligned to scalar element size "
+ << scalar_alignment << extra();
}
} else {
// Without relaxed block layout, the offset must be divisible by the
// alignment requirement.
if (!IsAlignedTo(offset, alignment)) {
- return fail(memberIdx)
- << "at offset " << offset << " is not aligned to " << alignment;
+ return fail(memberIdx) << "at offset " << offset
+ << " is not aligned to " << alignment << extra();
}
}
if (offset < nextValidOffset)
return fail(memberIdx) << "at offset " << offset
<< " overlaps previous member ending at offset "
- << nextValidOffset - 1;
+ << nextValidOffset - 1 << extra();
if (!scalar_block_layout && relaxed_block_layout) {
// Check improper straddle of vectors.
if (spv::Op::OpTypeVector == opcode &&
hasImproperStraddle(id, offset, constraint, constraints, vstate))
return fail(memberIdx)
- << "is an improperly straddling vector at offset " << offset;
+ << "is an improperly straddling vector at offset " << offset
+ << extra();
}
// Check struct members recursively.
spv_result_t recursive_status = SPV_SUCCESS;
if (spv::Op::OpTypeStruct == opcode &&
SPV_SUCCESS != (recursive_status = checkLayout(
- id, storage_class_str, decoration_str, blockRules,
+ id, storage_class, decoration_str, blockRules,
scalar_block_layout, offset, constraints, vstate)))
return recursive_status;
// Check matrix stride.
if (spv::Op::OpTypeMatrix == opcode) {
const auto stride = constraint.matrix_stride;
if (!IsAlignedTo(stride, alignment)) {
- return fail(memberIdx) << "is a matrix with stride " << stride
- << " not satisfying alignment to " << alignment;
+ return fail(memberIdx)
+ << "is a matrix with stride " << stride
+ << " not satisfying alignment to " << alignment << extra();
}
}
@@ -585,12 +622,13 @@
if (spv::Decoration::ArrayStride == decoration.dec_type()) {
array_stride = decoration.params()[0];
if (array_stride == 0) {
- return fail(memberIdx) << "contains an array with stride 0";
+ return fail(memberIdx)
+ << "contains an array with stride 0" << extra();
}
if (!IsAlignedTo(array_stride, array_alignment))
return fail(memberIdx)
<< "contains an array with stride " << decoration.params()[0]
- << " not satisfying alignment to " << alignment;
+ << " not satisfying alignment to " << alignment << extra();
}
}
@@ -617,12 +655,20 @@
if (SPV_SUCCESS !=
(recursive_status = checkLayout(
- typeId, storage_class_str, decoration_str, blockRules,
+ typeId, storage_class, decoration_str, blockRules,
scalar_block_layout, next_offset, constraints, vstate)))
return recursive_status;
seen[next_offset % 16] = true;
}
+ } else if (spv::Op::OpTypeMatrix == element_inst->opcode()) {
+ // Matrix stride would be on the array element in the struct.
+ const auto stride = constraint.matrix_stride;
+ if (!IsAlignedTo(stride, alignment)) {
+ return fail(memberIdx)
+ << "is a matrix with stride " << stride
+ << " not satisfying alignment to " << alignment << extra();
+ }
}
// Proceed to the element in case it is an array.
@@ -637,7 +683,7 @@
if (element_size > array_stride) {
return fail(memberIdx)
<< "contains an array with stride " << array_stride
- << ", but with an element size of " << element_size;
+ << ", but with an element size of " << element_size << extra();
}
}
nextValidOffset = offset + size;
@@ -675,7 +721,16 @@
spv::Op type, ValidationState_t& vstate) {
const auto& members = getStructMembers(struct_id, vstate);
for (size_t memberIdx = 0; memberIdx < members.size(); memberIdx++) {
- const auto id = members[memberIdx];
+ auto id = members[memberIdx];
+ if (type == spv::Op::OpTypeMatrix) {
+ // Matrix decorations also apply to arrays of matrices.
+ auto memberInst = vstate.FindDef(id);
+ while (memberInst->opcode() == spv::Op::OpTypeArray ||
+ memberInst->opcode() == spv::Op::OpTypeRuntimeArray) {
+ memberInst = vstate.FindDef(memberInst->GetOperandAs<uint32_t>(1u));
+ }
+ id = memberInst->id();
+ }
if (type != vstate.FindDef(id)->opcode()) continue;
bool found = false;
for (auto& dec : vstate.id_decorations(id)) {
@@ -767,18 +822,39 @@
int num_workgroup_variables = 0;
int num_workgroup_variables_with_block = 0;
int num_workgroup_variables_with_aliased = 0;
+ bool has_task_payload = false;
for (const auto& desc : descs) {
std::unordered_set<Instruction*> seen_vars;
+ std::unordered_set<spv::BuiltIn> input_var_builtin;
+ std::unordered_set<spv::BuiltIn> output_var_builtin;
for (auto interface : desc.interfaces) {
Instruction* var_instr = vstate.FindDef(interface);
- if (!var_instr || spv::Op::OpVariable != var_instr->opcode()) {
+ if (!var_instr ||
+ (spv::Op::OpVariable != var_instr->opcode() &&
+ spv::Op::OpUntypedVariableKHR != var_instr->opcode())) {
return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
- << "Interfaces passed to OpEntryPoint must be of type "
- "OpTypeVariable. Found Op"
+ << "Interfaces passed to OpEntryPoint must be variables. "
+ "Found Op"
<< spvOpcodeString(var_instr->opcode()) << ".";
}
+ const bool untyped_pointers =
+ var_instr->opcode() == spv::Op::OpUntypedVariableKHR;
+ const auto sc_index = 2u;
const spv::StorageClass storage_class =
- var_instr->GetOperandAs<spv::StorageClass>(2);
+ var_instr->GetOperandAs<spv::StorageClass>(sc_index);
+ if (vstate.version() >= SPV_SPIRV_VERSION_WORD(1, 4)) {
+ // SPV_EXT_mesh_shader, at most one task payload is permitted
+ // per entry point
+ if (storage_class == spv::StorageClass::TaskPayloadWorkgroupEXT) {
+ if (has_task_payload) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << "There can be at most one OpVariable with storage "
+ "class TaskPayloadWorkgroupEXT associated with "
+ "an OpEntryPoint";
+ }
+ has_task_payload = true;
+ }
+ }
if (vstate.version() >= SPV_SPIRV_VERSION_WORD(1, 4)) {
// Starting in 1.4, OpEntryPoint must list all global variables
// it statically uses and those interfaces must be unique.
@@ -805,45 +881,96 @@
}
}
- const uint32_t ptr_id = var_instr->word(1);
- Instruction* ptr_instr = vstate.FindDef(ptr_id);
// It is guaranteed (by validator ID checks) that ptr_instr is
// OpTypePointer. Word 3 of this instruction is the type being pointed
- // to.
- const uint32_t type_id = ptr_instr->word(3);
+ // to. For untyped variables, the pointee type comes from the data type
+ // operand.
+ const uint32_t type_id =
+ untyped_pointers ? var_instr->word(4)
+ : vstate.FindDef(var_instr->word(1))->word(3);
Instruction* type_instr = vstate.FindDef(type_id);
- if (type_instr && spv::Op::OpTypeStruct == type_instr->opcode() &&
- isBuiltInStruct(type_id, vstate)) {
- if (!isBlock(type_id, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_DATA, vstate.FindDef(type_id))
- << vstate.VkErrorID(4919)
- << "Interface struct has no Block decoration but has "
- "BuiltIn members. "
- "Location decorations must be used on each member of "
- "OpVariable with a structure type that is a block not "
- "decorated with Location.";
+ const bool is_struct =
+ type_instr && spv::Op::OpTypeStruct == type_instr->opcode();
+
+ // Search all Built-in (on the variable or the struct)
+ bool has_built_in = false;
+ for (auto& dec :
+ vstate.id_decorations(is_struct ? type_id : interface)) {
+ if (dec.dec_type() != spv::Decoration::BuiltIn) continue;
+ has_built_in = true;
+
+ if (!spvIsVulkanEnv(vstate.context()->target_env)) continue;
+
+ const spv::BuiltIn builtin = dec.builtin();
+ if (storage_class == spv::StorageClass::Input) {
+ if (!input_var_builtin.insert(builtin).second) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << vstate.VkErrorID(9658)
+ << "OpEntryPoint contains duplicate input variables "
+ "with "
+ << vstate.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)builtin)
+ << " builtin";
+ }
}
- if (storage_class == spv::StorageClass::Input)
- ++num_builtin_block_inputs;
- if (storage_class == spv::StorageClass::Output)
- ++num_builtin_block_outputs;
- if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1)
- break;
+ if (storage_class == spv::StorageClass::Output) {
+ if (!output_var_builtin.insert(builtin).second) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << vstate.VkErrorID(9659)
+ << "OpEntryPoint contains duplicate output variables "
+ "with "
+ << vstate.grammar().lookupOperandName(
+ SPV_OPERAND_TYPE_BUILT_IN, (uint32_t)builtin)
+ << " builtin";
+ }
+ }
+ }
+
+ if (has_built_in) {
if (auto error = CheckBuiltInVariable(interface, vstate))
return error;
- } else if (isBuiltInVar(interface, vstate)) {
- if (auto error = CheckBuiltInVariable(interface, vstate))
- return error;
+
+ if (is_struct) {
+ if (!isBlock(type_id, vstate)) {
+ return vstate.diag(SPV_ERROR_INVALID_DATA,
+ vstate.FindDef(type_id))
+ << vstate.VkErrorID(4919)
+ << "Interface struct has no Block decoration but has "
+ "BuiltIn members. "
+ "Location decorations must be used on each member of "
+ "OpVariable with a structure type that is a block not "
+ "decorated with Location.";
+ }
+ if (storage_class == spv::StorageClass::Input)
+ ++num_builtin_block_inputs;
+ if (storage_class == spv::StorageClass::Output)
+ ++num_builtin_block_outputs;
+ if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1)
+ break;
+ }
}
if (storage_class == spv::StorageClass::Workgroup) {
++num_workgroup_variables;
- if (type_instr && spv::Op::OpTypeStruct == type_instr->opcode()) {
- if (hasDecoration(type_id, spv::Decoration::Block, vstate))
- ++num_workgroup_variables_with_block;
- if (hasDecoration(var_instr->id(), spv::Decoration::Aliased,
- vstate))
- ++num_workgroup_variables_with_aliased;
+ if (type_instr) {
+ if (spv::Op::OpTypeStruct == type_instr->opcode()) {
+ if (hasDecoration(type_id, spv::Decoration::Block, vstate)) {
+ ++num_workgroup_variables_with_block;
+ } else if (untyped_pointers &&
+ vstate.HasCapability(spv::Capability::Shader)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << "Untyped workgroup variables in shaders must be "
+ "block decorated";
+ }
+ if (hasDecoration(var_instr->id(), spv::Decoration::Aliased,
+ vstate))
+ ++num_workgroup_variables_with_aliased;
+ } else if (untyped_pointers &&
+ vstate.HasCapability(spv::Capability::Shader)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << "Untyped workgroup variables in shaders must be block "
+ "decorated structs";
+ }
}
}
@@ -924,25 +1051,33 @@
const bool workgroup_blocks_allowed = vstate.HasCapability(
spv::Capability::WorkgroupMemoryExplicitLayoutKHR);
- if (workgroup_blocks_allowed && num_workgroup_variables > 0 &&
+ if (workgroup_blocks_allowed &&
+ !vstate.HasCapability(spv::Capability::UntypedPointersKHR) &&
+ num_workgroup_variables > 0 &&
num_workgroup_variables_with_block > 0) {
if (num_workgroup_variables != num_workgroup_variables_with_block) {
- return vstate.diag(SPV_ERROR_INVALID_BINARY, vstate.FindDef(entry_point))
+ return vstate.diag(SPV_ERROR_INVALID_BINARY,
+ vstate.FindDef(entry_point))
<< "When declaring WorkgroupMemoryExplicitLayoutKHR, "
- "either all or none of the Workgroup Storage Class variables "
+ "either all or none of the Workgroup Storage Class "
+ "variables "
"in the entry point interface must point to struct types "
- "decorated with Block. Entry point id "
+ "decorated with Block (unless the "
+ "UntypedPointersKHR capability is declared). "
+ "Entry point id "
<< entry_point << " does not meet this requirement.";
}
if (num_workgroup_variables_with_block > 1 &&
num_workgroup_variables_with_block !=
- num_workgroup_variables_with_aliased) {
- return vstate.diag(SPV_ERROR_INVALID_BINARY, vstate.FindDef(entry_point))
+ num_workgroup_variables_with_aliased) {
+ return vstate.diag(SPV_ERROR_INVALID_BINARY,
+ vstate.FindDef(entry_point))
<< "When declaring WorkgroupMemoryExplicitLayoutKHR, "
"if more than one Workgroup Storage Class variable in "
"the entry point interface point to a type decorated "
- "with Block, all of them must be decorated with Aliased. "
- "Entry point id "
+ "with Block, all of them must be decorated with Aliased "
+ "(unless the UntypedPointerWorkgroupKHR capability is "
+ "declared). Entry point id "
<< entry_point << " does not meet this requirement.";
}
} else if (!workgroup_blocks_allowed &&
@@ -1048,11 +1183,17 @@
const auto& words = inst.words();
auto type_id = inst.type_id();
const Instruction* type_inst = vstate.FindDef(type_id);
- if (spv::Op::OpVariable == inst.opcode()) {
+ bool scalar_block_layout = false;
+ MemberConstraints constraints;
+ if (spv::Op::OpVariable == inst.opcode() ||
+ spv::Op::OpUntypedVariableKHR == inst.opcode()) {
+ const bool untyped_pointer =
+ inst.opcode() == spv::Op::OpUntypedVariableKHR;
const auto var_id = inst.id();
// For storage class / decoration combinations, see Vulkan 14.5.4 "Offset
// and Stride Assignment".
- const auto storageClass = inst.GetOperandAs<spv::StorageClass>(2);
+ const auto storageClassVal = words[3];
+ const auto storageClass = spv::StorageClass(storageClassVal);
const bool uniform = storageClass == spv::StorageClass::Uniform;
const bool uniform_constant =
storageClass == spv::StorageClass::UniformConstant;
@@ -1113,8 +1254,8 @@
if (!entry_points.empty() &&
!hasDecoration(var_id, spv::Decoration::Binding, vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << (uniform ? "Uniform" : "Storage Buffer") << " id '"
- << var_id << "' is missing Binding decoration.\n"
+ << getStorageClassString(storageClass) << " id '" << var_id
+ << "' is missing Binding decoration.\n"
<< "From ARB_gl_spirv extension:\n"
<< "Uniform and shader storage block variables must "
<< "also be decorated with a *Binding*.";
@@ -1131,26 +1272,24 @@
if (uniform || push_constant || storage_buffer || phys_storage_buffer ||
workgroup) {
const auto ptrInst = vstate.FindDef(words[1]);
- assert(spv::Op::OpTypePointer == ptrInst->opcode());
- auto id = ptrInst->words()[3];
- auto id_inst = vstate.FindDef(id);
- // Jump through one level of arraying.
- if (!workgroup && (id_inst->opcode() == spv::Op::OpTypeArray ||
- id_inst->opcode() == spv::Op::OpTypeRuntimeArray)) {
- id = id_inst->GetOperandAs<uint32_t>(1u);
- id_inst = vstate.FindDef(id);
+ assert(spv::Op::OpTypePointer == ptrInst->opcode() ||
+ spv::Op::OpTypeUntypedPointerKHR == ptrInst->opcode());
+ auto id = untyped_pointer ? (words.size() > 4 ? words[4] : 0)
+ : ptrInst->words()[3];
+ if (id != 0) {
+ auto id_inst = vstate.FindDef(id);
+ // Jump through one level of arraying.
+ if (!workgroup &&
+ (id_inst->opcode() == spv::Op::OpTypeArray ||
+ id_inst->opcode() == spv::Op::OpTypeRuntimeArray)) {
+ id = id_inst->GetOperandAs<uint32_t>(1u);
+ id_inst = vstate.FindDef(id);
+ }
+ // Struct requirement is checked on variables so just move on here.
+ if (spv::Op::OpTypeStruct != id_inst->opcode()) continue;
+ ComputeMemberConstraintsForStruct(&constraints, id,
+ LayoutConstraints(), vstate);
}
- // Struct requirement is checked on variables so just move on here.
- if (spv::Op::OpTypeStruct != id_inst->opcode()) continue;
- MemberConstraints constraints;
- ComputeMemberConstraintsForStruct(&constraints, id, LayoutConstraints(),
- vstate);
- // Prepare for messages
- const char* sc_str =
- uniform ? "Uniform"
- : (push_constant ? "PushConstant"
- : (workgroup ? "Workgroup"
- : "StorageBuffer"));
if (spvIsVulkanEnv(vstate.context()->target_env)) {
const bool block = hasDecoration(id, spv::Decoration::Block, vstate);
@@ -1196,7 +1335,8 @@
!hasDecoration(var_id, spv::Decoration::DescriptorSet,
vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << vstate.VkErrorID(6677) << sc_str << " id '" << var_id
+ << vstate.VkErrorID(6677)
+ << getStorageClassString(storageClass) << " id '" << var_id
<< "' is missing DescriptorSet decoration.\n"
<< "From Vulkan spec:\n"
<< "These variables must have DescriptorSet and Binding "
@@ -1205,7 +1345,8 @@
if (!entry_points.empty() &&
!hasDecoration(var_id, spv::Decoration::Binding, vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << vstate.VkErrorID(6677) << sc_str << " id '" << var_id
+ << vstate.VkErrorID(6677)
+ << getStorageClassString(storageClass) << " id '" << var_id
<< "' is missing Binding decoration.\n"
<< "From Vulkan spec:\n"
<< "These variables must have DescriptorSet and Binding "
@@ -1214,88 +1355,91 @@
}
}
- for (const auto& dec : vstate.id_decorations(id)) {
- const bool blockDeco = spv::Decoration::Block == dec.dec_type();
- const bool bufferDeco =
- spv::Decoration::BufferBlock == dec.dec_type();
- const bool blockRules = uniform && blockDeco;
- const bool bufferRules =
- (uniform && bufferDeco) ||
- ((push_constant || storage_buffer ||
- phys_storage_buffer || workgroup) && blockDeco);
- if (uniform && blockDeco) {
- vstate.RegisterPointerToUniformBlock(ptrInst->id());
- vstate.RegisterStructForUniformBlock(id);
- }
- if ((uniform && bufferDeco) ||
- ((storage_buffer || phys_storage_buffer) && blockDeco)) {
- vstate.RegisterPointerToStorageBuffer(ptrInst->id());
- vstate.RegisterStructForStorageBuffer(id);
- }
-
- if (blockRules || bufferRules) {
- const char* deco_str = blockDeco ? "Block" : "BufferBlock";
- spv_result_t recursive_status = SPV_SUCCESS;
- const bool scalar_block_layout = workgroup ?
- vstate.options()->workgroup_scalar_block_layout :
- vstate.options()->scalar_block_layout;
-
- if (isMissingOffsetInStruct(id, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Structure id " << id << " decorated as " << deco_str
- << " must be explicitly laid out with Offset "
- "decorations.";
+ if (id != 0) {
+ for (const auto& dec : vstate.id_decorations(id)) {
+ const bool blockDeco = spv::Decoration::Block == dec.dec_type();
+ const bool bufferDeco =
+ spv::Decoration::BufferBlock == dec.dec_type();
+ const bool blockRules = uniform && blockDeco;
+ const bool bufferRules = (uniform && bufferDeco) ||
+ ((push_constant || storage_buffer ||
+ phys_storage_buffer || workgroup) &&
+ blockDeco);
+ if (uniform && blockDeco) {
+ vstate.RegisterPointerToUniformBlock(ptrInst->id());
+ vstate.RegisterStructForUniformBlock(id);
+ }
+ if ((uniform && bufferDeco) ||
+ ((storage_buffer || phys_storage_buffer) && blockDeco)) {
+ vstate.RegisterPointerToStorageBuffer(ptrInst->id());
+ vstate.RegisterStructForStorageBuffer(id);
}
- if (!checkForRequiredDecoration(
- id,
- [](spv::Decoration d) {
- return d == spv::Decoration::ArrayStride;
- },
- spv::Op::OpTypeArray, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Structure id " << id << " decorated as " << deco_str
- << " must be explicitly laid out with ArrayStride "
- "decorations.";
- }
+ if (blockRules || bufferRules) {
+ const char* deco_str = blockDeco ? "Block" : "BufferBlock";
+ spv_result_t recursive_status = SPV_SUCCESS;
+ scalar_block_layout =
+ workgroup ? vstate.options()->workgroup_scalar_block_layout
+ : vstate.options()->scalar_block_layout;
- if (!checkForRequiredDecoration(
- id,
- [](spv::Decoration d) {
- return d == spv::Decoration::MatrixStride;
- },
- spv::Op::OpTypeMatrix, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Structure id " << id << " decorated as " << deco_str
- << " must be explicitly laid out with MatrixStride "
- "decorations.";
- }
+ if (isMissingOffsetInStruct(id, vstate)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
+ << "Structure id " << id << " decorated as " << deco_str
+ << " must be explicitly laid out with Offset "
+ "decorations.";
+ }
- if (!checkForRequiredDecoration(
- id,
- [](spv::Decoration d) {
- return d == spv::Decoration::RowMajor ||
- d == spv::Decoration::ColMajor;
- },
- spv::Op::OpTypeMatrix, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Structure id " << id << " decorated as " << deco_str
- << " must be explicitly laid out with RowMajor or "
- "ColMajor decorations.";
- }
+ if (!checkForRequiredDecoration(
+ id,
+ [](spv::Decoration d) {
+ return d == spv::Decoration::ArrayStride;
+ },
+ spv::Op::OpTypeArray, vstate)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
+ << "Structure id " << id << " decorated as " << deco_str
+ << " must be explicitly laid out with ArrayStride "
+ "decorations.";
+ }
- if (spvIsVulkanEnv(vstate.context()->target_env)) {
- if (blockRules && (SPV_SUCCESS != (recursive_status = checkLayout(
- id, sc_str, deco_str, true,
- scalar_block_layout, 0,
- constraints, vstate)))) {
- return recursive_status;
- } else if (bufferRules &&
- (SPV_SUCCESS !=
- (recursive_status = checkLayout(
- id, sc_str, deco_str, false, scalar_block_layout,
- 0, constraints, vstate)))) {
- return recursive_status;
+ if (!checkForRequiredDecoration(
+ id,
+ [](spv::Decoration d) {
+ return d == spv::Decoration::MatrixStride;
+ },
+ spv::Op::OpTypeMatrix, vstate)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
+ << "Structure id " << id << " decorated as " << deco_str
+ << " must be explicitly laid out with MatrixStride "
+ "decorations.";
+ }
+
+ if (!checkForRequiredDecoration(
+ id,
+ [](spv::Decoration d) {
+ return d == spv::Decoration::RowMajor ||
+ d == spv::Decoration::ColMajor;
+ },
+ spv::Op::OpTypeMatrix, vstate)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
+ << "Structure id " << id << " decorated as " << deco_str
+ << " must be explicitly laid out with RowMajor or "
+ "ColMajor decorations.";
+ }
+
+ if (spvIsVulkanEnv(vstate.context()->target_env)) {
+ if (blockRules &&
+ (SPV_SUCCESS !=
+ (recursive_status = checkLayout(
+ id, storageClass, deco_str, true, scalar_block_layout,
+ 0, constraints, vstate)))) {
+ return recursive_status;
+ } else if (bufferRules &&
+ (SPV_SUCCESS != (recursive_status = checkLayout(
+ id, storageClass, deco_str,
+ false, scalar_block_layout, 0,
+ constraints, vstate)))) {
+ return recursive_status;
+ }
}
}
}
@@ -1304,19 +1448,107 @@
} else if (type_inst && type_inst->opcode() == spv::Op::OpTypePointer &&
type_inst->GetOperandAs<spv::StorageClass>(1u) ==
spv::StorageClass::PhysicalStorageBuffer) {
- const bool scalar_block_layout = vstate.options()->scalar_block_layout;
- MemberConstraints constraints;
const bool buffer = true;
- const auto data_type_id = type_inst->GetOperandAs<uint32_t>(2u);
- const auto* data_type_inst = vstate.FindDef(data_type_id);
+ const auto pointee_type_id = type_inst->GetOperandAs<uint32_t>(2u);
+ const auto* data_type_inst = vstate.FindDef(pointee_type_id);
+ scalar_block_layout = vstate.options()->scalar_block_layout;
if (data_type_inst->opcode() == spv::Op::OpTypeStruct) {
+ ComputeMemberConstraintsForStruct(&constraints, pointee_type_id,
+ LayoutConstraints(), vstate);
+ }
+ if (auto res = checkLayout(
+ pointee_type_id, spv::StorageClass::PhysicalStorageBuffer,
+ "Block", !buffer, scalar_block_layout, 0, constraints, vstate)) {
+ return res;
+ }
+ } else if (vstate.HasCapability(spv::Capability::UntypedPointersKHR) &&
+ spvIsVulkanEnv(vstate.context()->target_env)) {
+ // Untyped variables are checked above. Here we check that instructions
+ // using an untyped pointer have a valid layout.
+ uint32_t ptr_ty_id = 0;
+ uint32_t data_type_id = 0;
+ switch (inst.opcode()) {
+ case spv::Op::OpUntypedAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsAccessChainKHR:
+ case spv::Op::OpUntypedPtrAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsPtrAccessChainKHR:
+ ptr_ty_id = inst.type_id();
+ data_type_id = inst.GetOperandAs<uint32_t>(2);
+ break;
+ case spv::Op::OpLoad:
+ if (vstate.GetIdOpcode(vstate.GetOperandTypeId(&inst, 2)) ==
+ spv::Op::OpTypeUntypedPointerKHR) {
+ const auto ptr_id = inst.GetOperandAs<uint32_t>(2);
+ ptr_ty_id = vstate.FindDef(ptr_id)->type_id();
+ data_type_id = inst.type_id();
+ }
+ break;
+ case spv::Op::OpStore:
+ if (vstate.GetIdOpcode(vstate.GetOperandTypeId(&inst, 0)) ==
+ spv::Op::OpTypeUntypedPointerKHR) {
+ const auto ptr_id = inst.GetOperandAs<uint32_t>(0);
+ ptr_ty_id = vstate.FindDef(ptr_id)->type_id();
+ data_type_id = vstate.GetOperandTypeId(&inst, 1);
+ }
+ break;
+ case spv::Op::OpUntypedArrayLengthKHR:
+ ptr_ty_id = vstate.FindDef(inst.GetOperandAs<uint32_t>(3))->type_id();
+ data_type_id = inst.GetOperandAs<uint32_t>(2);
+ break;
+ default:
+ break;
+ }
+
+ if (ptr_ty_id == 0 || data_type_id == 0) {
+ // Not an untyped pointer.
+ continue;
+ }
+
+ const auto sc =
+ vstate.FindDef(ptr_ty_id)->GetOperandAs<spv::StorageClass>(1);
+
+ auto data_type = vstate.FindDef(data_type_id);
+ scalar_block_layout =
+ sc == spv::StorageClass::Workgroup
+ ? vstate.options()->workgroup_scalar_block_layout
+ : vstate.options()->scalar_block_layout;
+
+ // If the data type is an array that contains a Block- or
+ // BufferBlock-decorated struct, then use the struct for layout checks
+ // instead of the array. In this case, the array represents a descriptor
+ // array which should not have an explicit layout.
+ if (data_type->opcode() == spv::Op::OpTypeArray ||
+ data_type->opcode() == spv::Op::OpTypeRuntimeArray) {
+ const auto ele_type =
+ vstate.FindDef(data_type->GetOperandAs<uint32_t>(1u));
+ if (ele_type->opcode() == spv::Op::OpTypeStruct &&
+ (vstate.HasDecoration(ele_type->id(), spv::Decoration::Block) ||
+ vstate.HasDecoration(ele_type->id(),
+ spv::Decoration::BufferBlock))) {
+ data_type = ele_type;
+ data_type_id = ele_type->id();
+ }
+ }
+
+ // Assume uniform storage class uses block rules unless we see a
+ // BufferBlock decorated struct in the data type.
+ bool bufferRules = sc == spv::StorageClass::Uniform ? false : true;
+ if (data_type->opcode() == spv::Op::OpTypeStruct) {
+ if (sc == spv::StorageClass::Uniform) {
+ bufferRules =
+ vstate.HasDecoration(data_type_id, spv::Decoration::BufferBlock);
+ }
ComputeMemberConstraintsForStruct(&constraints, data_type_id,
LayoutConstraints(), vstate);
}
- if (auto res = checkLayout(data_type_id, "PhysicalStorageBuffer", "Block",
- !buffer, scalar_block_layout, 0, constraints,
- vstate)) {
- return res;
+ const char* deco_str =
+ bufferRules
+ ? (sc == spv::StorageClass::Uniform ? "BufferBlock" : "Block")
+ : "Block";
+ if (auto result =
+ checkLayout(data_type_id, sc, deco_str, !bufferRules,
+ scalar_block_layout, 0, constraints, vstate)) {
+ return result;
}
}
}
@@ -1343,7 +1575,8 @@
// to the same id.
static const spv::Decoration mutually_exclusive_per_id[][2] = {
{spv::Decoration::Block, spv::Decoration::BufferBlock},
- {spv::Decoration::Restrict, spv::Decoration::Aliased}};
+ {spv::Decoration::Restrict, spv::Decoration::Aliased},
+ {spv::Decoration::RestrictPointer, spv::Decoration::AliasedPointer}};
static const auto num_mutually_exclusive_per_id_pairs =
sizeof(mutually_exclusive_per_id) / (2 * sizeof(spv::Decoration));
@@ -1534,14 +1767,19 @@
return SPV_SUCCESS;
}
-// Returns SPV_SUCCESS if validation rules are satisfied for the NonWritable
+// Returns SPV_SUCCESS if validation rules are satisfied for the NonReadable or
+// NonWritable
// decoration. Otherwise emits a diagnostic and returns something other than
// SPV_SUCCESS. The |inst| parameter is the object being decorated. This must
// be called after TypePass and AnnotateCheckDecorationsOfBuffers are called.
-spv_result_t CheckNonWritableDecoration(ValidationState_t& vstate,
- const Instruction& inst,
- const Decoration& decoration) {
+spv_result_t CheckNonReadableWritableDecorations(ValidationState_t& vstate,
+ const Instruction& inst,
+ const Decoration& decoration) {
assert(inst.id() && "Parser ensures the target of the decoration has an ID");
+ const bool is_non_writable =
+ decoration.dec_type() == spv::Decoration::NonWritable;
+ assert(is_non_writable ||
+ decoration.dec_type() == spv::Decoration::NonReadable);
if (decoration.struct_member_index() == Decoration::kInvalidMember) {
// The target must be a memory object declaration.
@@ -1549,30 +1787,44 @@
const auto opcode = inst.opcode();
const auto type_id = inst.type_id();
if (opcode != spv::Op::OpVariable &&
+ opcode != spv::Op::OpUntypedVariableKHR &&
opcode != spv::Op::OpFunctionParameter &&
opcode != spv::Op::OpRawAccessChainNV) {
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
- << "Target of NonWritable decoration must be a memory object "
+ << "Target of "
+ << (is_non_writable ? "NonWritable" : "NonReadable")
+ << " decoration must be a "
+ "memory object "
"declaration (a variable or a function parameter)";
}
const auto var_storage_class = opcode == spv::Op::OpVariable
? inst.GetOperandAs<spv::StorageClass>(2)
+ : opcode == spv::Op::OpUntypedVariableKHR
+ ? inst.GetOperandAs<spv::StorageClass>(3)
: spv::StorageClass::Max;
if ((var_storage_class == spv::StorageClass::Function ||
var_storage_class == spv::StorageClass::Private) &&
- vstate.features().nonwritable_var_in_function_or_private) {
+ vstate.features().nonwritable_var_in_function_or_private &&
+ is_non_writable) {
// New permitted feature in SPIR-V 1.4.
+ } else if (var_storage_class == spv::StorageClass::TileAttachmentQCOM) {
} else if (
// It may point to a UBO, SSBO, storage image, or raw access chain.
vstate.IsPointerToUniformBlock(type_id) ||
vstate.IsPointerToStorageBuffer(type_id) ||
vstate.IsPointerToStorageImage(type_id) ||
+ vstate.IsPointerToTensor(type_id) ||
opcode == spv::Op::OpRawAccessChainNV) {
} else {
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
- << "Target of NonWritable decoration is invalid: must point to a "
- "storage image, uniform block, "
- << (vstate.features().nonwritable_var_in_function_or_private
+ << "Target of "
+ << (is_non_writable ? "NonWritable" : "NonReadable")
+ << " decoration is invalid: "
+ "must point to a "
+ "storage image, tensor variable in UniformConstant storage "
+ "class, uniform block, "
+ << (vstate.features().nonwritable_var_in_function_or_private &&
+ is_non_writable
? "storage buffer, or variable in Private or Function "
"storage class"
: "or storage buffer");
@@ -1648,6 +1900,7 @@
case spv::Op::OpSNegate:
return SPV_SUCCESS;
case spv::Op::OpExtInst:
+ case spv::Op::OpExtInstWithForwardRefsKHR:
// TODO(dneto): Only certain extended instructions allow these
// decorations. For now allow anything.
return SPV_SUCCESS;
@@ -1714,14 +1967,14 @@
if (spvIsVulkanEnv(vstate.context()->target_env)) {
// Strip the array, if present.
- if (vstate.GetIdOpcode(type_id) == spv::Op::OpTypeArray) {
+ while (vstate.GetIdOpcode(type_id) == spv::Op::OpTypeArray) {
type_id = vstate.FindDef(type_id)->word(2u);
}
if (!vstate.IsIntScalarOrVectorType(type_id) &&
!vstate.IsFloatScalarOrVectorType(type_id)) {
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
- << vstate.VkErrorID(4924)
+ << vstate.VkErrorID(10583)
<< "Component decoration specified for type "
<< vstate.getIdName(type_id) << " that is not a scalar or vector";
}
@@ -1826,7 +2079,8 @@
{ \
spv_result_t e##LINE = (X); \
if (e##LINE != SPV_SUCCESS) return e##LINE; \
- } static_assert(true, "require extra semicolon")
+ } \
+ static_assert(true, "require extra semicolon")
#define PASS_OR_BAIL(X) PASS_OR_BAIL_AT_LINE(X, __LINE__)
// Check rules for decorations where we start from the decoration rather
@@ -1858,8 +2112,10 @@
PASS_OR_BAIL(
CheckFPRoundingModeForShaders(vstate, *inst, decoration));
break;
+ case spv::Decoration::NonReadable:
case spv::Decoration::NonWritable:
- PASS_OR_BAIL(CheckNonWritableDecoration(vstate, *inst, decoration));
+ PASS_OR_BAIL(
+ CheckNonReadableWritableDecorations(vstate, *inst, decoration));
break;
case spv::Decoration::Uniform:
case spv::Decoration::UniformId:
@@ -1888,6 +2144,205 @@
return SPV_SUCCESS;
}
+bool AllowsLayout(ValidationState_t& vstate, const spv::StorageClass sc) {
+ switch (sc) {
+ case spv::StorageClass::StorageBuffer:
+ case spv::StorageClass::Uniform:
+ case spv::StorageClass::PhysicalStorageBuffer:
+ case spv::StorageClass::PushConstant:
+ // Always explicitly laid out.
+ return true;
+ case spv::StorageClass::UniformConstant:
+ return false;
+ case spv::StorageClass::Workgroup:
+ return vstate.HasCapability(
+ spv::Capability::WorkgroupMemoryExplicitLayoutKHR);
+ case spv::StorageClass::Function:
+ case spv::StorageClass::Private:
+ return vstate.version() <= SPV_SPIRV_VERSION_WORD(1, 4);
+ case spv::StorageClass::Input:
+ case spv::StorageClass::Output:
+ // Block is used generally and mesh shaders use Offset.
+ return true;
+ default:
+ // TODO: Some storage classes in ray tracing use explicit layout
+ // decorations, but it is not well documented which. For now treat other
+ // storage classes as allowed to be laid out. See Vulkan internal issue
+ // 4192.
+ return true;
+ }
+}
+
+bool UsesExplicitLayout(ValidationState_t& vstate, uint32_t type_id,
+ std::unordered_map<uint32_t, bool>& cache) {
+ if (type_id == 0) {
+ return false;
+ }
+
+ if (cache.count(type_id)) {
+ return cache[type_id];
+ }
+
+ bool res = false;
+ const auto type_inst = vstate.FindDef(type_id);
+ if (type_inst->opcode() == spv::Op::OpTypeStruct ||
+ type_inst->opcode() == spv::Op::OpTypeArray ||
+ type_inst->opcode() == spv::Op::OpTypeRuntimeArray ||
+ type_inst->opcode() == spv::Op::OpTypePointer ||
+ type_inst->opcode() == spv::Op::OpTypeUntypedPointerKHR) {
+ const auto& id_decs = vstate.id_decorations();
+ const auto iter = id_decs.find(type_id);
+ if (iter != id_decs.end()) {
+ bool allowLayoutDecorations = false;
+ if (type_inst->opcode() == spv::Op::OpTypePointer) {
+ const auto sc = type_inst->GetOperandAs<spv::StorageClass>(1);
+ allowLayoutDecorations = AllowsLayout(vstate, sc);
+ }
+ if (!allowLayoutDecorations) {
+ res = std::any_of(
+ iter->second.begin(), iter->second.end(), [](const Decoration& d) {
+ return d.dec_type() == spv::Decoration::Block ||
+ d.dec_type() == spv::Decoration::BufferBlock ||
+ d.dec_type() == spv::Decoration::Offset ||
+ d.dec_type() == spv::Decoration::ArrayStride ||
+ d.dec_type() == spv::Decoration::MatrixStride;
+ });
+ }
+ }
+
+ if (!res) {
+ switch (type_inst->opcode()) {
+ case spv::Op::OpTypeStruct:
+ for (uint32_t i = 1; !res && i < type_inst->operands().size(); i++) {
+ res = UsesExplicitLayout(
+ vstate, type_inst->GetOperandAs<uint32_t>(i), cache);
+ }
+ break;
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeRuntimeArray:
+ res = UsesExplicitLayout(vstate, type_inst->GetOperandAs<uint32_t>(1),
+ cache);
+ break;
+ case spv::Op::OpTypePointer: {
+ const auto sc = type_inst->GetOperandAs<spv::StorageClass>(1);
+ if (!AllowsLayout(vstate, sc)) {
+ res = UsesExplicitLayout(
+ vstate, type_inst->GetOperandAs<uint32_t>(2), cache);
+ }
+ }
+ default:
+ break;
+ }
+ }
+ }
+
+ cache[type_id] = res;
+ return res;
+}
+
+spv_result_t CheckInvalidVulkanExplicitLayout(ValidationState_t& vstate) {
+ if (!spvIsVulkanEnv(vstate.context()->target_env)) {
+ return SPV_SUCCESS;
+ }
+
+ std::unordered_map<uint32_t, bool> cache;
+ for (const auto& inst : vstate.ordered_instructions()) {
+ const auto type_id = inst.type_id();
+ const auto type_inst = vstate.FindDef(type_id);
+ uint32_t fail_id = 0;
+ // Variables are the main place to check for improper decorations, but some
+ // untyped pointer instructions must also be checked since those types may
+ // never be instantiated by a variable. Unlike verifying a valid layout,
+ // physical storage buffer does not need checked here since it is always
+ // explicitly laid out.
+ switch (inst.opcode()) {
+ case spv::Op::OpVariable:
+ case spv::Op::OpUntypedVariableKHR: {
+ const auto sc = inst.GetOperandAs<spv::StorageClass>(2);
+ auto check_id = type_id;
+ if (inst.opcode() == spv::Op::OpUntypedVariableKHR) {
+ if (inst.operands().size() > 3) {
+ check_id = inst.GetOperandAs<uint32_t>(3);
+ }
+ }
+ if (!AllowsLayout(vstate, sc) &&
+ UsesExplicitLayout(vstate, check_id, cache)) {
+ fail_id = check_id;
+ }
+ break;
+ }
+ case spv::Op::OpUntypedAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsAccessChainKHR:
+ case spv::Op::OpUntypedPtrAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsPtrAccessChainKHR: {
+ // Check both the base type and return type. The return type may have an
+ // invalid array stride.
+ const auto sc = type_inst->GetOperandAs<spv::StorageClass>(1);
+ const auto base_type_id = inst.GetOperandAs<uint32_t>(2);
+ if (!AllowsLayout(vstate, sc)) {
+ if (UsesExplicitLayout(vstate, base_type_id, cache)) {
+ fail_id = base_type_id;
+ } else if (UsesExplicitLayout(vstate, type_id, cache)) {
+ fail_id = type_id;
+ }
+ }
+ break;
+ }
+ case spv::Op::OpUntypedArrayLengthKHR: {
+ // Check the data type.
+ const auto ptr_ty_id =
+ vstate.FindDef(inst.GetOperandAs<uint32_t>(3))->type_id();
+ const auto ptr_ty = vstate.FindDef(ptr_ty_id);
+ const auto sc = ptr_ty->GetOperandAs<spv::StorageClass>(1);
+ const auto base_type_id = inst.GetOperandAs<uint32_t>(2);
+ if (!AllowsLayout(vstate, sc) &&
+ UsesExplicitLayout(vstate, base_type_id, cache)) {
+ fail_id = base_type_id;
+ }
+ break;
+ }
+ case spv::Op::OpLoad: {
+ const auto ptr_id = inst.GetOperandAs<uint32_t>(2);
+ const auto ptr_type = vstate.FindDef(vstate.FindDef(ptr_id)->type_id());
+ if (ptr_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) {
+ // For untyped pointers check the return type for an invalid layout.
+ const auto sc = ptr_type->GetOperandAs<spv::StorageClass>(1);
+ if (!AllowsLayout(vstate, sc) &&
+ UsesExplicitLayout(vstate, type_id, cache)) {
+ fail_id = type_id;
+ }
+ }
+ break;
+ }
+ case spv::Op::OpStore: {
+ const auto ptr_id = inst.GetOperandAs<uint32_t>(1);
+ const auto ptr_type = vstate.FindDef(vstate.FindDef(ptr_id)->type_id());
+ if (ptr_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) {
+ // For untyped pointers, check the type of the data operand for an
+ // invalid layout.
+ const auto sc = ptr_type->GetOperandAs<spv::StorageClass>(1);
+ const auto data_type_id = vstate.GetOperandTypeId(&inst, 1);
+ if (!AllowsLayout(vstate, sc) &&
+ UsesExplicitLayout(vstate, data_type_id, cache)) {
+ fail_id = inst.GetOperandAs<uint32_t>(2);
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ if (fail_id != 0) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << vstate.VkErrorID(10684)
+ << "Invalid explicit layout decorations on type for operand "
+ << vstate.getIdName(fail_id);
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
} // namespace
spv_result_t ValidateDecorations(ValidationState_t& vstate) {
@@ -1899,6 +2354,7 @@
if (auto error = CheckVulkanMemoryModelDeprecatedDecorations(vstate))
return error;
if (auto error = CheckDecorationsFromDecoration(vstate)) return error;
+ if (auto error = CheckInvalidVulkanExplicitLayout(vstate)) return error;
return SPV_SUCCESS;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_derivatives.cpp b/third_party/SPIRV-Tools/source/val/validate_derivatives.cpp
index 90cf664..1a473ba 100644
--- a/third_party/SPIRV-Tools/source/val/validate_derivatives.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_derivatives.cpp
@@ -60,12 +60,14 @@
->RegisterExecutionModelLimitation([opcode](spv::ExecutionModel model,
std::string* message) {
if (model != spv::ExecutionModel::Fragment &&
- model != spv::ExecutionModel::GLCompute) {
+ model != spv::ExecutionModel::GLCompute &&
+ model != spv::ExecutionModel::MeshEXT &&
+ model != spv::ExecutionModel::TaskEXT) {
if (message) {
*message =
std::string(
- "Derivative instructions require Fragment or GLCompute "
- "execution model: ") +
+ "Derivative instructions require Fragment, GLCompute, "
+ "MeshEXT or TaskEXT execution model: ") +
spvOpcodeString(opcode);
}
return false;
@@ -79,19 +81,23 @@
const auto* models = state.GetExecutionModels(entry_point->id());
const auto* modes = state.GetExecutionModes(entry_point->id());
if (models &&
- models->find(spv::ExecutionModel::GLCompute) != models->end() &&
+ (models->find(spv::ExecutionModel::GLCompute) !=
+ models->end() ||
+ models->find(spv::ExecutionModel::MeshEXT) != models->end() ||
+ models->find(spv::ExecutionModel::TaskEXT) != models->end()) &&
(!modes ||
- (modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) ==
+ (modes->find(spv::ExecutionMode::DerivativeGroupLinearKHR) ==
modes->end() &&
- modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) ==
+ modes->find(spv::ExecutionMode::DerivativeGroupQuadsKHR) ==
modes->end()))) {
if (message) {
- *message = std::string(
- "Derivative instructions require "
- "DerivativeGroupQuadsNV "
- "or DerivativeGroupLinearNV execution mode for "
- "GLCompute execution model: ") +
- spvOpcodeString(opcode);
+ *message =
+ std::string(
+ "Derivative instructions require "
+ "DerivativeGroupQuadsKHR "
+ "or DerivativeGroupLinearKHR execution mode for "
+ "GLCompute, MeshEXT or TaskEXT execution model: ") +
+ spvOpcodeString(opcode);
}
return false;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_extensions.cpp b/third_party/SPIRV-Tools/source/val/validate_extensions.cpp
index 7b73c9c..58aaf52 100644
--- a/third_party/SPIRV-Tools/source/val/validate_extensions.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_extensions.cpp
@@ -21,11 +21,11 @@
#include "NonSemanticShaderDebugInfo100.h"
#include "OpenCLDebugInfo100.h"
#include "source/common_debug_info.h"
-#include "source/enum_string_mapping.h"
#include "source/extensions.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/latest_version_opencl_std_header.h"
#include "source/spirv_constant.h"
+#include "source/table2.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
@@ -35,16 +35,15 @@
namespace val {
namespace {
-std::string ReflectionInstructionName(ValidationState_t& _,
- const Instruction* inst) {
- spv_ext_inst_desc desc = nullptr;
- if (_.grammar().lookupExtInst(SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION,
- inst->word(4), &desc) != SPV_SUCCESS ||
+std::string ReflectionInstructionName(const Instruction* inst) {
+ const ExtInstDesc* desc = nullptr;
+ if (LookupExtInst(SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION,
+ inst->word(4), &desc) != SPV_SUCCESS ||
!desc) {
return std::string("Unknown ExtInst");
}
std::ostringstream ss;
- ss << desc->name;
+ ss << desc->name().data();
return ss.str();
}
@@ -93,17 +92,17 @@
const std::function<std::string()>& ext_inst_name) {
auto* operand = _.FindDef(inst->word(word_index));
if (operand->opcode() != expected_opcode) {
- spv_opcode_desc desc = nullptr;
- if (_.grammar().lookupOpcode(expected_opcode, &desc) != SPV_SUCCESS ||
+ const spvtools::InstructionDesc* desc = nullptr;
+ if (spvtools::LookupOpcodeForEnv(_.context()->target_env, expected_opcode,
+ &desc) != SPV_SUCCESS ||
!desc) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected operand " << operand_name << " is invalid";
}
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << ext_inst_name() << ": "
- << "expected operand " << operand_name << " must be a result id of "
- << "Op" << desc->name;
+ << ext_inst_name() << ": " << "expected operand " << operand_name
+ << " must be a result id of " << "Op" << desc->name().data();
}
return SPV_SUCCESS;
}
@@ -147,7 +146,7 @@
const Instruction* inst, uint32_t word_index) {
if (inst->words().size() <= word_index) return false;
auto* debug_inst = _.FindDef(inst->word(word_index));
- if (debug_inst->opcode() != spv::Op::OpExtInst ||
+ if (!spvIsExtendedInstruction(debug_inst->opcode()) ||
(debug_inst->ext_inst_type() != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 &&
debug_inst->ext_inst_type() !=
SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) ||
@@ -165,7 +164,7 @@
const Instruction* inst, uint32_t word_index) {
if (inst->words().size() <= word_index) return false;
auto* debug_inst = _.FindDef(inst->word(word_index));
- if (debug_inst->opcode() != spv::Op::OpExtInst ||
+ if (!spvIsExtendedInstruction(debug_inst->opcode()) ||
(debug_inst->ext_inst_type() !=
SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) ||
!expectation(
@@ -189,18 +188,17 @@
if (DoesDebugInfoOperandMatchExpectation(_, expectation, inst, word_index))
return SPV_SUCCESS;
- spv_ext_inst_desc desc = nullptr;
- if (_.grammar().lookupExtInst(inst->ext_inst_type(), expected_debug_inst,
- &desc) != SPV_SUCCESS ||
+ const ExtInstDesc* desc = nullptr;
+ if (LookupExtInst(inst->ext_inst_type(), expected_debug_inst, &desc) !=
+ SPV_SUCCESS ||
!desc) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected operand " << debug_inst_name << " is invalid";
}
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << ext_inst_name() << ": "
- << "expected operand " << debug_inst_name << " must be a result id of "
- << desc->name;
+ << ext_inst_name() << ": " << "expected operand " << debug_inst_name
+ << " must be a result id of " << desc->name().data();
}
#define CHECK_DEBUG_OPERAND(NAME, debug_opcode, index) \
@@ -285,7 +283,7 @@
spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _,
const Instruction* inst,
uint32_t version) {
- const auto inst_name = ReflectionInstructionName(_, inst);
+ const auto inst_name = ReflectionInstructionName(inst);
const auto kernel_id = inst->GetOperandAs<uint32_t>(4);
const auto kernel = _.FindDef(kernel_id);
if (kernel->opcode() != spv::Op::OpFunction) {
@@ -409,7 +407,7 @@
spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) {
const auto decl_id = inst->GetOperandAs<uint32_t>(4);
const auto decl = _.FindDef(decl_id);
- if (!decl || decl->opcode() != spv::Op::OpExtInst) {
+ if (!decl || !spvIsExtendedInstruction(decl->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Kernel must be a Kernel extended instruction";
}
@@ -432,7 +430,7 @@
spv_result_t ValidateArgInfo(ValidationState_t& _, const Instruction* inst,
uint32_t info_index) {
auto info = _.FindDef(inst->GetOperandAs<uint32_t>(info_index));
- if (!info || info->opcode() != spv::Op::OpExtInst) {
+ if (!info || !spvIsExtendedInstruction(info->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "ArgInfo must be an ArgumentInfo extended instruction";
}
@@ -930,7 +928,7 @@
}
if (version < required_version) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << ReflectionInstructionName(_, inst) << " requires version "
+ << ReflectionInstructionName(inst) << " requires version "
<< required_version << ", but parsed version is " << version;
}
@@ -1052,12 +1050,21 @@
} // anonymous namespace
spv_result_t ValidateExtension(ValidationState_t& _, const Instruction* inst) {
+ std::string extension = GetExtensionString(&(inst->c_inst()));
+ if (_.version() < SPV_SPIRV_VERSION_WORD(1, 3)) {
+ if (extension == ExtensionToString(kSPV_KHR_vulkan_memory_model)) {
+ return _.diag(SPV_ERROR_WRONG_VERSION, inst)
+ << extension << " extension requires SPIR-V version 1.3 or later.";
+ }
+ }
if (_.version() < SPV_SPIRV_VERSION_WORD(1, 4)) {
- std::string extension = GetExtensionString(&(inst->c_inst()));
if (extension ==
ExtensionToString(kSPV_KHR_workgroup_memory_explicit_layout) ||
extension == ExtensionToString(kSPV_EXT_mesh_shader) ||
- extension == ExtensionToString(kSPV_NV_shader_invocation_reorder)) {
+ extension == ExtensionToString(kSPV_NV_shader_invocation_reorder) ||
+ extension ==
+ ExtensionToString(kSPV_NV_cluster_acceleration_structure) ||
+ extension == ExtensionToString(kSPV_NV_linear_swept_spheres)) {
return _.diag(SPV_ERROR_WRONG_VERSION, inst)
<< extension << " extension requires SPIR-V version 1.4 or later.";
}
@@ -1092,9 +1099,8 @@
spv_ext_inst_type_t(inst->ext_inst_type());
auto ext_inst_name = [&_, ext_inst_set, ext_inst_type, ext_inst_index]() {
- spv_ext_inst_desc desc = nullptr;
- if (_.grammar().lookupExtInst(ext_inst_type, ext_inst_index, &desc) !=
- SPV_SUCCESS ||
+ const ExtInstDesc* desc = nullptr;
+ if (LookupExtInst(ext_inst_type, ext_inst_index, &desc) != SPV_SUCCESS ||
!desc) {
return std::string("Unknown ExtInst");
}
@@ -1105,7 +1111,7 @@
std::ostringstream ss;
ss << import_inst->GetOperandAs<std::string>(1);
ss << " ";
- ss << desc->name;
+ ss << desc->name().data();
return ss.str();
};
@@ -1136,7 +1142,16 @@
case GLSLstd450NMin:
case GLSLstd450NMax:
case GLSLstd450NClamp: {
- if (!_.IsFloatScalarOrVectorType(result_type)) {
+ bool supportsCoopVec =
+ (ext_inst_key == GLSLstd450FMin || ext_inst_key == GLSLstd450FMax ||
+ ext_inst_key == GLSLstd450FClamp ||
+ ext_inst_key == GLSLstd450NMin || ext_inst_key == GLSLstd450NMax ||
+ ext_inst_key == GLSLstd450NClamp ||
+ ext_inst_key == GLSLstd450Step || ext_inst_key == GLSLstd450Fma);
+
+ if (!_.IsFloatScalarOrVectorType(result_type) &&
+ !(supportsCoopVec &&
+ _.IsFloatCooperativeVectorNVType(result_type))) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected Result Type to be a float scalar or vector type";
@@ -1166,7 +1181,14 @@
case GLSLstd450FindILsb:
case GLSLstd450FindUMsb:
case GLSLstd450FindSMsb: {
- if (!_.IsIntScalarOrVectorType(result_type)) {
+ bool supportsCoopVec =
+ (ext_inst_key == GLSLstd450UMin || ext_inst_key == GLSLstd450UMax ||
+ ext_inst_key == GLSLstd450UClamp ||
+ ext_inst_key == GLSLstd450SMin || ext_inst_key == GLSLstd450SMax ||
+ ext_inst_key == GLSLstd450SClamp);
+
+ if (!_.IsIntScalarOrVectorType(result_type) &&
+ !(supportsCoopVec && _.IsIntCooperativeVectorNVType(result_type))) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected Result Type to be an int scalar or vector type";
@@ -1178,7 +1200,10 @@
for (uint32_t operand_index = 4; operand_index < num_operands;
++operand_index) {
const uint32_t operand_type = _.GetOperandTypeId(inst, operand_index);
- if (!operand_type || !_.IsIntScalarOrVectorType(operand_type)) {
+ if (!operand_type ||
+ (!_.IsIntScalarOrVectorType(operand_type) &&
+ !(supportsCoopVec &&
+ _.IsIntCooperativeVectorNVType(operand_type)))) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected all operands to be int scalars or vectors";
@@ -1231,7 +1256,13 @@
case GLSLstd450Log2:
case GLSLstd450Atan2:
case GLSLstd450Pow: {
- if (!_.IsFloatScalarOrVectorType(result_type)) {
+ bool supportsCoopVec =
+ (ext_inst_key == GLSLstd450Atan || ext_inst_key == GLSLstd450Tanh ||
+ ext_inst_key == GLSLstd450Exp || ext_inst_key == GLSLstd450Log);
+
+ if (!_.IsFloatScalarOrVectorType(result_type) &&
+ !(supportsCoopVec &&
+ _.IsFloatCooperativeVectorNVType(result_type))) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected Result Type to be a 16 or 32-bit scalar or "
@@ -1980,7 +2011,7 @@
"CrossWorkgroup, Workgroup or Function";
}
- if (result_type != p_data_type) {
+ if (!_.ContainsUntypedPointer(p_type) && result_type != p_data_type) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected data type of the pointer to be equal to Result "
@@ -2042,15 +2073,17 @@
"CrossWorkgroup, Workgroup or Function";
}
- if (!_.IsIntScalarOrVectorType(p_data_type) ||
- _.GetBitWidth(p_data_type) != 32) {
+ if ((!_.IsIntScalarOrVectorType(p_data_type) ||
+ _.GetBitWidth(p_data_type) != 32) &&
+ !_.ContainsUntypedPointer(p_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected data type of the pointer to be a 32-bit int "
"scalar or vector type";
}
- if (_.GetDimension(p_data_type) != num_components) {
+ if (!_.ContainsUntypedPointer(p_type) &&
+ _.GetDimension(p_data_type) != num_components) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected data type of the pointer to have the same number "
@@ -2701,8 +2734,9 @@
"Generic, CrossWorkgroup, Workgroup or Function";
}
- if (!_.IsFloatScalarType(p_data_type) ||
- _.GetBitWidth(p_data_type) != 16) {
+ if ((!_.IsFloatScalarType(p_data_type) ||
+ _.GetBitWidth(p_data_type) != 16) &&
+ !_.ContainsUntypedPointer(p_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected operand P data type to be 16-bit float scalar";
@@ -2763,8 +2797,9 @@
"Generic, CrossWorkgroup, Workgroup or Function";
}
- if (!_.IsFloatScalarType(p_data_type) ||
- _.GetBitWidth(p_data_type) != 16) {
+ if ((!_.IsFloatScalarType(p_data_type) ||
+ _.GetBitWidth(p_data_type) != 16) &&
+ !_.ContainsUntypedPointer(p_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected operand P data type to be 16-bit float scalar";
@@ -2855,8 +2890,9 @@
"CrossWorkgroup, Workgroup or Function";
}
- if (!_.IsFloatScalarType(p_data_type) ||
- _.GetBitWidth(p_data_type) != 16) {
+ if ((!_.IsFloatScalarType(p_data_type) ||
+ _.GetBitWidth(p_data_type) != 16) &&
+ !_.ContainsUntypedPointer(p_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected operand P data type to be 16-bit float scalar";
@@ -2962,14 +2998,41 @@
<< "expected operand Format to be a pointer";
}
- if (format_storage_class != spv::StorageClass::UniformConstant) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << ext_inst_name() << ": "
- << "expected Format storage class to be UniformConstant";
+ if (_.HasExtension(
+ Extension::kSPV_EXT_relaxed_printf_string_address_space)) {
+ if (format_storage_class != spv::StorageClass::UniformConstant &&
+ // Extension SPV_EXT_relaxed_printf_string_address_space allows
+ // format strings in Global, Local, Private and Generic address
+ // spaces
+
+ // Global
+ format_storage_class != spv::StorageClass::CrossWorkgroup &&
+ // Local
+ format_storage_class != spv::StorageClass::Workgroup &&
+ // Private
+ format_storage_class != spv::StorageClass::Function &&
+ // Generic
+ format_storage_class != spv::StorageClass::Generic) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name() << ": "
+ << "expected Format storage class to be UniformConstant, "
+ "Crossworkgroup, Workgroup, Function, or Generic";
+ }
+ } else {
+ if (format_storage_class != spv::StorageClass::UniformConstant) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name() << ": "
+ << "expected Format storage class to be UniformConstant";
+ }
}
- if (!_.IsIntScalarType(format_data_type) ||
- _.GetBitWidth(format_data_type) != 8) {
+ // If pointer points to an array, get the type of an element
+ if (_.IsIntArrayType(format_data_type))
+ format_data_type = _.GetComponentType(format_data_type);
+
+ if ((!_.IsIntScalarType(format_data_type) ||
+ _.GetBitWidth(format_data_type) != 8) &&
+ !_.ContainsUntypedPointer(format_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< ext_inst_name() << ": "
<< "expected Format data type to be 8-bit int";
@@ -3058,7 +3121,6 @@
// validation.
case NonSemanticShaderDebugInfo100DebugInfoNone:
case NonSemanticShaderDebugInfo100DebugCompilationUnit:
- case NonSemanticShaderDebugInfo100DebugTypeBasic:
case NonSemanticShaderDebugInfo100DebugTypePointer:
case NonSemanticShaderDebugInfo100DebugTypeQualifier:
case NonSemanticShaderDebugInfo100DebugTypeArray:
@@ -3084,7 +3146,6 @@
case NonSemanticShaderDebugInfo100DebugInlinedAt:
case NonSemanticShaderDebugInfo100DebugLocalVariable:
case NonSemanticShaderDebugInfo100DebugInlinedVariable:
- case NonSemanticShaderDebugInfo100DebugDeclare:
case NonSemanticShaderDebugInfo100DebugValue:
case NonSemanticShaderDebugInfo100DebugOperation:
case NonSemanticShaderDebugInfo100DebugExpression:
@@ -3093,6 +3154,24 @@
case NonSemanticShaderDebugInfo100DebugImportedEntity:
case NonSemanticShaderDebugInfo100DebugSource:
break;
+
+ // These checks are for operands that are differnet in
+ // ShaderDebugInfo100
+ case NonSemanticShaderDebugInfo100DebugTypeBasic: {
+ CHECK_CONST_UINT_OPERAND("Flags", 8);
+ break;
+ }
+ case NonSemanticShaderDebugInfo100DebugDeclare: {
+ for (uint32_t word_index = 8; word_index < num_words; ++word_index) {
+ auto index_inst = _.FindDef(inst->word(word_index));
+ auto type_id = index_inst != nullptr ? index_inst->type_id() : 0;
+ if (type_id == 0 || !IsIntScalar(_, type_id, false, false))
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name() << ": "
+ << "expected index must be scalar integer";
+ }
+ break;
+ }
case NonSemanticShaderDebugInfo100DebugTypeMatrix: {
CHECK_DEBUG_OPERAND("Vector Type", CommonDebugInfoDebugTypeVector, 5);
@@ -3114,14 +3193,84 @@
}
break;
}
- // TODO: Add validation rules for remaining cases as well.
- case NonSemanticShaderDebugInfo100DebugFunctionDefinition:
- case NonSemanticShaderDebugInfo100DebugSourceContinued:
- case NonSemanticShaderDebugInfo100DebugLine:
+ case NonSemanticShaderDebugInfo100DebugFunctionDefinition: {
+ CHECK_DEBUG_OPERAND("Function", CommonDebugInfoDebugFunction, 5);
+ CHECK_OPERAND("Definition", spv::Op::OpFunction, 6);
+ const auto* current_function = inst->function();
+ if (current_function->first_block()->id() != inst->block()->id()) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name()
+ << ": must be in the entry basic block of the function";
+ }
+
+ const uint32_t definition_id = inst->word(6);
+ if (definition_id != current_function->id()) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name()
+ << ": operand Definition must point to the OpFunction it is "
+ "inside";
+ }
+ break;
+ }
+ case NonSemanticShaderDebugInfo100DebugLine: {
+ CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 5);
+ CHECK_CONST_UINT_OPERAND("Line Start", 6);
+ CHECK_CONST_UINT_OPERAND("Line End", 7);
+ CHECK_CONST_UINT_OPERAND("Column Start", 8);
+ CHECK_CONST_UINT_OPERAND("Column End", 9);
+
+ // above already validates if 32-bit and non-spec constant
+ // but want to use EvalInt32IfConst to be consistent with other Eval
+ // locations
+ bool is_int32 = false, is_const_int32 = false;
+ uint32_t line_start = 0;
+ uint32_t line_end = 0;
+ uint32_t column_start = 0;
+ uint32_t column_end = 0;
+ std::tie(is_int32, is_const_int32, line_start) =
+ _.EvalInt32IfConst(inst->word(6));
+ std::tie(is_int32, is_const_int32, line_end) =
+ _.EvalInt32IfConst(inst->word(7));
+ std::tie(is_int32, is_const_int32, column_start) =
+ _.EvalInt32IfConst(inst->word(8));
+ std::tie(is_int32, is_const_int32, column_end) =
+ _.EvalInt32IfConst(inst->word(9));
+ if (line_end < line_start) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name() << ": operand Line End (" << line_end
+ << ") is less than Line Start (" << line_start << ")";
+ } else if (line_start == line_end && column_end < column_start) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name() << ": operand Column End (" << column_end
+ << ") is less than Column Start (" << column_start
+ << ") when Line Start equals Line End";
+ }
+ break;
+ }
+ case NonSemanticShaderDebugInfo100DebugSourceContinued: {
+ CHECK_OPERAND("Text", spv::Op::OpString, 5);
+ break;
+ }
+ case NonSemanticShaderDebugInfo100DebugBuildIdentifier: {
+ CHECK_OPERAND("Identifier", spv::Op::OpString, 5);
+ CHECK_CONST_UINT_OPERAND("Flags", 6);
+ break;
+ }
+ case NonSemanticShaderDebugInfo100DebugStoragePath: {
+ CHECK_OPERAND("Path", spv::Op::OpString, 5);
+ break;
+ }
+ case NonSemanticShaderDebugInfo100DebugEntryPoint: {
+ CHECK_DEBUG_OPERAND("Entry Point", CommonDebugInfoDebugFunction, 5);
+ CHECK_DEBUG_OPERAND("Compilation Unit",
+ CommonDebugInfoDebugCompilationUnit, 6);
+ CHECK_OPERAND("Compiler Signature", spv::Op::OpString, 7);
+ CHECK_OPERAND("Command-line Arguments", spv::Op::OpString, 8);
+ break;
+ }
+
+ // Has no additional checks
case NonSemanticShaderDebugInfo100DebugNoLine:
- case NonSemanticShaderDebugInfo100DebugBuildIdentifier:
- case NonSemanticShaderDebugInfo100DebugStoragePath:
- case NonSemanticShaderDebugInfo100DebugEntryPoint:
break;
case NonSemanticShaderDebugInfo100InstructionsMax:
assert(0);
@@ -3423,9 +3572,7 @@
}
case CommonDebugInfoDebugFunction: {
CHECK_OPERAND("Name", spv::Op::OpString, 5);
- auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6,
- ext_inst_name, false);
- if (validate_type != SPV_SUCCESS) return validate_type;
+ CHECK_DEBUG_OPERAND("Type", CommonDebugInfoDebugTypeFunction, 6);
CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7);
CHECK_CONST_UINT_OPERAND("Line", 8);
CHECK_CONST_UINT_OPERAND("Column", 9);
@@ -3460,9 +3607,7 @@
}
case CommonDebugInfoDebugFunctionDeclaration: {
CHECK_OPERAND("Name", spv::Op::OpString, 5);
- auto validate_type = ValidateOperandDebugType(_, "Type", inst, 6,
- ext_inst_name, false);
- if (validate_type != SPV_SUCCESS) return validate_type;
+ CHECK_DEBUG_OPERAND("Type", CommonDebugInfoDebugTypeFunction, 6);
CHECK_DEBUG_OPERAND("Source", CommonDebugInfoDebugSource, 7);
CHECK_CONST_UINT_OPERAND("Line", 8);
CHECK_CONST_UINT_OPERAND("Column", 9);
@@ -3524,18 +3669,6 @@
}
CHECK_DEBUG_OPERAND("Expression", CommonDebugInfoDebugExpression, 7);
-
- if (vulkanDebugInfo) {
- for (uint32_t word_index = 8; word_index < num_words;
- ++word_index) {
- auto index_inst = _.FindDef(inst->word(word_index));
- auto type_id = index_inst != nullptr ? index_inst->type_id() : 0;
- if (type_id == 0 || !IsIntScalar(_, type_id, false, false))
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << ext_inst_name() << ": "
- << "expected index must be scalar integer";
- }
- }
break;
}
case CommonDebugInfoDebugExpression: {
@@ -3706,7 +3839,7 @@
const spv::Op opcode = inst->opcode();
if (opcode == spv::Op::OpExtension) return ValidateExtension(_, inst);
if (opcode == spv::Op::OpExtInstImport) return ValidateExtInstImport(_, inst);
- if (opcode == spv::Op::OpExtInst) return ValidateExtInst(_, inst);
+ if (spvIsExtendedInstruction(opcode)) return ValidateExtInst(_, inst);
return SPV_SUCCESS;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_function.cpp b/third_party/SPIRV-Tools/source/val/validate_function.cpp
index 639817f..b08c5b4 100644
--- a/third_party/SPIRV-Tools/source/val/validate_function.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_function.cpp
@@ -14,8 +14,8 @@
#include <algorithm>
-#include "source/enum_string_mapping.h"
#include "source/opcode.h"
+#include "source/table2.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
@@ -86,7 +86,10 @@
spv::Op::OpGetKernelPreferredWorkGroupSizeMultiple,
spv::Op::OpGetKernelLocalSizeForSubgroupCount,
spv::Op::OpGetKernelMaxNumSubgroups,
- spv::Op::OpName};
+ spv::Op::OpName,
+ spv::Op::OpCooperativeMatrixPerElementOpNV,
+ spv::Op::OpCooperativeMatrixReduceNV,
+ spv::Op::OpCooperativeMatrixLoadTensorNV};
for (auto& pair : inst->uses()) {
const auto* use = pair.first;
if (std::find(acceptable.begin(), acceptable.end(), use->opcode()) ==
@@ -149,78 +152,6 @@
"type of the same index.";
}
- // Validate that PhysicalStorageBuffer have one of Restrict, Aliased,
- // RestrictPointer, or AliasedPointer.
- auto param_nonarray_type_id = param_type->id();
- while (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypeArray) {
- param_nonarray_type_id =
- _.FindDef(param_nonarray_type_id)->GetOperandAs<uint32_t>(1u);
- }
- if (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypePointer) {
- auto param_nonarray_type = _.FindDef(param_nonarray_type_id);
- if (param_nonarray_type->GetOperandAs<spv::StorageClass>(1u) ==
- spv::StorageClass::PhysicalStorageBuffer) {
- // check for Aliased or Restrict
- const auto& decorations = _.id_decorations(inst->id());
-
- bool foundAliased = std::any_of(
- decorations.begin(), decorations.end(), [](const Decoration& d) {
- return spv::Decoration::Aliased == d.dec_type();
- });
-
- bool foundRestrict = std::any_of(
- decorations.begin(), decorations.end(), [](const Decoration& d) {
- return spv::Decoration::Restrict == d.dec_type();
- });
-
- if (!foundAliased && !foundRestrict) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionParameter " << inst->id()
- << ": expected Aliased or Restrict for PhysicalStorageBuffer "
- "pointer.";
- }
- if (foundAliased && foundRestrict) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionParameter " << inst->id()
- << ": can't specify both Aliased and Restrict for "
- "PhysicalStorageBuffer pointer.";
- }
- } else {
- const auto pointee_type_id =
- param_nonarray_type->GetOperandAs<uint32_t>(2);
- const auto pointee_type = _.FindDef(pointee_type_id);
- if (spv::Op::OpTypePointer == pointee_type->opcode() &&
- pointee_type->GetOperandAs<spv::StorageClass>(1u) ==
- spv::StorageClass::PhysicalStorageBuffer) {
- // check for AliasedPointer/RestrictPointer
- const auto& decorations = _.id_decorations(inst->id());
-
- bool foundAliased = std::any_of(
- decorations.begin(), decorations.end(), [](const Decoration& d) {
- return spv::Decoration::AliasedPointer == d.dec_type();
- });
-
- bool foundRestrict = std::any_of(
- decorations.begin(), decorations.end(), [](const Decoration& d) {
- return spv::Decoration::RestrictPointer == d.dec_type();
- });
-
- if (!foundAliased && !foundRestrict) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionParameter " << inst->id()
- << ": expected AliasedPointer or RestrictPointer for "
- "PhysicalStorageBuffer pointer.";
- }
- if (foundAliased && foundRestrict) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionParameter " << inst->id()
- << ": can't specify both AliasedPointer and "
- "RestrictPointer for PhysicalStorageBuffer pointer.";
- }
- }
- }
- }
-
return SPV_SUCCESS;
}
@@ -278,7 +209,7 @@
function_type->GetOperandAs<uint32_t>(param_index);
const auto parameter_type = _.FindDef(parameter_type_id);
if (!parameter_type || argument_type->id() != parameter_type->id()) {
- if (!_.options()->before_hlsl_legalization ||
+ if (!parameter_type || !_.options()->before_hlsl_legalization ||
!DoPointeesLogicallyMatch(argument_type, parameter_type, _)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpFunctionCall Argument <id> " << _.getIdName(argument_id)
@@ -288,7 +219,8 @@
}
if (_.addressing_model() == spv::AddressingModel::Logical) {
- if (parameter_type->opcode() == spv::Op::OpTypePointer &&
+ if ((parameter_type->opcode() == spv::Op::OpTypePointer ||
+ parameter_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) &&
!_.options()->relax_logical_pointer) {
spv::StorageClass sc =
parameter_type->GetOperandAs<spv::StorageClass>(1u);
@@ -317,14 +249,17 @@
// Validate memory object declaration requirements.
if (argument->opcode() != spv::Op::OpVariable &&
+ argument->opcode() != spv::Op::OpUntypedVariableKHR &&
argument->opcode() != spv::Op::OpFunctionParameter) {
- const bool ssbo_vptr = _.features().variable_pointers &&
- sc == spv::StorageClass::StorageBuffer;
+ const bool ssbo_vptr =
+ _.HasCapability(spv::Capability::VariablePointersStorageBuffer) &&
+ sc == spv::StorageClass::StorageBuffer;
const bool wg_vptr =
_.HasCapability(spv::Capability::VariablePointers) &&
sc == spv::StorageClass::Workgroup;
const bool uc_ptr = sc == spv::StorageClass::UniformConstant;
- if (!ssbo_vptr && !wg_vptr && !uc_ptr) {
+ if (!_.options()->before_hlsl_legalization && !ssbo_vptr &&
+ !wg_vptr && !uc_ptr) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Pointer operand " << _.getIdName(argument_id)
<< " must be a memory object declaration";
@@ -336,6 +271,80 @@
return SPV_SUCCESS;
}
+spv_result_t ValidateCooperativeMatrixPerElementOp(ValidationState_t& _,
+ const Instruction* inst) {
+ const auto function_id = inst->GetOperandAs<uint32_t>(3);
+ const auto function = _.FindDef(function_id);
+ if (!function || spv::Op::OpFunction != function->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV Function <id> "
+ << _.getIdName(function_id) << " is not a function.";
+ }
+
+ const auto matrix_id = inst->GetOperandAs<uint32_t>(2);
+ const auto matrix = _.FindDef(matrix_id);
+ const auto matrix_type_id = matrix->type_id();
+ if (!_.IsCooperativeMatrixKHRType(matrix_type_id)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV Matrix <id> "
+ << _.getIdName(matrix_id) << " is not a cooperative matrix.";
+ }
+
+ const auto result_type_id = inst->GetOperandAs<uint32_t>(0);
+ if (matrix_type_id != result_type_id) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV Result Type <id> "
+ << _.getIdName(result_type_id) << " must match matrix type <id> "
+ << _.getIdName(matrix_type_id) << ".";
+ }
+
+ const auto matrix_comp_type_id =
+ _.FindDef(matrix_type_id)->GetOperandAs<uint32_t>(1);
+ const auto function_type_id = function->GetOperandAs<uint32_t>(3);
+ const auto function_type = _.FindDef(function_type_id);
+ auto return_type_id = function_type->GetOperandAs<uint32_t>(1);
+ if (return_type_id != matrix_comp_type_id) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV function return type <id> "
+ << _.getIdName(return_type_id)
+ << " must match matrix component type <id> "
+ << _.getIdName(matrix_comp_type_id) << ".";
+ }
+
+ if (function_type->operands().size() < 5) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV function type <id> "
+ << _.getIdName(function_type_id)
+ << " must have a least three parameters.";
+ }
+
+ const auto param0_id = function_type->GetOperandAs<uint32_t>(2);
+ const auto param1_id = function_type->GetOperandAs<uint32_t>(3);
+ const auto param2_id = function_type->GetOperandAs<uint32_t>(4);
+ if (!_.IsIntScalarType(param0_id) || _.GetBitWidth(param0_id) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV function type first parameter "
+ "type <id> "
+ << _.getIdName(param0_id) << " must be a 32-bit integer.";
+ }
+
+ if (!_.IsIntScalarType(param1_id) || _.GetBitWidth(param1_id) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV function type second "
+ "parameter type <id> "
+ << _.getIdName(param1_id) << " must be a 32-bit integer.";
+ }
+
+ if (param2_id != matrix_comp_type_id) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixPerElementOpNV function type third parameter "
+ "type <id> "
+ << _.getIdName(param2_id) << " must match matrix component type.";
+ }
+
+ return SPV_SUCCESS;
+}
+
} // namespace
spv_result_t FunctionPass(ValidationState_t& _, const Instruction* inst) {
@@ -349,6 +358,10 @@
case spv::Op::OpFunctionCall:
if (auto error = ValidateFunctionCall(_, inst)) return error;
break;
+ case spv::Op::OpCooperativeMatrixPerElementOpNV:
+ if (auto error = ValidateCooperativeMatrixPerElementOp(_, inst))
+ return error;
+ break;
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_id.cpp b/third_party/SPIRV-Tools/source/val/validate_id.cpp
index bcfeb59..f43e982 100644
--- a/third_party/SPIRV-Tools/source/val/validate_id.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_id.cpp
@@ -115,20 +115,72 @@
return SPV_SUCCESS;
}
+bool InstructionCanHaveTypeOperand(const Instruction* inst) {
+ static std::unordered_set<spv::Op> instruction_allow_set{
+ spv::Op::OpSizeOf,
+ spv::Op::OpCooperativeMatrixLengthNV,
+ spv::Op::OpCooperativeMatrixLengthKHR,
+ spv::Op::OpUntypedArrayLengthKHR,
+ spv::Op::OpFunction,
+ spv::Op::OpAsmINTEL,
+ };
+ const auto opcode = inst->opcode();
+ bool type_instruction = spvOpcodeGeneratesType(opcode);
+ bool debug_instruction = spvOpcodeIsDebug(opcode) || inst->IsDebugInfo();
+ bool coop_matrix_spec_constant_op_length =
+ (opcode == spv::Op::OpSpecConstantOp) &&
+ (spv::Op(inst->word(3)) == spv::Op::OpCooperativeMatrixLengthNV ||
+ spv::Op(inst->word(3)) == spv::Op::OpCooperativeMatrixLengthKHR);
+ return type_instruction || debug_instruction || inst->IsNonSemantic() ||
+ spvOpcodeIsDecoration(opcode) || instruction_allow_set.count(opcode) ||
+ spvOpcodeGeneratesUntypedPointer(opcode) ||
+ coop_matrix_spec_constant_op_length;
+}
+
+bool InstructionRequiresTypeOperand(const Instruction* inst) {
+ static std::unordered_set<spv::Op> instruction_deny_set{
+ spv::Op::OpExtInst,
+ spv::Op::OpExtInstWithForwardRefsKHR,
+ spv::Op::OpExtInstImport,
+ spv::Op::OpSelectionMerge,
+ spv::Op::OpLoopMerge,
+ spv::Op::OpFunction,
+ spv::Op::OpSizeOf,
+ spv::Op::OpCooperativeMatrixLengthNV,
+ spv::Op::OpCooperativeMatrixLengthKHR,
+ spv::Op::OpPhi,
+ spv::Op::OpUntypedArrayLengthKHR,
+ spv::Op::OpAsmINTEL,
+ };
+ const auto opcode = inst->opcode();
+ bool debug_instruction = spvOpcodeIsDebug(opcode) || inst->IsDebugInfo();
+ bool coop_matrix_spec_constant_op_length =
+ opcode == spv::Op::OpSpecConstantOp &&
+ (spv::Op(inst->word(3)) == spv::Op::OpCooperativeMatrixLengthNV ||
+ spv::Op(inst->word(3)) == spv::Op::OpCooperativeMatrixLengthKHR);
+
+ return !debug_instruction && !inst->IsNonSemantic() &&
+ !spvOpcodeIsDecoration(opcode) && !spvOpcodeIsBranch(opcode) &&
+ !instruction_deny_set.count(opcode) &&
+ !spvOpcodeGeneratesUntypedPointer(opcode) &&
+ !coop_matrix_spec_constant_op_length;
+}
+
// Performs SSA validation on the IDs of an instruction. The
// can_have_forward_declared_ids functor should return true if the
// instruction operand's ID can be forward referenced.
spv_result_t IdPass(ValidationState_t& _, Instruction* inst) {
auto can_have_forward_declared_ids =
- inst->opcode() == spv::Op::OpExtInst &&
+ spvIsExtendedInstruction(inst->opcode()) &&
spvExtInstIsDebugInfo(inst->ext_inst_type())
? spvDbgInfoExtOperandCanBeForwardDeclaredFunction(
- inst->ext_inst_type(), inst->word(4))
+ inst->opcode(), inst->ext_inst_type(), inst->word(4))
: spvOperandCanBeForwardDeclaredFunction(inst->opcode());
// Keep track of a result id defined by this instruction. 0 means it
// does not define an id.
uint32_t result_id = 0;
+ bool has_forward_declared_ids = false;
for (unsigned i = 0; i < inst->operands().size(); i++) {
const spv_parsed_operand_t& operand = inst->operand(i);
@@ -157,37 +209,14 @@
case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
case SPV_OPERAND_TYPE_SCOPE_ID:
if (const auto def = _.FindDef(operand_word)) {
- const auto opcode = inst->opcode();
if (spvOpcodeGeneratesType(def->opcode()) &&
- !spvOpcodeGeneratesType(opcode) && !spvOpcodeIsDebug(opcode) &&
- !inst->IsDebugInfo() && !inst->IsNonSemantic() &&
- !spvOpcodeIsDecoration(opcode) && opcode != spv::Op::OpFunction &&
- opcode != spv::Op::OpCooperativeMatrixLengthNV &&
- opcode != spv::Op::OpCooperativeMatrixLengthKHR &&
- !(opcode == spv::Op::OpSpecConstantOp &&
- (spv::Op(inst->word(3)) ==
- spv::Op::OpCooperativeMatrixLengthNV ||
- spv::Op(inst->word(3)) ==
- spv::Op::OpCooperativeMatrixLengthKHR))) {
+ !InstructionCanHaveTypeOperand(inst)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Operand " << _.getIdName(operand_word)
<< " cannot be a type";
- } else if (def->type_id() == 0 && !spvOpcodeGeneratesType(opcode) &&
- !spvOpcodeIsDebug(opcode) && !inst->IsDebugInfo() &&
- !inst->IsNonSemantic() && !spvOpcodeIsDecoration(opcode) &&
- !spvOpcodeIsBranch(opcode) && opcode != spv::Op::OpPhi &&
- opcode != spv::Op::OpExtInst &&
- opcode != spv::Op::OpExtInstImport &&
- opcode != spv::Op::OpSelectionMerge &&
- opcode != spv::Op::OpLoopMerge &&
- opcode != spv::Op::OpFunction &&
- opcode != spv::Op::OpCooperativeMatrixLengthNV &&
- opcode != spv::Op::OpCooperativeMatrixLengthKHR &&
- !(opcode == spv::Op::OpSpecConstantOp &&
- (spv::Op(inst->word(3)) ==
- spv::Op::OpCooperativeMatrixLengthNV ||
- spv::Op(inst->word(3)) ==
- spv::Op::OpCooperativeMatrixLengthKHR))) {
+ } else if (def->type_id() == 0 &&
+ !spvOpcodeGeneratesType(def->opcode()) &&
+ InstructionRequiresTypeOperand(inst)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Operand " << _.getIdName(operand_word)
<< " requires a type";
@@ -200,6 +229,7 @@
ret = SPV_SUCCESS;
}
} else if (can_have_forward_declared_ids(i)) {
+ has_forward_declared_ids = true;
if (spvOpcodeGeneratesType(inst->opcode()) &&
!_.IsForwardPointer(operand_word)) {
ret = _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -229,12 +259,35 @@
<< " has not been defined";
}
break;
+ case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER:
+ // Ideally, this check would live in validate_extensions.cpp. But since
+ // forward references are only allowed on non-semantic instructions, and
+ // ID validation is done first, we would fail with a "ID had not been
+ // defined" error before we could give a more helpful message. For this
+ // reason, this test is done here, so we can be more helpful to the
+ // user.
+ if (inst->opcode() == spv::Op::OpExtInstWithForwardRefsKHR &&
+ !inst->IsNonSemantic())
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "OpExtInstWithForwardRefsKHR is only allowed with "
+ "non-semantic instructions.";
+ ret = SPV_SUCCESS;
+ break;
default:
ret = SPV_SUCCESS;
break;
}
if (SPV_SUCCESS != ret) return ret;
}
+ const bool must_have_forward_declared_ids =
+ inst->opcode() == spv::Op::OpExtInstWithForwardRefsKHR;
+ if (must_have_forward_declared_ids && !has_forward_declared_ids) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Opcode OpExtInstWithForwardRefsKHR must have at least one "
+ "forward "
+ "declared ID.";
+ }
+
if (result_id) _.RemoveIfForwardDeclared(result_id);
return SPV_SUCCESS;
diff --git a/third_party/SPIRV-Tools/source/val/validate_image.cpp b/third_party/SPIRV-Tools/source/val/validate_image.cpp
index a1a76ea..58f22f2 100644
--- a/third_party/SPIRV-Tools/source/val/validate_image.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_image.cpp
@@ -455,15 +455,18 @@
}
if (!_.options()->before_hlsl_legalization &&
- spvIsVulkanEnv(_.context()->target_env)) {
+ spvIsVulkanEnv(_.context()->target_env) &&
+ !_.options()->allow_offset_texture_operand) {
if (opcode != spv::Op::OpImageGather &&
opcode != spv::Op::OpImageDrefGather &&
opcode != spv::Op::OpImageSparseGather &&
opcode != spv::Op::OpImageSparseDrefGather) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4663)
+ << _.VkErrorID(10213)
<< "Image Operand Offset can only be used with "
- "OpImage*Gather operations";
+ "OpImage*Gather operations."
+ << _.MissingFeature("maintenance8 feature",
+ "--allow-offset-texture-operand", false);
}
}
}
@@ -994,6 +997,7 @@
case spv::Op::OpImageBlockMatchWindowSSDQCOM:
case spv::Op::OpImageBlockMatchGatherSADQCOM:
case spv::Op::OpImageBlockMatchGatherSSDQCOM:
+ case spv::Op::OpImageSampleFootprintNV:
return true;
case spv::Op::OpStore:
if (_.HasCapability(spv::Capability::BindlessTextureNV)) return true;
@@ -1005,7 +1009,8 @@
spv_result_t ValidateSampledImage(ValidationState_t& _,
const Instruction* inst) {
- if (_.GetIdOpcode(inst->type_id()) != spv::Op::OpTypeSampledImage) {
+ auto type_inst = _.FindDef(inst->type_id());
+ if (type_inst->opcode() != spv::Op::OpTypeSampledImage) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Result Type to be OpTypeSampledImage.";
}
@@ -1022,8 +1027,25 @@
<< "Corrupt image type definition";
}
- // TODO(atgoo@github.com) Check compatibility of result type and received
- // image.
+ // Image operands must match except for depth.
+ auto sampled_image_id = type_inst->GetOperandAs<uint32_t>(1);
+ if (sampled_image_id != image_type) {
+ ImageTypeInfo sampled_info;
+ if (!GetImageTypeInfo(_, sampled_image_id, &sampled_info)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Corrupt image type definition";
+ }
+ if (info.sampled_type != sampled_info.sampled_type ||
+ info.dim != sampled_info.dim || info.arrayed != sampled_info.arrayed ||
+ info.multisampled != sampled_info.multisampled ||
+ info.sampled != sampled_info.sampled ||
+ info.format != sampled_info.format ||
+ info.access_qualifier != sampled_info.access_qualifier) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Image operands must match result image operands except for "
+ "depth";
+ }
+ }
if (spvIsVulkanEnv(_.context()->target_env)) {
if (info.sampled != 1) {
@@ -1115,28 +1137,33 @@
spv_result_t ValidateImageTexelPointer(ValidationState_t& _,
const Instruction* inst) {
const auto result_type = _.FindDef(inst->type_id());
- if (result_type->opcode() != spv::Op::OpTypePointer) {
+ if (result_type->opcode() != spv::Op::OpTypePointer &&
+ result_type->opcode() != spv::Op::OpTypeUntypedPointerKHR) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Result Type to be OpTypePointer";
+ << "Expected Result Type to be a pointer";
}
const auto storage_class = result_type->GetOperandAs<spv::StorageClass>(1);
if (storage_class != spv::StorageClass::Image) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Result Type to be OpTypePointer whose Storage Class "
+ << "Expected Result Type to be a pointer whose Storage Class "
"operand is Image";
}
- const auto ptr_type = result_type->GetOperandAs<uint32_t>(2);
- const auto ptr_opcode = _.GetIdOpcode(ptr_type);
- if (ptr_opcode != spv::Op::OpTypeInt && ptr_opcode != spv::Op::OpTypeFloat &&
- ptr_opcode != spv::Op::OpTypeVoid &&
- !(ptr_opcode == spv::Op::OpTypeVector &&
- _.HasCapability(spv::Capability::AtomicFloat16VectorNV) &&
- _.IsFloat16Vector2Or4Type(ptr_type))) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Result Type to be OpTypePointer whose Type operand "
- "must be a scalar numerical type or OpTypeVoid";
+ uint32_t ptr_type = 0;
+ if (result_type->opcode() == spv::Op::OpTypePointer) {
+ ptr_type = result_type->GetOperandAs<uint32_t>(2);
+ const auto ptr_opcode = _.GetIdOpcode(ptr_type);
+ if (ptr_opcode != spv::Op::OpTypeInt &&
+ ptr_opcode != spv::Op::OpTypeFloat &&
+ ptr_opcode != spv::Op::OpTypeVoid &&
+ !(ptr_opcode == spv::Op::OpTypeVector &&
+ _.HasCapability(spv::Capability::AtomicFloat16VectorNV) &&
+ _.IsFloat16Vector2Or4Type(ptr_type))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Result Type to be a pointer whose Type operand "
+ "must be a scalar numerical type or OpTypeVoid";
+ }
}
const auto image_ptr = _.FindDef(_.GetOperandTypeId(inst, 2));
@@ -1157,7 +1184,8 @@
<< "Corrupt image type definition";
}
- if (info.sampled_type != ptr_type &&
+ if (result_type->opcode() == spv::Op::OpTypePointer &&
+ info.sampled_type != ptr_type &&
!(_.HasCapability(spv::Capability::AtomicFloat16VectorNV) &&
_.IsFloat16Vector2Or4Type(ptr_type) &&
_.GetIdOpcode(info.sampled_type) == spv::Op::OpTypeFloat &&
@@ -2002,11 +2030,13 @@
->RegisterExecutionModelLimitation(
[&](spv::ExecutionModel model, std::string* message) {
if (model != spv::ExecutionModel::Fragment &&
- model != spv::ExecutionModel::GLCompute) {
+ model != spv::ExecutionModel::GLCompute &&
+ model != spv::ExecutionModel::MeshEXT &&
+ model != spv::ExecutionModel::TaskEXT) {
if (message) {
*message = std::string(
- "OpImageQueryLod requires Fragment or GLCompute execution "
- "model");
+ "OpImageQueryLod requires Fragment, GLCompute, MeshEXT or "
+ "TaskEXT execution model");
}
return false;
}
@@ -2018,16 +2048,20 @@
std::string* message) {
const auto* models = state.GetExecutionModels(entry_point->id());
const auto* modes = state.GetExecutionModes(entry_point->id());
- if (models->find(spv::ExecutionModel::GLCompute) != models->end() &&
- modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) ==
- modes->end() &&
- modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) ==
- modes->end()) {
+ if (models &&
+ (models->find(spv::ExecutionModel::GLCompute) != models->end() ||
+ models->find(spv::ExecutionModel::MeshEXT) != models->end() ||
+ models->find(spv::ExecutionModel::TaskEXT) != models->end()) &&
+ (!modes ||
+ (modes->find(spv::ExecutionMode::DerivativeGroupLinearKHR) ==
+ modes->end() &&
+ modes->find(spv::ExecutionMode::DerivativeGroupQuadsKHR) ==
+ modes->end()))) {
if (message) {
*message = std::string(
- "OpImageQueryLod requires DerivativeGroupQuadsNV "
- "or DerivativeGroupLinearNV execution mode for GLCompute "
- "execution model");
+ "OpImageQueryLod requires DerivativeGroupQuadsKHR "
+ "or DerivativeGroupLinearKHR execution mode for GLCompute, "
+ "MeshEXT or TaskEXT execution model");
}
return false;
}
@@ -2296,12 +2330,14 @@
->RegisterExecutionModelLimitation([opcode](spv::ExecutionModel model,
std::string* message) {
if (model != spv::ExecutionModel::Fragment &&
- model != spv::ExecutionModel::GLCompute) {
+ model != spv::ExecutionModel::GLCompute &&
+ model != spv::ExecutionModel::MeshEXT &&
+ model != spv::ExecutionModel::TaskEXT) {
if (message) {
*message =
std::string(
- "ImplicitLod instructions require Fragment or GLCompute "
- "execution model: ") +
+ "ImplicitLod instructions require Fragment, GLCompute, "
+ "MeshEXT or TaskEXT execution model: ") +
spvOpcodeString(opcode);
}
return false;
@@ -2315,19 +2351,22 @@
const auto* models = state.GetExecutionModels(entry_point->id());
const auto* modes = state.GetExecutionModes(entry_point->id());
if (models &&
- models->find(spv::ExecutionModel::GLCompute) != models->end() &&
+ (models->find(spv::ExecutionModel::GLCompute) != models->end() ||
+ models->find(spv::ExecutionModel::MeshEXT) != models->end() ||
+ models->find(spv::ExecutionModel::TaskEXT) != models->end()) &&
(!modes ||
- (modes->find(spv::ExecutionMode::DerivativeGroupLinearNV) ==
+ (modes->find(spv::ExecutionMode::DerivativeGroupLinearKHR) ==
modes->end() &&
- modes->find(spv::ExecutionMode::DerivativeGroupQuadsNV) ==
+ modes->find(spv::ExecutionMode::DerivativeGroupQuadsKHR) ==
modes->end()))) {
if (message) {
- *message =
- std::string(
- "ImplicitLod instructions require DerivativeGroupQuadsNV "
- "or DerivativeGroupLinearNV execution mode for GLCompute "
- "execution model: ") +
- spvOpcodeString(opcode);
+ *message = std::string(
+ "ImplicitLod instructions require "
+ "DerivativeGroupQuadsKHR "
+ "or DerivativeGroupLinearKHR execution mode for "
+ "GLCompute, "
+ "MeshEXT or TaskEXT execution model: ") +
+ spvOpcodeString(opcode);
}
return false;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_instruction.cpp b/third_party/SPIRV-Tools/source/val/validate_instruction.cpp
index 5bc4d2c..655408d 100644
--- a/third_party/SPIRV-Tools/source/val/validate_instruction.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_instruction.cpp
@@ -20,13 +20,13 @@
#include <vector>
#include "source/enum_set.h"
-#include "source/enum_string_mapping.h"
#include "source/extensions.h"
#include "source/opcode.h"
#include "source/operand.h"
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/spirv_validator_options.h"
+#include "source/table2.h"
#include "source/util/string_utils.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
@@ -35,14 +35,13 @@
namespace val {
namespace {
-std::string ToString(const CapabilitySet& capabilities,
- const AssemblyGrammar& grammar) {
+std::string ToString(const CapabilitySet& capabilities) {
std::stringstream ss;
for (auto capability : capabilities) {
- spv_operand_desc desc;
- if (SPV_SUCCESS == grammar.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
- uint32_t(capability), &desc))
- ss << desc->name << " ";
+ const spvtools::OperandDesc* desc = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
+ uint32_t(capability), &desc))
+ ss << desc->name().data() << " ";
else
ss << uint32_t(capability) << " ";
}
@@ -72,10 +71,11 @@
break;
}
// Look it up in the grammar
- spv_opcode_desc opcode_desc = {};
- if (SPV_SUCCESS == state.grammar().lookupOpcode(opcode, &opcode_desc)) {
+ const spvtools::InstructionDesc* opcode_desc = nullptr;
+ if (SPV_SUCCESS ==
+ LookupOpcodeForEnv(state.context()->target_env, opcode, &opcode_desc)) {
return state.grammar().filterCapsAgainstTargetEnv(
- opcode_desc->capabilities, opcode_desc->numCapabilities);
+ opcode_desc->capabilities());
}
return CapabilitySet();
}
@@ -86,7 +86,7 @@
// return an error code.
spv_result_t OperandVersionExtensionCheck(
ValidationState_t& _, const Instruction* inst, size_t which_operand,
- const spv_operand_desc_t& operand_desc, uint32_t word) {
+ const spvtools::OperandDesc& operand_desc, uint32_t word) {
const uint32_t module_version = _.version();
const uint32_t operand_min_version = operand_desc.minVersion;
const uint32_t operand_last_version = operand_desc.lastVersion;
@@ -103,27 +103,29 @@
return _.diag(SPV_ERROR_WRONG_VERSION, inst)
<< spvtools::utils::CardinalToOrdinal(which_operand)
<< " operand of " << spvOpcodeString(inst->opcode()) << ": operand "
- << operand_desc.name << "(" << word << ") requires SPIR-V version "
+ << operand_desc.name().data() << "(" << word
+ << ") requires SPIR-V version "
<< SPV_SPIRV_VERSION_MAJOR_PART(operand_last_version) << "."
<< SPV_SPIRV_VERSION_MINOR_PART(operand_last_version)
<< " or earlier";
}
- if (!reserved && operand_desc.numExtensions == 0) {
+ if (!reserved && operand_desc.extensions_range.empty()) {
return _.diag(SPV_ERROR_WRONG_VERSION, inst)
<< spvtools::utils::CardinalToOrdinal(which_operand)
<< " operand of " << spvOpcodeString(inst->opcode()) << ": operand "
- << operand_desc.name << "(" << word << ") requires SPIR-V version "
+ << operand_desc.name().data() << "(" << word
+ << ") requires SPIR-V version "
<< SPV_SPIRV_VERSION_MAJOR_PART(operand_min_version) << "."
<< SPV_SPIRV_VERSION_MINOR_PART(operand_min_version) << " or later";
} else {
- ExtensionSet required_extensions(operand_desc.numExtensions,
- operand_desc.extensions);
+ ExtensionSet required_extensions(operand_desc.extensions_range.count(),
+ operand_desc.extensions().data());
if (!_.HasAnyOfExtensions(required_extensions)) {
return _.diag(SPV_ERROR_MISSING_EXTENSION, inst)
<< spvtools::utils::CardinalToOrdinal(which_operand)
<< " operand of " << spvOpcodeString(inst->opcode())
- << ": operand " << operand_desc.name << "(" << word
+ << ": operand " << operand_desc.name().data() << "(" << word
<< ") requires one of these extensions: "
<< ExtensionSetToString(required_extensions);
}
@@ -166,9 +168,9 @@
}
CapabilitySet enabling_capabilities;
- spv_operand_desc operand_desc = nullptr;
+ const spvtools::OperandDesc* operand_desc = nullptr;
const auto lookup_result =
- state.grammar().lookupOperand(operand.type, word, &operand_desc);
+ spvtools::LookupOperand(operand.type, word, &operand_desc);
if (lookup_result == SPV_SUCCESS) {
// Allow FPRoundingMode decoration if requested.
if (operand.type == SPV_OPERAND_TYPE_DECORATION &&
@@ -186,7 +188,7 @@
}
} else {
enabling_capabilities = state.grammar().filterCapsAgainstTargetEnv(
- operand_desc->capabilities, operand_desc->numCapabilities);
+ operand_desc->capabilities());
}
// When encountering an OpCapability instruction, the instruction pass
@@ -201,7 +203,7 @@
<< "Operand " << which_operand << " of "
<< spvOpcodeString(inst->opcode())
<< " requires one of these capabilities: "
- << ToString(enabling_capabilities, state.grammar());
+ << ToString(enabling_capabilities);
}
}
return OperandVersionExtensionCheck(state, inst, which_operand,
@@ -222,10 +224,10 @@
case spv::Op::OpImageSparseSampleProjExplicitLod:
case spv::Op::OpImageSparseSampleProjDrefImplicitLod:
case spv::Op::OpImageSparseSampleProjDrefExplicitLod: {
- spv_opcode_desc inst_desc;
- _.grammar().lookupOpcode(opcode, &inst_desc);
+ const spvtools::InstructionDesc* inst_desc = nullptr;
+ spvtools::LookupOpcode(opcode, &inst_desc);
return _.diag(SPV_ERROR_INVALID_BINARY, inst)
- << "Invalid Opcode name 'Op" << inst_desc->name << "'";
+ << "Invalid Opcode name 'Op" << inst_desc->name().data() << "'";
}
default:
break;
@@ -242,8 +244,7 @@
if (!_.HasAnyOfCapabilities(opcode_caps)) {
return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst)
<< "Opcode " << spvOpcodeString(opcode)
- << " requires one of these capabilities: "
- << ToString(opcode_caps, _.grammar());
+ << " requires one of these capabilities: " << ToString(opcode_caps);
}
for (size_t i = 0; i < inst->operands().size(); ++i) {
const auto& operand = inst->operand(i);
@@ -276,8 +277,8 @@
// dependencies for the opcode.
spv_result_t VersionCheck(ValidationState_t& _, const Instruction* inst) {
const auto opcode = inst->opcode();
- spv_opcode_desc inst_desc;
- const spv_result_t r = _.grammar().lookupOpcode(opcode, &inst_desc);
+ const spvtools::InstructionDesc* inst_desc = nullptr;
+ const spv_result_t r = spvtools::LookupOpcode(opcode, &inst_desc);
assert(r == SPV_SUCCESS);
(void)r;
@@ -297,13 +298,14 @@
const bool capability_check_is_sufficient =
inst->opcode() != spv::Op::OpTerminateInvocation;
- if (capability_check_is_sufficient && (inst_desc->numCapabilities > 0u)) {
+ if (capability_check_is_sufficient && !inst_desc->capabilities().empty()) {
// We already checked that the direct capability dependency has been
// satisfied. We don't need to check any further.
return SPV_SUCCESS;
}
- ExtensionSet exts(inst_desc->numExtensions, inst_desc->extensions);
+ ExtensionSet exts(inst_desc->extensions().begin(),
+ inst_desc->extensions().end());
if (exts.empty()) {
// If no extensions can enable this instruction, then emit error
// messages only concerning core SPIR-V versions if errors happen.
@@ -475,6 +477,16 @@
const uint32_t entry_point = inst->word(1);
_.RegisterExecutionModeForEntryPoint(entry_point,
spv::ExecutionMode(inst->word(2)));
+ if (inst->GetOperandAs<spv::ExecutionMode>(1) ==
+ spv::ExecutionMode::LocalSize ||
+ inst->GetOperandAs<spv::ExecutionMode>(1) ==
+ spv::ExecutionMode::LocalSizeId) {
+ _.RegisterEntryPointLocalSize(entry_point, inst);
+ }
+ if (inst->GetOperandAs<spv::ExecutionMode>(1) ==
+ spv::ExecutionMode::OutputPrimitivesEXT) {
+ _.RegisterEntryPointOutputPrimitivesEXT(entry_point, inst);
+ }
} else if (opcode == spv::Op::OpVariable) {
const auto storage_class = inst->GetOperandAs<spv::StorageClass>(2);
if (auto error = LimitCheckNumVars(_, inst->id(), storage_class)) {
diff --git a/third_party/SPIRV-Tools/source/val/validate_interfaces.cpp b/third_party/SPIRV-Tools/source/val/validate_interfaces.cpp
index ace548a..b80c7d8 100644
--- a/third_party/SPIRV-Tools/source/val/validate_interfaces.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_interfaces.cpp
@@ -34,11 +34,13 @@
bool is_interface_variable(const Instruction* inst, bool is_spv_1_4) {
if (is_spv_1_4) {
// Starting in SPIR-V 1.4, all global variables are interface variables.
- return inst->opcode() == spv::Op::OpVariable &&
+ return (inst->opcode() == spv::Op::OpVariable ||
+ inst->opcode() == spv::Op::OpUntypedVariableKHR) &&
inst->GetOperandAs<spv::StorageClass>(2u) !=
spv::StorageClass::Function;
} else {
- return inst->opcode() == spv::Op::OpVariable &&
+ return (inst->opcode() == spv::Op::OpVariable ||
+ inst->opcode() == spv::Op::OpUntypedVariableKHR) &&
(inst->GetOperandAs<spv::StorageClass>(2u) ==
spv::StorageClass::Input ||
inst->GetOperandAs<spv::StorageClass>(2u) ==
@@ -46,6 +48,29 @@
}
}
+// Special validation for varibles that are between shader stages
+spv_result_t ValidateInputOutputInterfaceVariables(ValidationState_t& _,
+ const Instruction* var) {
+ auto var_pointer = _.FindDef(var->GetOperandAs<uint32_t>(0));
+ uint32_t pointer_id = var_pointer->GetOperandAs<uint32_t>(2);
+
+ const auto isPhysicalStorageBuffer = [](const Instruction* insn) {
+ return insn->opcode() == spv::Op::OpTypePointer &&
+ insn->GetOperandAs<spv::StorageClass>(1) ==
+ spv::StorageClass::PhysicalStorageBuffer;
+ };
+
+ if (_.ContainsType(pointer_id, isPhysicalStorageBuffer)) {
+ return _.diag(SPV_ERROR_INVALID_ID, var)
+ << _.VkErrorID(9557) << "Input/Output interface variable id <"
+ << var->id()
+ << "> contains a PhysicalStorageBuffer pointer, which is not "
+ "allowed. If you want to interface shader stages with a "
+ "PhysicalStorageBuffer, cast to a uint64 or uvec2 instead.";
+ }
+ return SPV_SUCCESS;
+}
+
// Checks that \c var is listed as an interface in all the entry points that use
// it.
spv_result_t check_interface_variable(ValidationState_t& _,
@@ -105,6 +130,14 @@
}
}
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ if (var->GetOperandAs<spv::StorageClass>(2) == spv::StorageClass::Input ||
+ var->GetOperandAs<spv::StorageClass>(2) == spv::StorageClass::Output) {
+ if (auto error = ValidateInputOutputInterfaceVariables(_, var))
+ return error;
+ }
+ }
+
return SPV_SUCCESS;
}
@@ -242,8 +275,9 @@
std::unordered_set<uint32_t>* output_index1_locations) {
const bool is_fragment = entry_point->GetOperandAs<spv::ExecutionModel>(0) ==
spv::ExecutionModel::Fragment;
- const bool is_output =
- variable->GetOperandAs<spv::StorageClass>(2) == spv::StorageClass::Output;
+ const auto sc_index = 2u;
+ const bool is_output = variable->GetOperandAs<spv::StorageClass>(sc_index) ==
+ spv::StorageClass::Output;
auto ptr_type_id = variable->GetOperandAs<uint32_t>(0);
auto ptr_type = _.FindDef(ptr_type_id);
auto type_id = ptr_type->GetOperandAs<uint32_t>(2);
@@ -519,11 +553,15 @@
std::unordered_set<uint32_t> input_locations;
std::unordered_set<uint32_t> output_locations_index0;
std::unordered_set<uint32_t> output_locations_index1;
+ std::unordered_set<uint32_t> patch_locations_index0;
+ std::unordered_set<uint32_t> patch_locations_index1;
std::unordered_set<uint32_t> seen;
for (uint32_t i = 3; i < entry_point->operands().size(); ++i) {
auto interface_id = entry_point->GetOperandAs<uint32_t>(i);
auto interface_var = _.FindDef(interface_id);
- auto storage_class = interface_var->GetOperandAs<spv::StorageClass>(2);
+ const auto sc_index = 2u;
+ auto storage_class =
+ interface_var->GetOperandAs<spv::StorageClass>(sc_index);
if (storage_class != spv::StorageClass::Input &&
storage_class != spv::StorageClass::Output) {
continue;
@@ -534,6 +572,26 @@
continue;
}
+ // The two Tessellation stages have a "Patch" variable that interface with
+ // the Location mechanism, but are not suppose to be tied to the "normal"
+ // input/output Location.
+ // TODO - SPIR-V allows the Patch decoration to be applied to struct
+ // members, but is not allowed in GLSL/HLSL
+ bool has_patch = false;
+ for (auto& dec : _.id_decorations(interface_var->id())) {
+ if (dec.dec_type() == spv::Decoration::Patch) {
+ has_patch = true;
+ if (auto error = GetLocationsForVariable(_, entry_point, interface_var,
+ &patch_locations_index0,
+ &patch_locations_index1))
+ return error;
+ break;
+ }
+ }
+ if (has_patch) {
+ continue;
+ }
+
auto locations = (storage_class == spv::StorageClass::Input)
? &input_locations
: &output_locations_index0;
@@ -596,6 +654,47 @@
has_callable_data = true;
break;
}
+ case spv::StorageClass::Input:
+ case spv::StorageClass::Output: {
+ auto result_type = _.FindDef(interface_var->type_id());
+ if (_.ContainsType(result_type->GetOperandAs<uint32_t>(2),
+ [](const Instruction* inst) {
+ if (inst &&
+ inst->opcode() == spv::Op::OpTypeFloat) {
+ if (inst->words().size() > 3) {
+ if (inst->GetOperandAs<spv::FPEncoding>(2) ==
+ spv::FPEncoding::BFloat16KHR) {
+ return true;
+ }
+ }
+ }
+ return false;
+ })) {
+ return _.diag(SPV_ERROR_INVALID_ID, interface_var)
+ << _.VkErrorID(10370) << "Bfloat16 OpVariable <id> "
+ << _.getIdName(interface_var->id()) << " must not be declared "
+ << "with a Storage Class of Input or Output.";
+ }
+ if (_.ContainsType(
+ result_type->GetOperandAs<uint32_t>(2),
+ [](const Instruction* inst) {
+ if (inst && inst->opcode() == spv::Op::OpTypeFloat) {
+ if (inst->words().size() > 3) {
+ auto encoding = inst->GetOperandAs<spv::FPEncoding>(2);
+ if ((encoding == spv::FPEncoding::Float8E4M3EXT) ||
+ (encoding == spv::FPEncoding::Float8E5M2EXT)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ })) {
+ return _.diag(SPV_ERROR_INVALID_ID, interface_var)
+ << "FP8 E4M3/E5M2 OpVariable <id> " // TODO VUID
+ << _.getIdName(interface_var->id()) << " must not be declared "
+ << "with a Storage Class of Input or Output.";
+ }
+ }
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_invalid_type.cpp b/third_party/SPIRV-Tools/source/val/validate_invalid_type.cpp
new file mode 100644
index 0000000..6afc0f8
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/val/validate_invalid_type.cpp
@@ -0,0 +1,162 @@
+// Copyright (c) 2025 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Performs validation of invalid type instructions.
+
+#include <vector>
+
+#include "source/opcode.h"
+#include "source/val/instruction.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
+
+namespace spvtools {
+namespace val {
+
+// Validates correctness of certain special type instructions.
+spv_result_t InvalidTypePass(ValidationState_t& _, const Instruction* inst) {
+ const spv::Op opcode = inst->opcode();
+
+ switch (opcode) {
+ // OpExtInst
+ case spv::Op::OpExtInst:
+ // Arithmetic Instructions
+ case spv::Op::OpFAdd:
+ case spv::Op::OpFSub:
+ case spv::Op::OpFMul:
+ case spv::Op::OpFDiv:
+ case spv::Op::OpFRem:
+ case spv::Op::OpFMod:
+ case spv::Op::OpFNegate:
+ // Derivative Instructions
+ case spv::Op::OpDPdx:
+ case spv::Op::OpDPdy:
+ case spv::Op::OpFwidth:
+ case spv::Op::OpDPdxFine:
+ case spv::Op::OpDPdyFine:
+ case spv::Op::OpFwidthFine:
+ case spv::Op::OpDPdxCoarse:
+ case spv::Op::OpDPdyCoarse:
+ case spv::Op::OpFwidthCoarse:
+ // Atomic Instructions
+ case spv::Op::OpAtomicFAddEXT:
+ case spv::Op::OpAtomicFMinEXT:
+ case spv::Op::OpAtomicFMaxEXT:
+ case spv::Op::OpAtomicLoad:
+ case spv::Op::OpAtomicExchange:
+ // Group and Subgroup Instructions
+ case spv::Op::OpGroupNonUniformRotateKHR:
+ case spv::Op::OpGroupNonUniformBroadcast:
+ case spv::Op::OpGroupNonUniformShuffle:
+ case spv::Op::OpGroupNonUniformShuffleXor:
+ case spv::Op::OpGroupNonUniformShuffleUp:
+ case spv::Op::OpGroupNonUniformShuffleDown:
+ case spv::Op::OpGroupNonUniformQuadBroadcast:
+ case spv::Op::OpGroupNonUniformQuadSwap:
+ case spv::Op::OpGroupNonUniformBroadcastFirst:
+ case spv::Op::OpGroupNonUniformFAdd:
+ case spv::Op::OpGroupNonUniformFMul:
+ case spv::Op::OpGroupNonUniformFMin: {
+ const uint32_t result_type = inst->type_id();
+ if (_.IsBfloat16Type(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode) << " doesn't support BFloat16 type.";
+ }
+ if (_.IsFP8Type(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode)
+ << " doesn't support FP8 E4M3/E5M2 types.";
+ }
+ break;
+ }
+
+ case spv::Op::OpAtomicStore: {
+ uint32_t data_type =
+ _.FindDef(inst->GetOperandAs<uint32_t>(3))->type_id();
+ if (_.IsBfloat16VectorType(data_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode) << " doesn't support BFloat16 type.";
+ }
+ if (_.IsFP8VectorType(data_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode)
+ << " doesn't support FP8 E4M3/E5M2 types.";
+ }
+ break;
+ }
+ // Relational and Logical Instructions
+ case spv::Op::OpIsNan:
+ case spv::Op::OpIsInf:
+ case spv::Op::OpIsFinite:
+ case spv::Op::OpIsNormal:
+ case spv::Op::OpSignBitSet: {
+ const uint32_t operand_type = _.GetOperandTypeId(inst, 2);
+ if (_.IsBfloat16Type(operand_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode) << " doesn't support BFloat16 type.";
+ }
+ if (_.IsFP8Type(operand_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode)
+ << " doesn't support FP8 E4M3/E5M2 types.";
+ }
+ break;
+ }
+
+ case spv::Op::OpGroupNonUniformAllEqual: {
+ const auto value_type = _.GetOperandTypeId(inst, 3);
+ if (_.IsBfloat16Type(value_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode) << " doesn't support BFloat16 type.";
+ }
+ if (_.IsFP8Type(value_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode)
+ << " doesn't support FP8 E4M3/E5M2 types.";
+ }
+
+ break;
+ }
+
+ case spv::Op::OpMatrixTimesMatrix: {
+ const uint32_t result_type = inst->type_id();
+ uint32_t res_num_rows = 0;
+ uint32_t res_num_cols = 0;
+ uint32_t res_col_type = 0;
+ uint32_t res_component_type = 0;
+ if (_.GetMatrixTypeInfo(result_type, &res_num_rows, &res_num_cols,
+ &res_col_type, &res_component_type)) {
+ if (_.IsBfloat16Type(res_component_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode)
+ << " doesn't support BFloat16 type.";
+ }
+ if (_.IsFP8Type(res_component_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << spvOpcodeString(opcode)
+ << " doesn't support FP8 E4M3/E5M2 types.";
+ }
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/val/validate_layout.cpp b/third_party/SPIRV-Tools/source/val/validate_layout.cpp
index dbc1f1e..baf36b8 100644
--- a/third_party/SPIRV-Tools/source/val/validate_layout.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_layout.cpp
@@ -35,6 +35,7 @@
const Instruction* inst, spv::Op opcode) {
switch (opcode) {
case spv::Op::OpExtInst:
+ case spv::Op::OpExtInstWithForwardRefsKHR:
if (spvExtInstIsDebugInfo(inst->ext_inst_type())) {
const uint32_t ext_inst_index = inst->word(4);
bool local_debug_info = false;
@@ -74,8 +75,8 @@
if (local_debug_info) {
if (_.in_function_body() == false) {
- // DebugScope, DebugNoScope, DebugDeclare, DebugValue must
- // appear in a function body.
+ // TODO - Print the actual name of the instruction as this list is
+ // not complete (see ext_inst_name in ValidateExtInst() for example)
return _.diag(SPV_ERROR_INVALID_LAYOUT, inst)
<< "DebugScope, DebugNoScope, DebugDeclare, DebugValue "
<< "of debug info extension must appear in a function "
@@ -243,6 +244,7 @@
break;
case spv::Op::OpExtInst:
+ case spv::Op::OpExtInstWithForwardRefsKHR:
if (spvExtInstIsDebugInfo(inst->ext_inst_type())) {
const uint32_t ext_inst_index = inst->word(4);
bool local_debug_info = false;
diff --git a/third_party/SPIRV-Tools/source/val/validate_logicals.cpp b/third_party/SPIRV-Tools/source/val/validate_logicals.cpp
index 4479e43..8a2e5d8 100644
--- a/third_party/SPIRV-Tools/source/val/validate_logicals.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_logicals.cpp
@@ -159,9 +159,11 @@
const spv::Op type_opcode = type_inst->opcode();
switch (type_opcode) {
+ case spv::Op::OpTypeUntypedPointerKHR:
case spv::Op::OpTypePointer: {
if (_.addressing_model() == spv::AddressingModel::Logical &&
- !_.features().variable_pointers)
+ !_.HasCapability(
+ spv::Capability::VariablePointersStorageBuffer))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Using pointers with OpSelect requires capability "
<< "VariablePointers or VariablePointersStorageBuffer";
diff --git a/third_party/SPIRV-Tools/source/val/validate_memory.cpp b/third_party/SPIRV-Tools/source/val/validate_memory.cpp
index 2d6715f..6b6a2d8 100644
--- a/third_party/SPIRV-Tools/source/val/validate_memory.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_memory.cpp
@@ -1,6 +1,6 @@
// Copyright (c) 2018 Google LLC.
-// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights
-// reserved.
+// Modifications Copyright (C) 2020-2024 Advanced Micro Devices, Inc. All
+// rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -196,44 +196,15 @@
return false;
}
-bool ContainsCooperativeMatrix(ValidationState_t& _,
- const Instruction* storage) {
- const size_t elem_type_index = 1;
- uint32_t elem_type_id;
- Instruction* elem_type;
-
- switch (storage->opcode()) {
- case spv::Op::OpTypeCooperativeMatrixNV:
- case spv::Op::OpTypeCooperativeMatrixKHR:
- return true;
- case spv::Op::OpTypeArray:
- case spv::Op::OpTypeRuntimeArray:
- elem_type_id = storage->GetOperandAs<uint32_t>(elem_type_index);
- elem_type = _.FindDef(elem_type_id);
- return ContainsCooperativeMatrix(_, elem_type);
- case spv::Op::OpTypeStruct:
- for (size_t member_type_index = 1;
- member_type_index < storage->operands().size();
- ++member_type_index) {
- auto member_type_id =
- storage->GetOperandAs<uint32_t>(member_type_index);
- auto member_type = _.FindDef(member_type_id);
- if (ContainsCooperativeMatrix(_, member_type)) return true;
- }
- break;
- default:
- break;
- }
- return false;
-}
-
std::pair<spv::StorageClass, spv::StorageClass> GetStorageClass(
ValidationState_t& _, const Instruction* inst) {
spv::StorageClass dst_sc = spv::StorageClass::Max;
spv::StorageClass src_sc = spv::StorageClass::Max;
switch (inst->opcode()) {
case spv::Op::OpCooperativeMatrixLoadNV:
+ case spv::Op::OpCooperativeMatrixLoadTensorNV:
case spv::Op::OpCooperativeMatrixLoadKHR:
+ case spv::Op::OpCooperativeVectorLoadNV:
case spv::Op::OpLoad: {
auto load_pointer = _.FindDef(inst->GetOperandAs<uint32_t>(2));
auto load_pointer_type = _.FindDef(load_pointer->type_id());
@@ -241,7 +212,9 @@
break;
}
case spv::Op::OpCooperativeMatrixStoreNV:
+ case spv::Op::OpCooperativeMatrixStoreTensorNV:
case spv::Op::OpCooperativeMatrixStoreKHR:
+ case spv::Op::OpCooperativeVectorStoreNV:
case spv::Op::OpStore: {
auto store_pointer = _.FindDef(inst->GetOperandAs<uint32_t>(0));
auto store_pointer_type = _.FindDef(store_pointer->type_id());
@@ -278,8 +251,9 @@
// Returns the scope ID operand for MakeAvailable memory access with mask
// at the given operand index.
// This function is only called for OpLoad, OpStore, OpCopyMemory and
-// OpCopyMemorySized, OpCooperativeMatrixLoadNV, and
-// OpCooperativeMatrixStoreNV.
+// OpCopyMemorySized, OpCooperativeMatrixLoadNV,
+// OpCooperativeMatrixStoreNV, OpCooperativeVectorLoadNV,
+// OpCooperativeVectorStoreNV.
uint32_t GetMakeAvailableScope(const Instruction* inst, uint32_t mask,
uint32_t mask_index) {
assert(mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR));
@@ -290,8 +264,9 @@
}
// This function is only called for OpLoad, OpStore, OpCopyMemory,
-// OpCopyMemorySized, OpCooperativeMatrixLoadNV, and
-// OpCooperativeMatrixStoreNV.
+// OpCopyMemorySized, OpCooperativeMatrixLoadNV,
+// OpCooperativeMatrixStoreNV, OpCooperativeVectorLoadNV,
+// OpCooperativeVectorStoreNV.
uint32_t GetMakeVisibleScope(const Instruction* inst, uint32_t mask,
uint32_t mask_index) {
assert(mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR));
@@ -330,7 +305,9 @@
if (mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR)) {
if (inst->opcode() == spv::Op::OpLoad ||
inst->opcode() == spv::Op::OpCooperativeMatrixLoadNV ||
- inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) {
+ inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV ||
+ inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR ||
+ inst->opcode() == spv::Op::OpCooperativeVectorLoadNV) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "MakePointerAvailableKHR cannot be used with OpLoad.";
}
@@ -349,7 +326,10 @@
if (mask & uint32_t(spv::MemoryAccessMask::MakePointerVisibleKHR)) {
if (inst->opcode() == spv::Op::OpStore ||
- inst->opcode() == spv::Op::OpCooperativeMatrixStoreNV) {
+ inst->opcode() == spv::Op::OpCooperativeMatrixStoreNV ||
+ inst->opcode() == spv::Op::OpCooperativeMatrixStoreKHR ||
+ inst->opcode() == spv::Op::OpCooperativeMatrixStoreTensorNV ||
+ inst->opcode() == spv::Op::OpCooperativeVectorStoreNV) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "MakePointerVisibleKHR cannot be used with OpStore.";
}
@@ -400,48 +380,96 @@
<< _.VkErrorID(4708)
<< "Memory accesses with PhysicalStorageBuffer must use Aligned.";
}
+ } else {
+ // even if there are other masks, the Aligned operand will be next
+ const uint32_t aligned_value = inst->GetOperandAs<uint32_t>(index + 1);
+ const bool is_power_of_two =
+ aligned_value && !(aligned_value & (aligned_value - 1));
+ if (!is_power_of_two) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Memory accesses Aligned operand value " << aligned_value
+ << " is not a power of two.";
+ }
}
return SPV_SUCCESS;
}
spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
+ const bool untyped_pointer = inst->opcode() == spv::Op::OpUntypedVariableKHR;
+
auto result_type = _.FindDef(inst->type_id());
- if (!result_type || result_type->opcode() != spv::Op::OpTypePointer) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable Result Type <id> " << _.getIdName(inst->type_id())
- << " is not a pointer type.";
+ if (untyped_pointer) {
+ if (!result_type ||
+ result_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Result type must be an untyped pointer";
+ } else {
+ if (!result_type || result_type->opcode() != spv::Op::OpTypePointer) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpVariable Result Type <id> " << _.getIdName(inst->type_id())
+ << " is not a pointer type.";
+ }
}
- const auto type_index = 2;
- const auto value_id = result_type->GetOperandAs<uint32_t>(type_index);
- auto value_type = _.FindDef(value_id);
+ const auto storage_class_index = 2u;
+ auto storage_class =
+ inst->GetOperandAs<spv::StorageClass>(storage_class_index);
+ uint32_t value_id = 0;
+ if (untyped_pointer) {
+ const auto has_data_type = 3u < inst->operands().size();
+ if (has_data_type) {
+ value_id = inst->GetOperandAs<uint32_t>(3u);
+ auto data_type = _.FindDef(value_id);
+ if (!data_type || !spvOpcodeGeneratesType(data_type->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Data type must be a type instruction";
+ }
+ } else {
+ if (storage_class == spv::StorageClass::Function ||
+ storage_class == spv::StorageClass::Private ||
+ storage_class == spv::StorageClass::Workgroup) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Data type must be specified for Function, Private, and "
+ "Workgroup storage classes";
+ }
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Vulkan requires that data type be specified";
+ }
+ }
+ }
- const auto initializer_index = 3;
- const auto storage_class_index = 2;
+ // For OpVariable the data type comes from pointee type of the result type,
+ // while for OpUntypedVariableKHR the data type comes from the operand.
+ if (!untyped_pointer) {
+ value_id = result_type->GetOperandAs<uint32_t>(2);
+ }
+ auto value_type = value_id == 0 ? nullptr : _.FindDef(value_id);
+
+ const auto initializer_index = untyped_pointer ? 4u : 3u;
if (initializer_index < inst->operands().size()) {
const auto initializer_id = inst->GetOperandAs<uint32_t>(initializer_index);
const auto initializer = _.FindDef(initializer_id);
const auto is_module_scope_var =
- initializer && (initializer->opcode() == spv::Op::OpVariable) &&
+ initializer &&
+ (initializer->opcode() == spv::Op::OpVariable ||
+ initializer->opcode() == spv::Op::OpUntypedVariableKHR) &&
(initializer->GetOperandAs<spv::StorageClass>(storage_class_index) !=
spv::StorageClass::Function);
const auto is_constant =
initializer && spvOpcodeIsConstant(initializer->opcode());
if (!initializer || !(is_constant || is_module_scope_var)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable Initializer <id> " << _.getIdName(initializer_id)
+ << "Variable Initializer <id> " << _.getIdName(initializer_id)
<< " is not a constant or module-scope variable.";
}
if (initializer->type_id() != value_id) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Initializer type must match the type pointed to by the Result "
- "Type";
+ << "Initializer type must match the data type";
}
}
- auto storage_class =
- inst->GetOperandAs<spv::StorageClass>(storage_class_index);
if (storage_class != spv::StorageClass::Workgroup &&
storage_class != spv::StorageClass::CrossWorkgroup &&
storage_class != spv::StorageClass::Private &&
@@ -453,7 +481,8 @@
storage_class != spv::StorageClass::CallableDataKHR &&
storage_class != spv::StorageClass::IncomingCallableDataKHR &&
storage_class != spv::StorageClass::TaskPayloadWorkgroupEXT &&
- storage_class != spv::StorageClass::HitObjectAttributeNV) {
+ storage_class != spv::StorageClass::HitObjectAttributeNV &&
+ storage_class != spv::StorageClass::NodePayloadAMDX) {
bool storage_input_or_output = storage_class == spv::StorageClass::Input ||
storage_class == spv::StorageClass::Output;
bool builtin = false;
@@ -465,7 +494,7 @@
}
}
}
- if (!builtin &&
+ if (!builtin && value_type &&
ContainsInvalidBool(_, value_type, storage_input_or_output)) {
if (storage_input_or_output) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -481,7 +510,8 @@
"Classes: Workgroup, CrossWorkgroup, Private, Function, "
"Input, Output, RayPayloadKHR, IncomingRayPayloadKHR, "
"HitAttributeKHR, CallableDataKHR, "
- "IncomingCallableDataKHR, or UniformConstant";
+ "IncomingCallableDataKHR, NodePayloadAMDX, or "
+ "UniformConstant";
}
}
}
@@ -494,7 +524,7 @@
if (storage_class == spv::StorageClass::Generic) {
return _.diag(SPV_ERROR_INVALID_BINARY, inst)
- << "OpVariable storage class cannot be Generic";
+ << "Variable storage class cannot be Generic";
}
if (inst->function() && storage_class != spv::StorageClass::Function) {
@@ -516,17 +546,17 @@
result_type->GetOperandAs<spv::StorageClass>(result_storage_class_index);
if (storage_class != result_storage_class) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "From SPIR-V spec, section 3.32.8 on OpVariable:\n"
- << "Its Storage Class operand must be the same as the Storage Class "
- << "operand of the result type.";
+ << "Storage class must match result type storage class";
}
// Variable pointer related restrictions.
- const auto pointee = _.FindDef(result_type->word(3));
+ const auto pointee = untyped_pointer
+ ? value_id == 0 ? nullptr : _.FindDef(value_id)
+ : _.FindDef(result_type->word(3));
if (_.addressing_model() == spv::AddressingModel::Logical &&
!_.options()->relax_logical_pointer) {
// VariablePointersStorageBuffer is implied by VariablePointers.
- if (pointee->opcode() == spv::Op::OpTypePointer) {
+ if (pointee && pointee->opcode() == spv::Op::OpTypePointer) {
if (!_.HasCapability(spv::Capability::VariablePointersStorageBuffer)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "In Logical addressing, variables may not allocate a pointer "
@@ -545,7 +575,7 @@
// Vulkan Push Constant Interface section: Check type of PushConstant
// variables.
if (storage_class == spv::StorageClass::PushConstant) {
- if (pointee->opcode() != spv::Op::OpTypeStruct) {
+ if (pointee && pointee->opcode() != spv::Op::OpTypeStruct) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< _.VkErrorID(6808) << "PushConstant OpVariable <id> "
<< _.getIdName(inst->id()) << " has illegal type.\n"
@@ -557,11 +587,11 @@
// Vulkan Descriptor Set Interface: Check type of UniformConstant and
// Uniform variables.
if (storage_class == spv::StorageClass::UniformConstant) {
- if (!IsAllowedTypeOrArrayOfSame(
- _, pointee,
- {spv::Op::OpTypeImage, spv::Op::OpTypeSampler,
- spv::Op::OpTypeSampledImage,
- spv::Op::OpTypeAccelerationStructureKHR})) {
+ if (pointee && !IsAllowedTypeOrArrayOfSame(
+ _, pointee,
+ {spv::Op::OpTypeImage, spv::Op::OpTypeSampler,
+ spv::Op::OpTypeSampledImage, spv::Op::OpTypeTensorARM,
+ spv::Op::OpTypeAccelerationStructureKHR})) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< _.VkErrorID(4655) << "UniformConstant OpVariable <id> "
<< _.getIdName(inst->id()) << " has illegal type.\n"
@@ -574,7 +604,8 @@
}
if (storage_class == spv::StorageClass::Uniform) {
- if (!IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) {
+ if (pointee &&
+ !IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< _.VkErrorID(6807) << "Uniform OpVariable <id> "
<< _.getIdName(inst->id()) << " has illegal type.\n"
@@ -587,7 +618,8 @@
}
if (storage_class == spv::StorageClass::StorageBuffer) {
- if (!IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) {
+ if (pointee &&
+ !IsAllowedTypeOrArrayOfSame(_, pointee, {spv::Op::OpTypeStruct})) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< _.VkErrorID(6807) << "StorageBuffer OpVariable <id> "
<< _.getIdName(inst->id()) << " has illegal type.\n"
@@ -620,11 +652,17 @@
}
}
}
+ }
- // Initializers in Vulkan are only allowed in some storage clases
- if (inst->operands().size() > 3) {
+ // Vulkan Appendix A: Check that if contains initializer, then
+ // storage class is Output, Private, or Function.
+ if (inst->operands().size() > initializer_index &&
+ storage_class != spv::StorageClass::Output &&
+ storage_class != spv::StorageClass::Private &&
+ storage_class != spv::StorageClass::Function) {
+ if (spvIsVulkanEnv(_.context()->target_env)) {
if (storage_class == spv::StorageClass::Workgroup) {
- auto init_id = inst->GetOperandAs<uint32_t>(3);
+ auto init_id = inst->GetOperandAs<uint32_t>(initializer_index);
auto init = _.FindDef(init_id);
if (init->opcode() != spv::Op::OpConstantNull) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -651,7 +689,7 @@
}
}
- if (inst->operands().size() > 3) {
+ if (initializer_index < inst->operands().size()) {
if (storage_class == spv::StorageClass::TaskPayloadWorkgroupEXT) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpVariable, <id> " << _.getIdName(inst->id())
@@ -674,33 +712,6 @@
<< "PhysicalStorageBuffer must not be used with OpVariable.";
}
- auto pointee_base = pointee;
- while (pointee_base->opcode() == spv::Op::OpTypeArray) {
- pointee_base = _.FindDef(pointee_base->GetOperandAs<uint32_t>(1u));
- }
- if (pointee_base->opcode() == spv::Op::OpTypePointer) {
- if (pointee_base->GetOperandAs<spv::StorageClass>(1u) ==
- spv::StorageClass::PhysicalStorageBuffer) {
- // check for AliasedPointer/RestrictPointer
- bool foundAliased =
- _.HasDecoration(inst->id(), spv::Decoration::AliasedPointer);
- bool foundRestrict =
- _.HasDecoration(inst->id(), spv::Decoration::RestrictPointer);
- if (!foundAliased && !foundRestrict) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable " << inst->id()
- << ": expected AliasedPointer or RestrictPointer for "
- << "PhysicalStorageBuffer pointer.";
- }
- if (foundAliased && foundRestrict) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable " << inst->id()
- << ": can't specify both AliasedPointer and "
- << "RestrictPointer for PhysicalStorageBuffer pointer.";
- }
- }
- }
-
// Vulkan specific validation rules for OpTypeRuntimeArray
if (spvIsVulkanEnv(_.context()->target_env)) {
// OpTypeRuntimeArray should only ever be in a container like OpTypeStruct,
@@ -768,7 +779,12 @@
// Cooperative matrix types can only be allocated in Function or Private
if ((storage_class != spv::StorageClass::Function &&
storage_class != spv::StorageClass::Private) &&
- ContainsCooperativeMatrix(_, pointee)) {
+ pointee &&
+ _.ContainsType(pointee->id(), [](const Instruction* type_inst) {
+ auto opcode = type_inst->opcode();
+ return opcode == spv::Op::OpTypeCooperativeMatrixNV ||
+ opcode == spv::Op::OpTypeCooperativeMatrixKHR;
+ })) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Cooperative matrix types (or types containing them) can only be "
"allocated "
@@ -776,6 +792,20 @@
"parameters";
}
+ if ((storage_class != spv::StorageClass::Function &&
+ storage_class != spv::StorageClass::Private) &&
+ pointee &&
+ _.ContainsType(pointee->id(), [](const Instruction* type_inst) {
+ auto opcode = type_inst->opcode();
+ return opcode == spv::Op::OpTypeCooperativeVectorNV;
+ })) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Cooperative vector types (or types containing them) can only be "
+ "allocated "
+ << "in Function or Private storage classes or as function "
+ "parameters";
+ }
+
if (_.HasCapability(spv::Capability::Shader)) {
// Don't allow variables containing 16-bit elements without the appropriate
// capabilities.
@@ -784,7 +814,8 @@
(!_.HasCapability(spv::Capability::Float16) &&
_.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeFloat, 16))) {
auto underlying_type = value_type;
- while (underlying_type->opcode() == spv::Op::OpTypePointer) {
+ while (underlying_type &&
+ underlying_type->opcode() == spv::Op::OpTypePointer) {
storage_class = underlying_type->GetOperandAs<spv::StorageClass>(1u);
underlying_type =
_.FindDef(underlying_type->GetOperandAs<uint32_t>(2u));
@@ -800,7 +831,8 @@
}
break;
case spv::StorageClass::Uniform:
- if (!_.HasCapability(
+ if (underlying_type &&
+ !_.HasCapability(
spv::Capability::UniformAndStorageBuffer16BitAccess)) {
if (underlying_type->opcode() == spv::Op::OpTypeArray ||
underlying_type->opcode() == spv::Op::OpTypeRuntimeArray) {
@@ -848,7 +880,8 @@
if (!_.HasCapability(spv::Capability::Int8) &&
_.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeInt, 8)) {
auto underlying_type = value_type;
- while (underlying_type->opcode() == spv::Op::OpTypePointer) {
+ while (underlying_type &&
+ underlying_type->opcode() == spv::Op::OpTypePointer) {
storage_class = underlying_type->GetOperandAs<spv::StorageClass>(1u);
underlying_type =
_.FindDef(underlying_type->GetOperandAs<uint32_t>(2u));
@@ -864,7 +897,8 @@
}
break;
case spv::StorageClass::Uniform:
- if (!_.HasCapability(
+ if (underlying_type &&
+ !_.HasCapability(
spv::Capability::UniformAndStorageBuffer8BitAccess)) {
if (underlying_type->opcode() == spv::Op::OpTypeArray ||
underlying_type->opcode() == spv::Op::OpTypeRuntimeArray) {
@@ -903,6 +937,65 @@
}
}
+ if (_.HasCapability(spv::Capability::TileShadingQCOM) &&
+ storage_class == spv::StorageClass::TileAttachmentQCOM) {
+ if (result_type->opcode() == spv::Op::OpTypePointer) {
+ const auto pointee_type =
+ _.FindDef(result_type->GetOperandAs<uint32_t>(2));
+ if (pointee_type && pointee_type->opcode() == spv::Op::OpTypeImage) {
+ spv::Dim dim = static_cast<spv::Dim>(pointee_type->word(3));
+ if (dim != spv::Dim::Dim2D) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Any OpTypeImage variable in the TileAttachmentQCOM "
+ "Storage Class must "
+ "have 2D as its dimension";
+ }
+ unsigned sampled = pointee_type->word(7);
+ if (sampled != 1 && sampled != 2) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Any OpyTpeImage variable in the TileAttachmentQCOM "
+ "Storage Class must "
+ "have 1 or 2 as Image 'Sampled' parameter";
+ }
+ for (const auto& pair_o : inst->uses()) {
+ const auto* use_inst_o = pair_o.first;
+ if (use_inst_o->opcode() == spv::Op::OpLoad) {
+ for (const auto& pair_i : use_inst_o->uses()) {
+ const auto* use_inst_i = pair_i.first;
+ switch (use_inst_i->opcode()) {
+ case spv::Op::OpImageQueryFormat:
+ case spv::Op::OpImageQueryOrder:
+ case spv::Op::OpImageQuerySizeLod:
+ case spv::Op::OpImageQuerySize:
+ case spv::Op::OpImageQueryLod:
+ case spv::Op::OpImageQueryLevels:
+ case spv::Op::OpImageQuerySamples:
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Any variable in the TileAttachmentQCOM Storage "
+ "Class must "
+ "not be consumed by an OpImageQuery* instruction";
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!(_.HasDecoration(inst->id(), spv::Decoration::DescriptorSet) &&
+ _.HasDecoration(inst->id(), spv::Decoration::Binding))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Any variable in the TileAttachmentQCOM Storage Class must "
+ "be decorated with DescriptorSet and Binding";
+ }
+ if (_.HasDecoration(inst->id(), spv::Decoration::Component)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Any variable in the TileAttachmentQCOM Storage Class must "
+ "not be decorated with Component decoration";
+ }
+ }
+
return SPV_SUCCESS;
}
@@ -929,21 +1022,23 @@
}
const auto pointer_type = _.FindDef(pointer->type_id());
- if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) {
+ if (!pointer_type ||
+ (pointer_type->opcode() != spv::Op::OpTypePointer &&
+ pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpLoad type for pointer <id> " << _.getIdName(pointer_id)
<< " is not a pointer type.";
}
- uint32_t pointee_data_type;
- spv::StorageClass storage_class;
- if (!_.GetPointerTypeInfo(pointer_type->id(), &pointee_data_type,
- &storage_class) ||
- result_type->id() != pointee_data_type) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpLoad Result Type <id> " << _.getIdName(inst->type_id())
- << " does not match Pointer <id> " << _.getIdName(pointer->id())
- << "s type.";
+ if (pointer_type->opcode() == spv::Op::OpTypePointer) {
+ const auto pointee_type =
+ _.FindDef(pointer_type->GetOperandAs<uint32_t>(2));
+ if (!pointee_type || result_type->id() != pointee_type->id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpLoad Result Type <id> " << _.getIdName(inst->type_id())
+ << " does not match Pointer <id> " << _.getIdName(pointer->id())
+ << "s type.";
+ }
}
if (!_.options()->before_hlsl_legalization &&
@@ -986,17 +1081,23 @@
<< " is not a logical pointer.";
}
const auto pointer_type = _.FindDef(pointer->type_id());
- if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) {
+ if (!pointer_type ||
+ (pointer_type->opcode() != spv::Op::OpTypePointer &&
+ pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpStore type for pointer <id> " << _.getIdName(pointer_id)
<< " is not a pointer type.";
}
- const auto type_id = pointer_type->GetOperandAs<uint32_t>(2);
- const auto type = _.FindDef(type_id);
- if (!type || spv::Op::OpTypeVoid == type->opcode()) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> " << _.getIdName(pointer_id)
- << "s type is void.";
+
+ Instruction* type = nullptr;
+ if (pointer_type->opcode() == spv::Op::OpTypePointer) {
+ const auto type_id = pointer_type->GetOperandAs<uint32_t>(2);
+ type = _.FindDef(type_id);
+ if (!type || spv::Op::OpTypeVoid == type->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << "s type is void.";
+ }
}
// validate storage class
@@ -1073,7 +1174,7 @@
<< "s type is void.";
}
- if (type->id() != object_type->id()) {
+ if (type && (type->id() != object_type->id())) {
if (!_.options()->relax_struct_store ||
type->opcode() != spv::Op::OpTypeStruct ||
object_type->opcode() != spv::Op::OpTypeStruct) {
@@ -1106,6 +1207,23 @@
}
}
+ if (spvIsVulkanEnv(_.context()->target_env) &&
+ !_.options()->before_hlsl_legalization) {
+ const auto isForbiddenType = [](const Instruction* type_inst) {
+ auto opcode = type_inst->opcode();
+ return opcode == spv::Op::OpTypeImage ||
+ opcode == spv::Op::OpTypeSampler ||
+ opcode == spv::Op::OpTypeSampledImage ||
+ opcode == spv::Op::OpTypeAccelerationStructureKHR;
+ };
+ if (_.ContainsType(object_type->id(), isForbiddenType)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(6924)
+ << "Cannot store to OpTypeImage, OpTypeSampler, "
+ "OpTypeSampledImage, or OpTypeAccelerationStructureKHR objects";
+ }
+ }
+
return SPV_SUCCESS;
}
@@ -1178,7 +1296,8 @@
const auto target_pointer_type = _.FindDef(target->type_id());
if (!target_pointer_type ||
- target_pointer_type->opcode() != spv::Op::OpTypePointer) {
+ (target_pointer_type->opcode() != spv::Op::OpTypePointer &&
+ target_pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Target operand <id> " << _.getIdName(target_id)
<< " is not a pointer.";
@@ -1186,35 +1305,52 @@
const auto source_pointer_type = _.FindDef(source->type_id());
if (!source_pointer_type ||
- source_pointer_type->opcode() != spv::Op::OpTypePointer) {
+ (source_pointer_type->opcode() != spv::Op::OpTypePointer &&
+ source_pointer_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Source operand <id> " << _.getIdName(source_id)
<< " is not a pointer.";
}
if (inst->opcode() == spv::Op::OpCopyMemory) {
- const auto target_type =
- _.FindDef(target_pointer_type->GetOperandAs<uint32_t>(2));
- if (!target_type || target_type->opcode() == spv::Op::OpTypeVoid) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Target operand <id> " << _.getIdName(target_id)
- << " cannot be a void pointer.";
+ const bool target_typed =
+ target_pointer_type->opcode() == spv::Op::OpTypePointer;
+ const bool source_typed =
+ source_pointer_type->opcode() == spv::Op::OpTypePointer;
+ Instruction* target_type = nullptr;
+ Instruction* source_type = nullptr;
+ if (target_typed) {
+ target_type = _.FindDef(target_pointer_type->GetOperandAs<uint32_t>(2));
+
+ if (!target_type || target_type->opcode() == spv::Op::OpTypeVoid) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Target operand <id> " << _.getIdName(target_id)
+ << " cannot be a void pointer.";
+ }
}
- const auto source_type =
- _.FindDef(source_pointer_type->GetOperandAs<uint32_t>(2));
- if (!source_type || source_type->opcode() == spv::Op::OpTypeVoid) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Source operand <id> " << _.getIdName(source_id)
- << " cannot be a void pointer.";
+ if (source_typed) {
+ source_type = _.FindDef(source_pointer_type->GetOperandAs<uint32_t>(2));
+ if (!source_type || source_type->opcode() == spv::Op::OpTypeVoid) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Source operand <id> " << _.getIdName(source_id)
+ << " cannot be a void pointer.";
+ }
}
- if (target_type->id() != source_type->id()) {
+ if (target_type && source_type && target_type->id() != source_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Target <id> " << _.getIdName(source_id)
<< "s type does not match Source <id> "
<< _.getIdName(source_type->id()) << "s type.";
}
+
+ if (!target_type && !source_type) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "One of Source or Target must be a typed pointer";
+ }
+
+ if (auto error = CheckMemoryAccess(_, inst, 2)) return error;
} else {
const auto size_id = inst->GetOperandAs<uint32_t>(2);
const auto size = _.FindDef(size_id);
@@ -1230,7 +1366,6 @@
<< "Size operand <id> " << _.getIdName(size_id)
<< " must be a scalar integer type.";
}
-
bool is_zero = true;
switch (size->opcode()) {
case spv::Op::OpConstantNull:
@@ -1257,18 +1392,125 @@
// Cannot infer any other opcodes.
break;
}
+
+ if (_.HasCapability(spv::Capability::Shader)) {
+ bool is_int = false;
+ bool is_const = false;
+ uint32_t value = 0;
+ std::tie(is_int, is_const, value) = _.EvalInt32IfConst(size_id);
+ if (is_const) {
+ if (value % 4 != 0) {
+ const auto source_sc =
+ source_pointer_type->GetOperandAs<spv::StorageClass>(1);
+ const auto target_sc =
+ target_pointer_type->GetOperandAs<spv::StorageClass>(1);
+ const bool int8 = _.HasCapability(spv::Capability::Int8);
+ const bool ubo_int8 = _.HasCapability(
+ spv::Capability::UniformAndStorageBuffer8BitAccess);
+ const bool ssbo_int8 =
+ _.HasCapability(spv::Capability::StorageBuffer8BitAccess) ||
+ ubo_int8;
+ const bool pc_int8 =
+ _.HasCapability(spv::Capability::StoragePushConstant8);
+ const bool wg_int8 = _.HasCapability(
+ spv::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR);
+ const bool int16 = _.HasCapability(spv::Capability::Int16) || int8;
+ const bool ubo_int16 =
+ _.HasCapability(
+ spv::Capability::UniformAndStorageBuffer16BitAccess) ||
+ ubo_int8;
+ const bool ssbo_int16 =
+ _.HasCapability(spv::Capability::StorageBuffer16BitAccess) ||
+ ubo_int16 || ssbo_int8;
+ const bool pc_int16 =
+ _.HasCapability(spv::Capability::StoragePushConstant16) ||
+ pc_int8;
+ const bool io_int16 =
+ _.HasCapability(spv::Capability::StorageInputOutput16);
+ const bool wg_int16 = _.HasCapability(
+ spv::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR);
+
+ bool source_int16_match = false;
+ bool target_int16_match = false;
+ bool source_int8_match = false;
+ bool target_int8_match = false;
+ switch (source_sc) {
+ case spv::StorageClass::StorageBuffer:
+ source_int16_match = ssbo_int16;
+ source_int8_match = ssbo_int8;
+ break;
+ case spv::StorageClass::Uniform:
+ source_int16_match = ubo_int16;
+ source_int8_match = ubo_int8;
+ break;
+ case spv::StorageClass::PushConstant:
+ source_int16_match = pc_int16;
+ source_int8_match = pc_int8;
+ break;
+ case spv::StorageClass::Input:
+ case spv::StorageClass::Output:
+ source_int16_match = io_int16;
+ break;
+ case spv::StorageClass::Workgroup:
+ source_int16_match = wg_int16;
+ source_int8_match = wg_int8;
+ break;
+ default:
+ break;
+ }
+ switch (target_sc) {
+ case spv::StorageClass::StorageBuffer:
+ target_int16_match = ssbo_int16;
+ target_int8_match = ssbo_int8;
+ break;
+ case spv::StorageClass::Uniform:
+ target_int16_match = ubo_int16;
+ target_int8_match = ubo_int8;
+ break;
+ case spv::StorageClass::PushConstant:
+ target_int16_match = pc_int16;
+ target_int8_match = pc_int8;
+ break;
+ // Input is read-only so it cannot be the target pointer.
+ case spv::StorageClass::Output:
+ target_int16_match = io_int16;
+ break;
+ case spv::StorageClass::Workgroup:
+ target_int16_match = wg_int16;
+ target_int8_match = wg_int8;
+ break;
+ default:
+ break;
+ }
+ if (!int8 && !int16 && !(source_int16_match && target_int16_match)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Size must be a multiple of 4";
+ }
+ if (value % 2 != 0) {
+ if (!int8 && !(source_int8_match && target_int8_match)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Size must be a multiple of 2";
+ }
+ }
+ }
+ }
+ }
+
+ if (auto error = CheckMemoryAccess(_, inst, 3)) return error;
}
if (auto error = ValidateCopyMemoryMemoryAccess(_, inst)) return error;
// Get past the pointers to avoid checking a pointer copy.
- auto sub_type = _.FindDef(target_pointer_type->GetOperandAs<uint32_t>(2));
- while (sub_type->opcode() == spv::Op::OpTypePointer) {
- sub_type = _.FindDef(sub_type->GetOperandAs<uint32_t>(2));
- }
- if (_.HasCapability(spv::Capability::Shader) &&
- _.ContainsLimitedUseIntOrFloatType(sub_type->id())) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Cannot copy memory of objects containing 8- or 16-bit types";
+ if (target_pointer_type->opcode() == spv::Op::OpTypePointer) {
+ auto sub_type = _.FindDef(target_pointer_type->GetOperandAs<uint32_t>(2));
+ while (sub_type->opcode() == spv::Op::OpTypePointer) {
+ sub_type = _.FindDef(sub_type->GetOperandAs<uint32_t>(2));
+ }
+ if (_.HasCapability(spv::Capability::Shader) &&
+ _.ContainsLimitedUseIntOrFloatType(sub_type->id())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Cannot copy memory of objects containing 8- or 16-bit types";
+ }
}
return SPV_SUCCESS;
@@ -1279,27 +1521,104 @@
std::string instr_name =
"Op" + std::string(spvOpcodeString(static_cast<spv::Op>(inst->opcode())));
- // The result type must be OpTypePointer.
+ const bool untyped_pointer = spvOpcodeGeneratesUntypedPointer(inst->opcode());
+
+ // The result type must be OpTypePointer for regular access chains and an
+ // OpTypeUntypedPointerKHR for untyped access chains.
auto result_type = _.FindDef(inst->type_id());
- if (spv::Op::OpTypePointer != result_type->opcode()) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Result Type of " << instr_name << " <id> "
- << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op"
- << spvOpcodeString(static_cast<spv::Op>(result_type->opcode()))
- << ".";
+ if (untyped_pointer) {
+ if (!result_type ||
+ spv::Op::OpTypeUntypedPointerKHR != result_type->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "The Result Type of " << instr_name << " <id> "
+ << _.getIdName(inst->id())
+ << " must be OpTypeUntypedPointerKHR. Found Op"
+ << spvOpcodeString(static_cast<spv::Op>(result_type->opcode()))
+ << ".";
+ }
+ } else {
+ if (!result_type || spv::Op::OpTypePointer != result_type->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "The Result Type of " << instr_name << " <id> "
+ << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op"
+ << spvOpcodeString(static_cast<spv::Op>(result_type->opcode()))
+ << ".";
+ }
}
- // Result type is a pointer. Find out what it's pointing to.
- // This will be used to make sure the indexing results in the same type.
- // OpTypePointer word 3 is the type being pointed to.
- const auto result_type_pointee = _.FindDef(result_type->word(3));
+ if (untyped_pointer) {
+ // Base type must be a non-pointer type.
+ const auto base_type = _.FindDef(inst->GetOperandAs<uint32_t>(2));
+ if (!base_type || !spvOpcodeGeneratesType(base_type->opcode()) ||
+ base_type->opcode() == spv::Op::OpTypePointer ||
+ base_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Base type must be a non-pointer type";
+ }
+
+ const auto ContainsBlock = [&_](const Instruction* type_inst) {
+ if (type_inst->opcode() == spv::Op::OpTypeStruct) {
+ if (_.HasDecoration(type_inst->id(), spv::Decoration::Block) ||
+ _.HasDecoration(type_inst->id(), spv::Decoration::BufferBlock)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ // Block (and BufferBlock) arrays cannot be reinterpreted via untyped access
+ // chains.
+ const bool base_type_block_array =
+ base_type->opcode() == spv::Op::OpTypeArray &&
+ _.ContainsType(base_type->id(), ContainsBlock,
+ /* traverse_all_types = */ false);
+
+ const auto base_index = untyped_pointer ? 3 : 2;
+ const auto base_id = inst->GetOperandAs<uint32_t>(base_index);
+ auto base = _.FindDef(base_id);
+ // Strictly speaking this misses trivial access chains and function
+ // parameter chasing, but that would be a significant complication in the
+ // traversal.
+ while (base->opcode() == spv::Op::OpCopyObject) {
+ base = _.FindDef(base->GetOperandAs<uint32_t>(2));
+ }
+ const Instruction* base_data_type = nullptr;
+ if (base->opcode() == spv::Op::OpVariable) {
+ const auto ptr_type = _.FindDef(base->type_id());
+ base_data_type = _.FindDef(ptr_type->GetOperandAs<uint32_t>(2));
+ } else if (base->opcode() == spv::Op::OpUntypedVariableKHR) {
+ if (base->operands().size() > 3) {
+ base_data_type = _.FindDef(base->GetOperandAs<uint32_t>(3));
+ }
+ }
+
+ if (base_data_type) {
+ const bool base_block_array =
+ base_data_type->opcode() == spv::Op::OpTypeArray &&
+ _.ContainsType(base_data_type->id(), ContainsBlock,
+ /* traverse_all_types = */ false);
+
+ if (base_type_block_array != base_block_array) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Both Base Type and Base must be Block or BufferBlock arrays "
+ "or neither can be";
+ } else if (base_type_block_array && base_block_array &&
+ base_type->id() != base_data_type->id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "If Base or Base Type is a Block or BufferBlock array, the "
+ "other must also be the same array";
+ }
+ }
+ }
// Base must be a pointer, pointing to the base of a composite object.
- const auto base_index = 2;
+ const auto base_index = untyped_pointer ? 3 : 2;
const auto base_id = inst->GetOperandAs<uint32_t>(base_index);
const auto base = _.FindDef(base_id);
const auto base_type = _.FindDef(base->type_id());
- if (!base_type || spv::Op::OpTypePointer != base_type->opcode()) {
+ if (!base_type || !(spv::Op::OpTypePointer == base_type->opcode() ||
+ (untyped_pointer && spv::Op::OpTypeUntypedPointerKHR ==
+ base_type->opcode()))) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "The Base <id> " << _.getIdName(base_id) << " in " << instr_name
<< " instruction must be a pointer.";
@@ -1317,14 +1636,18 @@
}
// The type pointed to by OpTypePointer (word 3) must be a composite type.
- auto type_pointee = _.FindDef(base_type->word(3));
+ auto type_pointee = untyped_pointer
+ ? _.FindDef(inst->GetOperandAs<uint32_t>(2))
+ : _.FindDef(base_type->word(3));
// Check Universal Limit (SPIR-V Spec. Section 2.17).
// The number of indexes passed to OpAccessChain may not exceed 255
// The instruction includes 4 words + N words (for N indexes)
size_t num_indexes = inst->words().size() - 4;
if (inst->opcode() == spv::Op::OpPtrAccessChain ||
- inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) {
+ inst->opcode() == spv::Op::OpInBoundsPtrAccessChain ||
+ inst->opcode() == spv::Op::OpUntypedPtrAccessChainKHR ||
+ inst->opcode() == spv::Op::OpUntypedInBoundsPtrAccessChainKHR) {
// In pointer access chains, the element operand is required, but not
// counted as an index.
--num_indexes;
@@ -1343,9 +1666,11 @@
// instruction. The second index will apply similarly to that result, and so
// on. Once any non-composite type is reached, there must be no remaining
// (unused) indexes.
- auto starting_index = 4;
+ auto starting_index = untyped_pointer ? 5 : 4;
if (inst->opcode() == spv::Op::OpPtrAccessChain ||
- inst->opcode() == spv::Op::OpInBoundsPtrAccessChain) {
+ inst->opcode() == spv::Op::OpInBoundsPtrAccessChain ||
+ inst->opcode() == spv::Op::OpUntypedPtrAccessChainKHR ||
+ inst->opcode() == spv::Op::OpUntypedInBoundsPtrAccessChainKHR) {
++starting_index;
}
for (size_t i = starting_index; i < inst->words().size(); ++i) {
@@ -1362,12 +1687,15 @@
switch (type_pointee->opcode()) {
case spv::Op::OpTypeMatrix:
case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeCooperativeVectorNV:
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
case spv::Op::OpTypeArray:
- case spv::Op::OpTypeRuntimeArray: {
+ case spv::Op::OpTypeRuntimeArray:
+ case spv::Op::OpTypeNodePayloadArrayAMDX: {
// In OpTypeMatrix, OpTypeVector, spv::Op::OpTypeCooperativeMatrixNV,
- // OpTypeArray, and OpTypeRuntimeArray, word 2 is the Element Type.
+ // OpTypeCooperativeVectorNV, OpTypeArray, and OpTypeRuntimeArray, word
+ // 2 is the Element Type.
type_pointee = _.FindDef(type_pointee->word(2));
break;
}
@@ -1376,9 +1704,10 @@
// index: the index must be an OpConstant.
int64_t cur_index;
if (!_.EvalConstantValInt64(cur_word, &cur_index)) {
- return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr)
- << "The <id> passed to " << instr_name
- << " to index into a "
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "The <id> passed to " << instr_name << " to index "
+ << _.getIdName(cur_word)
+ << " into a "
"structure must be an OpConstant.";
}
@@ -1387,10 +1716,10 @@
const int64_t num_struct_members =
static_cast<int64_t>(type_pointee->words().size() - 2);
if (cur_index >= num_struct_members || cur_index < 0) {
- return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr)
- << "Index is out of bounds: " << instr_name
- << " cannot find index " << cur_index
- << " into the structure <id> "
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Index " << _.getIdName(cur_word)
+ << " is out of bounds: " << instr_name << " cannot find index "
+ << cur_index << " into the structure <id> "
<< _.getIdName(type_pointee->id()) << ". This structure has "
<< num_struct_members << " members. Largest valid index is "
<< num_struct_members - 1 << ".";
@@ -1410,18 +1739,25 @@
}
}
}
- // At this point, we have fully walked down from the base using the indices.
- // The type being pointed to should be the same as the result type.
- if (type_pointee->id() != result_type_pointee->id()) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << instr_name << " result type (Op"
- << spvOpcodeString(
- static_cast<spv::Op>(result_type_pointee->opcode()))
- << ") does not match the type that results from indexing into the "
- "base "
- "<id> (Op"
- << spvOpcodeString(static_cast<spv::Op>(type_pointee->opcode()))
- << ").";
+
+ if (!untyped_pointer) {
+ // Result type is a pointer. Find out what it's pointing to.
+ // This will be used to make sure the indexing results in the same type.
+ // OpTypePointer word 3 is the type being pointed to.
+ const auto result_type_pointee = _.FindDef(result_type->word(3));
+ // At this point, we have fully walked down from the base using the indeces.
+ // The type being pointed to should be the same as the result type.
+ if (type_pointee->id() != result_type_pointee->id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << instr_name << " result type (Op"
+ << spvOpcodeString(
+ static_cast<spv::Op>(result_type_pointee->opcode()))
+ << ") does not match the type that results from indexing into the "
+ "base "
+ "<id> (Op"
+ << spvOpcodeString(static_cast<spv::Op>(type_pointee->opcode()))
+ << ").";
+ }
}
return SPV_SUCCESS;
@@ -1549,7 +1885,8 @@
spv_result_t ValidatePtrAccessChain(ValidationState_t& _,
const Instruction* inst) {
- if (_.addressing_model() == spv::AddressingModel::Logical) {
+ if (_.addressing_model() == spv::AddressingModel::Logical &&
+ inst->opcode() == spv::Op::OpPtrAccessChain) {
if (!_.features().variable_pointers) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Generating variable pointers requires capability "
@@ -1560,12 +1897,36 @@
// Need to call first, will make sure Base is a valid ID
if (auto error = ValidateAccessChain(_, inst)) return error;
- const auto base_id = inst->GetOperandAs<uint32_t>(2);
- const auto base = _.FindDef(base_id);
+ const bool untyped_pointer = spvOpcodeGeneratesUntypedPointer(inst->opcode());
+
+ const auto base_idx = untyped_pointer ? 3 : 2;
+ const auto base = _.FindDef(inst->GetOperandAs<uint32_t>(base_idx));
const auto base_type = _.FindDef(base->type_id());
const auto base_type_storage_class =
base_type->GetOperandAs<spv::StorageClass>(1);
+ const auto element_idx = untyped_pointer ? 4 : 3;
+ const auto element = _.FindDef(inst->GetOperandAs<uint32_t>(element_idx));
+ const auto element_type = _.FindDef(element->type_id());
+ if (!element_type || element_type->opcode() != spv::Op::OpTypeInt) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Element must be an integer";
+ }
+ uint64_t element_val = 0;
+ if (_.EvalConstantValUint64(element->id(), &element_val)) {
+ if (element_val != 0) {
+ const auto interp_type =
+ untyped_pointer ? _.FindDef(inst->GetOperandAs<uint32_t>(2))
+ : _.FindDef(base_type->GetOperandAs<uint32_t>(2));
+ if (interp_type->opcode() == spv::Op::OpTypeStruct &&
+ (_.HasDecoration(interp_type->id(), spv::Decoration::Block) ||
+ _.HasDecoration(interp_type->id(), spv::Decoration::BufferBlock))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Element must be 0 if the interpretation type is a Block- or "
+ "BufferBlock-decorated structure";
+ }
+ }
+ }
+
if (_.HasCapability(spv::Capability::Shader) &&
(base_type_storage_class == spv::StorageClass::Uniform ||
base_type_storage_class == spv::StorageClass::StorageBuffer ||
@@ -1580,15 +1941,17 @@
}
if (spvIsVulkanEnv(_.context()->target_env)) {
+ const auto untyped_cap =
+ untyped_pointer && _.HasCapability(spv::Capability::UntypedPointersKHR);
if (base_type_storage_class == spv::StorageClass::Workgroup) {
- if (!_.HasCapability(spv::Capability::VariablePointers)) {
+ if (!_.HasCapability(spv::Capability::VariablePointers) && !untyped_cap) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(7651)
<< "OpPtrAccessChain Base operand pointing to Workgroup "
"storage class must use VariablePointers capability";
}
} else if (base_type_storage_class == spv::StorageClass::StorageBuffer) {
- if (!_.features().variable_pointers) {
+ if (!_.features().variable_pointers && !untyped_cap) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(7652)
<< "OpPtrAccessChain Base operand pointing to StorageBuffer "
@@ -1596,7 +1959,8 @@
"VariablePointersStorageBuffer capability";
}
} else if (base_type_storage_class !=
- spv::StorageClass::PhysicalStorageBuffer) {
+ spv::StorageClass::PhysicalStorageBuffer &&
+ !untyped_cap) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(7650)
<< "OpPtrAccessChain Base operand must point to Workgroup, "
@@ -1623,18 +1987,28 @@
<< " must be OpTypeInt with width 32 and signedness 0.";
}
- // The structure that is passed in must be an pointer to a structure, whose
- // last element is a runtime array.
- auto pointer = state.FindDef(inst->GetOperandAs<uint32_t>(2));
- auto pointer_type = state.FindDef(pointer->type_id());
- if (pointer_type->opcode() != spv::Op::OpTypePointer) {
+ const bool untyped = inst->opcode() == spv::Op::OpUntypedArrayLengthKHR;
+ auto pointer_ty_id = state.GetOperandTypeId(inst, (untyped ? 3 : 2));
+ auto pointer_ty = state.FindDef(pointer_ty_id);
+ if (untyped) {
+ if (pointer_ty->opcode() != spv::Op::OpTypeUntypedPointerKHR) {
+ return state.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Pointer must be an untyped pointer";
+ }
+ } else if (pointer_ty->opcode() != spv::Op::OpTypePointer) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
<< "The Structure's type in " << instr_name << " <id> "
<< state.getIdName(inst->id())
<< " must be a pointer to an OpTypeStruct.";
}
- auto structure_type = state.FindDef(pointer_type->GetOperandAs<uint32_t>(2));
+ Instruction* structure_type = nullptr;
+ if (untyped) {
+ structure_type = state.FindDef(inst->GetOperandAs<uint32_t>(2));
+ } else {
+ structure_type = state.FindDef(pointer_ty->GetOperandAs<uint32_t>(2));
+ }
+
if (structure_type->opcode() != spv::Op::OpTypeStruct) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
<< "The Structure's type in " << instr_name << " <id> "
@@ -1653,11 +2027,12 @@
// The array member must the index of the last element (the run time
// array).
- if (inst->GetOperandAs<uint32_t>(3) != num_of_members - 1) {
+ const auto index = untyped ? 4 : 3;
+ if (inst->GetOperandAs<uint32_t>(index) != num_of_members - 1) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
<< "The array member in " << instr_name << " <id> "
<< state.getIdName(inst->id())
- << " must be an the last member of the struct.";
+ << " must be the last member of the struct.";
}
return SPV_SUCCESS;
}
@@ -1842,6 +2217,144 @@
const auto pointer_type_id = pointer->type_id();
const auto pointer_type = _.FindDef(pointer_type_id);
+ if (!pointer_type ||
+ !(pointer_type->opcode() == spv::Op::OpTypePointer ||
+ pointer_type->opcode() == spv::Op::OpTypeUntypedPointerKHR)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " type for pointer <id> " << _.getIdName(pointer_id)
+ << " is not a pointer type.";
+ }
+
+ const bool untyped =
+ pointer_type->opcode() == spv::Op::OpTypeUntypedPointerKHR;
+ const auto storage_class_index = 1u;
+ const auto storage_class =
+ pointer_type->GetOperandAs<spv::StorageClass>(storage_class_index);
+
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ if (storage_class != spv::StorageClass::Workgroup &&
+ storage_class != spv::StorageClass::StorageBuffer &&
+ storage_class != spv::StorageClass::PhysicalStorageBuffer) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(8973) << opname
+ << " storage class for pointer type <id> "
+ << _.getIdName(pointer_type_id)
+ << " is not Workgroup, StorageBuffer, or PhysicalStorageBuffer.";
+ }
+ }
+
+ if (!untyped) {
+ const auto pointee_id = pointer_type->GetOperandAs<uint32_t>(2);
+ const auto pointee_type = _.FindDef(pointee_id);
+ if (!pointee_type || !(_.IsIntScalarOrVectorType(pointee_id) ||
+ _.IsFloatScalarOrVectorType(pointee_id))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " Pointer <id> " << _.getIdName(pointer->id())
+ << "s Type must be a scalar or vector type.";
+ }
+ }
+
+ const auto layout_index =
+ (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 3u : 2u;
+ const auto layout_id = inst->GetOperandAs<uint32_t>(layout_index);
+ const auto layout_inst = _.FindDef(layout_id);
+ if (!layout_inst || !_.IsIntScalarType(layout_inst->type_id()) ||
+ !spvOpcodeIsConstant(layout_inst->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "MemoryLayout operand <id> " << _.getIdName(layout_id)
+ << " must be a 32-bit integer constant instruction.";
+ }
+
+ bool stride_required = false;
+ uint64_t layout;
+ if (_.EvalConstantValUint64(layout_id, &layout)) {
+ stride_required =
+ (layout == (uint64_t)spv::CooperativeMatrixLayout::RowMajorKHR) ||
+ (layout == (uint64_t)spv::CooperativeMatrixLayout::ColumnMajorKHR);
+ }
+
+ const auto stride_index =
+ (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 4u : 3u;
+ if (inst->operands().size() > stride_index) {
+ const auto stride_id = inst->GetOperandAs<uint32_t>(stride_index);
+ const auto stride = _.FindDef(stride_id);
+ if (!stride || !_.IsIntScalarType(stride->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Stride operand <id> " << _.getIdName(stride_id)
+ << " must be a scalar integer type.";
+ }
+ } else if (stride_required) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "MemoryLayout " << layout << " requires a Stride.";
+ }
+
+ const auto memory_access_index =
+ (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 5u : 4u;
+ if (inst->operands().size() > memory_access_index) {
+ if (auto error = CheckMemoryAccess(_, inst, memory_access_index))
+ return error;
+ }
+
+ return SPV_SUCCESS;
+}
+
+// Returns the number of instruction words taken up by a tensor addressing
+// operands argument and its implied operands.
+int TensorAddressingOperandsNumWords(spv::TensorAddressingOperandsMask mask) {
+ int result = 1; // Count the mask
+ if ((mask & spv::TensorAddressingOperandsMask::TensorView) !=
+ spv::TensorAddressingOperandsMask::MaskNone)
+ ++result;
+ if ((mask & spv::TensorAddressingOperandsMask::DecodeFunc) !=
+ spv::TensorAddressingOperandsMask::MaskNone)
+ ++result;
+ return result;
+}
+
+spv_result_t ValidateCooperativeMatrixLoadStoreTensorNV(
+ ValidationState_t& _, const Instruction* inst) {
+ uint32_t type_id;
+ const char* opname;
+ if (inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) {
+ type_id = inst->type_id();
+ opname = "spv::Op::OpCooperativeMatrixLoadTensorNV";
+ } else {
+ // get Object operand's type
+ type_id = _.FindDef(inst->GetOperandAs<uint32_t>(1))->type_id();
+ opname = "spv::Op::OpCooperativeMatrixStoreTensorNV";
+ }
+
+ auto matrix_type = _.FindDef(type_id);
+
+ if (matrix_type->opcode() != spv::Op::OpTypeCooperativeMatrixKHR) {
+ if (inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "spv::Op::OpCooperativeMatrixLoadTensorNV Result Type <id> "
+ << _.getIdName(type_id) << " is not a cooperative matrix type.";
+ } else {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "spv::Op::OpCooperativeMatrixStoreTensorNV Object type <id> "
+ << _.getIdName(type_id) << " is not a cooperative matrix type.";
+ }
+ }
+
+ const auto pointer_index =
+ (inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) ? 2u : 0u;
+ const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
+ const auto pointer = _.FindDef(pointer_id);
+ if (!pointer ||
+ ((_.addressing_model() == spv::AddressingModel::Logical) &&
+ ((!_.features().variable_pointers &&
+ !spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
+ (_.features().variable_pointers &&
+ !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " Pointer <id> " << _.getIdName(pointer_id)
+ << " is not a logical pointer.";
+ }
+
+ const auto pointer_type_id = pointer->type_id();
+ const auto pointer_type = _.FindDef(pointer_type_id);
if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< opname << " type for pointer <id> " << _.getIdName(pointer_id)
@@ -1862,46 +2375,528 @@
<< " is not Workgroup, StorageBuffer, or PhysicalStorageBuffer.";
}
- const auto pointee_id = pointer_type->GetOperandAs<uint32_t>(2);
- const auto pointee_type = _.FindDef(pointee_id);
- if (!pointee_type || !(_.IsIntScalarOrVectorType(pointee_id) ||
- _.IsFloatScalarOrVectorType(pointee_id))) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opname << " Pointer <id> " << _.getIdName(pointer->id())
- << "s Type must be a scalar or vector type.";
- }
-
- const auto layout_index =
- (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 3u : 2u;
- const auto colmajor_id = inst->GetOperandAs<uint32_t>(layout_index);
- const auto colmajor = _.FindDef(colmajor_id);
- if (!colmajor || !_.IsIntScalarType(colmajor->type_id()) ||
- !(spvOpcodeIsConstant(colmajor->opcode()) ||
- spvOpcodeIsSpecConstant(colmajor->opcode()))) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "MemoryLayout operand <id> " << _.getIdName(colmajor_id)
- << " must be a 32-bit integer constant instruction.";
- }
-
- const auto stride_index =
- (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 4u : 3u;
- if (inst->operands().size() > stride_index) {
- const auto stride_id = inst->GetOperandAs<uint32_t>(stride_index);
- const auto stride = _.FindDef(stride_id);
- if (!stride || !_.IsIntScalarType(stride->type_id())) {
+ if (inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) {
+ const auto object_index = 3;
+ const auto object_id = inst->GetOperandAs<uint32_t>(object_index);
+ const auto object = _.FindDef(object_id);
+ if (!object || object->type_id() != type_id) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Stride operand <id> " << _.getIdName(stride_id)
- << " must be a scalar integer type.";
+ << opname << " Object <id> " << _.getIdName(object_id)
+ << " type does not match Result Type.";
}
}
+ const auto tensor_layout_index =
+ (inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) ? 4u : 2u;
+ const auto tensor_layout_id =
+ inst->GetOperandAs<uint32_t>(tensor_layout_index);
+ const auto tensor_layout = _.FindDef(tensor_layout_id);
+ if (!tensor_layout || _.FindDef(tensor_layout->type_id())->opcode() !=
+ spv::Op::OpTypeTensorLayoutNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " TensorLayout <id> " << _.getIdName(tensor_layout_id)
+ << " does not have a tensor layout type.";
+ }
+
const auto memory_access_index =
- (inst->opcode() == spv::Op::OpCooperativeMatrixLoadKHR) ? 5u : 4u;
+ (inst->opcode() == spv::Op::OpCooperativeMatrixLoadTensorNV) ? 5u : 3u;
if (inst->operands().size() > memory_access_index) {
if (auto error = CheckMemoryAccess(_, inst, memory_access_index))
return error;
}
+ const auto memory_access_mask =
+ inst->GetOperandAs<uint32_t>(memory_access_index);
+ const auto tensor_operands_index =
+ memory_access_index + MemoryAccessNumWords(memory_access_mask);
+ const auto tensor_operands =
+ inst->GetOperandAs<spv::TensorAddressingOperandsMask>(
+ tensor_operands_index);
+
+ if (inst->operands().size() <
+ tensor_operands_index +
+ TensorAddressingOperandsNumWords(tensor_operands)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " not enough tensor addressing operands.";
+ }
+
+ uint32_t tensor_operand_index = tensor_operands_index + 1;
+ if ((tensor_operands & spv::TensorAddressingOperandsMask::TensorView) !=
+ spv::TensorAddressingOperandsMask::MaskNone) {
+ const auto tensor_view_id =
+ inst->GetOperandAs<uint32_t>(tensor_operand_index);
+ const auto tensor_view = _.FindDef(tensor_view_id);
+ if (!tensor_view || _.FindDef(tensor_view->type_id())->opcode() !=
+ spv::Op::OpTypeTensorViewNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " TensorView <id> " << _.getIdName(tensor_view_id)
+ << " does not have a tensor view type.";
+ }
+
+ tensor_operand_index++;
+ }
+
+ if ((tensor_operands & spv::TensorAddressingOperandsMask::DecodeFunc) !=
+ spv::TensorAddressingOperandsMask::MaskNone) {
+ if (inst->opcode() == spv::Op::OpCooperativeMatrixStoreTensorNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpCooperativeMatrixStoreTensorNV does not support DecodeFunc.";
+ }
+ const auto decode_func_id =
+ inst->GetOperandAs<uint32_t>(tensor_operand_index);
+ const auto decode_func = _.FindDef(decode_func_id);
+
+ if (!decode_func || decode_func->opcode() != spv::Op::OpFunction) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " DecodeFunc <id> " << _.getIdName(decode_func_id)
+ << " is not a function.";
+ }
+
+ const auto component_type_index = 1;
+ const auto component_type_id =
+ matrix_type->GetOperandAs<uint32_t>(component_type_index);
+
+ const auto function_type =
+ _.FindDef(decode_func->GetOperandAs<uint32_t>(3));
+ if (function_type->GetOperandAs<uint32_t>(1) != component_type_id) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " DecodeFunc <id> " << _.getIdName(decode_func_id)
+ << " return type must match matrix component type.";
+ }
+
+ const auto decode_ptr_type_id = function_type->GetOperandAs<uint32_t>(2);
+ const auto decode_ptr_type = _.FindDef(decode_ptr_type_id);
+ auto decode_storage_class =
+ decode_ptr_type->GetOperandAs<spv::StorageClass>(storage_class_index);
+
+ if (decode_storage_class != spv::StorageClass::PhysicalStorageBuffer) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " DecodeFunc <id> " << _.getIdName(decode_func_id)
+ << " first parameter must be pointer to PhysicalStorageBuffer.";
+ }
+
+ const auto tensor_layout_type = _.FindDef(tensor_layout->type_id());
+
+ for (uint32_t param = 3; param < 5; ++param) {
+ const auto param_type_id = function_type->GetOperandAs<uint32_t>(param);
+ const auto param_type = _.FindDef(param_type_id);
+ if (param_type->opcode() != spv::Op::OpTypeArray) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " DecodeFunc <id> " << _.getIdName(decode_func_id)
+ << " second/third parameter must be array of 32-bit integer "
+ "with "
+ << " dimension equal to the tensor dimension.";
+ }
+ const auto length_index = 2u;
+ uint64_t array_length;
+ if (_.EvalConstantValUint64(
+ param_type->GetOperandAs<uint32_t>(length_index),
+ &array_length)) {
+ const auto tensor_layout_dim_id =
+ tensor_layout_type->GetOperandAs<uint32_t>(1);
+ uint64_t dim_value;
+ if (_.EvalConstantValUint64(tensor_layout_dim_id, &dim_value)) {
+ if (array_length != dim_value) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " DecodeFunc <id> "
+ << _.getIdName(decode_func_id)
+ << " second/third parameter must be array of 32-bit integer "
+ "with "
+ << " dimension equal to the tensor dimension.";
+ }
+ }
+ }
+ }
+
+ tensor_operand_index++;
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateInt32Operand(ValidationState_t& _, const Instruction* inst,
+ uint32_t operand_index,
+ const char* opcode_name,
+ const char* operand_name) {
+ const auto type_id =
+ _.FindDef(inst->GetOperandAs<uint32_t>(operand_index))->type_id();
+ if (!_.IsIntScalarType(type_id) || _.GetBitWidth(type_id) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " " << operand_name << " type <id> "
+ << _.getIdName(type_id) << " is not a 32 bit integer.";
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateCooperativeVectorPointer(ValidationState_t& _,
+ const Instruction* inst,
+ const char* opname,
+ uint32_t pointer_index) {
+ const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
+ const auto pointer = _.FindDef(pointer_id);
+ if (!pointer ||
+ ((_.addressing_model() == spv::AddressingModel::Logical) &&
+ ((!_.features().variable_pointers &&
+ !spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
+ (_.features().variable_pointers &&
+ !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " Pointer <id> " << _.getIdName(pointer_id)
+ << " is not a logical pointer.";
+ }
+
+ const auto pointer_type_id = pointer->type_id();
+ const auto pointer_type = _.FindDef(pointer_type_id);
+ if (!pointer_type || pointer_type->opcode() != spv::Op::OpTypePointer) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " type for pointer <id> " << _.getIdName(pointer_id)
+ << " is not a pointer type.";
+ }
+
+ const auto storage_class_index = 1u;
+ const auto storage_class =
+ pointer_type->GetOperandAs<spv::StorageClass>(storage_class_index);
+
+ if (storage_class != spv::StorageClass::Workgroup &&
+ storage_class != spv::StorageClass::StorageBuffer &&
+ storage_class != spv::StorageClass::PhysicalStorageBuffer) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " storage class for pointer type <id> "
+ << _.getIdName(pointer_type_id)
+ << " is not Workgroup or StorageBuffer.";
+ }
+
+ const auto pointee_id = pointer_type->GetOperandAs<uint32_t>(2);
+ const auto pointee_type = _.FindDef(pointee_id);
+ if (!pointee_type ||
+ (pointee_type->opcode() != spv::Op::OpTypeArray &&
+ pointee_type->opcode() != spv::Op::OpTypeRuntimeArray)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " Pointer <id> " << _.getIdName(pointer->id())
+ << "s Type must be an array type.";
+ }
+
+ const auto array_elem_type_id = pointee_type->GetOperandAs<uint32_t>(1);
+ auto array_elem_type = _.FindDef(array_elem_type_id);
+ if (!array_elem_type || !(_.IsIntScalarOrVectorType(array_elem_type_id) ||
+ _.IsFloatScalarOrVectorType(array_elem_type_id))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opname << " Pointer <id> " << _.getIdName(pointer->id())
+ << "s Type must be an array of scalar or vector type.";
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateCooperativeVectorLoadStoreNV(ValidationState_t& _,
+ const Instruction* inst) {
+ uint32_t type_id;
+ const char* opname;
+ if (inst->opcode() == spv::Op::OpCooperativeVectorLoadNV) {
+ type_id = inst->type_id();
+ opname = "spv::Op::OpCooperativeVectorLoadNV";
+ } else {
+ // get Object operand's type
+ type_id = _.FindDef(inst->GetOperandAs<uint32_t>(2))->type_id();
+ opname = "spv::Op::OpCooperativeVectorStoreNV";
+ }
+
+ auto vector_type = _.FindDef(type_id);
+
+ if (vector_type->opcode() != spv::Op::OpTypeCooperativeVectorNV) {
+ if (inst->opcode() == spv::Op::OpCooperativeVectorLoadNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "spv::Op::OpCooperativeVectorLoadNV Result Type <id> "
+ << _.getIdName(type_id) << " is not a cooperative vector type.";
+ } else {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "spv::Op::OpCooperativeVectorStoreNV Object type <id> "
+ << _.getIdName(type_id) << " is not a cooperative vector type.";
+ }
+ }
+
+ const auto pointer_index =
+ (inst->opcode() == spv::Op::OpCooperativeVectorLoadNV) ? 2u : 0u;
+
+ if (auto error =
+ ValidateCooperativeVectorPointer(_, inst, opname, pointer_index)) {
+ return error;
+ }
+
+ const auto memory_access_index =
+ (inst->opcode() == spv::Op::OpCooperativeVectorLoadNV) ? 4u : 3u;
+ if (inst->operands().size() > memory_access_index) {
+ if (auto error = CheckMemoryAccess(_, inst, memory_access_index))
+ return error;
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateCooperativeVectorOuterProductNV(ValidationState_t& _,
+ const Instruction* inst) {
+ const auto pointer_index = 0u;
+ const auto opcode_name =
+ "spv::Op::OpCooperativeVectorOuterProductAccumulateNV";
+
+ if (auto error = ValidateCooperativeVectorPointer(_, inst, opcode_name,
+ pointer_index)) {
+ return error;
+ }
+
+ auto type_id = _.FindDef(inst->GetOperandAs<uint32_t>(2))->type_id();
+ auto a_type = _.FindDef(type_id);
+
+ if (a_type->opcode() != spv::Op::OpTypeCooperativeVectorNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " A type <id> " << _.getIdName(type_id)
+ << " is not a cooperative vector type.";
+ }
+
+ type_id = _.FindDef(inst->GetOperandAs<uint32_t>(3))->type_id();
+ auto b_type = _.FindDef(type_id);
+
+ if (b_type->opcode() != spv::Op::OpTypeCooperativeVectorNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " B type <id> " << _.getIdName(type_id)
+ << " is not a cooperative vector type.";
+ }
+
+ const auto a_component_type_id = a_type->GetOperandAs<uint32_t>(1);
+ const auto b_component_type_id = b_type->GetOperandAs<uint32_t>(1);
+
+ if (a_component_type_id != b_component_type_id) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " A and B component types "
+ << _.getIdName(a_component_type_id) << " and "
+ << _.getIdName(b_component_type_id) << " do not match.";
+ }
+
+ if (auto error = ValidateInt32Operand(_, inst, 1, opcode_name, "Offset")) {
+ return error;
+ }
+
+ if (auto error =
+ ValidateInt32Operand(_, inst, 4, opcode_name, "MemoryLayout")) {
+ return error;
+ }
+
+ if (auto error = ValidateInt32Operand(_, inst, 5, opcode_name,
+ "MatrixInterpretation")) {
+ return error;
+ }
+
+ if (inst->operands().size() > 6) {
+ if (auto error =
+ ValidateInt32Operand(_, inst, 6, opcode_name, "MatrixStride")) {
+ return error;
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateCooperativeVectorReduceSumNV(ValidationState_t& _,
+ const Instruction* inst) {
+ const auto opcode_name = "spv::Op::OpCooperativeVectorReduceSumAccumulateNV";
+ const auto pointer_index = 0u;
+
+ if (auto error = ValidateCooperativeVectorPointer(_, inst, opcode_name,
+ pointer_index)) {
+ return error;
+ }
+
+ auto type_id = _.FindDef(inst->GetOperandAs<uint32_t>(2))->type_id();
+ auto v_type = _.FindDef(type_id);
+
+ if (v_type->opcode() != spv::Op::OpTypeCooperativeVectorNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " V type <id> " << _.getIdName(type_id)
+ << " is not a cooperative vector type.";
+ }
+
+ if (auto error = ValidateInt32Operand(_, inst, 1, opcode_name, "Offset")) {
+ return error;
+ }
+
+ return SPV_SUCCESS;
+}
+
+bool InterpretationIsPacked(spv::ComponentType interp) {
+ switch (interp) {
+ case spv::ComponentType::SignedInt8PackedNV:
+ case spv::ComponentType::UnsignedInt8PackedNV:
+ return true;
+ default:
+ return false;
+ }
+}
+
+using std::get;
+
+spv_result_t ValidateCooperativeVectorMatrixMulNV(ValidationState_t& _,
+ const Instruction* inst) {
+ const bool has_bias =
+ inst->opcode() == spv::Op::OpCooperativeVectorMatrixMulAddNV;
+ const auto opcode_name = has_bias
+ ? "spv::Op::OpCooperativeVectorMatrixMulAddNV"
+ : "spv::Op::OpCooperativeVectorMatrixMulNV";
+
+ const auto bias_offset = has_bias ? 3 : 0;
+
+ const auto result_type_index = 0u;
+ const auto input_index = 2u;
+ const auto input_interpretation_index = 3u;
+ const auto matrix_index = 4u;
+ const auto matrix_interpretation_index = 6u;
+ const auto bias_index = 7u;
+ const auto bias_interpretation_index = 9u;
+ const auto m_index = 7u + bias_offset;
+ const auto k_index = 8u + bias_offset;
+ const auto memory_layout_index = 9u + bias_offset;
+ const auto transpose_index = 10u + bias_offset;
+
+ const auto result_type_id = inst->GetOperandAs<uint32_t>(result_type_index);
+ const auto input_id = inst->GetOperandAs<uint32_t>(input_index);
+ const auto input_interpretation_id =
+ inst->GetOperandAs<uint32_t>(input_interpretation_index);
+ const auto matrix_interpretation_id =
+ inst->GetOperandAs<uint32_t>(matrix_interpretation_index);
+ const auto bias_interpretation_id =
+ inst->GetOperandAs<uint32_t>(bias_interpretation_index);
+ const auto m_id = inst->GetOperandAs<uint32_t>(m_index);
+ const auto k_id = inst->GetOperandAs<uint32_t>(k_index);
+ const auto memory_layout_id =
+ inst->GetOperandAs<uint32_t>(memory_layout_index);
+ const auto transpose_id = inst->GetOperandAs<uint32_t>(transpose_index);
+
+ if (auto error = ValidateCooperativeVectorPointer(_, inst, opcode_name,
+ matrix_index)) {
+ return error;
+ }
+
+ if (inst->opcode() == spv::Op::OpCooperativeVectorMatrixMulAddNV) {
+ if (auto error = ValidateCooperativeVectorPointer(_, inst, opcode_name,
+ bias_index)) {
+ return error;
+ }
+ }
+
+ const auto result_type = _.FindDef(result_type_id);
+
+ if (result_type->opcode() != spv::Op::OpTypeCooperativeVectorNV) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " result type <id> " << _.getIdName(result_type_id)
+ << " is not a cooperative vector type.";
+ }
+
+ const auto result_component_type_id = result_type->GetOperandAs<uint32_t>(1u);
+ if (!(_.IsIntScalarType(result_component_type_id) &&
+ _.GetBitWidth(result_component_type_id) == 32) &&
+ !(_.IsFloatScalarType(result_component_type_id) &&
+ (_.GetBitWidth(result_component_type_id) == 32 ||
+ _.GetBitWidth(result_component_type_id) == 16))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " result component type <id> "
+ << _.getIdName(result_component_type_id)
+ << " is not a 32 bit int or 16/32 bit float.";
+ }
+
+ const auto m_eval = _.EvalInt32IfConst(m_id);
+ const auto rc_eval =
+ _.EvalInt32IfConst(result_type->GetOperandAs<uint32_t>(2u));
+ if (get<1>(m_eval) && get<1>(rc_eval) && get<2>(m_eval) != get<2>(rc_eval)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " result type number of components "
+ << get<2>(rc_eval) << " does not match M " << get<2>(m_eval);
+ }
+
+ const auto k_eval = _.EvalInt32IfConst(k_id);
+
+ const auto input = _.FindDef(input_id);
+ const auto input_type = _.FindDef(input->type_id());
+ const auto input_num_components_id = input_type->GetOperandAs<uint32_t>(2u);
+
+ auto input_interp_eval = _.EvalInt32IfConst(input_interpretation_id);
+ if (get<1>(input_interp_eval) &&
+ !InterpretationIsPacked(spv::ComponentType{get<2>(input_interp_eval)})) {
+ const auto inc_eval = _.EvalInt32IfConst(input_num_components_id);
+ if (get<1>(inc_eval) && get<1>(k_eval) &&
+ get<2>(inc_eval) != get<2>(k_eval)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " input number of components "
+ << get<2>(inc_eval) << " does not match K " << get<2>(k_eval);
+ }
+ }
+
+ if (!_.IsBoolScalarType(_.FindDef(transpose_id)->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " Transpose <id> " << _.getIdName(transpose_id)
+ << " is not a scalar boolean.";
+ }
+
+ const auto check_constant = [&](uint32_t id,
+ const char* operand_name) -> spv_result_t {
+ if (!spvOpcodeIsConstant(_.GetIdOpcode(id))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << opcode_name << " " << operand_name << " <id> "
+ << _.getIdName(id) << " is not a constant instruction.";
+ }
+ return SPV_SUCCESS;
+ };
+
+ if (auto error =
+ check_constant(input_interpretation_id, "InputInterpretation")) {
+ return error;
+ }
+ if (auto error =
+ check_constant(matrix_interpretation_id, "MatrixInterpretation")) {
+ return error;
+ }
+ if (has_bias) {
+ if (auto error =
+ check_constant(bias_interpretation_id, "BiasInterpretation")) {
+ return error;
+ }
+ }
+ if (auto error = check_constant(m_id, "M")) {
+ return error;
+ }
+ if (auto error = check_constant(k_id, "K")) {
+ return error;
+ }
+ if (auto error = check_constant(memory_layout_id, "MemoryLayout")) {
+ return error;
+ }
+ if (auto error = check_constant(transpose_id, "Transpose")) {
+ return error;
+ }
+
+ if (auto error = ValidateInt32Operand(_, inst, input_interpretation_index,
+ opcode_name, "InputInterpretation")) {
+ return error;
+ }
+ if (auto error = ValidateInt32Operand(_, inst, matrix_interpretation_index,
+ opcode_name, "MatrixInterpretation")) {
+ return error;
+ }
+ if (has_bias) {
+ if (auto error = ValidateInt32Operand(_, inst, bias_interpretation_index,
+ opcode_name, "BiasInterpretation")) {
+ return error;
+ }
+ }
+ if (auto error = ValidateInt32Operand(_, inst, m_index, opcode_name, "M")) {
+ return error;
+ }
+ if (auto error = ValidateInt32Operand(_, inst, k_index, opcode_name, "K")) {
+ return error;
+ }
+ if (auto error = ValidateInt32Operand(_, inst, memory_layout_index,
+ opcode_name, "MemoryLayout")) {
+ return error;
+ }
+
return SPV_SUCCESS;
}
@@ -1929,16 +2924,42 @@
const auto op1 = _.FindDef(inst->GetOperandAs<uint32_t>(2u));
const auto op2 = _.FindDef(inst->GetOperandAs<uint32_t>(3u));
- if (!op1 || !op2 || op1->type_id() != op2->type_id()) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "The types of Operand 1 and Operand 2 must match";
- }
const auto op1_type = _.FindDef(op1->type_id());
- if (!op1_type || op1_type->opcode() != spv::Op::OpTypePointer) {
+ const auto op2_type = _.FindDef(op2->type_id());
+ if (!op1_type || (op1_type->opcode() != spv::Op::OpTypePointer &&
+ op1_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Operand type must be a pointer";
}
+ if (!op2_type || (op2_type->opcode() != spv::Op::OpTypePointer &&
+ op2_type->opcode() != spv::Op::OpTypeUntypedPointerKHR)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Operand type must be a pointer";
+ }
+
+ if (inst->opcode() == spv::Op::OpPtrDiff) {
+ if (op1->type_id() != op2->type_id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "The types of Operand 1 and Operand 2 must match";
+ }
+ } else {
+ const auto either_untyped =
+ op1_type->opcode() == spv::Op::OpTypeUntypedPointerKHR ||
+ op2_type->opcode() == spv::Op::OpTypeUntypedPointerKHR;
+ if (either_untyped) {
+ const auto sc1 = op1_type->GetOperandAs<spv::StorageClass>(1);
+ const auto sc2 = op2_type->GetOperandAs<spv::StorageClass>(1);
+ if (sc1 != sc2) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Pointer storage classes must match";
+ }
+ } else if (op1->type_id() != op2->type_id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "The types of Operand 1 and Operand 2 must match";
+ }
+ }
+
spv::StorageClass sc = op1_type->GetOperandAs<spv::StorageClass>(1u);
if (_.addressing_model() == spv::AddressingModel::Logical) {
if (sc != spv::StorageClass::Workgroup &&
@@ -1966,6 +2987,7 @@
spv_result_t MemoryPass(ValidationState_t& _, const Instruction* inst) {
switch (inst->opcode()) {
case spv::Op::OpVariable:
+ case spv::Op::OpUntypedVariableKHR:
if (auto error = ValidateVariable(_, inst)) return error;
break;
case spv::Op::OpLoad:
@@ -1979,17 +3001,22 @@
if (auto error = ValidateCopyMemory(_, inst)) return error;
break;
case spv::Op::OpPtrAccessChain:
+ case spv::Op::OpUntypedPtrAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsPtrAccessChainKHR:
if (auto error = ValidatePtrAccessChain(_, inst)) return error;
break;
case spv::Op::OpAccessChain:
case spv::Op::OpInBoundsAccessChain:
case spv::Op::OpInBoundsPtrAccessChain:
+ case spv::Op::OpUntypedAccessChainKHR:
+ case spv::Op::OpUntypedInBoundsAccessChainKHR:
if (auto error = ValidateAccessChain(_, inst)) return error;
break;
case spv::Op::OpRawAccessChainNV:
if (auto error = ValidateRawAccessChain(_, inst)) return error;
break;
case spv::Op::OpArrayLength:
+ case spv::Op::OpUntypedArrayLengthKHR:
if (auto error = ValidateArrayLength(_, inst)) return error;
break;
case spv::Op::OpCooperativeMatrixLoadNV:
@@ -2006,6 +3033,29 @@
if (auto error = ValidateCooperativeMatrixLoadStoreKHR(_, inst))
return error;
break;
+ case spv::Op::OpCooperativeMatrixLoadTensorNV:
+ case spv::Op::OpCooperativeMatrixStoreTensorNV:
+ if (auto error = ValidateCooperativeMatrixLoadStoreTensorNV(_, inst))
+ return error;
+ break;
+ case spv::Op::OpCooperativeVectorLoadNV:
+ case spv::Op::OpCooperativeVectorStoreNV:
+ if (auto error = ValidateCooperativeVectorLoadStoreNV(_, inst))
+ return error;
+ break;
+ case spv::Op::OpCooperativeVectorOuterProductAccumulateNV:
+ if (auto error = ValidateCooperativeVectorOuterProductNV(_, inst))
+ return error;
+ break;
+ case spv::Op::OpCooperativeVectorReduceSumAccumulateNV:
+ if (auto error = ValidateCooperativeVectorReduceSumNV(_, inst))
+ return error;
+ break;
+ case spv::Op::OpCooperativeVectorMatrixMulNV:
+ case spv::Op::OpCooperativeVectorMatrixMulAddNV:
+ if (auto error = ValidateCooperativeVectorMatrixMulNV(_, inst))
+ return error;
+ break;
case spv::Op::OpPtrEqual:
case spv::Op::OpPtrNotEqual:
case spv::Op::OpPtrDiff:
diff --git a/third_party/SPIRV-Tools/source/val/validate_memory_semantics.cpp b/third_party/SPIRV-Tools/source/val/validate_memory_semantics.cpp
index dab7b5a..d94d37d 100644
--- a/third_party/SPIRV-Tools/source/val/validate_memory_semantics.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_memory_semantics.cpp
@@ -66,8 +66,7 @@
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< spvOpcodeString(opcode)
<< ": Memory Semantics can have at most one of the following "
- "bits "
- "set: Acquire, Release, AcquireRelease or "
+ "bits set: Acquire, Release, AcquireRelease or "
"SequentiallyConsistent";
}
@@ -176,10 +175,8 @@
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4732) << spvOpcodeString(opcode)
<< ": Vulkan specification requires Memory Semantics to have "
- "one "
- "of the following bits set: Acquire, Release, "
- "AcquireRelease "
- "or SequentiallyConsistent";
+ "one of the following bits set: Acquire, Release, "
+ "AcquireRelease or SequentiallyConsistent";
} else if (opcode != spv::Op::OpMemoryBarrier &&
num_memory_order_set_bits) {
// should leave only atomics and control barriers for Vulkan env
@@ -203,11 +200,20 @@
"storage class";
}
- if (opcode == spv::Op::OpControlBarrier && value && !includes_storage_class) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4650) << spvOpcodeString(opcode)
- << ": expected Memory Semantics to include a Vulkan-supported "
- "storage class if Memory Semantics is not None";
+ if (opcode == spv::Op::OpControlBarrier && value) {
+ if (!num_memory_order_set_bits) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(10609) << spvOpcodeString(opcode)
+ << ": Vulkan specification requires non-zero Memory Semantics "
+ "to have one of the following bits set: Acquire, Release, "
+ "AcquireRelease or SequentiallyConsistent";
+ }
+ if (!includes_storage_class) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(4650) << spvOpcodeString(opcode)
+ << ": expected Memory Semantics to include a Vulkan-supported "
+ "storage class if Memory Semantics is not None";
+ }
}
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_mesh_shading.cpp b/third_party/SPIRV-Tools/source/val/validate_mesh_shading.cpp
index e569e25..3bd1dbd 100644
--- a/third_party/SPIRV-Tools/source/val/validate_mesh_shading.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_mesh_shading.cpp
@@ -15,6 +15,7 @@
// Validates ray query instructions from SPV_KHR_ray_query
#include "source/opcode.h"
+#include "source/spirv_target_env.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
@@ -22,6 +23,24 @@
namespace spvtools {
namespace val {
+bool IsInterfaceVariable(ValidationState_t& _, const Instruction* inst,
+ spv::ExecutionModel model) {
+ bool foundInterface = false;
+ for (auto entry_point : _.entry_points()) {
+ const auto* models = _.GetExecutionModels(entry_point);
+ if (models->find(model) == models->end()) return false;
+ for (const auto& desc : _.entry_point_descriptions(entry_point)) {
+ for (auto interface : desc.interfaces) {
+ if (inst->id() == interface) {
+ foundInterface = true;
+ break;
+ }
+ }
+ }
+ }
+ return foundInterface;
+}
+
spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst) {
const spv::Op opcode = inst->opcode();
switch (opcode) {
@@ -111,7 +130,37 @@
// No validation rules (for the moment).
break;
}
+ case spv::Op::OpVariable: {
+ if (_.HasCapability(spv::Capability::MeshShadingEXT)) {
+ bool meshInterfaceVar =
+ IsInterfaceVariable(_, inst, spv::ExecutionModel::MeshEXT);
+ bool fragInterfaceVar =
+ IsInterfaceVariable(_, inst, spv::ExecutionModel::Fragment);
+ const spv::StorageClass storage_class =
+ inst->GetOperandAs<spv::StorageClass>(2);
+ bool storage_output = (storage_class == spv::StorageClass::Output);
+ bool storage_input = (storage_class == spv::StorageClass::Input);
+
+ if (_.HasDecoration(inst->id(), spv::Decoration::PerPrimitiveEXT)) {
+ if (fragInterfaceVar && !storage_input) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "PerPrimitiveEXT decoration must be applied only to "
+ "variables in the Input Storage Class in the Fragment "
+ "Execution Model.";
+ }
+
+ if (meshInterfaceVar && !storage_output) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(4336)
+ << "PerPrimitiveEXT decoration must be applied only to "
+ "variables in the Output Storage Class in the "
+ "Storage Class in the MeshEXT Execution Model.";
+ }
+ }
+ }
+ break;
+ }
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_misc.cpp b/third_party/SPIRV-Tools/source/val/validate_misc.cpp
index d71fd2d..a404134 100644
--- a/third_party/SPIRV-Tools/source/val/validate_misc.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_misc.cpp
@@ -50,10 +50,22 @@
bool is_int32 = false, is_const_int32 = false;
uint32_t value = 0;
std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope);
- if (is_const_int32 && spv::Scope(value) != spv::Scope::Subgroup &&
- spv::Scope(value) != spv::Scope::Device) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4652) << "Scope must be Subgroup or Device";
+ if (is_const_int32) {
+ spv::Scope scope_val{value};
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ if (scope_val != spv::Scope::Subgroup &&
+ scope_val != spv::Scope::Device) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(4652) << "Scope must be Subgroup or Device";
+ }
+ } else if (spvIsOpenCLEnv(_.context()->target_env)) {
+ if (scope_val != spv::Scope::Workgroup &&
+ scope_val != spv::Scope::Subgroup &&
+ scope_val != spv::Scope::Device) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Scope must be Subgroup, Workgroup, or Device";
+ }
+ }
}
// Result Type must be a 64 - bit unsigned integer type or
diff --git a/third_party/SPIRV-Tools/source/val/validate_mode_setting.cpp b/third_party/SPIRV-Tools/source/val/validate_mode_setting.cpp
index 8502fda..a5cd8b3 100644
--- a/third_party/SPIRV-Tools/source/val/validate_mode_setting.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_mode_setting.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2018 Google LLC.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,6 +18,7 @@
#include "source/opcode.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
@@ -308,21 +311,124 @@
}
}
}
+ if (!ok && _.HasCapability(spv::Capability::TileShadingQCOM)) {
+ ok =
+ execution_modes &&
+ execution_modes->count(spv::ExecutionMode::TileShadingRateQCOM);
+ }
if (!ok) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(6426)
+ << (_.HasCapability(spv::Capability::TileShadingQCOM)
+ ? _.VkErrorID(10685)
+ : _.VkErrorID(6426))
<< "In the Vulkan environment, GLCompute execution model "
- "entry points require either the LocalSize or "
- "LocalSizeId execution mode or an object decorated with "
- "WorkgroupSize must be specified.";
+ "entry points require either the "
+ << (_.HasCapability(spv::Capability::TileShadingQCOM)
+ ? "TileShadingRateQCOM, "
+ : "")
+ << "LocalSize or LocalSizeId execution mode or an object "
+ "decorated with WorkgroupSize must be specified.";
+ }
+ }
+
+ if (_.HasCapability(spv::Capability::TileShadingQCOM)) {
+ if (execution_modes) {
+ if (execution_modes->count(
+ spv::ExecutionMode::TileShadingRateQCOM) &&
+ (execution_modes->count(spv::ExecutionMode::LocalSize) ||
+ execution_modes->count(spv::ExecutionMode::LocalSizeId))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "If the TileShadingRateQCOM execution mode is used, "
+ << "LocalSize and LocalSizeId must not be specified.";
+ }
+ if (execution_modes->count(
+ spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "The NonCoherentTileAttachmentQCOM execution mode must "
+ "not be used in any stage other than fragment.";
+ }
+ }
+ } else {
+ if (execution_modes &&
+ execution_modes->count(spv::ExecutionMode::TileShadingRateQCOM)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "If the TileShadingRateQCOM execution mode is used, the "
+ "TileShadingQCOM capability must be enabled.";
}
}
break;
default:
+ if (execution_modes &&
+ execution_modes->count(spv::ExecutionMode::TileShadingRateQCOM)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "The TileShadingRateQCOM execution mode must not be used "
+ "in any stage other than compute.";
+ }
+ if (execution_model != spv::ExecutionModel::Fragment) {
+ if (execution_modes &&
+ execution_modes->count(
+ spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "The NonCoherentTileAttachmentQCOM execution mode must "
+ "not be used in any stage other than fragment.";
+ }
+ if (_.HasCapability(spv::Capability::TileShadingQCOM)) {
+ return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst)
+ << "The TileShadingQCOM capability must not be enabled in "
+ "any stage other than compute or fragment.";
+ }
+ } else {
+ if (execution_modes &&
+ execution_modes->count(
+ spv::ExecutionMode::NonCoherentTileAttachmentReadQCOM)) {
+ if (!_.HasCapability(spv::Capability::TileShadingQCOM)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "If the NonCoherentTileAttachmentReadQCOM execution "
+ "mode is used, the TileShadingQCOM capability must be "
+ "enabled.";
+ }
+ }
+ }
break;
}
}
+ if (_.EntryPointHasLocalSizeOrId(entry_point_id)) {
+ const Instruction* local_size_inst =
+ _.EntryPointLocalSizeOrId(entry_point_id);
+ if (local_size_inst) {
+ const auto mode = local_size_inst->GetOperandAs<spv::ExecutionMode>(1);
+ const uint32_t operand_x = local_size_inst->GetOperandAs<uint32_t>(2);
+ const uint32_t operand_y = local_size_inst->GetOperandAs<uint32_t>(3);
+ const uint32_t operand_z = local_size_inst->GetOperandAs<uint32_t>(4);
+ if (mode == spv::ExecutionMode::LocalSize) {
+ if ((operand_x * operand_y * operand_z) == 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, local_size_inst)
+ << "Local Size execution mode must not have a product of zero "
+ "(X "
+ "= "
+ << operand_x << ", Y = " << operand_y << ", Z = " << operand_z
+ << ").";
+ }
+ } else if (mode == spv::ExecutionMode::LocalSizeId) {
+ // can only validate product if static and not spec constant
+ // (This is done for us in EvalConstantValUint64)
+ uint64_t x_size, y_size, z_size;
+ bool static_x = _.EvalConstantValUint64(operand_x, &x_size);
+ bool static_y = _.EvalConstantValUint64(operand_y, &y_size);
+ bool static_z = _.EvalConstantValUint64(operand_z, &z_size);
+ if (static_x && static_y && static_z &&
+ ((x_size * y_size * z_size) == 0)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, local_size_inst)
+ << "Local Size Id execution mode must not have a product of "
+ "zero "
+ "(X = "
+ << x_size << ", Y = " << y_size << ", Z = " << z_size << ").";
+ }
+ }
+ }
+ }
+
return SPV_SUCCESS;
}
@@ -347,6 +453,12 @@
case spv::ExecutionMode::LocalSizeId:
case spv::ExecutionMode::FPFastMathDefault:
case spv::ExecutionMode::MaximumRegistersIdINTEL:
+ case spv::ExecutionMode::IsApiEntryAMDX:
+ case spv::ExecutionMode::MaxNodeRecursionAMDX:
+ case spv::ExecutionMode::MaxNumWorkgroupsAMDX:
+ case spv::ExecutionMode::ShaderIndexAMDX:
+ case spv::ExecutionMode::SharesInputWithAMDX:
+ case spv::ExecutionMode::StaticNumWorkgroupsAMDX:
valid_mode = true;
break;
default:
@@ -368,6 +480,12 @@
case spv::ExecutionMode::SubgroupsPerWorkgroupId:
case spv::ExecutionMode::LocalSizeHintId:
case spv::ExecutionMode::LocalSizeId:
+ case spv::ExecutionMode::IsApiEntryAMDX:
+ case spv::ExecutionMode::MaxNodeRecursionAMDX:
+ case spv::ExecutionMode::MaxNumWorkgroupsAMDX:
+ case spv::ExecutionMode::ShaderIndexAMDX:
+ case spv::ExecutionMode::SharesInputWithAMDX:
+ case spv::ExecutionMode::StaticNumWorkgroupsAMDX:
if (!spvOpcodeIsConstant(operand_inst->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "For OpExecutionModeId all Extra Operand ids must be "
@@ -426,13 +544,20 @@
} else if (mode == spv::ExecutionMode::SubgroupsPerWorkgroupId ||
mode == spv::ExecutionMode::LocalSizeHintId ||
mode == spv::ExecutionMode::LocalSizeId ||
- mode == spv::ExecutionMode::FPFastMathDefault) {
+ mode == spv::ExecutionMode::FPFastMathDefault ||
+ mode == spv::ExecutionMode::IsApiEntryAMDX ||
+ mode == spv::ExecutionMode::MaxNodeRecursionAMDX ||
+ mode == spv::ExecutionMode::MaxNumWorkgroupsAMDX ||
+ mode == spv::ExecutionMode::ShaderIndexAMDX ||
+ mode == spv::ExecutionMode::SharesInputWithAMDX ||
+ mode == spv::ExecutionMode::StaticNumWorkgroupsAMDX) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "OpExecutionMode is only valid when the Mode operand is an "
"execution mode that takes no Extra Operands, or takes Extra "
"Operands that are not id operands.";
}
+ const bool is_vulkan_env = (spvIsVulkanEnv(_.context()->target_env));
const auto* models = _.GetExecutionModels(entry_point_id);
switch (mode) {
case spv::ExecutionMode::Invocations:
@@ -543,6 +668,15 @@
"tessellation execution model.";
}
}
+ if (is_vulkan_env) {
+ if (_.HasCapability(spv::Capability::MeshShadingEXT) &&
+ inst->GetOperandAs<uint32_t>(2) == 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(7330)
+ << "In mesh shaders using the MeshEXT Execution Model the "
+ "OutputVertices Execution Mode must be greater than 0";
+ }
+ }
break;
case spv::ExecutionMode::OutputLinesEXT:
case spv::ExecutionMode::OutputTrianglesEXT:
@@ -557,6 +691,15 @@
"execution "
"model.";
}
+ if (mode == spv::ExecutionMode::OutputPrimitivesEXT && is_vulkan_env) {
+ if (_.HasCapability(spv::Capability::MeshShadingEXT) &&
+ inst->GetOperandAs<uint32_t>(2) == 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(7331)
+ << "In mesh shaders using the MeshEXT Execution Model the "
+ "OutputPrimitivesEXT Execution Mode must be greater than 0";
+ }
+ }
break;
case spv::ExecutionMode::QuadDerivativesKHR:
if (!std::all_of(models->begin(), models->end(),
@@ -618,9 +761,15 @@
break;
case spv::ExecutionMode::LocalSize:
case spv::ExecutionMode::LocalSizeId:
- if (mode == spv::ExecutionMode::LocalSizeId && !_.IsLocalSizeIdAllowed())
+ if (mode == spv::ExecutionMode::LocalSizeId &&
+ !_.IsLocalSizeIdAllowed()) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "LocalSizeId mode is not allowed by the current environment.";
+ << "LocalSizeId mode is not allowed by the current environment."
+ << (is_vulkan_env
+ ? _.MissingFeature("maintenance4 feature",
+ "--allow-localsizeid", false)
+ : "");
+ }
if (!std::all_of(
models->begin(), models->end(),
@@ -669,7 +818,7 @@
}
}
- if (spvIsVulkanEnv(_.context()->target_env)) {
+ if (is_vulkan_env) {
if (mode == spv::ExecutionMode::OriginLowerLeft) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4653)
@@ -682,6 +831,14 @@
<< "In the Vulkan environment, the PixelCenterInteger execution "
"mode must not be used.";
}
+ if (mode == spv::ExecutionMode::TileShadingRateQCOM) {
+ const auto rateX = inst->GetOperandAs<int>(2);
+ const auto rateY = inst->GetOperandAs<int>(3);
+ if ((rateX & (rateX - 1)) != 0 || (rateY & (rateY - 1)) != 0)
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "The TileShadingRateQCOM execution mode's x and y values "
+ "must be powers of 2.";
+ }
}
return SPV_SUCCESS;
@@ -743,6 +900,20 @@
}
}
+spv_result_t ValidateCapability(ValidationState_t& _, const Instruction* inst) {
+ auto cap = inst->GetOperandAs<spv::Capability>(0);
+ if (cap == spv::Capability::CooperativeMatrixKHR) {
+ if (_.HasCapability(spv::Capability::Shader) &&
+ !_.HasCapability(spv::Capability::VulkanMemoryModel)) {
+ return _.diag(SPV_ERROR_INVALID_CAPABILITY, inst)
+ << "If the Shader and CooperativeMatrixKHR capabilities are "
+ "declared, the VulkanMemoryModel capability must also be "
+ "declared";
+ }
+ }
+ return SPV_SUCCESS;
+}
+
} // namespace
spv_result_t ValidateFloatControls2(ValidationState_t& _) {
@@ -821,6 +992,9 @@
case spv::Op::OpMemoryModel:
if (auto error = ValidateMemoryModel(_, inst)) return error;
break;
+ case spv::Op::OpCapability:
+ if (auto error = ValidateCapability(_, inst)) return error;
+ break;
default:
break;
}
@@ -833,12 +1007,12 @@
std::set<PerEntryKey> seen_per_entry;
std::set<PerOperandKey> seen_per_operand;
- const auto lookupMode = [&_](spv::ExecutionMode mode) -> std::string {
- spv_operand_desc desc = nullptr;
- if (_.grammar().lookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODE,
- static_cast<uint32_t>(mode),
- &desc) == SPV_SUCCESS) {
- return std::string(desc->name);
+ const auto lookupMode = [](spv::ExecutionMode mode) -> std::string {
+ const spvtools::OperandDesc* desc = nullptr;
+ if (spvtools::LookupOperand(SPV_OPERAND_TYPE_EXECUTION_MODE,
+ static_cast<uint32_t>(mode),
+ &desc) == SPV_SUCCESS) {
+ return std::string(desc->name().data());
}
return "Unknown";
};
diff --git a/third_party/SPIRV-Tools/source/val/validate_non_uniform.cpp b/third_party/SPIRV-Tools/source/val/validate_non_uniform.cpp
index 75967d2..fd422a5 100644
--- a/third_party/SPIRV-Tools/source/val/validate_non_uniform.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_non_uniform.cpp
@@ -390,9 +390,8 @@
if (inst->words().size() > 6) {
const uint32_t cluster_size_op_id = inst->GetOperandAs<uint32_t>(5);
const Instruction* cluster_size_inst = _.FindDef(cluster_size_op_id);
- const uint32_t cluster_size_type =
- cluster_size_inst ? cluster_size_inst->type_id() : 0;
- if (!_.IsUnsignedIntScalarType(cluster_size_type)) {
+ if (!cluster_size_inst ||
+ !_.IsUnsignedIntScalarType(cluster_size_inst->type_id())) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "ClusterSize must be a scalar of integer type, whose "
"Signedness operand is 0.";
diff --git a/third_party/SPIRV-Tools/source/val/validate_ray_query.cpp b/third_party/SPIRV-Tools/source/val/validate_ray_query.cpp
index 9b67fc9..bd790ac 100644
--- a/third_party/SPIRV-Tools/source/val/validate_ray_query.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_ray_query.cpp
@@ -23,6 +23,17 @@
namespace val {
namespace {
+uint32_t GetArrayLength(ValidationState_t& _, const Instruction* array_type) {
+ assert(array_type->opcode() == spv::Op::OpTypeArray);
+ uint32_t const_int_id = array_type->GetOperandAs<uint32_t>(2U);
+ Instruction* array_length_inst = _.FindDef(const_int_id);
+ uint32_t array_length = 0;
+ if (array_length_inst->opcode() == spv::Op::OpConstant) {
+ array_length = array_length_inst->GetOperandAs<uint32_t>(2);
+ }
+ return array_length;
+}
+
spv_result_t ValidateRayQueryPointer(ValidationState_t& _,
const Instruction* inst,
uint32_t ray_query_index) {
@@ -263,6 +274,89 @@
break;
}
+ case spv::Op::OpRayQueryGetClusterIdNV: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ if (!_.IsIntScalarType(result_type) || _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit int scalar type";
+ }
+ break;
+ }
+
+ case spv::Op::OpRayQueryGetIntersectionSpherePositionNV: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ if (!_.IsFloatVectorType(result_type) ||
+ _.GetDimension(result_type) != 3 ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit float 3-component "
+ "vector type";
+ }
+ break;
+ }
+
+ case spv::Op::OpRayQueryGetIntersectionLSSPositionsNV: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ auto result_id = _.FindDef(result_type);
+ if ((result_id->opcode() != spv::Op::OpTypeArray) ||
+ (GetArrayLength(_, result_id) != 2) ||
+ !_.IsFloatVectorType(_.GetComponentType(result_type)) ||
+ _.GetDimension(_.GetComponentType(result_type)) != 3) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 2 element array of 32-bit 3 component float point "
+ "vector as Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpRayQueryGetIntersectionLSSRadiiNV: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ if (!_.IsFloatArrayType(result_type) ||
+ (GetArrayLength(_, _.FindDef(result_type)) != 2) ||
+ !_.IsFloatScalarType(_.GetComponentType(result_type))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 32-bit floating point scalar as Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpRayQueryGetIntersectionSphereRadiusNV:
+ case spv::Op::OpRayQueryGetIntersectionLSSHitValueNV: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ if (!_.IsFloatScalarType(result_type) ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit floating point "
+ "scalar type";
+ }
+ break;
+ }
+
+ case spv::Op::OpRayQueryIsSphereHitNV:
+ case spv::Op::OpRayQueryIsLSSHitNV: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ if (!_.IsBoolScalarType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be Boolean "
+ "scalar type";
+ }
+
+ break;
+ }
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validate_ray_tracing_reorder.cpp b/third_party/SPIRV-Tools/source/val/validate_ray_tracing_reorder.cpp
index cb190f9..3685a76 100644
--- a/third_party/SPIRV-Tools/source/val/validate_ray_tracing_reorder.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_ray_tracing_reorder.cpp
@@ -26,6 +26,17 @@
static const uint32_t KRayParamInvalidId = std::numeric_limits<uint32_t>::max();
+uint32_t GetArrayLength(ValidationState_t& _, const Instruction* array_type) {
+ assert(array_type->opcode() == spv::Op::OpTypeArray);
+ uint32_t const_int_id = array_type->GetOperandAs<uint32_t>(2U);
+ Instruction* array_length_inst = _.FindDef(const_int_id);
+ uint32_t array_length = 0;
+ if (array_length_inst->opcode() == spv::Op::OpConstant) {
+ array_length = array_length_inst->GetOperandAs<uint32_t>(2);
+ }
+ return array_length;
+}
+
spv_result_t ValidateHitObjectPointer(ValidationState_t& _,
const Instruction* inst,
uint32_t hit_object_index) {
@@ -614,6 +625,102 @@
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "bits must be a 32-bit int scalar";
}
+ break;
+ }
+
+ case spv::Op::OpHitObjectGetClusterIdNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ if (!_.IsIntScalarType(result_type) || _.GetBitWidth(result_type) != 32)
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 32-bit integer type scalar as Result Type: "
+ << spvOpcodeString(opcode);
+ break;
+ }
+
+ case spv::Op::OpHitObjectGetSpherePositionNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ if (!_.IsFloatVectorType(result_type) ||
+ _.GetDimension(result_type) != 3 ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 32-bit floating point 2 component vector type as "
+ "Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpHitObjectGetSphereRadiusNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ if (!_.IsFloatScalarType(result_type) ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 32-bit floating point scalar as Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpHitObjectGetLSSPositionsNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ auto result_id = _.FindDef(result_type);
+ if ((result_id->opcode() != spv::Op::OpTypeArray) ||
+ (GetArrayLength(_, result_id) != 2) ||
+ !_.IsFloatVectorType(_.GetComponentType(result_type)) ||
+ _.GetDimension(_.GetComponentType(result_type)) != 3) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 2 element array of 32-bit 3 component float point "
+ "vector as Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpHitObjectGetLSSRadiiNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ if (!_.IsFloatArrayType(result_type) ||
+ (GetArrayLength(_, _.FindDef(result_type)) != 2) ||
+ !_.IsFloatScalarType(_.GetComponentType(result_type))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 2 element array of 32-bit floating point scalar as "
+ "Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpHitObjectIsSphereHitNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ if (!_.IsBoolScalarType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Boolean scalar as Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
+ }
+
+ case spv::Op::OpHitObjectIsLSSHitNV: {
+ RegisterOpcodeForValidModel(_, inst);
+ if (auto error = ValidateHitObjectPointer(_, inst, 2)) return error;
+
+ if (!_.IsBoolScalarType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Boolean scalar as Result Type: "
+ << spvOpcodeString(opcode);
+ }
+ break;
}
default:
diff --git a/third_party/SPIRV-Tools/source/val/validate_tensor.cpp b/third_party/SPIRV-Tools/source/val/validate_tensor.cpp
new file mode 100644
index 0000000..0b54129
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/val/validate_tensor.cpp
@@ -0,0 +1,250 @@
+// Copyright (c) 2023-2025 Arm Ltd.
+//
+// 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.
+
+// Validates correctness of tensor instructions.
+
+#include "source/opcode.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+bool IsRankedTensor(ValidationState_t& _, uint32_t id) {
+ auto inst = _.FindDef(id);
+ if (!inst || inst->opcode() != spv::Op::OpTypeTensorARM ||
+ inst->words().size() <= 3) {
+ return false;
+ }
+ return true;
+}
+
+uint64_t GetTensorTypeRank(ValidationState_t& _, uint32_t id) {
+ auto inst = _.FindDef(id);
+ if (!inst || inst->opcode() != spv::Op::OpTypeTensorARM ||
+ inst->words().size() <= 3) {
+ return 0;
+ }
+ uint64_t rank = 0;
+ if (!_.EvalConstantValUint64(inst->word(3), &rank)) {
+ return 0;
+ }
+ return rank;
+}
+
+bool IsScalarTypeOrOrArrayOfScalarType(ValidationState_t& _, uint32_t id) {
+ auto inst = _.FindDef(id);
+ if (!inst) {
+ return false;
+ }
+ return _.IsScalarType(id) || (inst->opcode() == spv::Op::OpTypeArray &&
+ _.IsScalarType(inst->word(2)));
+}
+
+spv_result_t ValidateTensorRead(ValidationState_t& _, const Instruction* inst) {
+ // Result Type must be a scalar type or array of scalar type.
+ if (!IsScalarTypeOrOrArrayOfScalarType(_, inst->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Result Type to be a scalar type or array of "
+ "scalar type.";
+ }
+
+ // Tensor must be a Ranked Tensor.
+ auto op_tensor = inst->word(3);
+ auto inst_tensor = _.FindDef(op_tensor);
+ if (!inst_tensor || !IsRankedTensor(_, inst_tensor->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Tensor to be an OpTypeTensorARM whose Rank is "
+ "specified";
+ }
+
+ // The scalar type must be the same as the Element Type of Tensor.
+ if (_.GetComponentType(inst_tensor->type_id()) !=
+ _.GetComponentType(inst->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Result Type to be the same as the Element Type of "
+ "Tensor.";
+ }
+
+ // Coordinates is an array whose Element Type must be an integer type and
+ // whose Length must be equal to the Rank of Tensor.
+ auto op_coord = inst->word(4);
+ auto inst_coord = _.FindDef(op_coord);
+ auto tensor_rank = GetTensorTypeRank(_, inst_tensor->type_id());
+ if (!_.IsIntArrayType(inst_coord->type_id(), tensor_rank)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor.";
+ }
+
+ // Validate Tensor Operands
+ if (inst->words().size() > 5) {
+ auto toperands = static_cast<spv::TensorOperandsMask>(inst->word(5));
+ if ((toperands & spv::TensorOperandsMask::OutOfBoundsValueARM) !=
+ spv::TensorOperandsMask::MaskNone) {
+ if (inst->words().size() < 7) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "A value must be provided after the OutOfBoundsValueARM "
+ "Tensor Operand.";
+ }
+ auto op_oobval = inst->word(6);
+ auto inst_oobval = _.FindDef(op_oobval);
+ if (_.GetComponentType(inst_tensor->type_id()) !=
+ _.GetComponentType(inst_oobval->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Expected the type of the OutOfBoundsValueARM value to be "
+ "the same "
+ "as the Element Type of Tensor.";
+ }
+ }
+ if ((toperands & spv::TensorOperandsMask::MakeElementAvailableARM) !=
+ spv::TensorOperandsMask::MaskNone) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "MakeElementAvailableARM cannot be used with OpTensorReadARM.";
+ }
+ if (((toperands & spv::TensorOperandsMask::MakeElementVisibleARM) !=
+ spv::TensorOperandsMask::MaskNone) &&
+ ((toperands & spv::TensorOperandsMask::NonPrivateElementARM) ==
+ spv::TensorOperandsMask::MaskNone)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "MakeElementAvailableARM requires NonPrivateElementARM.";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTensorWrite(ValidationState_t& _,
+ const Instruction* inst) {
+ // Tensor must be a Ranked Tensor.
+ auto op_tensor = inst->word(1);
+ auto inst_tensor = _.FindDef(op_tensor);
+ if (!IsRankedTensor(_, inst_tensor->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Tensor to be an OpTypeTensorARM whose Rank is "
+ "specified";
+ }
+
+ // Coordinates is an array whose Element Type must be an integer type and
+ // whose Length must be equal to the Rank of Tensor.
+ auto op_coord = inst->word(2);
+ auto inst_coord = _.FindDef(op_coord);
+ auto tensor_rank = GetTensorTypeRank(_, inst_tensor->type_id());
+ if (!_.IsIntArrayType(inst_coord->type_id(), tensor_rank)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor.";
+ }
+
+ // Object must be an object of scalar type or array of scalar type.
+ // The scalar type must be the same as the Element Type of Tensor.
+ auto op_object = inst->word(3);
+ auto inst_object = _.FindDef(op_object);
+ if (!IsScalarTypeOrOrArrayOfScalarType(_, inst_object->type_id()) ||
+ (_.GetComponentType(inst_object->type_id()) !=
+ _.GetComponentType(inst_tensor->type_id()))) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Object to be a scalar type or array of scalar "
+ "type that is the same as the Element Type of Tensor.";
+ }
+
+ // Validate Tensor Operands
+ if (inst->words().size() > 5) {
+ auto toperands = static_cast<spv::TensorOperandsMask>(inst->word(4));
+ if ((toperands & spv::TensorOperandsMask::OutOfBoundsValueARM) !=
+ spv::TensorOperandsMask::MaskNone) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "OutOfBoundsValue Tensor Operand not allowed with "
+ "OpTensorWriteARM.";
+ }
+ if ((toperands & spv::TensorOperandsMask::MakeElementVisibleARM) !=
+ spv::TensorOperandsMask::MaskNone) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "MakeElementVisibleARM not allowed with OpTensorWriteARM.";
+ }
+ if (((toperands & spv::TensorOperandsMask::MakeElementAvailableARM) !=
+ spv::TensorOperandsMask::MaskNone) &&
+ ((toperands & spv::TensorOperandsMask::NonPrivateElementARM) ==
+ spv::TensorOperandsMask::MaskNone)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "MakeElementAvailableARM requires NonPrivateElementARM.";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTensorQuerySize(ValidationState_t& _,
+ const Instruction* inst) {
+ // Check result type
+ if (!_.IsIntScalarType(inst->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Result Type to be an integer type scalar";
+ }
+
+ // Check Tensor operand
+ auto op_tensor = inst->word(3);
+ auto inst_tensor = _.FindDef(op_tensor);
+ if (!inst_tensor || !IsRankedTensor(_, inst_tensor->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Tensor to be an OpTypeTensorARM whose Rank is "
+ "specified";
+ }
+
+ // Check Dimension operand
+ auto op_dim = inst->word(4);
+ auto inst_dim = _.FindDef(op_dim);
+ if (!spvOpcodeIsConstant(inst_dim->opcode()) ||
+ !_.IsIntScalarType(inst_dim->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Dimension must come from a constant instruction of scalar "
+ "integer type.";
+ }
+
+ auto inst_tensor_type = _.FindDef(inst_tensor->type_id());
+ auto op_tensor_rank = inst_tensor_type->word(3);
+ uint64_t tensor_rank = 0;
+ uint64_t dim;
+ if (_.EvalConstantValUint64(op_tensor_rank, &tensor_rank) &&
+ _.EvalConstantValUint64(op_dim, &dim) && (dim >= tensor_rank)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Dimension (" << dim << ") must be less than the Rank of Tensor ("
+ << tensor_rank << ").";
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace
+
+// Validates correctness of tensor instructions.
+spv_result_t TensorPass(ValidationState_t& _, const Instruction* inst) {
+ (void)_;
+ const spv::Op opcode = inst->opcode();
+ switch (opcode) {
+ case spv::Op::OpTensorReadARM:
+ return ValidateTensorRead(_, inst);
+ case spv::Op::OpTensorWriteARM:
+ return ValidateTensorWrite(_, inst);
+ case spv::Op::OpTensorQuerySizeARM:
+ return ValidateTensorQuerySize(_, inst);
+ default:
+ break;
+ }
+ return SPV_SUCCESS;
+}
+
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/val/validate_tensor_layout.cpp b/third_party/SPIRV-Tools/source/val/validate_tensor_layout.cpp
new file mode 100644
index 0000000..35c766b
--- /dev/null
+++ b/third_party/SPIRV-Tools/source/val/validate_tensor_layout.cpp
@@ -0,0 +1,184 @@
+// Copyright (c) 2024 NVIDIA Corporation
+//
+// 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.
+
+// Validate instructions that manipulate tensor layout and view objects
+
+#include "source/opcode.h"
+#include "source/spirv_target_env.h"
+#include "source/val/instruction.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+spv_result_t ValidateTensorLayoutResultTypeNV(ValidationState_t& _,
+ const Instruction* inst) {
+ const auto result_type_index = 0;
+ const auto result_type_id = inst->GetOperandAs<uint32_t>(result_type_index);
+ const auto result_type = _.FindDef(result_type_id);
+
+ if (!result_type || spv::Op::OpTypeTensorLayoutNV != result_type->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Result Type <id> "
+ << _.getIdName(result_type_id) << " is not a tensor layout type.";
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTensorViewResultTypeNV(ValidationState_t& _,
+ const Instruction* inst) {
+ const auto result_type_index = 0;
+ const auto result_type_id = inst->GetOperandAs<uint32_t>(result_type_index);
+ const auto result_type = _.FindDef(result_type_id);
+
+ if (!result_type || spv::Op::OpTypeTensorViewNV != result_type->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Result Type <id> "
+ << _.getIdName(result_type_id) << " is not a tensor view type.";
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateCreateTensorLayoutNV(ValidationState_t& _,
+ const Instruction* inst) {
+ if (auto error = ValidateTensorLayoutResultTypeNV(_, inst)) return error;
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateCreateTensorViewNV(ValidationState_t& _,
+ const Instruction* inst) {
+ if (auto error = ValidateTensorViewResultTypeNV(_, inst)) return error;
+
+ return SPV_SUCCESS;
+}
+
+enum ExpectedNumValues {
+ DIM,
+ DIMx2,
+ ONE,
+ FOUR,
+};
+
+spv_result_t ValidateTensorTypeWithDimValuesNV(ValidationState_t& _,
+ const Instruction* inst,
+ ExpectedNumValues expected,
+ bool is_view) {
+ std::string type_str;
+ if (is_view) {
+ if (auto error = ValidateTensorViewResultTypeNV(_, inst)) return error;
+ type_str = "TensorView";
+ } else {
+ if (auto error = ValidateTensorLayoutResultTypeNV(_, inst)) return error;
+ type_str = "TensorLayout";
+ }
+
+ const auto result_type_id = inst->GetOperandAs<uint32_t>(0);
+ const auto tensor_id = inst->GetOperandAs<uint32_t>(2);
+ const auto tensor = _.FindDef(tensor_id);
+ if (!tensor || result_type_id != tensor->type_id()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Result Type <id> "
+ << _.getIdName(result_type_id) << " does not match " << type_str
+ << " type.";
+ }
+
+ const auto num_values = inst->operands().size() - 3;
+
+ const auto result_type = _.FindDef(result_type_id);
+ const auto dim_index = 1;
+ const auto dim_id = result_type->GetOperandAs<uint32_t>(dim_index);
+ uint64_t dim_value;
+ if (_.EvalConstantValUint64(dim_id, &dim_value)) {
+ uint64_t expected_num_values = 0;
+ switch (expected) {
+ case DIM:
+ expected_num_values = dim_value;
+ break;
+ case DIMx2:
+ expected_num_values = dim_value * 2;
+ break;
+ case ONE:
+ expected_num_values = 1;
+ break;
+ case FOUR:
+ expected_num_values = 4;
+ break;
+ }
+
+ if (num_values != expected_num_values) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode())
+ << " unexpected number of operands.";
+ }
+ }
+
+ for (uint32_t i = 0; i < num_values; ++i) {
+ const auto val_id = inst->GetOperandAs<uint32_t>(i + 3);
+ const auto val = _.FindDef(val_id);
+ if (!val || !_.IsIntScalarType(val->type_id()) ||
+ _.GetBitWidth(val->type_id()) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " operand <id> "
+ << _.getIdName(val_id) << " is not a 32-bit integer.";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace
+
+spv_result_t TensorLayoutPass(ValidationState_t& _, const Instruction* inst) {
+ switch (inst->opcode()) {
+ case spv::Op::OpCreateTensorLayoutNV:
+ if (auto error = ValidateCreateTensorLayoutNV(_, inst)) return error;
+ break;
+ case spv::Op::OpCreateTensorViewNV:
+ if (auto error = ValidateCreateTensorViewNV(_, inst)) return error;
+ break;
+ case spv::Op::OpTensorLayoutSetBlockSizeNV:
+ case spv::Op::OpTensorLayoutSetDimensionNV:
+ case spv::Op::OpTensorLayoutSetStrideNV:
+ if (auto error = ValidateTensorTypeWithDimValuesNV(_, inst, DIM, false))
+ return error;
+ break;
+ case spv::Op::OpTensorLayoutSliceNV:
+ if (auto error = ValidateTensorTypeWithDimValuesNV(_, inst, DIMx2, false))
+ return error;
+ break;
+ case spv::Op::OpTensorLayoutSetClampValueNV:
+ if (auto error = ValidateTensorTypeWithDimValuesNV(_, inst, ONE, false))
+ return error;
+ break;
+ case spv::Op::OpTensorViewSetDimensionNV:
+ case spv::Op::OpTensorViewSetStrideNV:
+ if (auto error = ValidateTensorTypeWithDimValuesNV(_, inst, DIM, true))
+ return error;
+ break;
+ case spv::Op::OpTensorViewSetClipNV:
+ if (auto error = ValidateTensorTypeWithDimValuesNV(_, inst, FOUR, true))
+ return error;
+ break;
+ default:
+ break;
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/source/val/validate_type.cpp b/third_party/SPIRV-Tools/source/val/validate_type.cpp
index cb26a52..786a224 100644
--- a/third_party/SPIRV-Tools/source/val/validate_type.cpp
+++ b/third_party/SPIRV-Tools/source/val/validate_type.cpp
@@ -1,4 +1,7 @@
// Copyright (c) 2018 Google LLC.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
+// Copyright (c) 2024 NVIDIA Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -35,7 +38,9 @@
const auto opcode = inst->opcode();
if (opcode != spv::Op::OpTypeArray && opcode != spv::Op::OpTypeRuntimeArray &&
+ opcode != spv::Op::OpTypeNodePayloadArrayAMDX &&
opcode != spv::Op::OpTypeStruct && opcode != spv::Op::OpTypePointer &&
+ opcode != spv::Op::OpTypeUntypedPointerKHR &&
!_.RegisterUniqueTypeDeclaration(inst)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Duplicate non-aggregate type declarations are not allowed. "
@@ -107,11 +112,16 @@
// Int8, Int16, and Int64 capabilities allow using 8-bit, 16-bit, and 64-bit
// integers, respectively.
auto num_bits = inst->GetOperandAs<const uint32_t>(1);
+ const bool has_encoding = inst->operands().size() > 2;
if (num_bits == 32) {
return SPV_SUCCESS;
}
+ auto operands = inst->words();
+
if (num_bits == 16) {
- if (_.features().declare_float16_type) {
+ // An absence of FP encoding implies IEEE 754. The Float16 and Float16Buffer
+ // capabilities only enable IEEE 754 binary 16
+ if (has_encoding || _.features().declare_float16_type) {
return SPV_SUCCESS;
}
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -119,6 +129,32 @@
<< "type requires the Float16 or Float16Buffer capability,"
" or an extension that explicitly enables 16-bit floating point.";
}
+ if (num_bits == 8) {
+ if (!_.features().declare_float8_type) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Using a 8-bit floating point "
+ << "type requires the Float8EXT capability.";
+ }
+ if (!has_encoding) {
+ // we don't support fp8 without encoding
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "8-bit floating point type requires an encoding.";
+ }
+ const spvtools::OperandDesc* desc = nullptr;
+ const std::set<spv::FPEncoding> known_encodings{
+ spv::FPEncoding::Float8E4M3EXT, spv::FPEncoding::Float8E5M2EXT};
+ spv_result_t status = spvtools::LookupOperand(SPV_OPERAND_TYPE_FPENCODING,
+ inst->words()[3], &desc);
+ if ((status != SPV_SUCCESS) ||
+ (known_encodings.find(static_cast<spv::FPEncoding>(desc->value)) ==
+ known_encodings.end())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Unsupported 8-bit floating point encoding ("
+ << desc->name().data() << ").";
+ }
+
+ return SPV_SUCCESS;
+ }
if (num_bits == 64) {
if (_.HasCapability(spv::Capability::Float64)) {
return SPV_SUCCESS;
@@ -135,7 +171,24 @@
const auto component_index = 1;
const auto component_id = inst->GetOperandAs<uint32_t>(component_index);
const auto component_type = _.FindDef(component_id);
- if (!component_type || !spvOpcodeIsScalarType(component_type->opcode())) {
+ if (component_type) {
+ bool isPointer = component_type->opcode() == spv::Op::OpTypePointer;
+ bool isScalar = spvOpcodeIsScalarType(component_type->opcode());
+
+ if (_.HasCapability(spv::Capability::MaskedGatherScatterINTEL) &&
+ !isPointer && !isScalar) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Invalid OpTypeVector Component Type<id> "
+ << _.getIdName(component_id)
+ << ": Expected a scalar or pointer type when using the "
+ "SPV_INTEL_masked_gather_scatter extension.";
+ } else if (!_.HasCapability(spv::Capability::MaskedGatherScatterINTEL) &&
+ !isScalar) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeVector Component Type <id> " << _.getIdName(component_id)
+ << " is not a scalar type.";
+ }
+ } else {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpTypeVector Component Type <id> " << _.getIdName(component_id)
<< " is not a scalar type.";
@@ -164,6 +217,57 @@
return SPV_SUCCESS;
}
+spv_result_t ValidateTypeCooperativeVectorNV(ValidationState_t& _,
+ const Instruction* inst) {
+ const auto component_index = 1;
+ const auto component_type_id = inst->GetOperandAs<uint32_t>(component_index);
+ const auto component_type = _.FindDef(component_type_id);
+ if (!component_type || (spv::Op::OpTypeFloat != component_type->opcode() &&
+ spv::Op::OpTypeInt != component_type->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeVectorNV Component Type <id> "
+ << _.getIdName(component_type_id)
+ << " is not a scalar numerical type.";
+ }
+
+ const auto num_components_index = 2;
+ const auto num_components_id =
+ inst->GetOperandAs<uint32_t>(num_components_index);
+ const auto num_components = _.FindDef(num_components_id);
+ if (!num_components || !spvOpcodeIsConstant(num_components->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeVectorNV component count <id> "
+ << _.getIdName(num_components_id)
+ << " is not a scalar constant type.";
+ }
+
+ // NOTE: Check the initialiser value of the constant
+ const auto const_inst = num_components->words();
+ const auto const_result_type_index = 1;
+ const auto const_result_type = _.FindDef(const_inst[const_result_type_index]);
+ if (!const_result_type || spv::Op::OpTypeInt != const_result_type->opcode()) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeVectorNV component count <id> "
+ << _.getIdName(num_components_id)
+ << " is not a constant integer type.";
+ }
+
+ int64_t num_components_value;
+ if (_.EvalConstantValInt64(num_components_id, &num_components_value)) {
+ auto& type_words = const_result_type->words();
+ const bool is_signed = type_words[3] > 0;
+ if (num_components_value == 0 || (num_components_value < 0 && is_signed)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeVectorNV component count <id> "
+ << _.getIdName(num_components_id)
+ << " default value must be at least 1: found "
+ << num_components_value;
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
spv_result_t ValidateTypeMatrix(ValidationState_t& _, const Instruction* inst) {
const auto column_type_index = 1;
const auto column_type_id = inst->GetOperandAs<uint32_t>(column_type_index);
@@ -210,6 +314,18 @@
<< " is a void type.";
}
+ if (_.HasCapability(spv::Capability::Shader)) {
+ if (element_type->opcode() == spv::Op::OpTypeStruct &&
+ (_.HasDecoration(element_type->id(), spv::Decoration::Block) ||
+ _.HasDecoration(element_type->id(), spv::Decoration::BufferBlock))) {
+ if (_.HasDecoration(inst->id(), spv::Decoration::ArrayStride)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Array containing a Block or BufferBlock must not be "
+ "decorated with ArrayStride";
+ }
+ }
+ }
+
if (spvIsVulkanEnv(_.context()->target_env) &&
element_type->opcode() == spv::Op::OpTypeRuntimeArray) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -268,6 +384,18 @@
<< " is a void type.";
}
+ if (_.HasCapability(spv::Capability::Shader)) {
+ if (element_type->opcode() == spv::Op::OpTypeStruct &&
+ (_.HasDecoration(element_type->id(), spv::Decoration::Block) ||
+ _.HasDecoration(element_type->id(), spv::Decoration::BufferBlock))) {
+ if (_.HasDecoration(inst->id(), spv::Decoration::ArrayStride)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Array containing a Block or BufferBlock must not be "
+ "decorated with ArrayStride";
+ }
+ }
+ }
+
if (spvIsVulkanEnv(_.context()->target_env) &&
element_type->opcode() == spv::Op::OpTypeRuntimeArray) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -305,10 +433,9 @@
<< "Structure <id> " << _.getIdName(member_type_id)
<< " contains members with BuiltIn decoration. Therefore this "
<< "structure may not be contained as a member of another "
- << "structure "
- << "type. Structure <id> " << _.getIdName(struct_id)
- << " contains structure <id> " << _.getIdName(member_type_id)
- << ".";
+ << "structure " << "type. Structure <id> "
+ << _.getIdName(struct_id) << " contains structure <id> "
+ << _.getIdName(member_type_id) << ".";
}
if (spvIsVulkanEnv(_.context()->target_env) &&
@@ -338,13 +465,20 @@
// Struct members start at word 2 of OpTypeStruct instruction.
for (size_t word_i = 2; word_i < inst->words().size(); ++word_i) {
auto member = inst->word(word_i);
- auto memberTypeInstr = _.FindDef(member);
- if (memberTypeInstr && spv::Op::OpTypeStruct == memberTypeInstr->opcode()) {
- if (_.HasDecoration(memberTypeInstr->id(), spv::Decoration::Block) ||
- _.HasDecoration(memberTypeInstr->id(),
- spv::Decoration::BufferBlock) ||
- _.GetHasNestedBlockOrBufferBlockStruct(memberTypeInstr->id()))
- has_nested_blockOrBufferBlock_struct = true;
+ if (_.ContainsType(
+ member,
+ [&_](const Instruction* type_inst) {
+ if (type_inst->opcode() == spv::Op::OpTypeStruct &&
+ (_.HasDecoration(type_inst->id(), spv::Decoration::Block) ||
+ _.HasDecoration(type_inst->id(),
+ spv::Decoration::BufferBlock))) {
+ return true;
+ }
+ return false;
+ },
+ /* traverse_all_types = */ false)) {
+ has_nested_blockOrBufferBlock_struct = true;
+ break;
}
}
@@ -427,6 +561,9 @@
// a storage image.
if (sampled == 2) _.RegisterPointerToStorageImage(inst->id());
}
+ if (type->opcode() == spv::Op::OpTypeTensorARM) {
+ _.RegisterPointerToTensor(inst->id());
+ }
}
if (!_.IsValidStorageClass(storage_class)) {
@@ -479,6 +616,7 @@
for (auto& pair : inst->uses()) {
const auto* use = pair.first;
if (use->opcode() != spv::Op::OpFunction &&
+ use->opcode() != spv::Op::OpAsmINTEL &&
!spvOpcodeIsDebug(use->opcode()) && !use->IsNonSemantic() &&
!spvOpcodeIsDecoration(use->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, use)
@@ -539,6 +677,24 @@
<< " is not a scalar numerical type.";
}
+ if (_.IsBfloat16ScalarType(component_type_id)) {
+ if (!_.HasCapability(spv::Capability::BFloat16CooperativeMatrixKHR)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeMatrix Component Type <id> "
+ << _.getIdName(component_type_id)
+ << "require BFloat16CooperativeMatrixKHR be declared.";
+ }
+ }
+
+ if (_.IsFP8ScalarType(component_type_id)) {
+ if (!_.HasCapability(spv::Capability::Float8CooperativeMatrixEXT)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeMatrix Component Type <id> "
+ << _.getIdName(component_type_id)
+ << "require Float8CooperativeMatrixEXT be declared.";
+ }
+ }
+
const auto scope_index = 2;
const auto scope_id = inst->GetOperandAs<uint32_t>(scope_index);
const auto scope = _.FindDef(scope_id);
@@ -581,6 +737,249 @@
}
}
+ uint64_t scope_value;
+ if (_.EvalConstantValUint64(scope_id, &scope_value)) {
+ if (scope_value == static_cast<uint32_t>(spv::Scope::Workgroup)) {
+ for (auto entry_point_id : _.entry_points()) {
+ if (!_.EntryPointHasLocalSizeOrId(entry_point_id)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeMatrixKHR with ScopeWorkgroup "
+ << "used without specifying LocalSize or LocalSizeId "
+ << "for entry point <id> " << _.getIdName(entry_point_id);
+ }
+ const auto local_size = _.EntryPointLocalSizeOrId(entry_point_id);
+ const auto mode = local_size->GetOperandAs<spv::ExecutionMode>(1);
+ if (mode == spv::ExecutionMode::LocalSizeId) {
+ uint32_t local_size_ids[3] = {
+ local_size->GetOperandAs<uint32_t>(2),
+ local_size->GetOperandAs<uint32_t>(3),
+ local_size->GetOperandAs<uint32_t>(4),
+ };
+ for (auto id : local_size_ids) {
+ if (_.FindDef(id) > inst) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeCooperativeMatrixKHR with ScopeWorkgroup "
+ << "used before LocalSizeId constant value <id> "
+ << _.getIdName(id) << " is defined.";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTypeUntypedPointerKHR(ValidationState_t& _,
+ const Instruction* inst) {
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ const auto sc = inst->GetOperandAs<spv::StorageClass>(1);
+ switch (sc) {
+ case spv::StorageClass::Workgroup:
+ if (!_.HasCapability(
+ spv::Capability::WorkgroupMemoryExplicitLayoutKHR)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "Workgroup storage class untyped pointers in Vulkan "
+ "require WorkgroupMemoryExplicitLayoutKHR be declared";
+ }
+ break;
+ case spv::StorageClass::StorageBuffer:
+ case spv::StorageClass::PhysicalStorageBuffer:
+ case spv::StorageClass::Uniform:
+ case spv::StorageClass::PushConstant:
+ break;
+ default:
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "In Vulkan, untyped pointers can only be used in an "
+ "explicitly laid out storage class";
+ }
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTensorDim(ValidationState_t& _, const Instruction* inst) {
+ const auto dim_index = 1;
+ const auto dim_id = inst->GetOperandAs<uint32_t>(dim_index);
+ const auto dim = _.FindDef(dim_id);
+ if (!dim || !_.IsIntScalarType(dim->type_id()) ||
+ _.GetBitWidth(dim->type_id()) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Dim <id> "
+ << _.getIdName(dim_id) << " is not a 32-bit integer.";
+ }
+
+ constexpr uint32_t max_tensor_dim = 5;
+
+ uint64_t dim_value;
+ if (_.EvalConstantValUint64(dim_id, &dim_value)) {
+ if (dim_value == 0 || dim_value > max_tensor_dim) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Dim <id> "
+ << _.getIdName(dim_id) << " must be between 1 and "
+ << max_tensor_dim << ".";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTypeTensorLayoutNV(ValidationState_t& _,
+ const Instruction* inst) {
+ if (auto error = ValidateTensorDim(_, inst)) return error;
+
+ const auto clamp_index = 2;
+ const auto clamp_id = inst->GetOperandAs<uint32_t>(clamp_index);
+ const auto clamp = _.FindDef(clamp_id);
+ if (!clamp || !_.IsIntScalarType(clamp->type_id()) ||
+ _.GetBitWidth(clamp->type_id()) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " ClampMode <id> "
+ << _.getIdName(clamp_id) << " is not a 32-bit integer.";
+ }
+
+ uint64_t clamp_value;
+ if (_.EvalConstantValUint64(clamp_id, &clamp_value)) {
+ if (clamp_value >
+ static_cast<uint32_t>(spv::TensorClampMode::RepeatMirrored)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " ClampMode <id> "
+ << _.getIdName(clamp_id) << " must be a valid TensorClampMode.";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTypeTensorViewNV(ValidationState_t& _,
+ const Instruction* inst) {
+ if (auto error = ValidateTensorDim(_, inst)) return error;
+
+ const auto has_dim_index = 2;
+ const auto has_dim_id = inst->GetOperandAs<uint32_t>(has_dim_index);
+ const auto has_dim = _.FindDef(has_dim_id);
+ if (!has_dim || !_.IsBoolScalarType(has_dim->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " HasDimensions <id> "
+ << _.getIdName(has_dim_id) << " is not a boolean value.";
+ }
+
+ uint32_t permutation_mask = 0;
+ bool all_constant = true;
+ const auto num_dim = inst->operands().size() - 3;
+ for (size_t p_index = 3; p_index < inst->operands().size(); ++p_index) {
+ auto p_id = inst->GetOperandAs<uint32_t>(p_index);
+ const auto p = _.FindDef(p_id);
+ if (!p || !_.IsIntScalarType(p->type_id()) ||
+ _.GetBitWidth(p->type_id()) != 32) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Permutation <id> "
+ << _.getIdName(p_id) << " is not a 32-bit integer.";
+ }
+
+ uint64_t p_value;
+ if (_.EvalConstantValUint64(p_id, &p_value)) {
+ if (p_value >= num_dim) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode()) << " Permutation <id> "
+ << _.getIdName(p_id) << " must be a valid dimension.";
+ }
+ permutation_mask |= 1 << p_value;
+ } else {
+ all_constant = false;
+ }
+ }
+ if (all_constant && permutation_mask != (1U << num_dim) - 1U) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode())
+ << " Permutation values don't form a valid permutation.";
+ }
+
+ uint64_t dim_value;
+ if (_.EvalConstantValUint64(inst->GetOperandAs<uint32_t>(1), &dim_value)) {
+ if (dim_value != num_dim) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << spvOpcodeString(inst->opcode())
+ << " Incorrect number of permutation values.";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateTypeTensorARM(ValidationState_t& _,
+ const Instruction* inst) {
+ // Element type must be a scalar type
+ const auto element_type_index = 1;
+ const auto element_type_id = inst->GetOperandAs<uint32_t>(element_type_index);
+ const auto element_type = _.FindDef(element_type_id);
+ if (!element_type || (!_.IsFloatScalarType(element_type_id) &&
+ !_.IsIntScalarType(element_type_id) &&
+ !_.IsBoolScalarType(element_type_id))) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Element Type <id> "
+ << _.getIdName(element_type_id) << " is not a scalar type.";
+ }
+
+ if (inst->operands().size() < 3) {
+ return SPV_SUCCESS;
+ }
+
+ // Rank must be constant instruction with scalar integer type
+ const auto rank_index = 2;
+ const auto rank_id = inst->GetOperandAs<uint32_t>(rank_index);
+ const auto rank = _.FindDef(rank_id);
+ if (!rank || !spvOpcodeIsConstant(rank->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Rank <id> " << _.getIdName(rank_id)
+ << " is not a constant instruction.";
+ }
+ // Rank must have scalar integer type
+ if (!rank || !_.IsIntScalarType(rank->type_id())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Rank <id> " << _.getIdName(rank_id)
+ << " does not have a scalar integer type.";
+ }
+ // Rank must be greater than 0
+ uint64_t rank_value = 0;
+ if (_.EvalConstantValUint64(rank_id, &rank_value) && rank_value == 0) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Rank <id> " << _.getIdName(rank_id)
+ << " must define a value greater than 0.";
+ }
+
+ if (inst->operands().size() < 4) {
+ return SPV_SUCCESS;
+ }
+
+ // Shape must be constant instruction
+ const auto shape_index = 3;
+ const auto shape_id = inst->GetOperandAs<uint32_t>(shape_index);
+ const auto shape = _.FindDef(shape_id);
+ if (!shape || !spvOpcodeIsConstant(shape->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Shape <id> " << _.getIdName(shape_id)
+ << " is not a constant instruction.";
+ }
+
+ // Shape must be array of integer of length rank
+ if (!_.IsIntArrayType(shape->type_id(), rank_value)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Shape <id> " << _.getIdName(shape_id)
+ << " is not an array of integer type whose Length is equal to Rank.";
+ }
+
+ // Shape constituents must be greater than 0
+ for (size_t i = 2; i < shape->operands().size(); i++) {
+ const auto s_id = shape->GetOperandAs<uint32_t>(i);
+ uint64_t s_val = 0;
+ if (_.EvalConstantValUint64(s_id, &s_val) && s_val == 0) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpTypeTensorARM Shape constituent " << i - 2
+ << " is not greater than 0.";
+ }
+ }
+
return SPV_SUCCESS;
}
} // namespace
@@ -628,6 +1027,21 @@
case spv::Op::OpTypeCooperativeMatrixKHR:
if (auto error = ValidateTypeCooperativeMatrix(_, inst)) return error;
break;
+ case spv::Op::OpTypeCooperativeVectorNV:
+ if (auto error = ValidateTypeCooperativeVectorNV(_, inst)) return error;
+ break;
+ case spv::Op::OpTypeUntypedPointerKHR:
+ if (auto error = ValidateTypeUntypedPointerKHR(_, inst)) return error;
+ break;
+ case spv::Op::OpTypeTensorLayoutNV:
+ if (auto error = ValidateTypeTensorLayoutNV(_, inst)) return error;
+ break;
+ case spv::Op::OpTypeTensorViewNV:
+ if (auto error = ValidateTypeTensorViewNV(_, inst)) return error;
+ break;
+ case spv::Op::OpTypeTensorARM:
+ if (auto error = ValidateTypeTensorARM(_, inst)) return error;
+ break;
default:
break;
}
diff --git a/third_party/SPIRV-Tools/source/val/validation_state.cpp b/third_party/SPIRV-Tools/source/val/validation_state.cpp
index 87322d2..4300633 100644
--- a/third_party/SPIRV-Tools/source/val/validation_state.cpp
+++ b/third_party/SPIRV-Tools/source/val/validation_state.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2015-2016 The Khronos Group Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,6 +23,7 @@
#include "source/opcode.h"
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
+#include "source/table2.h"
#include "source/util/make_unique.h"
#include "source/val/basic_block.h"
#include "source/val/construct.h"
@@ -71,11 +74,14 @@
case spv::Op::OpMemberDecorateStringGOOGLE:
return kLayoutAnnotations;
case spv::Op::OpTypeForwardPointer:
+ case spv::Op::OpTypeTaskSequenceINTEL:
return kLayoutTypes;
case spv::Op::OpVariable:
+ case spv::Op::OpUntypedVariableKHR:
if (current_section == kLayoutTypes) return kLayoutTypes;
return kLayoutFunctionDefinitions;
case spv::Op::OpExtInst:
+ case spv::Op::OpExtInstWithForwardRefsKHR:
// spv::Op::OpExtInst is only allowed in types section for certain
// extended instruction sets. This will be checked separately.
if (current_section == kLayoutTypes) return kLayoutTypes;
@@ -363,11 +369,11 @@
if (module_capabilities_.contains(cap)) return;
module_capabilities_.insert(cap);
- spv_operand_desc desc;
- if (SPV_SUCCESS == grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
- uint32_t(cap), &desc)) {
- for (auto capability :
- CapabilitySet(desc->numCapabilities, desc->capabilities)) {
+ const spvtools::OperandDesc* desc = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(SPV_OPERAND_TYPE_CAPABILITY,
+ uint32_t(cap), &desc)) {
+ for (auto capability : CapabilitySet(desc->capabilities_range.count(),
+ desc->capabilities().data())) {
RegisterCapability(capability);
}
}
@@ -393,6 +399,9 @@
case spv::Capability::Float16Buffer:
features_.declare_float16_type = true;
break;
+ case spv::Capability::Float8EXT:
+ features_.declare_float8_type = true;
+ break;
case spv::Capability::StorageUniformBufferBlock16:
case spv::Capability::StorageUniform16:
case spv::Capability::StoragePushConstant16:
@@ -868,6 +877,9 @@
case spv::Op::OpTypeBool:
return id;
+ case spv::Op::OpTypeArray:
+ return inst->word(2);
+
case spv::Op::OpTypeVector:
return inst->word(2);
@@ -876,6 +888,10 @@
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
+ return inst->word(2);
+
+ case spv::Op::OpTypeTensorARM:
return inst->word(2);
default:
@@ -904,6 +920,7 @@
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
// Actual dimension isn't known, return 0
return 0;
@@ -937,11 +954,116 @@
return inst && inst->opcode() == spv::Op::OpTypeVoid;
}
+bool ValidationState_t::IsScalarType(uint32_t id) const {
+ return IsIntScalarType(id) || IsFloatScalarType(id) || IsBoolScalarType(id);
+}
+
+bool ValidationState_t::IsBfloat16ScalarType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (inst && inst->opcode() == spv::Op::OpTypeFloat) {
+ if (inst->words().size() > 3) {
+ if (inst->GetOperandAs<spv::FPEncoding>(2) ==
+ spv::FPEncoding::BFloat16KHR) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool ValidationState_t::IsBfloat16VectorType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (!inst) {
+ return false;
+ }
+
+ if (inst->opcode() == spv::Op::OpTypeVector) {
+ return IsBfloat16ScalarType(GetComponentType(id));
+ }
+
+ return false;
+}
+
+bool ValidationState_t::IsBfloat16CoopMatType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (!inst) {
+ return false;
+ }
+
+ if (inst->opcode() == spv::Op::OpTypeCooperativeMatrixKHR) {
+ return IsBfloat16ScalarType(inst->word(2));
+ }
+
+ return false;
+}
+
+bool ValidationState_t::IsBfloat16Type(uint32_t id) const {
+ return IsBfloat16ScalarType(id) || IsBfloat16VectorType(id) ||
+ IsBfloat16CoopMatType(id);
+}
+
+bool ValidationState_t::IsFP8ScalarType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (inst && inst->opcode() == spv::Op::OpTypeFloat) {
+ if (inst->words().size() > 3) {
+ auto encoding = inst->GetOperandAs<spv::FPEncoding>(2);
+ if ((encoding == spv::FPEncoding::Float8E4M3EXT) ||
+ (encoding == spv::FPEncoding::Float8E5M2EXT)) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool ValidationState_t::IsFP8VectorType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (!inst) {
+ return false;
+ }
+
+ if (inst->opcode() == spv::Op::OpTypeVector) {
+ return IsFP8ScalarType(GetComponentType(id));
+ }
+
+ return false;
+}
+
+bool ValidationState_t::IsFP8CoopMatType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (!inst) {
+ return false;
+ }
+
+ if (inst->opcode() == spv::Op::OpTypeCooperativeMatrixKHR) {
+ return IsFP8ScalarType(inst->word(2));
+ }
+
+ return false;
+}
+
+bool ValidationState_t::IsFP8Type(uint32_t id) const {
+ return IsFP8ScalarType(id) || IsFP8VectorType(id) || IsFP8CoopMatType(id);
+}
+
bool ValidationState_t::IsFloatScalarType(uint32_t id) const {
const Instruction* inst = FindDef(id);
return inst && inst->opcode() == spv::Op::OpTypeFloat;
}
+bool ValidationState_t::IsFloatArrayType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ if (!inst) {
+ return false;
+ }
+
+ if (inst->opcode() == spv::Op::OpTypeArray) {
+ return IsFloatScalarType(GetComponentType(id));
+ }
+
+ return false;
+}
+
bool ValidationState_t::IsFloatVectorType(uint32_t id) const {
const Instruction* inst = FindDef(id);
if (!inst) {
@@ -991,6 +1113,33 @@
return inst && inst->opcode() == spv::Op::OpTypeInt;
}
+bool ValidationState_t::IsIntArrayType(uint32_t id, uint64_t length) const {
+ const Instruction* inst = FindDef(id);
+ if (!inst) {
+ return false;
+ }
+
+ if (inst->opcode() != spv::Op::OpTypeArray) {
+ return false;
+ }
+
+ if (!IsIntScalarType(GetComponentType(id))) {
+ return false;
+ }
+
+ if (length != 0) {
+ const auto len_id = inst->GetOperandAs<uint32_t>(2);
+ const auto len = FindDef(len_id);
+ uint64_t len_value = 0;
+ if (!len || !spvOpcodeIsConstant(len->opcode()) ||
+ (EvalConstantValUint64(len_id, &len_value) && (length != len_value))) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
bool ValidationState_t::IsIntVectorType(uint32_t id) const {
const Instruction* inst = FindDef(id);
if (!inst) {
@@ -1167,8 +1316,11 @@
}
bool ValidationState_t::IsPointerType(uint32_t id) const {
+ if (!id) return false;
const Instruction* inst = FindDef(id);
- return inst && inst->opcode() == spv::Op::OpTypePointer;
+ assert(inst);
+ return inst->opcode() == spv::Op::OpTypePointer ||
+ inst->opcode() == spv::Op::OpTypeUntypedPointerKHR;
}
bool ValidationState_t::GetPointerTypeInfo(
@@ -1178,6 +1330,12 @@
const Instruction* inst = FindDef(id);
assert(inst);
+ if (inst->opcode() == spv::Op::OpTypeUntypedPointerKHR) {
+ *storage_class = spv::StorageClass(inst->word(2));
+ *data_type = 0;
+ return true;
+ }
+
if (inst->opcode() != spv::Op::OpTypePointer) return false;
*storage_class = spv::StorageClass(inst->word(2));
@@ -1263,9 +1421,31 @@
GetBitWidth(id) == 32));
}
+bool ValidationState_t::IsCooperativeVectorNVType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ return inst && inst->opcode() == spv::Op::OpTypeCooperativeVectorNV;
+}
+
+bool ValidationState_t::IsFloatCooperativeVectorNVType(uint32_t id) const {
+ if (!IsCooperativeVectorNVType(id)) return false;
+ return IsFloatScalarType(FindDef(id)->word(2));
+}
+
+bool ValidationState_t::IsIntCooperativeVectorNVType(uint32_t id) const {
+ if (!IsCooperativeVectorNVType(id)) return false;
+ return IsIntScalarType(FindDef(id)->word(2));
+}
+
+bool ValidationState_t::IsUnsignedIntCooperativeVectorNVType(
+ uint32_t id) const {
+ if (!IsCooperativeVectorNVType(id)) return false;
+ return IsUnsignedIntScalarType(FindDef(id)->word(2));
+}
+
spv_result_t ValidationState_t::CooperativeMatrixShapesMatch(
- const Instruction* inst, uint32_t m1, uint32_t m2) {
- const auto m1_type = FindDef(m1);
+ const Instruction* inst, uint32_t result_type_id, uint32_t m2,
+ bool is_conversion, bool swap_row_col) {
+ const auto m1_type = FindDef(result_type_id);
const auto m2_type = FindDef(m2);
if (m1_type->opcode() != m2_type->opcode()) {
@@ -1281,6 +1461,10 @@
uint32_t m2_rows_id = m2_type->GetOperandAs<uint32_t>(3);
uint32_t m2_cols_id = m2_type->GetOperandAs<uint32_t>(4);
+ if (swap_row_col) {
+ std::swap(m1_rows_id, m1_cols_id);
+ }
+
bool m1_is_int32 = false, m1_is_const_int32 = false, m2_is_int32 = false,
m2_is_const_int32 = false;
uint32_t m1_value = 0, m2_value = 0;
@@ -1304,7 +1488,7 @@
if (m1_is_const_int32 && m2_is_const_int32 && m1_value != m2_value) {
return diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected rows of Matrix type and Result Type to be "
- << "identical";
+ << (swap_row_col ? "swapped with columns" : "identical");
}
std::tie(m1_is_int32, m1_is_const_int32, m1_value) =
@@ -1315,7 +1499,7 @@
if (m1_is_const_int32 && m2_is_const_int32 && m1_value != m2_value) {
return diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected columns of Matrix type and Result Type to be "
- << "identical";
+ << (swap_row_col ? "swapped with rows" : "identical");
}
if (m1_type->opcode() == spv::Op::OpTypeCooperativeMatrixKHR) {
@@ -1326,7 +1510,12 @@
std::tie(m2_is_int32, m2_is_const_int32, m2_value) =
EvalInt32IfConst(m2_use_id);
- if (m1_is_const_int32 && m2_is_const_int32 && m1_value != m2_value) {
+ if (m1_is_const_int32 && m2_is_const_int32 && m1_value != m2_value &&
+ // CooperativeMatrixConversionsNV allows conversions from Acc->A/B
+ !(is_conversion &&
+ HasCapability(spv::Capability::CooperativeMatrixConversionsNV) &&
+ m2_value ==
+ (uint32_t)spv::CooperativeMatrixUse::MatrixAccumulatorKHR)) {
return diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Use of Matrix type and Result Type to be "
<< "identical";
@@ -1336,6 +1525,36 @@
return SPV_SUCCESS;
}
+spv_result_t ValidationState_t::CooperativeVectorDimensionsMatch(
+ const Instruction* inst, uint32_t v1, uint32_t v2) {
+ const auto v1_type = FindDef(v1);
+ const auto v2_type = FindDef(v2);
+
+ if (v1_type->opcode() != v2_type->opcode()) {
+ return diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected cooperative vector types";
+ }
+
+ uint32_t v1_components_id = v1_type->GetOperandAs<uint32_t>(2);
+ uint32_t v2_components_id = v2_type->GetOperandAs<uint32_t>(2);
+
+ bool v1_is_int32 = false, v1_is_const_int32 = false, v2_is_int32 = false,
+ v2_is_const_int32 = false;
+ uint32_t v1_value = 0, v2_value = 0;
+
+ std::tie(v1_is_int32, v1_is_const_int32, v1_value) =
+ EvalInt32IfConst(v1_components_id);
+ std::tie(v2_is_int32, v2_is_const_int32, v2_value) =
+ EvalInt32IfConst(v2_components_id);
+
+ if (v1_is_const_int32 && v2_is_const_int32 && v1_value != v2_value) {
+ return diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected number of components to be identical";
+ }
+
+ return SPV_SUCCESS;
+}
+
uint32_t ValidationState_t::GetOperandTypeId(const Instruction* inst,
size_t operand_index) const {
return GetTypeId(inst->GetOperandAs<uint32_t>(operand_index));
@@ -1628,6 +1847,7 @@
case spv::Op::OpTypeSampledImage:
case spv::Op::OpTypeCooperativeMatrixNV:
case spv::Op::OpTypeCooperativeMatrixKHR:
+ case spv::Op::OpTypeCooperativeVectorNV:
return ContainsType(inst->GetOperandAs<uint32_t>(1u), f,
traverse_all_types);
case spv::Op::OpTypePointer:
@@ -1662,6 +1882,10 @@
const auto f = [type, width](const Instruction* inst) {
if (inst->opcode() == type) {
+ // Bfloat16 is a special type.
+ if (type == spv::Op::OpTypeFloat && inst->words().size() > 3)
+ return false;
+
return inst->GetOperandAs<uint32_t>(1u) == width;
}
return false;
@@ -1688,6 +1912,39 @@
return ContainsType(id, f, /* traverse_all_types = */ false);
}
+bool ValidationState_t::ContainsUntypedPointer(uint32_t id) const {
+ const auto inst = FindDef(id);
+ if (!inst) return false;
+ if (!spvOpcodeGeneratesType(inst->opcode())) return false;
+ if (inst->opcode() == spv::Op::OpTypeUntypedPointerKHR) return true;
+
+ switch (inst->opcode()) {
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeRuntimeArray:
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeImage:
+ case spv::Op::OpTypeSampledImage:
+ case spv::Op::OpTypeCooperativeMatrixNV:
+ return ContainsUntypedPointer(inst->GetOperandAs<uint32_t>(1u));
+ case spv::Op::OpTypePointer:
+ if (IsForwardPointer(id)) return false;
+ return ContainsUntypedPointer(inst->GetOperandAs<uint32_t>(2u));
+ case spv::Op::OpTypeFunction:
+ case spv::Op::OpTypeStruct: {
+ for (uint32_t i = 1; i < inst->operands().size(); ++i) {
+ if (ContainsUntypedPointer(inst->GetOperandAs<uint32_t>(i)))
+ return true;
+ }
+ return false;
+ }
+ default:
+ return false;
+ }
+
+ return false;
+}
+
bool ValidationState_t::IsValidStorageClass(
spv::StorageClass storage_class) const {
if (spvIsVulkanEnv(context()->target_env)) {
@@ -1712,6 +1969,8 @@
case spv::StorageClass::TaskPayloadWorkgroupEXT:
case spv::StorageClass::HitObjectAttributeNV:
case spv::StorageClass::TileImageEXT:
+ case spv::StorageClass::NodePayloadAMDX:
+ case spv::StorageClass::TileAttachmentQCOM:
return true;
default:
return false;
@@ -1721,6 +1980,14 @@
return true;
}
+std::string ValidationState_t::MissingFeature(const std::string& feature,
+ const std::string& cmdline,
+ bool hint) const {
+ return "\nThis is " + (hint ? std::string("may be ") : "") +
+ "allowed if you enable the " + feature + " (or use the " + cmdline +
+ " command line flag)";
+}
+
#define VUID_WRAP(vuid) "[" #vuid "] "
// Currently no 2 VUID share the same id, so no need for |reference|
@@ -1983,8 +2250,12 @@
return VUID_WRAP(VUID-Position-Position-04321);
case 4330:
return VUID_WRAP(VUID-PrimitiveId-PrimitiveId-04330);
+ case 4333:
+ return VUID_WRAP(VUID-PrimitiveId-PrimitiveId-04333);
case 4334:
return VUID_WRAP(VUID-PrimitiveId-PrimitiveId-04334);
+ case 4336:
+ return VUID_WRAP(VUID-PrimitiveId-PrimitiveId-04336);
case 4337:
return VUID_WRAP(VUID-PrimitiveId-PrimitiveId-04337);
case 4345:
@@ -2169,6 +2440,8 @@
return VUID_WRAP(VUID-StandaloneSpirv-None-04644);
case 4645:
return VUID_WRAP(VUID-StandaloneSpirv-None-04645);
+ case 10609:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpControlBarrier-10609);
case 4650:
return VUID_WRAP(VUID-StandaloneSpirv-OpControlBarrier-04650);
case 4651:
@@ -2189,8 +2462,6 @@
return VUID_WRAP(VUID-StandaloneSpirv-OpImageTexelPointer-04658);
case 4659:
return VUID_WRAP(VUID-StandaloneSpirv-OpImageQuerySizeLod-04659);
- case 4663:
- return VUID_WRAP(VUID-StandaloneSpirv-Offset-04663);
case 4664:
return VUID_WRAP(VUID-StandaloneSpirv-OpImageGather-04664);
case 4667:
@@ -2255,8 +2526,6 @@
return VUID_WRAP(VUID-StandaloneSpirv-OpImage-04777);
case 4780:
return VUID_WRAP(VUID-StandaloneSpirv-Result-04780);
- case 4781:
- return VUID_WRAP(VUID-StandaloneSpirv-Base-04781);
case 4915:
return VUID_WRAP(VUID-StandaloneSpirv-Location-04915);
case 4916:
@@ -2275,8 +2544,6 @@
return VUID_WRAP(VUID-StandaloneSpirv-Component-04922);
case 4923:
return VUID_WRAP(VUID-StandaloneSpirv-Component-04923);
- case 4924:
- return VUID_WRAP(VUID-StandaloneSpirv-Component-04924);
case 6201:
return VUID_WRAP(VUID-StandaloneSpirv-Flat-06201);
case 6202:
@@ -2309,32 +2576,66 @@
return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06807);
case 6808:
return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06808);
+ case 6924:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpTypeImage-06924);
case 6925:
return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06925);
+ case 7034:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-07034);
+ case 7035:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-07035);
+ case 7036:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-07036);
+ case 7038:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-07038);
+ case 7039:
+ return VUID_WRAP(VUID-Layer-Layer-07039);
+ case 7040:
+ return VUID_WRAP(VUID-PrimitiveId-PrimitiveId-07040);
case 7041:
return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07041);
+ case 7042:
+ return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07042);
case 7043:
return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07043);
case 7044:
return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07044);
+ case 7046:
+ return VUID_WRAP(VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07046);
case 7047:
return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07047);
+ case 7048:
+ return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07048);
case 7049:
return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07049);
case 7050:
return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07050);
+ case 7052:
+ return VUID_WRAP(VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07052);
case 7053:
return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07053);
+ case 7054:
+ return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07054);
case 7055:
return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07055);
case 7056:
return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07056);
+ case 7058:
+ return VUID_WRAP(VUID-PrimitiveTriangleIndicesEXT-PrimitiveTriangleIndicesEXT-07058);
+ case 7059:
+ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-07059);
+ case 7060:
+ return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-07060);
case 7102:
return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07102);
- case 7320:
- return VUID_WRAP(VUID-StandaloneSpirv-ExecutionModel-07320);
case 7290:
return VUID_WRAP(VUID-StandaloneSpirv-Input-07290);
+ case 7320:
+ return VUID_WRAP(VUID-StandaloneSpirv-ExecutionModel-07320);
+ case 7330:
+ return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07330);
+ case 7331:
+ return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07331);
case 7650:
return VUID_WRAP(VUID-StandaloneSpirv-Base-07650);
case 7651:
@@ -2351,8 +2652,54 @@
return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-08722);
case 8973:
return VUID_WRAP(VUID-StandaloneSpirv-Pointer-08973);
+ case 9557:
+ return VUID_WRAP(VUID-StandaloneSpirv-Input-09557);
case 9638:
return VUID_WRAP(VUID-StandaloneSpirv-OpTypeImage-09638);
+ case 9658:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-09658);
+ case 9659:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-09659);
+ case 10213:
+ // This use to be a standalone, but maintenance8 will set allow_offset_texture_operand now
+ return VUID_WRAP(VUID-RuntimeSpirv-Offset-10213);
+ case 10370:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpTypeFloat-10370);
+ case 10583:
+ return VUID_WRAP(VUID-StandaloneSpirv-Component-10583);
+ case 10589:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-10589);
+ case 10590:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-10590);
+ case 10591:
+ return VUID_WRAP(VUID-CullPrimitiveEXT-CullPrimitiveEXT-10591);
+ case 10592:
+ return VUID_WRAP(VUID-Layer-Layer-10592);
+ case 10593:
+ return VUID_WRAP(VUID-Layer-Layer-10593);
+ case 10594:
+ return VUID_WRAP(VUID-Layer-Layer-10594);
+ case 10598:
+ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10598);
+ case 10599:
+ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10599);
+ case 10600:
+ return VUID_WRAP(VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10600);
+ case 10601:
+ return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-10601);
+ case 10602:
+ return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-10602);
+ case 10603:
+ return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-10603);
+ case 10684:
+ return VUID_WRAP(VUID-StandaloneSpirv-None-10684);
+ case 10685:
+ return VUID_WRAP(VUID-StandaloneSpirv-None-10685);
+ case 10824:
+ // This use to be a standalone, but maintenance9 will set allow_vulkan_32_bit_bitwise now
+ return VUID_WRAP(VUID-RuntimeSpirv-None-10824);
+ case 10880:
+ return VUID_WRAP(VUID-StandaloneSpirv-TessLevelInner-10880);
default:
return ""; // unknown id
}
diff --git a/third_party/SPIRV-Tools/source/val/validation_state.h b/third_party/SPIRV-Tools/source/val/validation_state.h
index 27acdcc..5c45be7 100644
--- a/third_party/SPIRV-Tools/source/val/validation_state.h
+++ b/third_party/SPIRV-Tools/source/val/validation_state.h
@@ -32,6 +32,7 @@
#include "source/name_mapper.h"
#include "source/spirv_definition.h"
#include "source/spirv_validator_options.h"
+#include "source/table2.h"
#include "source/val/decoration.h"
#include "source/val/function.h"
#include "source/val/instruction.h"
@@ -67,6 +68,7 @@
struct Feature {
bool declare_int16_type = false; // Allow OpTypeInt with 16 bit width?
bool declare_float16_type = false; // Allow OpTypeFloat with 16 bit width?
+ bool declare_float8_type = false; // Allow OpTypeFloat with 8 bit width?
bool free_fp_rounding_mode = false; // Allow the FPRoundingMode decoration
// and its values to be used without
// requiring any capability
@@ -240,6 +242,39 @@
entry_point_to_execution_modes_[entry_point].insert(execution_mode);
}
+ /// Registers that the entry point declares its local size
+ void RegisterEntryPointLocalSize(uint32_t entry_point,
+ const Instruction* inst) {
+ entry_point_to_local_size_or_id_[entry_point] = inst;
+ }
+
+ /// Registers that the entry point maximum number of primitives
+ /// mesh shader will ever emit
+ void RegisterEntryPointOutputPrimitivesEXT(uint32_t entry_point,
+ const Instruction* inst) {
+ entry_point_to_output_primitives_[entry_point] = inst;
+ }
+
+ /// Returns the maximum number of primitives mesh shader can emit
+ uint32_t GetOutputPrimitivesEXT(uint32_t entry_point) {
+ auto entry = entry_point_to_output_primitives_.find(entry_point);
+ if (entry != entry_point_to_output_primitives_.end()) {
+ auto inst = entry->second;
+ return inst->GetOperandAs<uint32_t>(2);
+ }
+ return 0;
+ }
+
+ /// Returns whether the entry point declares its local size
+ bool EntryPointHasLocalSizeOrId(uint32_t entry_point) const {
+ return entry_point_to_local_size_or_id_.find(entry_point) !=
+ entry_point_to_local_size_or_id_.end();
+ }
+ /// Returns the id of the local size
+ const Instruction* EntryPointLocalSizeOrId(uint32_t entry_point) const {
+ return entry_point_to_local_size_or_id_.find(entry_point)->second;
+ }
+
/// Returns the interface descriptions of a given entry point.
const std::vector<EntryPointDescription>& entry_point_descriptions(
uint32_t entry_point) {
@@ -600,12 +635,23 @@
// Returns true iff |id| is a type corresponding to the name of the function.
// Only works for types not for objects.
bool IsVoidType(uint32_t id) const;
+ bool IsScalarType(uint32_t id) const;
+ bool IsBfloat16ScalarType(uint32_t id) const;
+ bool IsBfloat16VectorType(uint32_t id) const;
+ bool IsBfloat16CoopMatType(uint32_t id) const;
+ bool IsBfloat16Type(uint32_t id) const;
+ bool IsFP8ScalarType(uint32_t id) const;
+ bool IsFP8VectorType(uint32_t id) const;
+ bool IsFP8CoopMatType(uint32_t id) const;
+ bool IsFP8Type(uint32_t id) const;
bool IsFloatScalarType(uint32_t id) const;
+ bool IsFloatArrayType(uint32_t id) const;
bool IsFloatVectorType(uint32_t id) const;
bool IsFloat16Vector2Or4Type(uint32_t id) const;
bool IsFloatScalarOrVectorType(uint32_t id) const;
bool IsFloatMatrixType(uint32_t id) const;
bool IsIntScalarType(uint32_t id) const;
+ bool IsIntArrayType(uint32_t id, uint64_t length = 0) const;
bool IsIntVectorType(uint32_t id) const;
bool IsIntScalarOrVectorType(uint32_t id) const;
bool IsUnsignedIntScalarType(uint32_t id) const;
@@ -628,6 +674,10 @@
bool IsIntCooperativeMatrixType(uint32_t id) const;
bool IsUnsignedIntCooperativeMatrixType(uint32_t id) const;
bool IsUnsigned64BitHandle(uint32_t id) const;
+ bool IsCooperativeVectorNVType(uint32_t id) const;
+ bool IsFloatCooperativeVectorNVType(uint32_t id) const;
+ bool IsIntCooperativeVectorNVType(uint32_t id) const;
+ bool IsUnsignedIntCooperativeVectorNVType(uint32_t id) const;
// Returns true if |id| is a type id that contains |type| (or integer or
// floating point type) of |width| bits.
@@ -648,6 +698,9 @@
const std::function<bool(const Instruction*)>& f,
bool traverse_all_types = true) const;
+ // Returns true if |id| is type id that contains an untyped pointer.
+ bool ContainsUntypedPointer(uint32_t id) const;
+
// Returns type_id if id has type or zero otherwise.
uint32_t GetTypeId(uint32_t id) const;
@@ -722,6 +775,16 @@
pointer_to_storage_image_.insert(type_id);
}
+ // Is the ID the type of a pointer to a tensor? That is, the pointee
+ // type is a tensor type.
+ bool IsPointerToTensor(uint32_t type_id) const {
+ return pointer_to_tensor_.find(type_id) != pointer_to_tensor_.cend();
+ }
+ // Save the ID of a pointer to a tensor.
+ void RegisterPointerToTensor(uint32_t type_id) {
+ pointer_to_tensor_.insert(type_id);
+ }
+
// Tries to evaluate a any scalar integer OpConstant as uint64.
// OpConstantNull is defined as zero for scalar int (will return true)
// OpSpecConstant* return false since their values cannot be relied upon
@@ -744,22 +807,28 @@
// Returns the string name for |decoration|.
std::string SpvDecorationString(uint32_t decoration) {
- spv_operand_desc desc = nullptr;
- if (grammar_.lookupOperand(SPV_OPERAND_TYPE_DECORATION, decoration,
- &desc) != SPV_SUCCESS) {
+ const spvtools::OperandDesc* desc = nullptr;
+ if (spvtools::LookupOperand(SPV_OPERAND_TYPE_DECORATION, decoration,
+ &desc) != SPV_SUCCESS) {
return std::string("Unknown");
}
- return std::string(desc->name);
+ return std::string(desc->name().data());
}
std::string SpvDecorationString(spv::Decoration decoration) {
return SpvDecorationString(uint32_t(decoration));
}
- // Returns whether type m1 and type m2 are cooperative matrices with
- // the same "shape" (matching scope, rows, cols). If any are specialization
- // constants, we assume they can match because we can't prove they don't.
+ // Returns whether type result_type_id and type m2 are cooperative matrices
+ // with the same "shape" (matching scope, rows, cols). If any are
+ // specialization constants, we assume they can match because we can't prove
+ // they don't.
spv_result_t CooperativeMatrixShapesMatch(const Instruction* inst,
- uint32_t m1, uint32_t m2);
+ uint32_t result_type_id,
+ uint32_t m2, bool is_conversion,
+ bool swap_row_col = false);
+
+ spv_result_t CooperativeVectorDimensionsMatch(const Instruction* inst,
+ uint32_t v1, uint32_t v2);
// Returns true if |lhs| and |rhs| logically match and, if the decorations of
// |rhs| are a subset of |lhs|.
@@ -788,6 +857,12 @@
// Validates the storage class for the target environment.
bool IsValidStorageClass(spv::StorageClass storage_class) const;
+ // Helps formulate a mesesage to user that setting one of the validator
+ // options might make their SPIR-V actually valid The |hint| option is because
+ // some checks are intertwined with each other, so hard to give confirmation
+ std::string MissingFeature(const std::string& feature,
+ const std::string& cmdline, bool hint) const;
+
// Takes a Vulkan Valid Usage ID (VUID) as |id| and optional |reference| and
// will return a non-empty string only if ID is known and targeting Vulkan.
// VUIDs are found in the Vulkan-Docs repo in the form "[[VUID-ref-ref-id]]"
@@ -945,6 +1020,14 @@
std::unordered_map<uint32_t, std::set<spv::ExecutionMode>>
entry_point_to_execution_modes_;
+ // Mapping entry point -> local size execution mode instruction
+ std::unordered_map<uint32_t, const Instruction*>
+ entry_point_to_local_size_or_id_;
+
+ // Mapping entry point -> OutputPrimitivesEXT execution mode instruction
+ std::unordered_map<uint32_t, const Instruction*>
+ entry_point_to_output_primitives_;
+
/// Mapping function -> array of entry points inside this
/// module which can (indirectly) call the function.
std::unordered_map<uint32_t, std::vector<uint32_t>> function_to_entry_points_;
@@ -966,6 +1049,9 @@
// The IDs of types of pointers to storage images. This is populated in the
// TypePass.
std::unordered_set<uint32_t> pointer_to_storage_image_;
+ // The IDs of types of pointers to tensors. This is populated in the
+ // TypePass.
+ std::unordered_set<uint32_t> pointer_to_tensor_;
/// Maps ids to friendly names.
std::unique_ptr<spvtools::FriendlyNameMapper> friendly_mapper_;
diff --git a/third_party/SPIRV-Tools/source/wasm/build.sh b/third_party/SPIRV-Tools/source/wasm/build.sh
index 69468c9..f466356 100755
--- a/third_party/SPIRV-Tools/source/wasm/build.sh
+++ b/third_party/SPIRV-Tools/source/wasm/build.sh
@@ -70,8 +70,8 @@
}
if [ ! -d external/spirv-headers ] ; then
- echo "Fetching SPIRV-headers"
- git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
+ echo "Fetching deps"
+ utils/git-sync-deps
fi
echo Building ${BASH_REMATCH[1]}
diff --git a/third_party/SPIRV-Tools/test/CMakeLists.txt b/third_party/SPIRV-Tools/test/CMakeLists.txt
index 40c64f8..acd5116 100644
--- a/third_party/SPIRV-Tools/test/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/test/CMakeLists.txt
@@ -88,6 +88,7 @@
set(TEST_SOURCES
test_fixture.h
unit_spirv.h
+ ${spirv-tools_SOURCE_DIR}/tools/io.h
assembly_context_test.cpp
assembly_format_test.cpp
@@ -107,18 +108,23 @@
ext_inst.glsl_test.cpp
ext_inst.non_semantic_test.cpp
ext_inst.opencl_test.cpp
+ ext_inst.tosa_test.cpp
+ ext_inst_lookup_test.cpp
fix_word_test.cpp
generator_magic_number_test.cpp
hex_float_test.cpp
+ hex_to_text_test.cpp
immediate_int_test.cpp
libspirv_macros_test.cpp
named_id_test.cpp
name_mapper_test.cpp
+ op_unknown_test.cpp
+ opcode_lookup_test.cpp
opcode_make_test.cpp
opcode_require_capabilities_test.cpp
opcode_split_test.cpp
- opcode_table_get_test.cpp
operand_capabilities_test.cpp
+ operand_lookup_test.cpp
operand_test.cpp
operand_pattern_test.cpp
parse_number_test.cpp
@@ -151,8 +157,10 @@
text_to_binary.subgroup_dispatch_test.cpp
text_to_binary.reserved_sampling_test.cpp
text_word_get_test.cpp
+ to_string_test.cpp
unit_spirv.cpp
+ ${spirv-tools_SOURCE_DIR}/tools/io.cpp
)
spvtools_pch(TEST_SOURCES pch_test)
diff --git a/third_party/SPIRV-Tools/test/binary_parse_test.cpp b/third_party/SPIRV-Tools/test/binary_parse_test.cpp
index 1a868db..1b8d72e 100644
--- a/third_party/SPIRV-Tools/test/binary_parse_test.cpp
+++ b/third_party/SPIRV-Tools/test/binary_parse_test.cpp
@@ -1157,7 +1157,7 @@
{"OpSource !9999 100",
"Invalid source language operand: 9999, if you are creating a new "
"source language please use value 0 (Unknown) and when ready, add "
- "your source language to SPRIV-Headers"},
+ "your source language to SPIRV-Headers"},
{"OpEntryPoint !9999", "Invalid execution model operand: 9999"},
{"OpMemoryModel !9999", "Invalid addressing model operand: 9999"},
{"OpMemoryModel Logical !9999", "Invalid memory model operand: 9999"},
diff --git a/third_party/SPIRV-Tools/test/binary_to_text.literal_test.cpp b/third_party/SPIRV-Tools/test/binary_to_text.literal_test.cpp
index 5956984..58e1f18 100644
--- a/third_party/SPIRV-Tools/test/binary_to_text.literal_test.cpp
+++ b/third_party/SPIRV-Tools/test/binary_to_text.literal_test.cpp
@@ -33,6 +33,7 @@
for (bool endian_swap : kSwapEndians) {
EXPECT_THAT(
EncodeAndDecodeSuccessfully(GetParam(), SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE,
SPV_ENV_UNIVERSAL_1_0, endian_swap),
Eq(GetParam()));
}
@@ -68,6 +69,7 @@
for (bool endian_swap : kSwapEndians) {
EXPECT_THAT(EncodeAndDecodeSuccessfully(std::get<0>(GetParam()),
SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE,
SPV_ENV_UNIVERSAL_1_0, endian_swap),
Eq(std::get<1>(GetParam())));
}
diff --git a/third_party/SPIRV-Tools/test/binary_to_text_test.cpp b/third_party/SPIRV-Tools/test/binary_to_text_test.cpp
index 85d5bd1..dde73e2 100644
--- a/third_party/SPIRV-Tools/test/binary_to_text_test.cpp
+++ b/third_party/SPIRV-Tools/test/binary_to_text_test.cpp
@@ -247,9 +247,9 @@
::testing::TestWithParam<std::tuple<spv_target_env, std::string>>>;
TEST_P(RoundTripInstructionsTest, Sample) {
- EXPECT_THAT(EncodeAndDecodeSuccessfully(std::get<1>(GetParam()),
- SPV_BINARY_TO_TEXT_OPTION_NONE,
- std::get<0>(GetParam())),
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ std::get<1>(GetParam()), SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE, std::get<0>(GetParam())),
Eq(std::get<1>(GetParam())));
}
@@ -402,6 +402,59 @@
"OpDecorateId %1 MaxByteOffsetId %2\n",
})));
+INSTANTIATE_TEST_SUITE_P(
+ CacheControlsINTEL, RoundTripInstructionsTest,
+ Combine(
+ ::testing::Values(SPV_ENV_UNIVERSAL_1_0),
+ ::testing::ValuesIn(std::vector<std::string>{
+ "OpDecorate %1 CacheControlLoadINTEL 0 UncachedINTEL\n",
+ "OpDecorate %1 CacheControlLoadINTEL 1 CachedINTEL\n",
+ "OpDecorate %1 CacheControlLoadINTEL 2 StreamingINTEL\n",
+ "OpDecorate %1 CacheControlLoadINTEL 3 InvalidateAfterReadINTEL\n",
+ "OpDecorate %1 CacheControlLoadINTEL 4 ConstCachedINTEL\n",
+ "OpDecorate %1 CacheControlStoreINTEL 0 UncachedINTEL\n",
+ "OpDecorate %1 CacheControlStoreINTEL 1 WriteThroughINTEL\n",
+ "OpDecorate %1 CacheControlStoreINTEL 2 WriteBackINTEL\n",
+ "OpDecorate %1 CacheControlStoreINTEL 3 StreamingINTEL\n",
+ })));
+
+INSTANTIATE_TEST_SUITE_P(
+ HostAccessINTEL, RoundTripInstructionsTest,
+ Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0),
+ ::testing::ValuesIn(std::vector<std::string>{
+ "OpDecorate %1 HostAccessINTEL NoneINTEL \"none\"\n",
+ "OpDecorate %1 HostAccessINTEL ReadINTEL \"read\"\n",
+ "OpDecorate %1 HostAccessINTEL WriteINTEL \"write\"\n",
+ "OpDecorate %1 HostAccessINTEL ReadWriteINTEL \"readwrite\"\n",
+ })));
+
+// clang-format off
+INSTANTIATE_TEST_SUITE_P(
+ MatrixMultiplyAccumulateOperands, RoundTripInstructionsTest,
+ Combine(::testing::Values(SPV_ENV_UNIVERSAL_1_0),
+ ::testing::ValuesIn(std::vector<std::string>{
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 None\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixASignedComponentsINTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixBSignedComponentsINTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixCBFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixResultBFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixAPackedInt8INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixBPackedInt8INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixAPackedInt4INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixBPackedInt4INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixATF32INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixBTF32INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixCBFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixAPackedFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixBPackedFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixAPackedBFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 MatrixBPackedBFloat16INTEL\n",
+ "%2 = OpSubgroupMatrixMultiplyAccumulateINTEL %1 %3 %4 %5 %6 "
+ "MatrixASignedComponentsINTEL|MatrixBSignedComponentsINTEL|MatrixAPackedInt8INTEL|MatrixBPackedInt8INTEL\n",
+ })));
+// clang-format on
+
using MaskSorting = TextToBinaryTest;
TEST_F(MaskSorting, MasksAreSortedFromLSBToMSB) {
@@ -464,6 +517,1462 @@
expected);
}
+TEST_F(IndentTest, NestedIf) {
+ const std::string input = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint Fragment %100 "main"
+OpExecutionMode %100 OriginUpperLeft
+OpName %var "var"
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%bool = OpTypeBool
+%5 = OpConstantNull %bool
+%true = OpConstantTrue %bool
+%false = OpConstantFalse %bool
+%uint = OpTypeInt 32 0
+%int = OpTypeInt 32 1
+%uint_42 = OpConstant %uint 42
+%int_42 = OpConstant %int 42
+%13 = OpTypeFunction %uint
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%uint_2 = OpConstant %uint 2
+%uint_3 = OpConstant %uint 3
+%uint_4 = OpConstant %uint 4
+%uint_5 = OpConstant %uint 5
+%uint_6 = OpConstant %uint 6
+%uint_7 = OpConstant %uint 7
+%uint_8 = OpConstant %uint 8
+%uint_10 = OpConstant %uint 10
+%uint_20 = OpConstant %uint 20
+%uint_30 = OpConstant %uint 30
+%uint_40 = OpConstant %uint 40
+%uint_50 = OpConstant %uint 50
+%uint_90 = OpConstant %uint 90
+%uint_99 = OpConstant %uint 99
+%_ptr_Private_uint = OpTypePointer Private %uint
+%var = OpVariable %_ptr_Private_uint Private
+%uint_999 = OpConstant %uint 999
+%100 = OpFunction %void None %3
+%10 = OpLabel
+OpStore %var %uint_0
+OpSelectionMerge %99 None
+OpBranchConditional %5 %30 %40
+%30 = OpLabel
+OpStore %var %uint_1
+OpBranch %99
+%40 = OpLabel
+OpStore %var %uint_2
+OpBranch %99
+%99 = OpLabel
+OpStore %var %uint_999
+OpReturn
+OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %20 = OpConstant %8 6
+ %21 = OpConstant %8 7
+ %22 = OpConstant %8 8
+ %23 = OpConstant %8 10
+ %24 = OpConstant %8 20
+ %25 = OpConstant %8 30
+ %26 = OpConstant %8 40
+ %27 = OpConstant %8 50
+ %28 = OpConstant %8 90
+ %29 = OpConstant %8 99
+ %31 = OpTypePointer Private %8
+ %1 = OpVariable %31 Private
+ %32 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+
+ %10 = OpLabel
+ OpStore %1 %14
+ OpSelectionMerge %99 None
+ OpBranchConditional %5 %30 %40
+
+ %30 = OpLabel
+ OpStore %1 %15
+ OpBranch %99
+
+ %40 = OpLabel
+ OpStore %1 %16
+ OpBranch %99
+
+ %99 = OpLabel
+ OpStore %1 %32
+ OpReturn
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(IndentTest, NestedWhile) {
+ const std::string input = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint Fragment %100 "main"
+OpExecutionMode %100 OriginUpperLeft
+OpName %var "var"
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%bool = OpTypeBool
+%5 = OpConstantNull %bool
+%true = OpConstantTrue %bool
+%false = OpConstantFalse %bool
+%uint = OpTypeInt 32 0
+%int = OpTypeInt 32 1
+%uint_42 = OpConstant %uint 42
+%int_42 = OpConstant %int 42
+%13 = OpTypeFunction %uint
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%uint_2 = OpConstant %uint 2
+%uint_3 = OpConstant %uint 3
+%uint_4 = OpConstant %uint 4
+%uint_5 = OpConstant %uint 5
+%uint_6 = OpConstant %uint 6
+%uint_7 = OpConstant %uint 7
+%uint_8 = OpConstant %uint 8
+%uint_10 = OpConstant %uint 10
+%uint_20 = OpConstant %uint 20
+%uint_30 = OpConstant %uint 30
+%uint_40 = OpConstant %uint 40
+%uint_50 = OpConstant %uint 50
+%uint_90 = OpConstant %uint 90
+%uint_99 = OpConstant %uint 99
+%_ptr_Private_uint = OpTypePointer Private %uint
+%var = OpVariable %_ptr_Private_uint Private
+%uint_999 = OpConstant %uint 999
+%100 = OpFunction %void None %3
+%10 = OpLabel
+OpStore %var %uint_0
+OpBranch %20
+%20 = OpLabel
+OpStore %var %uint_1
+OpLoopMerge %99 %20 None
+OpBranch %80
+%80 = OpLabel
+OpStore %var %uint_2
+OpBranchConditional %5 %99 %20
+%99 = OpLabel
+OpStore %var %uint_3
+OpReturn
+OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %30 = OpConstant %8 99
+ %31 = OpTypePointer Private %8
+ %1 = OpVariable %31 Private
+ %32 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+
+ %10 = OpLabel
+ OpStore %1 %14
+ OpBranch %20
+
+ %20 = OpLabel
+ OpStore %1 %15
+ OpLoopMerge %99 %20 None
+ OpBranch %80
+
+ %80 = OpLabel
+ OpStore %1 %16
+ OpBranchConditional %5 %99 %20
+
+ %99 = OpLabel
+ OpStore %1 %17
+ OpReturn
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(IndentTest, NestedLoopInLoop) {
+ const std::string input = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint Fragment %100 "main"
+OpExecutionMode %100 OriginUpperLeft
+OpName %var "var"
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%bool = OpTypeBool
+%5 = OpConstantNull %bool
+%true = OpConstantTrue %bool
+%false = OpConstantFalse %bool
+%uint = OpTypeInt 32 0
+%int = OpTypeInt 32 1
+%uint_42 = OpConstant %uint 42
+%int_42 = OpConstant %int 42
+%13 = OpTypeFunction %uint
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%uint_2 = OpConstant %uint 2
+%uint_3 = OpConstant %uint 3
+%uint_4 = OpConstant %uint 4
+%uint_5 = OpConstant %uint 5
+%uint_6 = OpConstant %uint 6
+%uint_7 = OpConstant %uint 7
+%uint_8 = OpConstant %uint 8
+%uint_10 = OpConstant %uint 10
+%uint_20 = OpConstant %uint 20
+%uint_30 = OpConstant %uint 30
+%uint_40 = OpConstant %uint 40
+%uint_50 = OpConstant %uint 50
+%uint_90 = OpConstant %uint 90
+%uint_99 = OpConstant %uint 99
+%_ptr_Private_uint = OpTypePointer Private %uint
+%var = OpVariable %_ptr_Private_uint Private
+%uint_999 = OpConstant %uint 999
+%100 = OpFunction %void None %3
+%10 = OpLabel
+OpBranch %20
+%20 = OpLabel
+OpLoopMerge %99 %50 None
+OpBranchConditional %5 %30 %99
+%30 = OpLabel
+OpLoopMerge %49 %40 None
+OpBranchConditional %true %35 %49
+%35 = OpLabel
+OpBranch %37
+%37 = OpLabel
+OpBranch %40
+%40 = OpLabel
+OpBranch %30
+%49 = OpLabel
+OpBranch %50
+%50 = OpLabel
+OpBranch %20
+%99 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %31 = OpConstant %8 99
+ %32 = OpTypePointer Private %8
+ %1 = OpVariable %32 Private
+ %33 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+
+ %10 = OpLabel
+ OpBranch %20
+
+ %20 = OpLabel
+ OpLoopMerge %99 %50 None
+ OpBranchConditional %5 %30 %99
+
+ %30 = OpLabel
+ OpLoopMerge %49 %40 None
+ OpBranchConditional %6 %35 %49
+
+ %35 = OpLabel
+ OpBranch %37
+
+ %37 = OpLabel
+ OpBranch %40
+
+ %40 = OpLabel
+ OpBranch %30
+
+ %49 = OpLabel
+ OpBranch %50
+
+ %50 = OpLabel
+ OpBranch %20
+
+ %99 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(IndentTest, NestedSwitch) {
+ const std::string input = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint Fragment %100 "main"
+OpExecutionMode %100 OriginUpperLeft
+OpName %var "var"
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%bool = OpTypeBool
+%5 = OpConstantNull %bool
+%true = OpConstantTrue %bool
+%false = OpConstantFalse %bool
+%uint = OpTypeInt 32 0
+%int = OpTypeInt 32 1
+%uint_42 = OpConstant %uint 42
+%int_42 = OpConstant %int 42
+%13 = OpTypeFunction %uint
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%uint_2 = OpConstant %uint 2
+%uint_3 = OpConstant %uint 3
+%uint_4 = OpConstant %uint 4
+%uint_5 = OpConstant %uint 5
+%uint_6 = OpConstant %uint 6
+%uint_7 = OpConstant %uint 7
+%uint_8 = OpConstant %uint 8
+%uint_10 = OpConstant %uint 10
+%uint_20 = OpConstant %uint 20
+%uint_30 = OpConstant %uint 30
+%uint_40 = OpConstant %uint 40
+%uint_50 = OpConstant %uint 50
+%uint_90 = OpConstant %uint 90
+%uint_99 = OpConstant %uint 99
+%_ptr_Private_uint = OpTypePointer Private %uint
+%var = OpVariable %_ptr_Private_uint Private
+%uint_999 = OpConstant %uint 999
+%100 = OpFunction %void None %3
+%10 = OpLabel
+OpSelectionMerge %99 None
+OpSwitch %uint_42 %80 20 %20 30 %30
+%20 = OpLabel
+OpBranch %80
+%80 = OpLabel
+OpBranch %30
+%30 = OpLabel
+OpBranch %99
+%99 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %31 = OpConstant %8 99
+ %32 = OpTypePointer Private %8
+ %1 = OpVariable %32 Private
+ %33 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+
+ %10 = OpLabel
+ OpSelectionMerge %99 None
+ OpSwitch %11 %80 20 %20 30 %30
+
+ %20 = OpLabel
+ OpBranch %80
+
+ %80 = OpLabel
+ OpBranch %30
+
+ %30 = OpLabel
+ OpBranch %99
+
+ %99 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(IndentTest, ReorderedIf) {
+ const std::string input = R"(
+ OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %31 = OpConstant %8 99
+ %32 = OpTypePointer Private %8
+ %1 = OpVariable %32 Private
+ %33 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+ %10 = OpLabel
+ OpSelectionMerge %99 None
+ OpBranchConditional %5 %20 %50
+ %99 = OpLabel
+ OpReturn
+ %20 = OpLabel
+ OpSelectionMerge %49 None
+ OpBranchConditional %5 %30 %40
+ %49 = OpLabel
+ OpBranch %99
+ %40 = OpLabel
+ OpBranch %49
+ %30 = OpLabel
+ OpBranch %49
+ %50 = OpLabel
+ OpSelectionMerge %79 None
+ OpBranchConditional %5 %60 %70
+ %79 = OpLabel
+ OpBranch %99
+ %60 = OpLabel
+ OpBranch %79
+ %70 = OpLabel
+ OpBranch %79
+ OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %31 = OpConstant %8 99
+ %32 = OpTypePointer Private %8
+ %1 = OpVariable %32 Private
+ %33 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+ %10 = OpLabel
+ OpSelectionMerge %99 None
+ OpBranchConditional %5 %20 %50
+ %20 = OpLabel
+ OpSelectionMerge %49 None
+ OpBranchConditional %5 %30 %40
+ %30 = OpLabel
+ OpBranch %49
+ %40 = OpLabel
+ OpBranch %49
+ %49 = OpLabel
+ OpBranch %99
+ %50 = OpLabel
+ OpSelectionMerge %79 None
+ OpBranchConditional %5 %60 %70
+ %60 = OpLabel
+ OpBranch %79
+ %70 = OpLabel
+ OpBranch %79
+ %79 = OpLabel
+ OpBranch %99
+ %99 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(IndentTest, ReorderedFallThroughInSwitch) {
+ const std::string input = R"(
+ OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %31 = OpConstant %8 99
+ %32 = OpTypePointer Private %8
+ %1 = OpVariable %32 Private
+ %33 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+ %10 = OpLabel
+ OpSelectionMerge %99 None
+ OpSwitch %11 %50 20 %20 50 %50
+ %99 = OpLabel
+ OpReturn
+ %20 = OpLabel
+ OpSelectionMerge %49 None
+ OpBranchConditional %5 %30 %40
+ %49 = OpLabel
+ OpBranchConditional %5 %99 %50
+ %30 = OpLabel
+ OpBranch %49
+ %40 = OpLabel
+ OpBranch %49
+ %50 = OpLabel
+ OpSelectionMerge %79 None
+ OpBranchConditional %5 %60 %70
+ %79 = OpLabel
+ OpBranch %99
+ %60 = OpLabel
+ OpBranch %79
+ %70 = OpLabel
+ OpBranch %79
+ OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint Fragment %100 "main"
+ OpExecutionMode %100 OriginUpperLeft
+ OpName %1 "var"
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpTypeBool
+ %5 = OpConstantNull %4
+ %6 = OpConstantTrue %4
+ %7 = OpConstantFalse %4
+ %8 = OpTypeInt 32 0
+ %9 = OpTypeInt 32 1
+ %11 = OpConstant %8 42
+ %12 = OpConstant %9 42
+ %13 = OpTypeFunction %8
+ %14 = OpConstant %8 0
+ %15 = OpConstant %8 1
+ %16 = OpConstant %8 2
+ %17 = OpConstant %8 3
+ %18 = OpConstant %8 4
+ %19 = OpConstant %8 5
+ %21 = OpConstant %8 6
+ %22 = OpConstant %8 7
+ %23 = OpConstant %8 8
+ %24 = OpConstant %8 10
+ %25 = OpConstant %8 20
+ %26 = OpConstant %8 30
+ %27 = OpConstant %8 40
+ %28 = OpConstant %8 50
+ %29 = OpConstant %8 90
+ %31 = OpConstant %8 99
+ %32 = OpTypePointer Private %8
+ %1 = OpVariable %32 Private
+ %33 = OpConstant %8 999
+ %100 = OpFunction %2 None %3
+ %10 = OpLabel
+ OpSelectionMerge %99 None
+ OpSwitch %11 %50 20 %20 50 %50
+ %20 = OpLabel
+ OpSelectionMerge %49 None
+ OpBranchConditional %5 %30 %40
+ %30 = OpLabel
+ OpBranch %49
+ %40 = OpLabel
+ OpBranch %49
+ %49 = OpLabel
+ OpBranchConditional %5 %99 %50
+ %50 = OpLabel
+ OpSelectionMerge %79 None
+ OpBranchConditional %5 %60 %70
+ %60 = OpLabel
+ OpBranch %79
+ %70 = OpLabel
+ OpBranch %79
+ %79 = OpLabel
+ OpBranch %99
+ %99 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(IndentTest, ReorderedNested) {
+ const std::string input = R"(
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %204
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "main"
+OpName %16 "ff(vf2;f1;"
+OpName %14 "g"
+OpName %15 "f"
+OpName %19 "vg"
+OpName %20 "Block140"
+OpMemberName %20 0 "a"
+OpMemberName %20 1 "b"
+OpName %22 "b140"
+OpName %35 "sv"
+OpName %39 "s"
+OpName %46 "f"
+OpName %51 "g"
+OpName %57 "x"
+OpName %69 "param"
+OpName %75 "i"
+OpName %80 "vc"
+OpName %88 "j"
+OpName %95 "size"
+OpName %174 "v"
+OpName %187 "i"
+OpName %204 "o_color"
+OpMemberDecorate %20 0 Offset 0
+OpMemberDecorate %20 1 Offset 16
+OpDecorate %20 Block
+OpDecorate %22 DescriptorSet 1
+OpDecorate %22 Binding 0
+OpDecorate %39 DescriptorSet 0
+OpDecorate %39 Binding 1
+OpDecorate %95 SpecId 20
+OpDecorate %204 Location 2
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 2
+%8 = OpTypePointer Function %7
+%9 = OpTypeVector %6 4
+%10 = OpTypeInt 32 0
+%11 = OpConstant %10 2
+%12 = OpTypeArray %9 %11
+%13 = OpTypeFunction %12 %8 %6
+%18 = OpTypePointer Private %9
+%19 = OpVariable %18 Private
+%20 = OpTypeStruct %6 %9
+%21 = OpTypePointer Uniform %20
+%22 = OpVariable %21 Uniform
+%23 = OpTypeInt 32 1
+%24 = OpConstant %23 1
+%25 = OpTypePointer Uniform %9
+%28 = OpConstant %6 0
+%29 = OpConstantComposite %9 %28 %28 %28 %28
+%34 = OpTypePointer Function %9
+%36 = OpTypeImage %6 2D 0 0 0 1 Unknown
+%37 = OpTypeSampledImage %36
+%38 = OpTypePointer UniformConstant %37
+%39 = OpVariable %38 UniformConstant
+%41 = OpConstantComposite %7 %28 %28
+%45 = OpTypePointer Function %6
+%47 = OpConstant %23 0
+%48 = OpTypePointer Uniform %6
+%53 = OpConstant %6 1
+%55 = OpTypeBool
+%56 = OpTypePointer Function %55
+%58 = OpConstant %10 0
+%59 = OpTypePointer Private %6
+%74 = OpTypePointer Function %23
+%87 = OpTypePointer Function %10
+%95 = OpSpecConstant %10 2
+%100 = OpConstant %10 1
+%109 = OpConstantComposite %9 %53 %53 %53 %53
+%127 = OpConstant %23 10
+%139 = OpConstant %6 2
+%143 = OpConstant %6 3
+%158 = OpConstant %6 4
+%177 = OpConstant %6 0.5
+%195 = OpConstant %23 100
+%202 = OpTypeVector %10 4
+%203 = OpTypePointer Output %202
+%204 = OpVariable %203 Output
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%35 = OpVariable %34 Function
+%46 = OpVariable %45 Function
+%51 = OpVariable %45 Function
+%57 = OpVariable %56 Function
+%69 = OpVariable %8 Function
+%75 = OpVariable %74 Function
+%80 = OpVariable %34 Function
+%88 = OpVariable %87 Function
+%174 = OpVariable %45 Function
+%187 = OpVariable %74 Function
+%26 = OpAccessChain %25 %22 %24
+%27 = OpLoad %9 %26
+OpStore %19 %27
+%40 = OpLoad %37 %39
+%42 = OpImageSampleImplicitLod %9 %40 %41
+%43 = OpLoad %9 %19
+%44 = OpFAdd %9 %42 %43
+OpStore %35 %44
+%49 = OpAccessChain %48 %22 %47
+%50 = OpLoad %6 %49
+OpStore %46 %50
+%52 = OpLoad %6 %46
+%54 = OpFAdd %6 %52 %53
+OpStore %51 %54
+%60 = OpAccessChain %59 %19 %58
+%61 = OpLoad %6 %60
+%62 = OpFOrdGreaterThan %55 %61 %28
+OpSelectionMerge %64 None
+OpBranchConditional %62 %63 %64
+%64 = OpLabel
+%73 = OpPhi %55 %62 %5 %72 %63
+OpStore %57 %73
+OpStore %75 %47
+OpBranch %76
+%197 = OpLabel
+OpBranch %190
+%63 = OpLabel
+%65 = OpLoad %6 %46
+%66 = OpLoad %6 %51
+%67 = OpCompositeConstruct %7 %65 %66
+%68 = OpLoad %6 %51
+OpStore %69 %67
+%70 = OpFunctionCall %12 %16 %69 %68
+%71 = OpCompositeExtract %6 %70 0 0
+%72 = OpFOrdGreaterThan %55 %71 %28
+OpBranch %64
+%77 = OpLabel
+%81 = OpLoad %9 %19
+OpStore %80 %81
+%82 = OpAccessChain %45 %80 %58
+%83 = OpLoad %6 %82
+%84 = OpFOrdGreaterThan %55 %83 %28
+OpSelectionMerge %86 None
+OpBranchConditional %84 %85 %113
+%85 = OpLabel
+OpStore %88 %58
+OpBranch %89
+%89 = OpLabel
+OpLoopMerge %91 %92 None
+OpBranch %93
+%93 = OpLabel
+%94 = OpLoad %10 %88
+%96 = OpULessThan %55 %94 %95
+OpBranchConditional %96 %90 %91
+%105 = OpLabel
+OpBranch %92
+%198 = OpLabel
+OpBranch %191
+%163 = OpLabel
+OpBranch %136
+%104 = OpLabel
+OpBranch %91
+%76 = OpLabel
+OpLoopMerge %78 %79 None
+OpBranch %77
+%92 = OpLabel
+%107 = OpLoad %10 %88
+%108 = OpIAdd %10 %107 %24
+OpStore %88 %108
+OpBranch %89
+%91 = OpLabel
+%110 = OpLoad %9 %80
+%111 = OpFAdd %9 %110 %109
+OpStore %80 %111
+OpBranch %79
+%113 = OpLabel
+%114 = OpLoad %9 %80
+%115 = OpFSub %9 %114 %109
+OpStore %80 %115
+OpBranch %86
+%132 = OpLabel
+%137 = OpLoad %6 %51
+%138 = OpFAdd %6 %137 %53
+OpStore %51 %138
+OpBranch %133
+%86 = OpLabel
+%116 = OpAccessChain %45 %80 %100
+%117 = OpLoad %6 %116
+%118 = OpFOrdGreaterThan %55 %117 %28
+OpSelectionMerge %120 None
+OpBranchConditional %118 %119 %120
+%119 = OpLabel
+OpBranch %78
+%120 = OpLabel
+%122 = OpAccessChain %45 %80 %11
+%123 = OpLoad %6 %122
+%124 = OpFAdd %6 %123 %53
+%125 = OpAccessChain %45 %80 %11
+OpStore %125 %124
+OpBranch %79
+%79 = OpLabel
+%126 = OpLoad %23 %75
+%128 = OpSLessThan %55 %126 %127
+OpBranchConditional %128 %76 %78
+%78 = OpLabel
+%129 = OpAccessChain %48 %22 %47
+%130 = OpLoad %6 %129
+%131 = OpConvertFToS %23 %130
+OpSelectionMerge %136 None
+OpSwitch %131 %135 0 %132 1 %132 2 %132 3 %133 4 %134
+%90 = OpLabel
+%97 = OpLoad %9 %19
+%98 = OpLoad %9 %80
+%99 = OpFAdd %9 %98 %97
+OpStore %80 %99
+%101 = OpAccessChain %45 %80 %100
+%102 = OpLoad %6 %101
+%103 = OpFOrdLessThan %55 %102 %28
+OpSelectionMerge %105 None
+OpBranchConditional %103 %104 %105
+%161 = OpLabel
+OpLoopMerge %163 %164 None
+OpBranch %165
+%165 = OpLabel
+%166 = OpLoad %6 %51
+%167 = OpFOrdLessThan %55 %166 %139
+OpBranchConditional %167 %162 %163
+%164 = OpLabel
+OpBranch %161
+%162 = OpLabel
+%168 = OpLoad %6 %46
+%169 = OpFOrdLessThan %55 %168 %53
+OpSelectionMerge %171 None
+OpBranchConditional %169 %170 %171
+%135 = OpLabel
+%159 = OpLoad %6 %51
+%160 = OpFAdd %6 %159 %158
+OpStore %51 %160
+OpBranch %161
+%133 = OpLabel
+%140 = OpLoad %6 %51
+%141 = OpFAdd %6 %140 %139
+OpStore %51 %141
+OpBranch %136
+%134 = OpLabel
+%144 = OpLoad %6 %51
+%145 = OpFAdd %6 %144 %143
+OpStore %51 %145
+OpBranch %146
+%146 = OpLabel
+OpLoopMerge %148 %149 None
+OpBranch %150
+%150 = OpLabel
+%151 = OpLoad %6 %51
+%152 = OpFOrdLessThan %55 %151 %139
+OpBranchConditional %152 %147 %148
+%147 = OpLabel
+%153 = OpLoad %6 %46
+%154 = OpFOrdLessThan %55 %153 %53
+OpSelectionMerge %156 None
+OpBranchConditional %154 %155 %156
+%155 = OpLabel
+OpBranch %148
+%156 = OpLabel
+OpBranch %149
+%149 = OpLabel
+OpBranch %146
+%148 = OpLabel
+OpBranch %135
+%136 = OpLabel
+OpStore %174 %53
+%175 = OpAccessChain %45 %35 %58
+%176 = OpLoad %6 %175
+%178 = OpFOrdLessThanEqual %55 %176 %177
+OpSelectionMerge %180 None
+OpBranchConditional %178 %179 %181
+%179 = OpLabel
+OpStore %174 %28
+OpBranch %180
+%185 = OpLabel
+OpStore %174 %139
+OpBranch %186
+%181 = OpLabel
+%182 = OpAccessChain %45 %35 %58
+%183 = OpLoad %6 %182
+%184 = OpFOrdGreaterThanEqual %55 %183 %177
+OpSelectionMerge %186 None
+OpBranchConditional %184 %185 %186
+%170 = OpLabel
+OpBranch %163
+%171 = OpLabel
+OpBranch %164
+%186 = OpLabel
+OpBranch %180
+%188 = OpLabel
+OpLoopMerge %190 %191 None
+OpBranch %189
+%189 = OpLabel
+%192 = OpLoad %9 %19
+%193 = OpFAdd %9 %192 %109
+OpStore %19 %193
+%194 = OpLoad %23 %187
+%196 = OpSGreaterThan %55 %194 %195
+OpSelectionMerge %198 None
+OpBranchConditional %196 %197 %198
+%180 = OpLabel
+OpStore %187 %47
+OpBranch %188
+%191 = OpLabel
+%200 = OpLoad %23 %187
+%201 = OpIAdd %23 %200 %24
+OpStore %187 %201
+OpBranch %188
+%190 = OpLabel
+OpReturn
+OpFunctionEnd
+%16 = OpFunction %12 None %13
+%14 = OpFunctionParameter %8
+%15 = OpFunctionParameter %6
+%17 = OpLabel
+%30 = OpCompositeConstruct %9 %15 %15 %15 %15
+%31 = OpCompositeConstruct %12 %29 %30
+OpReturnValue %31
+OpFunctionEnd
+)";
+ const std::string expected =
+ R"( OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %204
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource GLSL 450
+ OpName %4 "main"
+ OpName %16 "ff(vf2;f1;"
+ OpName %14 "g"
+ OpName %15 "f"
+ OpName %19 "vg"
+ OpName %20 "Block140"
+ OpMemberName %20 0 "a"
+ OpMemberName %20 1 "b"
+ OpName %22 "b140"
+ OpName %35 "sv"
+ OpName %39 "s"
+ OpName %46 "f"
+ OpName %51 "g"
+ OpName %57 "x"
+ OpName %69 "param"
+ OpName %75 "i"
+ OpName %80 "vc"
+ OpName %88 "j"
+ OpName %95 "size"
+ OpName %174 "v"
+ OpName %187 "i"
+ OpName %204 "o_color"
+ OpMemberDecorate %20 0 Offset 0
+ OpMemberDecorate %20 1 Offset 16
+ OpDecorate %20 Block
+ OpDecorate %22 DescriptorSet 1
+ OpDecorate %22 Binding 0
+ OpDecorate %39 DescriptorSet 0
+ OpDecorate %39 Binding 1
+ OpDecorate %95 SpecId 20
+ OpDecorate %204 Location 2
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypePointer Function %7
+ %9 = OpTypeVector %6 4
+ %10 = OpTypeInt 32 0
+ %11 = OpConstant %10 2
+ %12 = OpTypeArray %9 %11
+ %13 = OpTypeFunction %12 %8 %6
+ %18 = OpTypePointer Private %9
+ %19 = OpVariable %18 Private
+ %20 = OpTypeStruct %6 %9
+ %21 = OpTypePointer Uniform %20
+ %22 = OpVariable %21 Uniform
+ %23 = OpTypeInt 32 1
+ %24 = OpConstant %23 1
+ %25 = OpTypePointer Uniform %9
+ %28 = OpConstant %6 0
+ %29 = OpConstantComposite %9 %28 %28 %28 %28
+ %34 = OpTypePointer Function %9
+ %36 = OpTypeImage %6 2D 0 0 0 1 Unknown
+ %37 = OpTypeSampledImage %36
+ %38 = OpTypePointer UniformConstant %37
+ %39 = OpVariable %38 UniformConstant
+ %41 = OpConstantComposite %7 %28 %28
+ %45 = OpTypePointer Function %6
+ %47 = OpConstant %23 0
+ %48 = OpTypePointer Uniform %6
+ %53 = OpConstant %6 1
+ %55 = OpTypeBool
+ %56 = OpTypePointer Function %55
+ %58 = OpConstant %10 0
+ %59 = OpTypePointer Private %6
+ %74 = OpTypePointer Function %23
+ %87 = OpTypePointer Function %10
+ %95 = OpSpecConstant %10 2
+ %100 = OpConstant %10 1
+ %109 = OpConstantComposite %9 %53 %53 %53 %53
+ %127 = OpConstant %23 10
+ %139 = OpConstant %6 2
+ %143 = OpConstant %6 3
+ %158 = OpConstant %6 4
+ %177 = OpConstant %6 0.5
+ %195 = OpConstant %23 100
+ %202 = OpTypeVector %10 4
+ %203 = OpTypePointer Output %202
+ %204 = OpVariable %203 Output
+ %4 = OpFunction %2 None %3
+
+ %5 = OpLabel
+ %35 = OpVariable %34 Function
+ %46 = OpVariable %45 Function
+ %51 = OpVariable %45 Function
+ %57 = OpVariable %56 Function
+ %69 = OpVariable %8 Function
+ %75 = OpVariable %74 Function
+ %80 = OpVariable %34 Function
+ %88 = OpVariable %87 Function
+ %174 = OpVariable %45 Function
+ %187 = OpVariable %74 Function
+ %26 = OpAccessChain %25 %22 %24
+ %27 = OpLoad %9 %26
+ OpStore %19 %27
+ %40 = OpLoad %37 %39
+ %42 = OpImageSampleImplicitLod %9 %40 %41
+ %43 = OpLoad %9 %19
+ %44 = OpFAdd %9 %42 %43
+ OpStore %35 %44
+ %49 = OpAccessChain %48 %22 %47
+ %50 = OpLoad %6 %49
+ OpStore %46 %50
+ %52 = OpLoad %6 %46
+ %54 = OpFAdd %6 %52 %53
+ OpStore %51 %54
+ %60 = OpAccessChain %59 %19 %58
+ %61 = OpLoad %6 %60
+ %62 = OpFOrdGreaterThan %55 %61 %28
+ OpSelectionMerge %64 None
+ OpBranchConditional %62 %63 %64
+
+ %63 = OpLabel
+ %65 = OpLoad %6 %46
+ %66 = OpLoad %6 %51
+ %67 = OpCompositeConstruct %7 %65 %66
+ %68 = OpLoad %6 %51
+ OpStore %69 %67
+ %70 = OpFunctionCall %12 %16 %69 %68
+ %71 = OpCompositeExtract %6 %70 0 0
+ %72 = OpFOrdGreaterThan %55 %71 %28
+ OpBranch %64
+
+ %64 = OpLabel
+ %73 = OpPhi %55 %62 %5 %72 %63
+ OpStore %57 %73
+ OpStore %75 %47
+ OpBranch %76
+
+ %76 = OpLabel
+ OpLoopMerge %78 %79 None
+ OpBranch %77
+
+ %77 = OpLabel
+ %81 = OpLoad %9 %19
+ OpStore %80 %81
+ %82 = OpAccessChain %45 %80 %58
+ %83 = OpLoad %6 %82
+ %84 = OpFOrdGreaterThan %55 %83 %28
+ OpSelectionMerge %86 None
+ OpBranchConditional %84 %85 %113
+
+ %85 = OpLabel
+ OpStore %88 %58
+ OpBranch %89
+
+ %89 = OpLabel
+ OpLoopMerge %91 %92 None
+ OpBranch %93
+
+ %93 = OpLabel
+ %94 = OpLoad %10 %88
+ %96 = OpULessThan %55 %94 %95
+ OpBranchConditional %96 %90 %91
+
+ %90 = OpLabel
+ %97 = OpLoad %9 %19
+ %98 = OpLoad %9 %80
+ %99 = OpFAdd %9 %98 %97
+ OpStore %80 %99
+ %101 = OpAccessChain %45 %80 %100
+ %102 = OpLoad %6 %101
+ %103 = OpFOrdLessThan %55 %102 %28
+ OpSelectionMerge %105 None
+ OpBranchConditional %103 %104 %105
+
+ %104 = OpLabel
+ OpBranch %91
+
+ %105 = OpLabel
+ OpBranch %92
+
+ %92 = OpLabel
+ %107 = OpLoad %10 %88
+ %108 = OpIAdd %10 %107 %24
+ OpStore %88 %108
+ OpBranch %89
+
+ %91 = OpLabel
+ %110 = OpLoad %9 %80
+ %111 = OpFAdd %9 %110 %109
+ OpStore %80 %111
+ OpBranch %79
+
+ %113 = OpLabel
+ %114 = OpLoad %9 %80
+ %115 = OpFSub %9 %114 %109
+ OpStore %80 %115
+ OpBranch %86
+
+ %86 = OpLabel
+ %116 = OpAccessChain %45 %80 %100
+ %117 = OpLoad %6 %116
+ %118 = OpFOrdGreaterThan %55 %117 %28
+ OpSelectionMerge %120 None
+ OpBranchConditional %118 %119 %120
+
+ %119 = OpLabel
+ OpBranch %78
+
+ %120 = OpLabel
+ %122 = OpAccessChain %45 %80 %11
+ %123 = OpLoad %6 %122
+ %124 = OpFAdd %6 %123 %53
+ %125 = OpAccessChain %45 %80 %11
+ OpStore %125 %124
+ OpBranch %79
+
+ %79 = OpLabel
+ %126 = OpLoad %23 %75
+ %128 = OpSLessThan %55 %126 %127
+ OpBranchConditional %128 %76 %78
+
+ %78 = OpLabel
+ %129 = OpAccessChain %48 %22 %47
+ %130 = OpLoad %6 %129
+ %131 = OpConvertFToS %23 %130
+ OpSelectionMerge %136 None
+ OpSwitch %131 %135 0 %132 1 %132 2 %132 3 %133 4 %134
+
+ %132 = OpLabel
+ %137 = OpLoad %6 %51
+ %138 = OpFAdd %6 %137 %53
+ OpStore %51 %138
+ OpBranch %133
+
+ %133 = OpLabel
+ %140 = OpLoad %6 %51
+ %141 = OpFAdd %6 %140 %139
+ OpStore %51 %141
+ OpBranch %136
+
+ %134 = OpLabel
+ %144 = OpLoad %6 %51
+ %145 = OpFAdd %6 %144 %143
+ OpStore %51 %145
+ OpBranch %146
+
+ %146 = OpLabel
+ OpLoopMerge %148 %149 None
+ OpBranch %150
+
+ %150 = OpLabel
+ %151 = OpLoad %6 %51
+ %152 = OpFOrdLessThan %55 %151 %139
+ OpBranchConditional %152 %147 %148
+
+ %147 = OpLabel
+ %153 = OpLoad %6 %46
+ %154 = OpFOrdLessThan %55 %153 %53
+ OpSelectionMerge %156 None
+ OpBranchConditional %154 %155 %156
+
+ %155 = OpLabel
+ OpBranch %148
+
+ %156 = OpLabel
+ OpBranch %149
+
+ %149 = OpLabel
+ OpBranch %146
+
+ %148 = OpLabel
+ OpBranch %135
+
+ %135 = OpLabel
+ %159 = OpLoad %6 %51
+ %160 = OpFAdd %6 %159 %158
+ OpStore %51 %160
+ OpBranch %161
+
+ %161 = OpLabel
+ OpLoopMerge %163 %164 None
+ OpBranch %165
+
+ %165 = OpLabel
+ %166 = OpLoad %6 %51
+ %167 = OpFOrdLessThan %55 %166 %139
+ OpBranchConditional %167 %162 %163
+
+ %162 = OpLabel
+ %168 = OpLoad %6 %46
+ %169 = OpFOrdLessThan %55 %168 %53
+ OpSelectionMerge %171 None
+ OpBranchConditional %169 %170 %171
+
+ %170 = OpLabel
+ OpBranch %163
+
+ %171 = OpLabel
+ OpBranch %164
+
+ %164 = OpLabel
+ OpBranch %161
+
+ %163 = OpLabel
+ OpBranch %136
+
+ %136 = OpLabel
+ OpStore %174 %53
+ %175 = OpAccessChain %45 %35 %58
+ %176 = OpLoad %6 %175
+ %178 = OpFOrdLessThanEqual %55 %176 %177
+ OpSelectionMerge %180 None
+ OpBranchConditional %178 %179 %181
+
+ %179 = OpLabel
+ OpStore %174 %28
+ OpBranch %180
+
+ %181 = OpLabel
+ %182 = OpAccessChain %45 %35 %58
+ %183 = OpLoad %6 %182
+ %184 = OpFOrdGreaterThanEqual %55 %183 %177
+ OpSelectionMerge %186 None
+ OpBranchConditional %184 %185 %186
+
+ %185 = OpLabel
+ OpStore %174 %139
+ OpBranch %186
+
+ %186 = OpLabel
+ OpBranch %180
+
+ %180 = OpLabel
+ OpStore %187 %47
+ OpBranch %188
+
+ %188 = OpLabel
+ OpLoopMerge %190 %191 None
+ OpBranch %189
+
+ %189 = OpLabel
+ %192 = OpLoad %9 %19
+ %193 = OpFAdd %9 %192 %109
+ OpStore %19 %193
+ %194 = OpLoad %23 %187
+ %196 = OpSGreaterThan %55 %194 %195
+ OpSelectionMerge %198 None
+ OpBranchConditional %196 %197 %198
+
+ %197 = OpLabel
+ OpBranch %190
+
+ %198 = OpLabel
+ OpBranch %191
+
+ %191 = OpLabel
+ %200 = OpLoad %23 %187
+ %201 = OpIAdd %23 %200 %24
+ OpStore %187 %201
+ OpBranch %188
+
+ %190 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ %16 = OpFunction %12 None %13
+ %14 = OpFunctionParameter %8
+ %15 = OpFunctionParameter %6
+
+ %17 = OpLabel
+ %30 = OpCompositeConstruct %9 %15 %15 %15 %15
+ %31 = OpCompositeConstruct %12 %29 %30
+ OpReturnValue %31
+ OpFunctionEnd
+)";
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
using FriendlyNameDisassemblyTest = spvtest::TextToBinaryTest;
TEST_F(FriendlyNameDisassemblyTest, Sample) {
@@ -494,16 +2003,628 @@
%2 = OpTypeVoid
)";
const std::string expected =
- R"(OpCapability Shader ; 0x00000014
-OpMemoryModel Logical GLSL450 ; 0x0000001c
-%1 = OpTypeInt 32 0 ; 0x00000028
-%2 = OpTypeVoid ; 0x00000038
+ R"(OpCapability Shader ; 0x00000014
+OpMemoryModel Logical GLSL450 ; 0x0000001c
+%1 = OpTypeInt 32 0 ; 0x00000028
+%2 = OpTypeVoid ; 0x00000038
)";
EXPECT_THAT(EncodeAndDecodeSuccessfully(
input, SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET),
expected);
}
+TEST_F(TextToBinaryTest, Comments) {
+ const std::string input = R"(OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %63 "main" %4 %22
+OpExecutionMode %63 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "_ue"
+OpName %8 "_uf"
+OpName %11 "_ug"
+OpName %12 "_uA"
+OpMemberName %12 0 "_ux"
+OpName %14 "_uc"
+OpName %15 "_uB"
+OpMemberName %15 0 "_ux"
+OpName %20 "_ud"
+OpName %22 "_ucol"
+OpName %26 "ANGLEDepthRangeParams"
+OpMemberName %26 0 "near"
+OpMemberName %26 1 "far"
+OpMemberName %26 2 "diff"
+OpMemberName %26 3 "reserved"
+OpName %27 "ANGLEUniformBlock"
+OpMemberName %27 0 "viewport"
+OpMemberName %27 1 "clipDistancesEnabled"
+OpMemberName %27 2 "xfbActiveUnpaused"
+OpMemberName %27 3 "xfbVerticesPerInstance"
+OpMemberName %27 4 "numSamples"
+OpMemberName %27 5 "xfbBufferOffsets"
+OpMemberName %27 6 "acbBufferOffsets"
+OpMemberName %27 7 "depthRange"
+OpName %29 "ANGLEUniforms"
+OpName %33 "_uc"
+OpName %32 "_uh"
+OpName %49 "_ux"
+OpName %50 "_uy"
+OpName %48 "_ui"
+OpName %63 "main"
+OpName %65 "param"
+OpName %68 "param"
+OpName %73 "param"
+OpDecorate %4 Location 0
+OpDecorate %8 RelaxedPrecision
+OpDecorate %8 DescriptorSet 0
+OpDecorate %8 Binding 0
+OpDecorate %11 DescriptorSet 0
+OpDecorate %11 Binding 1
+OpMemberDecorate %12 0 Offset 0
+OpMemberDecorate %12 0 RelaxedPrecision
+OpDecorate %12 Block
+OpDecorate %14 DescriptorSet 0
+OpDecorate %14 Binding 2
+OpMemberDecorate %15 0 Offset 0
+OpMemberDecorate %15 0 RelaxedPrecision
+OpDecorate %15 BufferBlock
+OpDecorate %20 DescriptorSet 0
+OpDecorate %20 Binding 3
+OpDecorate %22 RelaxedPrecision
+OpDecorate %22 Location 0
+OpMemberDecorate %26 0 Offset 0
+OpMemberDecorate %26 1 Offset 4
+OpMemberDecorate %26 2 Offset 8
+OpMemberDecorate %26 3 Offset 12
+OpMemberDecorate %27 0 Offset 0
+OpMemberDecorate %27 1 Offset 16
+OpMemberDecorate %27 2 Offset 20
+OpMemberDecorate %27 3 Offset 24
+OpMemberDecorate %27 4 Offset 28
+OpMemberDecorate %27 5 Offset 32
+OpMemberDecorate %27 6 Offset 48
+OpMemberDecorate %27 7 Offset 64
+OpMemberDecorate %27 2 RelaxedPrecision
+OpMemberDecorate %27 4 RelaxedPrecision
+OpDecorate %27 Block
+OpDecorate %29 DescriptorSet 0
+OpDecorate %29 Binding 4
+OpDecorate %32 RelaxedPrecision
+OpDecorate %33 RelaxedPrecision
+OpDecorate %36 RelaxedPrecision
+OpDecorate %37 RelaxedPrecision
+OpDecorate %38 RelaxedPrecision
+OpDecorate %39 RelaxedPrecision
+OpDecorate %41 RelaxedPrecision
+OpDecorate %42 RelaxedPrecision
+OpDecorate %43 RelaxedPrecision
+OpDecorate %48 RelaxedPrecision
+OpDecorate %49 RelaxedPrecision
+OpDecorate %50 RelaxedPrecision
+OpDecorate %52 RelaxedPrecision
+OpDecorate %53 RelaxedPrecision
+OpDecorate %54 RelaxedPrecision
+OpDecorate %55 RelaxedPrecision
+OpDecorate %56 RelaxedPrecision
+OpDecorate %57 RelaxedPrecision
+OpDecorate %58 RelaxedPrecision
+OpDecorate %59 RelaxedPrecision
+OpDecorate %60 RelaxedPrecision
+OpDecorate %67 RelaxedPrecision
+OpDecorate %68 RelaxedPrecision
+OpDecorate %72 RelaxedPrecision
+OpDecorate %73 RelaxedPrecision
+OpDecorate %75 RelaxedPrecision
+OpDecorate %76 RelaxedPrecision
+OpDecorate %77 RelaxedPrecision
+OpDecorate %80 RelaxedPrecision
+OpDecorate %81 RelaxedPrecision
+%1 = OpTypeFloat 32
+%2 = OpTypeVector %1 4
+%5 = OpTypeImage %1 2D 0 0 0 1 Unknown
+%6 = OpTypeSampledImage %5
+%9 = OpTypeImage %1 2D 0 0 0 2 Rgba8
+%12 = OpTypeStruct %2
+%15 = OpTypeStruct %2
+%16 = OpTypeInt 32 0
+%17 = OpConstant %16 2
+%18 = OpTypeArray %15 %17
+%23 = OpTypeInt 32 1
+%24 = OpTypeVector %23 4
+%25 = OpTypeVector %16 4
+%26 = OpTypeStruct %1 %1 %1 %1
+%27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26
+%35 = OpTypeVector %1 2
+%40 = OpTypeVector %23 2
+%61 = OpTypeVoid
+%69 = OpConstant %16 0
+%78 = OpConstant %16 1
+%3 = OpTypePointer Input %2
+%7 = OpTypePointer UniformConstant %6
+%10 = OpTypePointer UniformConstant %9
+%13 = OpTypePointer Uniform %12
+%19 = OpTypePointer Uniform %18
+%21 = OpTypePointer Output %2
+%28 = OpTypePointer Uniform %27
+%30 = OpTypePointer Function %2
+%70 = OpTypePointer Uniform %2
+%31 = OpTypeFunction %2 %30
+%47 = OpTypeFunction %2 %30 %30
+%62 = OpTypeFunction %61
+%4 = OpVariable %3 Input
+%8 = OpVariable %7 UniformConstant
+%11 = OpVariable %10 UniformConstant
+%14 = OpVariable %13 Uniform
+%20 = OpVariable %19 Uniform
+%22 = OpVariable %21 Output
+%29 = OpVariable %28 Uniform
+%32 = OpFunction %2 None %31
+%33 = OpFunctionParameter %30
+%34 = OpLabel
+%36 = OpLoad %6 %8
+%37 = OpLoad %2 %33
+%38 = OpVectorShuffle %35 %37 %37 0 1
+%39 = OpImageSampleImplicitLod %2 %36 %38
+%41 = OpLoad %2 %33
+%42 = OpVectorShuffle %35 %41 %41 2 3
+%43 = OpConvertFToS %40 %42
+%44 = OpLoad %9 %11
+%45 = OpImageRead %2 %44 %43
+%46 = OpFAdd %2 %39 %45
+OpReturnValue %46
+OpFunctionEnd
+%48 = OpFunction %2 None %47
+%49 = OpFunctionParameter %30
+%50 = OpFunctionParameter %30
+%51 = OpLabel
+%52 = OpLoad %2 %49
+%53 = OpVectorShuffle %35 %52 %52 0 1
+%54 = OpLoad %2 %50
+%55 = OpVectorShuffle %35 %54 %54 2 3
+%56 = OpCompositeExtract %1 %53 0
+%57 = OpCompositeExtract %1 %53 1
+%58 = OpCompositeExtract %1 %55 0
+%59 = OpCompositeExtract %1 %55 1
+%60 = OpCompositeConstruct %2 %56 %57 %58 %59
+OpReturnValue %60
+OpFunctionEnd
+%63 = OpFunction %61 None %62
+%64 = OpLabel
+%65 = OpVariable %30 Function
+%68 = OpVariable %30 Function
+%73 = OpVariable %30 Function
+%66 = OpLoad %2 %4
+OpStore %65 %66
+%67 = OpFunctionCall %2 %32 %65
+%71 = OpAccessChain %70 %14 %69
+%72 = OpLoad %2 %71
+OpStore %68 %72
+%74 = OpAccessChain %70 %20 %69 %69
+%75 = OpLoad %2 %74
+OpStore %73 %75
+%76 = OpFunctionCall %2 %48 %68 %73
+%77 = OpFAdd %2 %67 %76
+%79 = OpAccessChain %70 %20 %78 %69
+%80 = OpLoad %2 %79
+%81 = OpFAdd %2 %77 %80
+OpStore %22 %81
+OpReturn
+OpFunctionEnd
+)";
+ const std::string expected = R"( OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %63 "main" %4 %22
+ OpExecutionMode %63 OriginUpperLeft
+
+ ; Debug Information
+ OpSource GLSL 450
+ OpName %4 "_ue" ; id %4
+ OpName %8 "_uf" ; id %8
+ OpName %11 "_ug" ; id %11
+ OpName %12 "_uA" ; id %12
+ OpMemberName %12 0 "_ux"
+ OpName %14 "_uc" ; id %14
+ OpName %15 "_uB" ; id %15
+ OpMemberName %15 0 "_ux"
+ OpName %20 "_ud" ; id %20
+ OpName %22 "_ucol" ; id %22
+ OpName %26 "ANGLEDepthRangeParams" ; id %26
+ OpMemberName %26 0 "near"
+ OpMemberName %26 1 "far"
+ OpMemberName %26 2 "diff"
+ OpMemberName %26 3 "reserved"
+ OpName %27 "ANGLEUniformBlock" ; id %27
+ OpMemberName %27 0 "viewport"
+ OpMemberName %27 1 "clipDistancesEnabled"
+ OpMemberName %27 2 "xfbActiveUnpaused"
+ OpMemberName %27 3 "xfbVerticesPerInstance"
+ OpMemberName %27 4 "numSamples"
+ OpMemberName %27 5 "xfbBufferOffsets"
+ OpMemberName %27 6 "acbBufferOffsets"
+ OpMemberName %27 7 "depthRange"
+ OpName %29 "ANGLEUniforms" ; id %29
+ OpName %33 "_uc" ; id %33
+ OpName %32 "_uh" ; id %32
+ OpName %49 "_ux" ; id %49
+ OpName %50 "_uy" ; id %50
+ OpName %48 "_ui" ; id %48
+ OpName %63 "main" ; id %63
+ OpName %65 "param" ; id %65
+ OpName %68 "param" ; id %68
+ OpName %73 "param" ; id %73
+
+ ; Annotations
+ OpDecorate %4 Location 0
+ OpDecorate %8 RelaxedPrecision
+ OpDecorate %8 DescriptorSet 0
+ OpDecorate %8 Binding 0
+ OpDecorate %11 DescriptorSet 0
+ OpDecorate %11 Binding 1
+ OpMemberDecorate %12 0 Offset 0
+ OpMemberDecorate %12 0 RelaxedPrecision
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 2
+ OpMemberDecorate %15 0 Offset 0
+ OpMemberDecorate %15 0 RelaxedPrecision
+ OpDecorate %15 BufferBlock
+ OpDecorate %20 DescriptorSet 0
+ OpDecorate %20 Binding 3
+ OpDecorate %22 RelaxedPrecision
+ OpDecorate %22 Location 0
+ OpMemberDecorate %26 0 Offset 0
+ OpMemberDecorate %26 1 Offset 4
+ OpMemberDecorate %26 2 Offset 8
+ OpMemberDecorate %26 3 Offset 12
+ OpMemberDecorate %27 0 Offset 0
+ OpMemberDecorate %27 1 Offset 16
+ OpMemberDecorate %27 2 Offset 20
+ OpMemberDecorate %27 3 Offset 24
+ OpMemberDecorate %27 4 Offset 28
+ OpMemberDecorate %27 5 Offset 32
+ OpMemberDecorate %27 6 Offset 48
+ OpMemberDecorate %27 7 Offset 64
+ OpMemberDecorate %27 2 RelaxedPrecision
+ OpMemberDecorate %27 4 RelaxedPrecision
+ OpDecorate %27 Block
+ OpDecorate %29 DescriptorSet 0
+ OpDecorate %29 Binding 4
+ OpDecorate %32 RelaxedPrecision
+ OpDecorate %33 RelaxedPrecision
+ OpDecorate %36 RelaxedPrecision
+ OpDecorate %37 RelaxedPrecision
+ OpDecorate %38 RelaxedPrecision
+ OpDecorate %39 RelaxedPrecision
+ OpDecorate %41 RelaxedPrecision
+ OpDecorate %42 RelaxedPrecision
+ OpDecorate %43 RelaxedPrecision
+ OpDecorate %48 RelaxedPrecision
+ OpDecorate %49 RelaxedPrecision
+ OpDecorate %50 RelaxedPrecision
+ OpDecorate %52 RelaxedPrecision
+ OpDecorate %53 RelaxedPrecision
+ OpDecorate %54 RelaxedPrecision
+ OpDecorate %55 RelaxedPrecision
+ OpDecorate %56 RelaxedPrecision
+ OpDecorate %57 RelaxedPrecision
+ OpDecorate %58 RelaxedPrecision
+ OpDecorate %59 RelaxedPrecision
+ OpDecorate %60 RelaxedPrecision
+ OpDecorate %67 RelaxedPrecision
+ OpDecorate %68 RelaxedPrecision
+ OpDecorate %72 RelaxedPrecision
+ OpDecorate %73 RelaxedPrecision
+ OpDecorate %75 RelaxedPrecision
+ OpDecorate %76 RelaxedPrecision
+ OpDecorate %77 RelaxedPrecision
+ OpDecorate %80 RelaxedPrecision
+ OpDecorate %81 RelaxedPrecision
+
+ ; Types, variables and constants
+ %1 = OpTypeFloat 32
+ %2 = OpTypeVector %1 4
+ %5 = OpTypeImage %1 2D 0 0 0 1 Unknown
+ %6 = OpTypeSampledImage %5
+ %9 = OpTypeImage %1 2D 0 0 0 2 Rgba8
+ %12 = OpTypeStruct %2 ; Block
+ %15 = OpTypeStruct %2 ; BufferBlock
+ %16 = OpTypeInt 32 0
+ %17 = OpConstant %16 2
+ %18 = OpTypeArray %15 %17
+ %23 = OpTypeInt 32 1
+ %24 = OpTypeVector %23 4
+ %25 = OpTypeVector %16 4
+ %26 = OpTypeStruct %1 %1 %1 %1
+ %27 = OpTypeStruct %2 %16 %16 %23 %23 %24 %25 %26 ; Block
+ %35 = OpTypeVector %1 2
+ %40 = OpTypeVector %23 2
+ %61 = OpTypeVoid
+ %69 = OpConstant %16 0
+ %78 = OpConstant %16 1
+ %3 = OpTypePointer Input %2
+ %7 = OpTypePointer UniformConstant %6
+ %10 = OpTypePointer UniformConstant %9
+ %13 = OpTypePointer Uniform %12
+ %19 = OpTypePointer Uniform %18
+ %21 = OpTypePointer Output %2
+ %28 = OpTypePointer Uniform %27
+ %30 = OpTypePointer Function %2
+ %70 = OpTypePointer Uniform %2
+ %31 = OpTypeFunction %2 %30
+ %47 = OpTypeFunction %2 %30 %30
+ %62 = OpTypeFunction %61
+ %4 = OpVariable %3 Input ; Location 0
+ %8 = OpVariable %7 UniformConstant ; RelaxedPrecision, DescriptorSet 0, Binding 0
+ %11 = OpVariable %10 UniformConstant ; DescriptorSet 0, Binding 1
+ %14 = OpVariable %13 Uniform ; DescriptorSet 0, Binding 2
+ %20 = OpVariable %19 Uniform ; DescriptorSet 0, Binding 3
+ %22 = OpVariable %21 Output ; RelaxedPrecision, Location 0
+ %29 = OpVariable %28 Uniform ; DescriptorSet 0, Binding 4
+
+ ; Function 32
+ %32 = OpFunction %2 None %31 ; RelaxedPrecision
+ %33 = OpFunctionParameter %30 ; RelaxedPrecision
+ %34 = OpLabel
+ %36 = OpLoad %6 %8 ; RelaxedPrecision
+ %37 = OpLoad %2 %33 ; RelaxedPrecision
+ %38 = OpVectorShuffle %35 %37 %37 0 1 ; RelaxedPrecision
+ %39 = OpImageSampleImplicitLod %2 %36 %38 ; RelaxedPrecision
+ %41 = OpLoad %2 %33 ; RelaxedPrecision
+ %42 = OpVectorShuffle %35 %41 %41 2 3 ; RelaxedPrecision
+ %43 = OpConvertFToS %40 %42 ; RelaxedPrecision
+ %44 = OpLoad %9 %11
+ %45 = OpImageRead %2 %44 %43
+ %46 = OpFAdd %2 %39 %45
+ OpReturnValue %46
+ OpFunctionEnd
+
+ ; Function 48
+ %48 = OpFunction %2 None %47 ; RelaxedPrecision
+ %49 = OpFunctionParameter %30 ; RelaxedPrecision
+ %50 = OpFunctionParameter %30 ; RelaxedPrecision
+ %51 = OpLabel
+ %52 = OpLoad %2 %49 ; RelaxedPrecision
+ %53 = OpVectorShuffle %35 %52 %52 0 1 ; RelaxedPrecision
+ %54 = OpLoad %2 %50 ; RelaxedPrecision
+ %55 = OpVectorShuffle %35 %54 %54 2 3 ; RelaxedPrecision
+ %56 = OpCompositeExtract %1 %53 0 ; RelaxedPrecision
+ %57 = OpCompositeExtract %1 %53 1 ; RelaxedPrecision
+ %58 = OpCompositeExtract %1 %55 0 ; RelaxedPrecision
+ %59 = OpCompositeExtract %1 %55 1 ; RelaxedPrecision
+ %60 = OpCompositeConstruct %2 %56 %57 %58 %59 ; RelaxedPrecision
+ OpReturnValue %60
+ OpFunctionEnd
+
+ ; Function 63
+ %63 = OpFunction %61 None %62
+ %64 = OpLabel
+ %65 = OpVariable %30 Function
+ %68 = OpVariable %30 Function ; RelaxedPrecision
+ %73 = OpVariable %30 Function ; RelaxedPrecision
+ %66 = OpLoad %2 %4
+ OpStore %65 %66
+ %67 = OpFunctionCall %2 %32 %65 ; RelaxedPrecision
+ %71 = OpAccessChain %70 %14 %69
+ %72 = OpLoad %2 %71 ; RelaxedPrecision
+ OpStore %68 %72
+ %74 = OpAccessChain %70 %20 %69 %69
+ %75 = OpLoad %2 %74 ; RelaxedPrecision
+ OpStore %73 %75
+ %76 = OpFunctionCall %2 %48 %68 %73 ; RelaxedPrecision
+ %77 = OpFAdd %2 %67 %76 ; RelaxedPrecision
+ %79 = OpAccessChain %70 %20 %78 %69
+ %80 = OpLoad %2 %79 ; RelaxedPrecision
+ %81 = OpFAdd %2 %77 %80 ; RelaxedPrecision
+ OpStore %22 %81
+ OpReturn
+ OpFunctionEnd
+)";
+
+ EXPECT_THAT(
+ EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_COMMENT | SPV_BINARY_TO_TEXT_OPTION_INDENT,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
+TEST_F(TextToBinaryTest, NestedWithComments) {
+ const std::string input = R"(OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %8 %44
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "v"
+ OpName %44 "color"
+ OpDecorate %8 RelaxedPrecision
+ OpDecorate %8 Location 0
+ OpDecorate %9 RelaxedPrecision
+ OpDecorate %18 RelaxedPrecision
+ OpDecorate %19 RelaxedPrecision
+ OpDecorate %20 RelaxedPrecision
+ OpDecorate %23 RelaxedPrecision
+ OpDecorate %24 RelaxedPrecision
+ OpDecorate %25 RelaxedPrecision
+ OpDecorate %26 RelaxedPrecision
+ OpDecorate %27 RelaxedPrecision
+ OpDecorate %28 RelaxedPrecision
+ OpDecorate %29 RelaxedPrecision
+ OpDecorate %30 RelaxedPrecision
+ OpDecorate %31 RelaxedPrecision
+ OpDecorate %33 RelaxedPrecision
+ OpDecorate %34 RelaxedPrecision
+ OpDecorate %35 RelaxedPrecision
+ OpDecorate %36 RelaxedPrecision
+ OpDecorate %37 RelaxedPrecision
+ OpDecorate %39 RelaxedPrecision
+ OpDecorate %40 RelaxedPrecision
+ OpDecorate %41 RelaxedPrecision
+ OpDecorate %42 RelaxedPrecision
+ OpDecorate %44 RelaxedPrecision
+ OpDecorate %44 Location 0
+ OpDecorate %45 RelaxedPrecision
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Input %6
+ %8 = OpVariable %7 Input
+ %10 = OpConstant %6 0
+ %11 = OpTypeBool
+ %15 = OpTypeVector %6 4
+ %16 = OpTypePointer Function %15
+ %21 = OpConstant %6 -0.5
+ %22 = OpConstant %6 -0.300000012
+ %38 = OpConstant %6 0.5
+ %43 = OpTypePointer Output %15
+ %44 = OpVariable %43 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpLoad %6 %8
+ %12 = OpFOrdLessThanEqual %11 %9 %10
+ OpSelectionMerge %14 None
+ OpBranchConditional %12 %13 %32
+ %13 = OpLabel
+ %18 = OpLoad %6 %8
+ %19 = OpExtInst %6 %1 Log %18
+ %20 = OpLoad %6 %8
+ %23 = OpExtInst %6 %1 FClamp %20 %21 %22
+ %24 = OpFMul %6 %19 %23
+ %25 = OpLoad %6 %8
+ %26 = OpExtInst %6 %1 Sin %25
+ %27 = OpLoad %6 %8
+ %28 = OpExtInst %6 %1 Cos %27
+ %29 = OpLoad %6 %8
+ %30 = OpExtInst %6 %1 Exp %29
+ %31 = OpCompositeConstruct %15 %24 %26 %28 %30
+ OpBranch %14
+ %32 = OpLabel
+ %33 = OpLoad %6 %8
+ %34 = OpExtInst %6 %1 Sqrt %33
+ %35 = OpLoad %6 %8
+ %36 = OpExtInst %6 %1 FSign %35
+ %37 = OpLoad %6 %8
+ %39 = OpExtInst %6 %1 FMax %37 %38
+ %40 = OpLoad %6 %8
+ %41 = OpExtInst %6 %1 Floor %40
+ %42 = OpCompositeConstruct %15 %34 %36 %39 %41
+ OpBranch %14
+ %14 = OpLabel
+ %45 = OpPhi %15 %31 %13 %42 %32
+ OpStore %44 %45
+ OpReturn
+ OpFunctionEnd
+)";
+ const std::string expected = R"( OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %8 %44
+ OpExecutionMode %4 OriginUpperLeft
+
+ ; Debug Information
+ OpSource ESSL 310
+ OpName %4 "main" ; id %4
+ OpName %8 "v" ; id %8
+ OpName %44 "color" ; id %44
+
+ ; Annotations
+ OpDecorate %8 RelaxedPrecision
+ OpDecorate %8 Location 0
+ OpDecorate %9 RelaxedPrecision
+ OpDecorate %18 RelaxedPrecision
+ OpDecorate %19 RelaxedPrecision
+ OpDecorate %20 RelaxedPrecision
+ OpDecorate %23 RelaxedPrecision
+ OpDecorate %24 RelaxedPrecision
+ OpDecorate %25 RelaxedPrecision
+ OpDecorate %26 RelaxedPrecision
+ OpDecorate %27 RelaxedPrecision
+ OpDecorate %28 RelaxedPrecision
+ OpDecorate %29 RelaxedPrecision
+ OpDecorate %30 RelaxedPrecision
+ OpDecorate %31 RelaxedPrecision
+ OpDecorate %33 RelaxedPrecision
+ OpDecorate %34 RelaxedPrecision
+ OpDecorate %35 RelaxedPrecision
+ OpDecorate %36 RelaxedPrecision
+ OpDecorate %37 RelaxedPrecision
+ OpDecorate %39 RelaxedPrecision
+ OpDecorate %40 RelaxedPrecision
+ OpDecorate %41 RelaxedPrecision
+ OpDecorate %42 RelaxedPrecision
+ OpDecorate %44 RelaxedPrecision
+ OpDecorate %44 Location 0
+ OpDecorate %45 RelaxedPrecision
+
+ ; Types, variables and constants
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Input %6
+ %8 = OpVariable %7 Input ; RelaxedPrecision, Location 0
+ %10 = OpConstant %6 0
+ %11 = OpTypeBool
+ %15 = OpTypeVector %6 4
+ %16 = OpTypePointer Function %15
+ %21 = OpConstant %6 -0.5
+ %22 = OpConstant %6 -0.300000012
+ %38 = OpConstant %6 0.5
+ %43 = OpTypePointer Output %15
+ %44 = OpVariable %43 Output ; RelaxedPrecision, Location 0
+
+
+ ; Function 4
+ %4 = OpFunction %2 None %3
+
+ %5 = OpLabel
+ %9 = OpLoad %6 %8 ; RelaxedPrecision
+ %12 = OpFOrdLessThanEqual %11 %9 %10
+ OpSelectionMerge %14 None
+ OpBranchConditional %12 %13 %32
+
+ %13 = OpLabel
+ %18 = OpLoad %6 %8 ; RelaxedPrecision
+ %19 = OpExtInst %6 %1 Log %18 ; RelaxedPrecision
+ %20 = OpLoad %6 %8 ; RelaxedPrecision
+ %23 = OpExtInst %6 %1 FClamp %20 %21 %22 ; RelaxedPrecision
+ %24 = OpFMul %6 %19 %23 ; RelaxedPrecision
+ %25 = OpLoad %6 %8 ; RelaxedPrecision
+ %26 = OpExtInst %6 %1 Sin %25 ; RelaxedPrecision
+ %27 = OpLoad %6 %8 ; RelaxedPrecision
+ %28 = OpExtInst %6 %1 Cos %27 ; RelaxedPrecision
+ %29 = OpLoad %6 %8 ; RelaxedPrecision
+ %30 = OpExtInst %6 %1 Exp %29 ; RelaxedPrecision
+ %31 = OpCompositeConstruct %15 %24 %26 %28 %30 ; RelaxedPrecision
+ OpBranch %14
+
+ %32 = OpLabel
+ %33 = OpLoad %6 %8 ; RelaxedPrecision
+ %34 = OpExtInst %6 %1 Sqrt %33 ; RelaxedPrecision
+ %35 = OpLoad %6 %8 ; RelaxedPrecision
+ %36 = OpExtInst %6 %1 FSign %35 ; RelaxedPrecision
+ %37 = OpLoad %6 %8 ; RelaxedPrecision
+ %39 = OpExtInst %6 %1 FMax %37 %38 ; RelaxedPrecision
+ %40 = OpLoad %6 %8 ; RelaxedPrecision
+ %41 = OpExtInst %6 %1 Floor %40 ; RelaxedPrecision
+ %42 = OpCompositeConstruct %15 %34 %36 %39 %41 ; RelaxedPrecision
+ OpBranch %14
+
+ %14 = OpLabel
+ %45 = OpPhi %15 %31 %13 %42 %32 ; RelaxedPrecision
+ OpStore %44 %45
+ OpReturn
+ OpFunctionEnd
+)";
+
+ EXPECT_THAT(
+ EncodeAndDecodeSuccessfully(
+ input,
+ SPV_BINARY_TO_TEXT_OPTION_COMMENT | SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS),
+ expected);
+}
+
// Test version string.
TEST_F(TextToBinaryTest, VersionString) {
auto words = CompileSuccessfully("");
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/diff_test_files_autogen.cmake b/third_party/SPIRV-Tools/test/diff/diff_files/diff_test_files_autogen.cmake
index 51cb62f..ce687d5 100644
--- a/third_party/SPIRV-Tools/test/diff/diff_files/diff_test_files_autogen.cmake
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/diff_test_files_autogen.cmake
@@ -30,6 +30,8 @@
"diff_files/different_decorations_vertex_autogen.cpp"
"diff_files/different_function_parameter_count_autogen.cpp"
"diff_files/extra_if_block_autogen.cpp"
+"diff_files/function_group_by_full_type_autogen.cpp"
+"diff_files/function_group_by_mapped_id_autogen.cpp"
"diff_files/index_signedness_autogen.cpp"
"diff_files/int_vs_uint_constants_autogen.cpp"
"diff_files/large_functions_large_diffs_autogen.cpp"
@@ -44,5 +46,6 @@
"diff_files/spec_constant_composite_autogen.cpp"
"diff_files/spec_constant_op_autogen.cpp"
"diff_files/spec_constant_specid_autogen.cpp"
+"diff_files/string_in_ext_inst_autogen.cpp"
"diff_files/unrelated_shaders_autogen.cpp"
)
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_autogen.cpp b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_autogen.cpp
new file mode 100644
index 0000000..1843425
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_autogen.cpp
@@ -0,0 +1,194 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_tests.py
+//
+// Copyright (c) 2022 Google LLC.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "../diff_test_utils.h"
+#include "gtest/gtest.h"
+
+namespace spvtools {
+namespace diff {
+namespace {
+
+// Use functions' `OpFunctionType` to group before grouping by return type only.
+constexpr char kSrc[] = R"( OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstantNull %int
+
+ %fn_int = OpTypeFunction %bool %int
+ %fn_int_int = OpTypeFunction %bool %int %int
+
+ %f = OpFunction %bool None %fn_int
+ %fp1 = OpFunctionParameter %int
+ %f_prologue = OpLabel
+ %fr = OpIEqual %bool %fp1 %int_0
+ OpReturnValue %fr
+ OpFunctionEnd
+
+ %g = OpFunction %bool None %fn_int_int
+ %gp1 = OpFunctionParameter %int
+ %gp2 = OpFunctionParameter %int
+ %g_prologue = OpLabel
+ %gr = OpIEqual %bool %gp1 %int_0
+ OpReturnValue %gr
+ OpFunctionEnd)";
+constexpr char kDst[] =
+ R"(;; Use functions' `OpFunctionType` to group before grouping by return type only.
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstantNull %int
+
+ %fn_int = OpTypeFunction %bool %int
+ %fn_int_int = OpTypeFunction %bool %int %int
+
+ %g = OpFunction %bool None %fn_int_int
+ %gp1 = OpFunctionParameter %int
+ %gp2 = OpFunctionParameter %int
+ %g_prologue = OpLabel
+ %gr = OpIEqual %bool %gp1 %int_0
+ OpReturnValue %gr
+ OpFunctionEnd
+
+ %f = OpFunction %bool None %fn_int
+ %fp1 = OpFunctionParameter %int
+ %f_prologue = OpLabel
+ %fr = OpIEqual %bool %fp1 %int_0
+ OpReturnValue %fr
+ OpFunctionEnd
+)";
+
+TEST(DiffTest, FunctionGroupByFullType) {
+ constexpr char kDiff[] = R"( ; SPIR-V
+ ; Version: 1.6
+ ; Generator: Khronos SPIR-V Tools Assembler; 0
+ ; Bound: 15
+ ; Schema: 0
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %1 = OpTypeBool
+ %2 = OpTypeInt 32 1
+ %3 = OpConstantNull %2
+ %4 = OpTypeFunction %1 %2
+ %5 = OpTypeFunction %1 %2 %2
+ %6 = OpFunction %1 None %4
+ %7 = OpFunctionParameter %2
+ %8 = OpLabel
+ %9 = OpIEqual %1 %7 %3
+ OpReturnValue %9
+ OpFunctionEnd
+ %10 = OpFunction %1 None %5
+ %11 = OpFunctionParameter %2
+ %12 = OpFunctionParameter %2
+ %13 = OpLabel
+ %14 = OpIEqual %1 %11 %3
+ OpReturnValue %14
+ OpFunctionEnd
+)";
+ Options options;
+ DoStringDiffTest(kSrc, kDst, kDiff, options);
+}
+
+TEST(DiffTest, FunctionGroupByFullTypeNoDebug) {
+ constexpr char kSrcNoDebug[] = R"( OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstantNull %int
+
+ %fn_int = OpTypeFunction %bool %int
+ %fn_int_int = OpTypeFunction %bool %int %int
+
+ %f = OpFunction %bool None %fn_int
+ %fp1 = OpFunctionParameter %int
+ %f_prologue = OpLabel
+ %fr = OpIEqual %bool %fp1 %int_0
+ OpReturnValue %fr
+ OpFunctionEnd
+
+ %g = OpFunction %bool None %fn_int_int
+ %gp1 = OpFunctionParameter %int
+ %gp2 = OpFunctionParameter %int
+ %g_prologue = OpLabel
+ %gr = OpIEqual %bool %gp1 %int_0
+ OpReturnValue %gr
+ OpFunctionEnd
+)";
+ constexpr char kDstNoDebug[] = R"( OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstantNull %int
+
+ %fn_int = OpTypeFunction %bool %int
+ %fn_int_int = OpTypeFunction %bool %int %int
+
+ %g = OpFunction %bool None %fn_int_int
+ %gp1 = OpFunctionParameter %int
+ %gp2 = OpFunctionParameter %int
+ %g_prologue = OpLabel
+ %gr = OpIEqual %bool %gp1 %int_0
+ OpReturnValue %gr
+ OpFunctionEnd
+
+ %f = OpFunction %bool None %fn_int
+ %fp1 = OpFunctionParameter %int
+ %f_prologue = OpLabel
+ %fr = OpIEqual %bool %fp1 %int_0
+ OpReturnValue %fr
+ OpFunctionEnd
+)";
+ constexpr char kDiff[] = R"( ; SPIR-V
+ ; Version: 1.6
+ ; Generator: Khronos SPIR-V Tools Assembler; 0
+ ; Bound: 15
+ ; Schema: 0
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %1 = OpTypeBool
+ %2 = OpTypeInt 32 1
+ %3 = OpConstantNull %2
+ %4 = OpTypeFunction %1 %2
+ %5 = OpTypeFunction %1 %2 %2
+ %6 = OpFunction %1 None %4
+ %7 = OpFunctionParameter %2
+ %8 = OpLabel
+ %9 = OpIEqual %1 %7 %3
+ OpReturnValue %9
+ OpFunctionEnd
+ %10 = OpFunction %1 None %5
+ %11 = OpFunctionParameter %2
+ %12 = OpFunctionParameter %2
+ %13 = OpLabel
+ %14 = OpIEqual %1 %11 %3
+ OpReturnValue %14
+ OpFunctionEnd
+)";
+ Options options;
+ DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options);
+}
+
+} // namespace
+} // namespace diff
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_dst.spvasm b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_dst.spvasm
new file mode 100644
index 0000000..eea5276
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_dst.spvasm
@@ -0,0 +1,25 @@
+;; Use functions' `OpFunctionType` to group before grouping by return type only.
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstantNull %int
+
+ %fn_int = OpTypeFunction %bool %int
+ %fn_int_int = OpTypeFunction %bool %int %int
+
+ %g = OpFunction %bool None %fn_int_int
+ %gp1 = OpFunctionParameter %int
+ %gp2 = OpFunctionParameter %int
+ %g_prologue = OpLabel
+ %gr = OpIEqual %bool %gp1 %int_0
+ OpReturnValue %gr
+ OpFunctionEnd
+
+ %f = OpFunction %bool None %fn_int
+ %fp1 = OpFunctionParameter %int
+ %f_prologue = OpLabel
+ %fr = OpIEqual %bool %fp1 %int_0
+ OpReturnValue %fr
+ OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_src.spvasm b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_src.spvasm
new file mode 100644
index 0000000..5cc7dd5
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_full_type_src.spvasm
@@ -0,0 +1,25 @@
+;; Use functions' `OpFunctionType` to group before grouping by return type only.
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstantNull %int
+
+ %fn_int = OpTypeFunction %bool %int
+ %fn_int_int = OpTypeFunction %bool %int %int
+
+ %f = OpFunction %bool None %fn_int
+ %fp1 = OpFunctionParameter %int
+ %f_prologue = OpLabel
+ %fr = OpIEqual %bool %fp1 %int_0
+ OpReturnValue %fr
+ OpFunctionEnd
+
+ %g = OpFunction %bool None %fn_int_int
+ %gp1 = OpFunctionParameter %int
+ %gp2 = OpFunctionParameter %int
+ %g_prologue = OpLabel
+ %gr = OpIEqual %bool %gp1 %int_0
+ OpReturnValue %gr
+ OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_autogen.cpp b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_autogen.cpp
new file mode 100644
index 0000000..66e7bd9
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_autogen.cpp
@@ -0,0 +1,181 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_tests.py
+//
+// Copyright (c) 2022 Google LLC.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "../diff_test_utils.h"
+#include "gtest/gtest.h"
+
+namespace spvtools {
+namespace diff {
+namespace {
+
+// Don't forget to map between source and destination ids when grouping
+// functions by return type.
+constexpr char kSrc[] = R"( OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %void = OpTypeVoid
+ %1 = OpTypeInt 32 0
+ %2 = OpTypeInt 32 1
+
+ %fn_uint = OpTypeFunction %1
+ %fn_int = OpTypeFunction %2
+
+ %uint_42 = OpConstant %1 42
+ %int_1729 = OpConstant %2 1729
+
+ %f = OpFunction %1 None %fn_uint
+ %f_prologue = OpLabel
+ OpReturnValue %uint_42
+ OpFunctionEnd
+
+ %g = OpFunction %2 None %fn_int
+ %g_prologue = OpLabel
+ OpReturnValue %int_1729
+ OpFunctionEnd)";
+constexpr char kDst[] =
+ R"(;; Don't forget to map between source and destination ids when grouping functions by return type.
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %void = OpTypeVoid
+ %2 = OpTypeInt 32 0
+ %1 = OpTypeInt 32 1
+
+ %fn_uint = OpTypeFunction %2
+ %fn_int = OpTypeFunction %1
+
+ %uint_42 = OpConstant %2 42
+ %int_1729 = OpConstant %1 1729
+
+ %f = OpFunction %2 None %fn_uint
+ %f_prologue = OpLabel
+ OpReturnValue %uint_42
+ OpFunctionEnd
+
+ %g = OpFunction %1 None %fn_int
+ %g_prologue = OpLabel
+ OpReturnValue %int_1729
+ OpFunctionEnd
+)";
+
+TEST(DiffTest, FunctionGroupByMappedId) {
+ constexpr char kDiff[] = R"( ; SPIR-V
+ ; Version: 1.6
+ ; Generator: Khronos SPIR-V Tools Assembler; 0
+ ; Bound: 12
+ ; Schema: 0
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %3 = OpTypeVoid
+ %1 = OpTypeInt 32 0
+ %2 = OpTypeInt 32 1
+ %4 = OpTypeFunction %1
+ %5 = OpTypeFunction %2
+ %6 = OpConstant %1 42
+ %7 = OpConstant %2 1729
+ %8 = OpFunction %1 None %4
+ %9 = OpLabel
+ OpReturnValue %6
+ OpFunctionEnd
+ %10 = OpFunction %2 None %5
+ %11 = OpLabel
+ OpReturnValue %7
+ OpFunctionEnd
+)";
+ Options options;
+ DoStringDiffTest(kSrc, kDst, kDiff, options);
+}
+
+TEST(DiffTest, FunctionGroupByMappedIdNoDebug) {
+ constexpr char kSrcNoDebug[] = R"( OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %void = OpTypeVoid
+ %1 = OpTypeInt 32 0
+ %2 = OpTypeInt 32 1
+
+ %fn_uint = OpTypeFunction %1
+ %fn_int = OpTypeFunction %2
+
+ %uint_42 = OpConstant %1 42
+ %int_1729 = OpConstant %2 1729
+
+ %f = OpFunction %1 None %fn_uint
+ %f_prologue = OpLabel
+ OpReturnValue %uint_42
+ OpFunctionEnd
+
+ %g = OpFunction %2 None %fn_int
+ %g_prologue = OpLabel
+ OpReturnValue %int_1729
+ OpFunctionEnd
+)";
+ constexpr char kDstNoDebug[] = R"( OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %void = OpTypeVoid
+ %2 = OpTypeInt 32 0
+ %1 = OpTypeInt 32 1
+
+ %fn_uint = OpTypeFunction %2
+ %fn_int = OpTypeFunction %1
+
+ %uint_42 = OpConstant %2 42
+ %int_1729 = OpConstant %1 1729
+
+ %f = OpFunction %2 None %fn_uint
+ %f_prologue = OpLabel
+ OpReturnValue %uint_42
+ OpFunctionEnd
+
+ %g = OpFunction %1 None %fn_int
+ %g_prologue = OpLabel
+ OpReturnValue %int_1729
+ OpFunctionEnd
+)";
+ constexpr char kDiff[] = R"( ; SPIR-V
+ ; Version: 1.6
+ ; Generator: Khronos SPIR-V Tools Assembler; 0
+ ; Bound: 12
+ ; Schema: 0
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %3 = OpTypeVoid
+ %1 = OpTypeInt 32 0
+ %2 = OpTypeInt 32 1
+ %4 = OpTypeFunction %1
+ %5 = OpTypeFunction %2
+ %6 = OpConstant %1 42
+ %7 = OpConstant %2 1729
+ %8 = OpFunction %1 None %4
+ %9 = OpLabel
+ OpReturnValue %6
+ OpFunctionEnd
+ %10 = OpFunction %2 None %5
+ %11 = OpLabel
+ OpReturnValue %7
+ OpFunctionEnd
+)";
+ Options options;
+ DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options);
+}
+
+} // namespace
+} // namespace diff
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_dst.spvasm b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_dst.spvasm
new file mode 100644
index 0000000..6af4241
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_dst.spvasm
@@ -0,0 +1,23 @@
+;; Don't forget to map between source and destination ids when grouping functions by return type.
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %void = OpTypeVoid
+ %2 = OpTypeInt 32 0
+ %1 = OpTypeInt 32 1
+
+ %fn_uint = OpTypeFunction %2
+ %fn_int = OpTypeFunction %1
+
+ %uint_42 = OpConstant %2 42
+ %int_1729 = OpConstant %1 1729
+
+ %f = OpFunction %2 None %fn_uint
+ %f_prologue = OpLabel
+ OpReturnValue %uint_42
+ OpFunctionEnd
+
+ %g = OpFunction %1 None %fn_int
+ %g_prologue = OpLabel
+ OpReturnValue %int_1729
+ OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_src.spvasm b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_src.spvasm
new file mode 100644
index 0000000..d920381
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/function_group_by_mapped_id_src.spvasm
@@ -0,0 +1,23 @@
+;; Don't forget to map between source and destination ids when grouping functions by return type.
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ %void = OpTypeVoid
+ %1 = OpTypeInt 32 0
+ %2 = OpTypeInt 32 1
+
+ %fn_uint = OpTypeFunction %1
+ %fn_int = OpTypeFunction %2
+
+ %uint_42 = OpConstant %1 42
+ %int_1729 = OpConstant %2 1729
+
+ %f = OpFunction %1 None %fn_uint
+ %f_prologue = OpLabel
+ OpReturnValue %uint_42
+ OpFunctionEnd
+
+ %g = OpFunction %2 None %fn_int
+ %g_prologue = OpLabel
+ OpReturnValue %int_1729
+ OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_autogen.cpp b/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_autogen.cpp
new file mode 100644
index 0000000..9362c7f
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_autogen.cpp
@@ -0,0 +1,204 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_tests.py
+//
+// Copyright (c) 2022 Google LLC.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "../diff_test_utils.h"
+#include "gtest/gtest.h"
+
+namespace spvtools {
+namespace diff {
+namespace {
+
+// Tests a diff where the an OpString is used only as parameter of OpExtInst.
+constexpr char kSrc[] = R"( OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %10 = OpString "unsigned == %u"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ OpName %main "main"
+ OpName %foo "foo"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %uint_127 = OpConstant %uint 127
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %foo = OpVariable %_ptr_Function_uint Function
+ OpStore %foo %uint_127
+ %11 = OpLoad %uint %foo
+ %13 = OpExtInst %void %12 1 %10 %11
+ OpReturn
+ OpFunctionEnd)";
+constexpr char kDst[] = R"( OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %10 = OpString "signed == %d"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ OpName %main "main"
+ OpName %foo "foo"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %uint_127 = OpConstant %uint 127
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %foo = OpVariable %_ptr_Function_uint Function
+ OpStore %foo %uint_127
+ %11 = OpLoad %uint %foo
+ %13 = OpExtInst %void %12 1 %10 %11
+ OpReturn
+ OpFunctionEnd
+)";
+
+TEST(DiffTest, StringInExtInst) {
+ constexpr char kDiff[] = R"( ; SPIR-V
+ ; Version: 1.6
+ ; Generator: Khronos SPIR-V Tools Assembler; 0
+-; Bound: 14
++; Bound: 15
+ ; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+-%10 = OpString "unsigned == %u"
++%14 = OpString "signed == %d"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ OpName %2 "main"
+ OpName %4 "foo"
+ %6 = OpTypeVoid
+ %3 = OpTypeFunction %6
+ %7 = OpTypeInt 32 0
+ %8 = OpTypePointer Function %7
+ %9 = OpConstant %7 127
+ %2 = OpFunction %6 None %3
+ %5 = OpLabel
+ %4 = OpVariable %8 Function
+ OpStore %4 %9
+ %11 = OpLoad %7 %4
+-%13 = OpExtInst %6 %12 1 %10 %11
++%13 = OpExtInst %6 %12 1 %14 %11
+ OpReturn
+ OpFunctionEnd
+)";
+ Options options;
+ DoStringDiffTest(kSrc, kDst, kDiff, options);
+}
+
+TEST(DiffTest, StringInExtInstNoDebug) {
+ constexpr char kSrcNoDebug[] = R"( OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %10 = OpString "unsigned == %u"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %uint_127 = OpConstant %uint 127
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %foo = OpVariable %_ptr_Function_uint Function
+ OpStore %foo %uint_127
+ %11 = OpLoad %uint %foo
+ %13 = OpExtInst %void %12 1 %10 %11
+ OpReturn
+ OpFunctionEnd
+)";
+ constexpr char kDstNoDebug[] = R"( OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %10 = OpString "signed == %d"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %uint_127 = OpConstant %uint 127
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %foo = OpVariable %_ptr_Function_uint Function
+ OpStore %foo %uint_127
+ %11 = OpLoad %uint %foo
+ %13 = OpExtInst %void %12 1 %10 %11
+ OpReturn
+ OpFunctionEnd
+)";
+ constexpr char kDiff[] = R"( ; SPIR-V
+ ; Version: 1.6
+ ; Generator: Khronos SPIR-V Tools Assembler; 0
+-; Bound: 14
++; Bound: 15
+ ; Schema: 0
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+-%10 = OpString "unsigned == %u"
++%14 = OpString "signed == %d"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ %4 = OpTypeVoid
+ %3 = OpTypeFunction %4
+ %6 = OpTypeInt 32 0
+ %7 = OpTypePointer Function %6
+ %8 = OpConstant %6 127
+ %2 = OpFunction %4 None %3
+ %5 = OpLabel
+ %9 = OpVariable %7 Function
+ OpStore %9 %8
+ %11 = OpLoad %6 %9
+-%13 = OpExtInst %4 %12 1 %10 %11
++%13 = OpExtInst %4 %12 1 %14 %11
+ OpReturn
+ OpFunctionEnd
+)";
+ Options options;
+ DoStringDiffTest(kSrcNoDebug, kDstNoDebug, kDiff, options);
+}
+
+} // namespace
+} // namespace diff
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_dst.spvasm b/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_dst.spvasm
new file mode 100644
index 0000000..3681332
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_dst.spvasm
@@ -0,0 +1,25 @@
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %10 = OpString "signed == %d"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ OpName %main "main"
+ OpName %foo "foo"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %uint_127 = OpConstant %uint 127
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %foo = OpVariable %_ptr_Function_uint Function
+ OpStore %foo %uint_127
+ %11 = OpLoad %uint %foo
+ %13 = OpExtInst %void %12 1 %10 %11
+ OpReturn
+ OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_src.spvasm b/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_src.spvasm
new file mode 100644
index 0000000..dd55bce
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/diff/diff_files/string_in_ext_inst_src.spvasm
@@ -0,0 +1,26 @@
+;; Tests a diff where the an OpString is used only as parameter of OpExtInst.
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %12 = OpExtInstImport "NonSemantic.DebugPrintf"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %10 = OpString "unsigned == %u"
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_debug_printf"
+ OpName %main "main"
+ OpName %foo "foo"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %uint_127 = OpConstant %uint 127
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %foo = OpVariable %_ptr_Function_uint Function
+ OpStore %foo %uint_127
+ %11 = OpLoad %uint %foo
+ %13 = OpExtInst %void %12 1 %10 %11
+ OpReturn
+ OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/diff/diff_test.cpp b/third_party/SPIRV-Tools/test/diff/diff_test.cpp
index 3b63c69..da86931 100644
--- a/third_party/SPIRV-Tools/test/diff/diff_test.cpp
+++ b/third_party/SPIRV-Tools/test/diff/diff_test.cpp
@@ -20,7 +20,6 @@
#include "source/opt/ir_context.h"
#include "source/spirv_constant.h"
#include "spirv-tools/libspirv.hpp"
-#include "tools/io.h"
#include "tools/util/cli_consumer.h"
#include <fstream>
diff --git a/third_party/SPIRV-Tools/test/diff/diff_test_utils.cpp b/third_party/SPIRV-Tools/test/diff/diff_test_utils.cpp
index 14bb821..3bea9c3 100644
--- a/third_party/SPIRV-Tools/test/diff/diff_test_utils.cpp
+++ b/third_party/SPIRV-Tools/test/diff/diff_test_utils.cpp
@@ -18,7 +18,6 @@
#include "source/opt/ir_context.h"
#include "spirv-tools/libspirv.hpp"
-#include "tools/io.h"
#include "tools/util/cli_consumer.h"
#include "gtest/gtest.h"
diff --git a/third_party/SPIRV-Tools/test/enum_set_test.cpp b/third_party/SPIRV-Tools/test/enum_set_test.cpp
index 11105f9..08a4693 100644
--- a/third_party/SPIRV-Tools/test/enum_set_test.cpp
+++ b/third_party/SPIRV-Tools/test/enum_set_test.cpp
@@ -846,9 +846,6 @@
CapabilitySet copy(GetParam().capabilities);
CapabilitySet moved(std::move(copy));
EXPECT_THAT(ElementsIn(moved), Eq(GetParam().expected));
-
- // The moved-from set is empty.
- EXPECT_THAT(ElementsIn(copy), Eq(std::vector<spv::Capability>{}));
}
TEST_P(CapabilitySetForEachTest, OperatorEquals) {
@@ -858,7 +855,7 @@
TEST_P(CapabilitySetForEachTest, OperatorEqualsSelfAssign) {
CapabilitySet assigned{GetParam().capabilities};
- assigned = assigned;
+ assigned = assigned; // NOLINT
EXPECT_THAT(ElementsIn(assigned), Eq(GetParam().expected));
}
diff --git a/third_party/SPIRV-Tools/test/enum_string_mapping_test.cpp b/third_party/SPIRV-Tools/test/enum_string_mapping_test.cpp
index 01dede7..e073c4b 100644
--- a/third_party/SPIRV-Tools/test/enum_string_mapping_test.cpp
+++ b/third_party/SPIRV-Tools/test/enum_string_mapping_test.cpp
@@ -21,8 +21,7 @@
#include <vector>
#include "gtest/gtest.h"
-#include "source/enum_string_mapping.h"
-#include "source/extensions.h"
+#include "source/table2.h"
namespace spvtools {
namespace {
@@ -33,8 +32,6 @@
using ExtensionTest =
::testing::TestWithParam<std::pair<Extension, std::string>>;
using UnknownExtensionTest = ::testing::TestWithParam<std::string>;
-using CapabilityTest =
- ::testing::TestWithParam<std::pair<spv::Capability, std::string>>;
TEST_P(ExtensionTest, TestExtensionFromString) {
const std::pair<Extension, std::string>& param = GetParam();
@@ -58,14 +55,6 @@
ASSERT_FALSE(GetExtensionFromString(GetParam().c_str(), &result_extension));
}
-TEST_P(CapabilityTest, TestCapabilityToString) {
- const std::pair<spv::Capability, std::string>& param = GetParam();
- const spv::Capability capability = param.first;
- const std::string capability_str = param.second;
- const std::string result_str = CapabilityToString(capability);
- EXPECT_EQ(capability_str, result_str);
-}
-
INSTANTIATE_TEST_SUITE_P(
AllExtensions, ExtensionTest,
ValuesIn(std::vector<std::pair<Extension, std::string>>({
@@ -97,107 +86,5 @@
/*alphabetically after all extensions*/ "Z",
"SPV_ERROR_random_string_hfsdklhlktherh"));
-INSTANTIATE_TEST_SUITE_P(
- AllCapabilities, CapabilityTest,
- ValuesIn(std::vector<std::pair<spv::Capability, std::string>>(
- {{spv::Capability::Matrix, "Matrix"},
- {spv::Capability::Shader, "Shader"},
- {spv::Capability::Geometry, "Geometry"},
- {spv::Capability::Tessellation, "Tessellation"},
- {spv::Capability::Addresses, "Addresses"},
- {spv::Capability::Linkage, "Linkage"},
- {spv::Capability::Kernel, "Kernel"},
- {spv::Capability::Vector16, "Vector16"},
- {spv::Capability::Float16Buffer, "Float16Buffer"},
- {spv::Capability::Float16, "Float16"},
- {spv::Capability::Float64, "Float64"},
- {spv::Capability::Int64, "Int64"},
- {spv::Capability::Int64Atomics, "Int64Atomics"},
- {spv::Capability::ImageBasic, "ImageBasic"},
- {spv::Capability::ImageReadWrite, "ImageReadWrite"},
- {spv::Capability::ImageMipmap, "ImageMipmap"},
- {spv::Capability::Pipes, "Pipes"},
- {spv::Capability::Groups, "Groups"},
- {spv::Capability::DeviceEnqueue, "DeviceEnqueue"},
- {spv::Capability::LiteralSampler, "LiteralSampler"},
- {spv::Capability::AtomicStorage, "AtomicStorage"},
- {spv::Capability::Int16, "Int16"},
- {spv::Capability::TessellationPointSize, "TessellationPointSize"},
- {spv::Capability::GeometryPointSize, "GeometryPointSize"},
- {spv::Capability::ImageGatherExtended, "ImageGatherExtended"},
- {spv::Capability::StorageImageMultisample, "StorageImageMultisample"},
- {spv::Capability::UniformBufferArrayDynamicIndexing,
- "UniformBufferArrayDynamicIndexing"},
- {spv::Capability::SampledImageArrayDynamicIndexing,
- "SampledImageArrayDynamicIndexing"},
- {spv::Capability::StorageBufferArrayDynamicIndexing,
- "StorageBufferArrayDynamicIndexing"},
- {spv::Capability::StorageImageArrayDynamicIndexing,
- "StorageImageArrayDynamicIndexing"},
- {spv::Capability::ClipDistance, "ClipDistance"},
- {spv::Capability::CullDistance, "CullDistance"},
- {spv::Capability::ImageCubeArray, "ImageCubeArray"},
- {spv::Capability::SampleRateShading, "SampleRateShading"},
- {spv::Capability::ImageRect, "ImageRect"},
- {spv::Capability::SampledRect, "SampledRect"},
- {spv::Capability::GenericPointer, "GenericPointer"},
- {spv::Capability::Int8, "Int8"},
- {spv::Capability::InputAttachment, "InputAttachment"},
- {spv::Capability::SparseResidency, "SparseResidency"},
- {spv::Capability::MinLod, "MinLod"},
- {spv::Capability::Sampled1D, "Sampled1D"},
- {spv::Capability::Image1D, "Image1D"},
- {spv::Capability::SampledCubeArray, "SampledCubeArray"},
- {spv::Capability::SampledBuffer, "SampledBuffer"},
- {spv::Capability::ImageBuffer, "ImageBuffer"},
- {spv::Capability::ImageMSArray, "ImageMSArray"},
- {spv::Capability::StorageImageExtendedFormats,
- "StorageImageExtendedFormats"},
- {spv::Capability::ImageQuery, "ImageQuery"},
- {spv::Capability::DerivativeControl, "DerivativeControl"},
- {spv::Capability::InterpolationFunction, "InterpolationFunction"},
- {spv::Capability::TransformFeedback, "TransformFeedback"},
- {spv::Capability::GeometryStreams, "GeometryStreams"},
- {spv::Capability::StorageImageReadWithoutFormat,
- "StorageImageReadWithoutFormat"},
- {spv::Capability::StorageImageWriteWithoutFormat,
- "StorageImageWriteWithoutFormat"},
- {spv::Capability::MultiViewport, "MultiViewport"},
- {spv::Capability::SubgroupDispatch, "SubgroupDispatch"},
- {spv::Capability::NamedBarrier, "NamedBarrier"},
- {spv::Capability::PipeStorage, "PipeStorage"},
- {spv::Capability::SubgroupBallotKHR, "SubgroupBallotKHR"},
- {spv::Capability::DrawParameters, "DrawParameters"},
- {spv::Capability::SubgroupVoteKHR, "SubgroupVoteKHR"},
- {spv::Capability::StorageBuffer16BitAccess,
- "StorageBuffer16BitAccess"},
- {spv::Capability::StorageUniformBufferBlock16,
- "StorageBuffer16BitAccess"}, // Preferred name
- {spv::Capability::UniformAndStorageBuffer16BitAccess,
- "UniformAndStorageBuffer16BitAccess"},
- {spv::Capability::StorageUniform16,
- "UniformAndStorageBuffer16BitAccess"}, // Preferred name
- {spv::Capability::StoragePushConstant16, "StoragePushConstant16"},
- {spv::Capability::StorageInputOutput16, "StorageInputOutput16"},
- {spv::Capability::DeviceGroup, "DeviceGroup"},
- {spv::Capability::AtomicFloat32AddEXT, "AtomicFloat32AddEXT"},
- {spv::Capability::AtomicFloat64AddEXT, "AtomicFloat64AddEXT"},
- {spv::Capability::AtomicFloat32MinMaxEXT, "AtomicFloat32MinMaxEXT"},
- {spv::Capability::AtomicFloat64MinMaxEXT, "AtomicFloat64MinMaxEXT"},
- {spv::Capability::MultiView, "MultiView"},
- {spv::Capability::Int64ImageEXT, "Int64ImageEXT"},
- {spv::Capability::SampleMaskOverrideCoverageNV,
- "SampleMaskOverrideCoverageNV"},
- {spv::Capability::GeometryShaderPassthroughNV,
- "GeometryShaderPassthroughNV"},
- // The next two are different names for the same token.
- {spv::Capability::ShaderViewportIndexLayerNV,
- "ShaderViewportIndexLayerEXT"},
- {spv::Capability::ShaderViewportIndexLayerEXT,
- "ShaderViewportIndexLayerEXT"},
- {spv::Capability::ShaderViewportMaskNV, "ShaderViewportMaskNV"},
- {spv::Capability::ShaderStereoViewNV, "ShaderStereoViewNV"},
- {spv::Capability::PerViewAttributesNV, "PerViewAttributesNV"}})));
-
} // namespace
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/ext_inst.non_semantic_test.cpp b/third_party/SPIRV-Tools/test/ext_inst.non_semantic_test.cpp
index 870684e..5062189 100644
--- a/third_party/SPIRV-Tools/test/ext_inst.non_semantic_test.cpp
+++ b/third_party/SPIRV-Tools/test/ext_inst.non_semantic_test.cpp
@@ -41,8 +41,7 @@
%8 = OpExtInstImport "NonSemantic.Testing.AnotherUnknownExtInstSet"
%9 = OpExtInst %4 %8 613874321 %7 %5 %6
)";
- std::string disassembly = EncodeAndDecodeSuccessfully(
- spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_ENV_UNIVERSAL_1_0);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
diff --git a/third_party/SPIRV-Tools/test/ext_inst.tosa_test.cpp b/third_party/SPIRV-Tools/test/ext_inst.tosa_test.cpp
new file mode 100644
index 0000000..2a506bd
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/ext_inst.tosa_test.cpp
@@ -0,0 +1,57 @@
+// Copyright (c) 2024-2025 Arm Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <string>
+
+#include "gmock/gmock.h"
+#include "source/util/string_utils.h"
+#include "spirv/unified1/TOSA.001000.1.h"
+#include "test/test_fixture.h"
+#include "test/unit_spirv.h"
+
+namespace spvtools {
+namespace {
+
+using spvtest::Concatenate;
+using spvtest::MakeInstruction;
+using spvtest::TextToBinaryTest;
+using testing::Eq;
+using utils::MakeVector;
+
+TEST_F(TextToBinaryTest, TOSAImportTest) {
+ const std::string src = "%1 = OpExtInstImport \"TOSA.001000.1\"";
+ EXPECT_THAT(CompiledInstructions(src),
+ Eq(MakeInstruction(spv::Op::OpExtInstImport, {1},
+ MakeVector("TOSA.001000.1"))));
+}
+
+TEST_F(TextToBinaryTest, TOSAInstructionSmokeTest) {
+ const std::string src =
+ "%1 = OpExtInstImport \"TOSA.001000.1\"\n"
+ "%3 = OpExtInst %2 %1 ARGMAX %4 %5 %6\n";
+
+ // First make sure it assembles correctly.
+ EXPECT_THAT(
+ CompiledInstructions(src),
+ Eq(Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
+ MakeVector("TOSA.001000.1")),
+ MakeInstruction(spv::Op::OpExtInst,
+ {2, 3, 1, TOSAARGMAX, 4, 5, 6})})))
+ << src;
+ // Now check the round trip through the disassembler.
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(src), src) << src;
+}
+
+} // namespace
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/ext_inst_lookup_test.cpp b/third_party/SPIRV-Tools/test/ext_inst_lookup_test.cpp
new file mode 100644
index 0000000..a580c7c
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/ext_inst_lookup_test.cpp
@@ -0,0 +1,87 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <array>
+#include <iostream>
+
+#include "gmock/gmock.h"
+#include "source/spirv_target_env.h"
+#include "source/table2.h"
+#include "test/unit_spirv.h"
+
+using ::testing::ContainerEq;
+using ::testing::ValuesIn;
+
+namespace spvtools {
+namespace {
+
+struct ExtInstLookupCase {
+ spv_ext_inst_type_t type;
+ std::string name;
+ uint32_t value;
+ bool expect_pass = true;
+};
+
+std::ostream& operator<<(std::ostream& os, const ExtInstLookupCase& eilc) {
+ os << "EILC(" << static_cast<int>(eilc.type) << ", '" << eilc.name << "', "
+ << eilc.value << ", expect pass? " << eilc.expect_pass << ")";
+ return os;
+}
+
+using ExtInstLookupTest = ::testing::TestWithParam<ExtInstLookupCase>;
+
+TEST_P(ExtInstLookupTest, ExtInstLookup_ByName) {
+ const ExtInstDesc* desc = nullptr;
+ auto status = LookupExtInst(GetParam().type, GetParam().name.data(), &desc);
+ if (GetParam().expect_pass) {
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(static_cast<uint32_t>(desc->value), GetParam().value);
+ } else {
+ EXPECT_NE(status, SPV_SUCCESS);
+ EXPECT_EQ(desc, nullptr);
+ }
+}
+
+TEST_P(ExtInstLookupTest, ExtInstLookup_ByValue_Success) {
+ const ExtInstDesc* desc = nullptr;
+ if (GetParam().expect_pass) {
+ auto status = LookupExtInst(GetParam().type, GetParam().value, &desc);
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(desc->value, GetParam().value);
+ EXPECT_EQ(std::string(desc->name().data()), GetParam().name);
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(Samples, ExtInstLookupTest,
+ ValuesIn(std::vector<ExtInstLookupCase>{
+ {SPV_EXT_INST_TYPE_GLSL_STD_450, "FMix", 46},
+ {SPV_EXT_INST_TYPE_OPENCL_STD, "s_mul24", 169},
+ {SPV_EXT_INST_TYPE_OPENCL_STD, "mix", 99},
+ }));
+
+TEST(ExtInstLookupSingleTest, ExtInstLookup_Value_Fails) {
+ // This list may need adjusting over time.
+ std::array<uint32_t, 3> bad_values = {{99999, 37737, 110101}};
+ for (auto bad_value : bad_values) {
+ const ExtInstDesc* desc = nullptr;
+ auto status = LookupExtInst(SPV_EXT_INST_TYPE_OPENCL_STD, bad_value, &desc);
+ EXPECT_NE(status, SPV_SUCCESS);
+ ASSERT_EQ(desc, nullptr);
+ }
+}
+
+} // namespace
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/fuzz/CMakeLists.txt b/third_party/SPIRV-Tools/test/fuzz/CMakeLists.txt
index 56af0b9..6232d6c 100644
--- a/third_party/SPIRV-Tools/test/fuzz/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/test/fuzz/CMakeLists.txt
@@ -123,7 +123,8 @@
transformation_wrap_early_terminator_in_function_test.cpp
transformation_wrap_region_in_selection_test.cpp
transformation_wrap_vector_synonym_test.cpp
- uniform_buffer_element_descriptor_test.cpp)
+ uniform_buffer_element_descriptor_test.cpp
+ ${spirv-tools_SOURCE_DIR}/tools/io.cpp)
if (${SPIRV_ENABLE_LONG_FUZZER_TESTS})
# These are long-running tests that depend on random seeds. We do not want
diff --git a/third_party/SPIRV-Tools/test/fuzz/fuzz_test_util.cpp b/third_party/SPIRV-Tools/test/fuzz/fuzz_test_util.cpp
index 93c9c58..b238455 100644
--- a/third_party/SPIRV-Tools/test/fuzz/fuzz_test_util.cpp
+++ b/third_party/SPIRV-Tools/test/fuzz/fuzz_test_util.cpp
@@ -145,7 +145,7 @@
const protobufs::TransformationSequence& transformations,
const char* filename) {
std::string json_string;
- auto json_options = google::protobuf::util::JsonOptions();
+ auto json_options = google::protobuf::util::JsonPrintOptions();
json_options.add_whitespace = true;
auto json_generation_status = google::protobuf::util::MessageToJsonString(
transformations, &json_string, json_options);
diff --git a/third_party/SPIRV-Tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp b/third_party/SPIRV-Tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp
index 44901f9..d08b98c 100644
--- a/third_party/SPIRV-Tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp
+++ b/third_party/SPIRV-Tools/test/fuzz/transformation_set_memory_operands_mask_test.cpp
@@ -333,10 +333,12 @@
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypeStruct %6 %6 %6
+ %1001 = OpTypeStruct %6 %6 %6
%8 = OpTypeInt 32 0
%9 = OpConstant %8 12
%10 = OpTypeArray %7 %9
- %11 = OpTypePointer Private %10
+ %1002 = OpTypeArray %1001 %9
+ %11 = OpTypePointer Private %1002
%12 = OpVariable %11 Private
%15 = OpTypeStruct %10 %7
%16 = OpTypePointer Uniform %15
@@ -344,26 +346,32 @@
%18 = OpTypeInt 32 1
%19 = OpConstant %18 0
%20 = OpTypePointer Uniform %10
- %24 = OpTypePointer Private %7
+ %24 = OpTypePointer Private %1001
%27 = OpTypePointer Private %6
%30 = OpConstant %18 1
- %132 = OpTypePointer Function %10
+ %132 = OpTypePointer Function %1002
%135 = OpTypePointer Uniform %7
- %145 = OpTypePointer Function %7
+ %145 = OpTypePointer Function %1001
%4 = OpFunction %2 None %3
%5 = OpLabel
%133 = OpVariable %132 Function
%21 = OpAccessChain %20 %17 %19
- OpCopyMemory %12 %21 Aligned 16 Nontemporal|Aligned 16
+ %1003 = OpLoad %10 %21 Nontemporal|Aligned 16
+ %1004 = OpCopyLogical %1002 %1003
+ OpStore %12 %1004 Aligned 16
OpCopyMemory %133 %12 Volatile
OpCopyMemory %133 %12
OpCopyMemory %133 %12
%136 = OpAccessChain %135 %17 %30
%138 = OpAccessChain %24 %12 %19
- OpCopyMemory %138 %136 None Aligned 16
- OpCopyMemory %138 %136 Aligned 16
+ %1005 = OpLoad %7 %136 Aligned 16
+ %1006 = OpCopyLogical %1001 %1005
+ OpStore %138 %1006
+ %1007 = OpLoad %7 %136
+ %1008 = OpCopyLogical %1001 %1007
+ OpStore %138 %1008 Aligned 16
%146 = OpAccessChain %145 %133 %30
- %147 = OpLoad %7 %146 Volatile|Nontemporal|Aligned 16
+ %147 = OpLoad %1001 %146 Volatile|Nontemporal|Aligned 16
%148 = OpAccessChain %24 %12 %19
OpStore %148 %147 Nontemporal
OpReturn
@@ -382,14 +390,14 @@
MakeUnique<FactManager>(context.get()), validator_options);
{
TransformationSetMemoryOperandsMask transformation(
- MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 0),
+ MakeInstructionDescriptor(21, spv::Op::OpLoad, 0),
(uint32_t)spv::MemoryAccessMask::Aligned |
(uint32_t)spv::MemoryAccessMask::Volatile,
- 1);
+ 0);
// Bad: cannot remove aligned
ASSERT_FALSE(TransformationSetMemoryOperandsMask(
- MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 0),
- (uint32_t)spv::MemoryAccessMask::Volatile, 1)
+ MakeInstructionDescriptor(21, spv::Op::OpLoad, 0),
+ (uint32_t)spv::MemoryAccessMask::Volatile, 0)
.IsApplicable(context.get(), transformation_context));
ASSERT_TRUE(
transformation.IsApplicable(context.get(), transformation_context));
@@ -399,13 +407,13 @@
{
TransformationSetMemoryOperandsMask transformation(
- MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 1),
+ MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 0),
(uint32_t)spv::MemoryAccessMask::Nontemporal |
(uint32_t)spv::MemoryAccessMask::Volatile,
1);
// Bad: cannot remove volatile
ASSERT_FALSE(TransformationSetMemoryOperandsMask(
- MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 1),
+ MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 0),
(uint32_t)spv::MemoryAccessMask::Nontemporal, 0)
.IsApplicable(context.get(), transformation_context));
ASSERT_TRUE(
@@ -417,7 +425,7 @@
{
// Creates the first operand.
TransformationSetMemoryOperandsMask transformation(
- MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 2),
+ MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 1),
(uint32_t)spv::MemoryAccessMask::Nontemporal |
(uint32_t)spv::MemoryAccessMask::Volatile,
0);
@@ -430,7 +438,7 @@
{
// Creates both operands.
TransformationSetMemoryOperandsMask transformation(
- MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 3),
+ MakeInstructionDescriptor(21, spv::Op::OpCopyMemory, 2),
(uint32_t)spv::MemoryAccessMask::Nontemporal |
(uint32_t)spv::MemoryAccessMask::Volatile,
1);
@@ -442,13 +450,13 @@
{
TransformationSetMemoryOperandsMask transformation(
- MakeInstructionDescriptor(138, spv::Op::OpCopyMemory, 0),
+ MakeInstructionDescriptor(138, spv::Op::OpLoad, 0),
(uint32_t)spv::MemoryAccessMask::Aligned |
(uint32_t)spv::MemoryAccessMask::Nontemporal,
- 1);
+ 0);
// Bad: the first mask is None, so Aligned cannot be added to it.
ASSERT_FALSE(TransformationSetMemoryOperandsMask(
- MakeInstructionDescriptor(138, spv::Op::OpCopyMemory, 0),
+ MakeInstructionDescriptor(138, spv::Op::OpStore, 0),
(uint32_t)spv::MemoryAccessMask::Aligned |
(uint32_t)spv::MemoryAccessMask::Nontemporal,
0)
@@ -461,8 +469,8 @@
{
TransformationSetMemoryOperandsMask transformation(
- MakeInstructionDescriptor(138, spv::Op::OpCopyMemory, 1),
- (uint32_t)spv::MemoryAccessMask::Volatile, 1);
+ MakeInstructionDescriptor(138, spv::Op::OpLoad, 1),
+ (uint32_t)spv::MemoryAccessMask::Volatile, 0);
ASSERT_TRUE(
transformation.IsApplicable(context.get(), transformation_context));
ApplyAndCheckFreshIds(transformation, context.get(),
@@ -522,10 +530,12 @@
%3 = OpTypeFunction %2
%6 = OpTypeFloat 32
%7 = OpTypeStruct %6 %6 %6
+ %1001 = OpTypeStruct %6 %6 %6
%8 = OpTypeInt 32 0
%9 = OpConstant %8 12
%10 = OpTypeArray %7 %9
- %11 = OpTypePointer Private %10
+ %1002 = OpTypeArray %1001 %9
+ %11 = OpTypePointer Private %1002
%12 = OpVariable %11 Private
%15 = OpTypeStruct %10 %7
%16 = OpTypePointer Uniform %15
@@ -533,26 +543,32 @@
%18 = OpTypeInt 32 1
%19 = OpConstant %18 0
%20 = OpTypePointer Uniform %10
- %24 = OpTypePointer Private %7
+ %24 = OpTypePointer Private %1001
%27 = OpTypePointer Private %6
%30 = OpConstant %18 1
- %132 = OpTypePointer Function %10
+ %132 = OpTypePointer Function %1002
%135 = OpTypePointer Uniform %7
- %145 = OpTypePointer Function %7
+ %145 = OpTypePointer Function %1001
%4 = OpFunction %2 None %3
%5 = OpLabel
%133 = OpVariable %132 Function
%21 = OpAccessChain %20 %17 %19
- OpCopyMemory %12 %21 Aligned 16 Aligned|Volatile 16
+ %1003 = OpLoad %10 %21 Aligned|Volatile 16
+ %1004 = OpCopyLogical %1002 %1003
+ OpStore %12 %1004 Aligned 16
OpCopyMemory %133 %12 Volatile Nontemporal|Volatile
OpCopyMemory %133 %12 Nontemporal|Volatile
OpCopyMemory %133 %12 None Nontemporal|Volatile
%136 = OpAccessChain %135 %17 %30
%138 = OpAccessChain %24 %12 %19
- OpCopyMemory %138 %136 None Aligned|Nontemporal 16
- OpCopyMemory %138 %136 Aligned 16 Volatile
+ %1005 = OpLoad %7 %136 Aligned|Nontemporal 16
+ %1006 = OpCopyLogical %1001 %1005
+ OpStore %138 %1006
+ %1007 = OpLoad %7 %136 Volatile
+ %1008 = OpCopyLogical %1001 %1007
+ OpStore %138 %1008 Aligned 16
%146 = OpAccessChain %145 %133 %30
- %147 = OpLoad %7 %146 Volatile|Aligned 16
+ %147 = OpLoad %1001 %146 Volatile|Aligned 16
%148 = OpAccessChain %24 %12 %19
OpStore %148 %147 None
OpReturn
diff --git a/third_party/SPIRV-Tools/test/hex_float_test.cpp b/third_party/SPIRV-Tools/test/hex_float_test.cpp
index a44d9ec..2e384d4 100644
--- a/third_party/SPIRV-Tools/test/hex_float_test.cpp
+++ b/third_party/SPIRV-Tools/test/hex_float_test.cpp
@@ -582,6 +582,12 @@
int16_t unbiased_half_exponent(uint16_t f) {
return HexFloat<FloatProxy<Float16>>(f).getUnbiasedNormalizedExponent();
}
+int8_t unbiased_E4M3_exponent(uint8_t f) {
+ return HexFloat<FloatProxy<Float8_E4M3>>(f).getUnbiasedNormalizedExponent();
+}
+int8_t unbiased_E5M2_exponent(uint8_t f) {
+ return HexFloat<FloatProxy<Float8_E5M2>>(f).getUnbiasedNormalizedExponent();
+}
TEST(HexFloatOperationTest, UnbiasedExponent) {
// Float cases
@@ -616,6 +622,31 @@
// Smallest representable number
EXPECT_EQ(-24, unbiased_half_exponent(0x0001));
+
+ // E4M3 cases
+ // The exponent is represented in the bits 0x78
+ // The offset is -7
+ EXPECT_EQ(0, unbiased_E4M3_exponent(0x38));
+ EXPECT_EQ(3, unbiased_E4M3_exponent(0x50));
+ EXPECT_EQ(-1, unbiased_E4M3_exponent(0x30));
+ EXPECT_EQ(-6, unbiased_E4M3_exponent(0x08));
+ EXPECT_EQ(8, unbiased_E4M3_exponent(0x78));
+
+ // Smallest representable number
+ EXPECT_EQ(-9, unbiased_E4M3_exponent(0x01));
+
+ // E5M2 cases
+ // The exponent is represented in the bits 0x7C
+ // The offset is -15
+ EXPECT_EQ(0, unbiased_E5M2_exponent(0x3C));
+ EXPECT_EQ(3, unbiased_E5M2_exponent(0x48));
+ EXPECT_EQ(-1, unbiased_E5M2_exponent(0x38));
+ EXPECT_EQ(-14, unbiased_E5M2_exponent(0x04));
+ EXPECT_EQ(16, unbiased_E5M2_exponent(0x7C));
+ EXPECT_EQ(10, unbiased_E5M2_exponent(0x64));
+
+ // Smallest representable number
+ EXPECT_EQ(-16, unbiased_E5M2_exponent(0x01));
}
// Creates a float that is the sum of 1/(2 ^ fractions[i]) for i in factions
@@ -839,6 +870,166 @@
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), RD::kToNegativeInfinity},
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), RD::kToNearestEven},
})));
+
+// clang-format on
+
+// The same as bits_set but for a E4M3 value instead of 32-bit floating
+// point.
+uint8_t e4m3_bits_set(const std::vector<uint32_t>& bits) {
+ const uint32_t top_bit = 1u << 2u;
+ uint32_t val = 0;
+ for (uint32_t i : bits) {
+ val |= top_bit >> i;
+ }
+ return static_cast<uint8_t>(val);
+}
+
+struct RoundSignificandCaseE4M3 {
+ float source_float;
+ std::pair<int8_t, bool> expected_results;
+ round_direction round;
+};
+
+using HexFloatRoundTestE4M3 =
+ ::testing::TestWithParam<RoundSignificandCaseE4M3>;
+
+TEST_P(HexFloatRoundTestE4M3, RoundDownToFPE4M3) {
+ using HF = HexFloat<FloatProxy<float>>;
+ using HFE4M3 = HexFloat<FloatProxy<Float8_E4M3>>;
+
+ HF input_value(GetParam().source_float);
+ bool carry_bit = false;
+ EXPECT_EQ(GetParam().expected_results.first,
+ input_value.getRoundedNormalizedSignificand<HFE4M3>(
+ GetParam().round, &carry_bit));
+ EXPECT_EQ(carry_bit, GetParam().expected_results.second);
+}
+
+// clang-format off
+INSTANTIATE_TEST_SUITE_P(F32ToE4M3, HexFloatRoundTestE4M3,
+ ::testing::ValuesIn(std::vector<RoundSignificandCaseE4M3>(
+ {
+ {float_fractions({0}), std::make_pair(e4m3_bits_set({}), false), RD::kToZero},
+ {float_fractions({0}), std::make_pair(e4m3_bits_set({}), false), RD::kToNearestEven},
+ {float_fractions({0}), std::make_pair(e4m3_bits_set({}), false), RD::kToPositiveInfinity},
+ {float_fractions({0}), std::make_pair(e4m3_bits_set({}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1}), std::make_pair(e4m3_bits_set({0}), false), RD::kToZero},
+
+ {float_fractions({0, 1, 4}), std::make_pair(e4m3_bits_set({0}), false), RD::kToZero},
+ {float_fractions({0, 1, 4}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 4}), std::make_pair(e4m3_bits_set({0}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 4}), std::make_pair(e4m3_bits_set({0}), false), RD::kToNearestEven},
+
+ {float_fractions({0, 1, 3, 4}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToZero},
+ {float_fractions({0, 1, 3, 4}), std::make_pair(e4m3_bits_set({0, 1}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 3, 4}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 3, 4}), std::make_pair(e4m3_bits_set({0, 1}), false), RD::kToNearestEven},
+
+ {float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0}), false), RD::kToZero},
+ {float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToNearestEven},
+
+ {-float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0}), false), RD::kToZero},
+ {-float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0}), false), RD::kToPositiveInfinity},
+ {-float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToNegativeInfinity},
+ {-float_fractions({0, 1, 4, 5}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToNearestEven},
+
+ {float_fractions({0, 1, 4, 22}), std::make_pair(e4m3_bits_set({0}), false), RD::kToZero},
+ {float_fractions({0, 1, 4, 22}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 4, 22}), std::make_pair(e4m3_bits_set({0}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 4, 22}), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToNearestEven},
+
+ // Carries
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e4m3_bits_set({0, 1, 2}), false), RD::kToZero},
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e4m3_bits_set({}), true), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e4m3_bits_set({0, 1, 2}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e4m3_bits_set({}), true), RD::kToNearestEven},
+
+ // Cases where original number was denorm. Note: this should have no effect
+ // the number is pre-normalized.
+ {static_cast<float>(ldexp(float_fractions({0, 1, 4, 6}), -128)), std::make_pair(e4m3_bits_set({0}), false), RD::kToZero},
+ {static_cast<float>(ldexp(float_fractions({0, 1, 4, 6}), -129)), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToPositiveInfinity},
+ {static_cast<float>(ldexp(float_fractions({0, 1, 4, 6}), -131)), std::make_pair(e4m3_bits_set({0}), false), RD::kToNegativeInfinity},
+ {static_cast<float>(ldexp(float_fractions({0, 1, 4, 6}), -130)), std::make_pair(e4m3_bits_set({0, 2}), false), RD::kToNearestEven},
+ })));
+
+// clang-format on
+// The same as bits_set but for a E4M3 value instead of 32-bit floating
+// point.
+uint8_t e5m2_bits_set(const std::vector<uint32_t>& bits) {
+ const uint32_t top_bit = 1u << 1u;
+ uint32_t val = 0;
+ for (uint32_t i : bits) {
+ val |= top_bit >> i;
+ }
+ return static_cast<uint8_t>(val);
+}
+
+struct RoundSignificandCaseE5M2 {
+ float source_float;
+ std::pair<int8_t, bool> expected_results;
+ round_direction round;
+};
+
+using HexFloatRoundTestE5M2 =
+ ::testing::TestWithParam<RoundSignificandCaseE5M2>;
+
+TEST_P(HexFloatRoundTestE5M2, RoundDownToFPE4M3) {
+ using HF = HexFloat<FloatProxy<float>>;
+ using HFE5M2 = HexFloat<FloatProxy<Float8_E5M2>>;
+
+ HF input_value(GetParam().source_float);
+ bool carry_bit = false;
+ EXPECT_EQ(GetParam().expected_results.first,
+ input_value.getRoundedNormalizedSignificand<HFE5M2>(
+ GetParam().round, &carry_bit));
+ EXPECT_EQ(carry_bit, GetParam().expected_results.second);
+}
+
+// clang-format off
+INSTANTIATE_TEST_SUITE_P(F32ToE5M2, HexFloatRoundTestE5M2,
+ ::testing::ValuesIn(std::vector<RoundSignificandCaseE5M2>(
+ {
+ {float_fractions({0}), std::make_pair(e5m2_bits_set({}), false), RD::kToZero},
+ {float_fractions({0}), std::make_pair(e5m2_bits_set({}), false), RD::kToNearestEven},
+ {float_fractions({0}), std::make_pair(e5m2_bits_set({}), false), RD::kToPositiveInfinity},
+ {float_fractions({0}), std::make_pair(e5m2_bits_set({}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1}), std::make_pair(e5m2_bits_set({0}), false), RD::kToZero},
+
+ {float_fractions({0, 1, 4}), std::make_pair(e5m2_bits_set({0}), false), RD::kToZero},
+ {float_fractions({0, 1, 4}), std::make_pair(e5m2_bits_set({0, 1}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 4}), std::make_pair(e5m2_bits_set({0}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 4}), std::make_pair(e5m2_bits_set({0}), false), RD::kToNearestEven},
+
+ {float_fractions({0, 3, 4}), std::make_pair(e5m2_bits_set({}), false), RD::kToZero},
+ {float_fractions({0, 3, 4}), std::make_pair(e5m2_bits_set({1}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 3, 4}), std::make_pair(e5m2_bits_set({}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 3, 4}), std::make_pair(e5m2_bits_set({1}), false), RD::kToNearestEven},
+
+ {float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({1}), false), RD::kToZero},
+ {float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({0}), false), RD::kToPositiveInfinity},
+ {float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({1}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({0}), false), RD::kToNearestEven},
+
+ {-float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({1}), false), RD::kToZero},
+ {-float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({1}), false), RD::kToPositiveInfinity},
+ {-float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({0}), false), RD::kToNegativeInfinity},
+ {-float_fractions({0, 2, 3}), std::make_pair(e5m2_bits_set({0}), false), RD::kToNearestEven},
+
+ // Carries
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e5m2_bits_set({0, 1}), false), RD::kToZero},
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e5m2_bits_set({}), true), RD::kToPositiveInfinity},
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e5m2_bits_set({0, 1}), false), RD::kToNegativeInfinity},
+ {float_fractions({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}), std::make_pair(e5m2_bits_set({}), true), RD::kToNearestEven},
+
+ // Cases where original number was denorm. Note: this should have no effect
+ // the number is pre-normalized.
+ {static_cast<float>(ldexp(float_fractions({0, 3, 6}), -128)), std::make_pair(e5m2_bits_set({}), false), RD::kToZero},
+ {static_cast<float>(ldexp(float_fractions({0, 3, 6}), -129)), std::make_pair(e5m2_bits_set({1}), false), RD::kToPositiveInfinity},
+ {static_cast<float>(ldexp(float_fractions({0, 3, 6}), -131)), std::make_pair(e5m2_bits_set({}), false), RD::kToNegativeInfinity},
+ {static_cast<float>(ldexp(float_fractions({0, 3, 6}), -130)), std::make_pair(e5m2_bits_set({1}), false), RD::kToNearestEven},
+ })));
// clang-format on
struct UpCastSignificandCase {
@@ -1016,6 +1207,225 @@
// Nans are below because we cannot test for equality.
})));
+using HexFloatFP32ToE4M3Tests = ::testing::TestWithParam<DownCastTest>;
+
+TEST_P(HexFloatFP32ToE4M3Tests, NarrowingCasts) {
+ using HF = HexFloat<FloatProxy<float>>;
+ using HFE4M3 = HexFloat<FloatProxy<Float8_E4M3>>;
+ HF f(GetParam().source_float);
+ for (auto round : GetParam().directions) {
+ HFE4M3 e4m3(0);
+ f.castTo(e4m3, round);
+ EXPECT_EQ(GetParam().expected_half, e4m3.value().getAsFloat().get_value())
+ << get_round_text(round) << " " << std::hex
+ << BitwiseCast<uint32_t>(GetParam().source_float)
+ << " cast to: " << (uint32_t)e4m3.value().getAsFloat().get_value();
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ F32ToE4M3, HexFloatFP32ToE4M3Tests,
+ ::testing::ValuesIn(std::vector<DownCastTest>({
+ // Exactly representable as half.
+ {0.f,
+ 0x0,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-0.f,
+ 0x80,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {1.0f,
+ 0x38,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-1.0f,
+ 0xB8,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ {float_fractions({0, 1, 3}),
+ 0x3D,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-float_fractions({0, 1, 3}),
+ 0xBD,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(ldexp(float_fractions({0, 1, 3}), 3)),
+ 0x55,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(float_fractions({0, 1, 3}), 3)),
+ 0xD5,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Underflow
+ {static_cast<float>(ldexp(1.0f, -10)),
+ 0x0,
+ {RD::kToZero, RD::kToNegativeInfinity, RD::kToNearestEven}},
+ {static_cast<float>(ldexp(1.0f, -10)), 0x1, {RD::kToPositiveInfinity}},
+ {static_cast<float>(-ldexp(1.0f, -10)),
+ 0x80,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.0f, -9)), 0x81, {RD::kToNegativeInfinity}},
+ {static_cast<float>(ldexp(1.0f, -9)),
+ 0x1,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Overflow
+ {static_cast<float>(ldexp(1.0f, 9)),
+ Float8_E4M3::max().get_value(),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(ldexp(1.0f, 10)),
+ Float8_E4M3::max().get_value(),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(ldexp(1.3f, 9)),
+ Float8_E4M3::max().get_value(),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.0f, 9)),
+ static_cast<uint16_t>(0x80 | Float8_E4M3::max().get_value()),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.0f, 10)),
+ static_cast<uint16_t>(0x80 | Float8_E4M3::max().get_value()),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.3f, 9)),
+ static_cast<uint16_t>(0x80 | Float8_E4M3::max().get_value()),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Transfer of Infinities
+ {std::numeric_limits<float>::infinity(),
+ Float8_E4M3::max().get_value(),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-std::numeric_limits<float>::infinity(),
+ static_cast<uint16_t>(0x80 | Float8_E4M3::max().get_value()),
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Nans are below because we cannot test for equality.
+ })));
+
+using HexFloatFP32ToE5M2Tests = ::testing::TestWithParam<DownCastTest>;
+
+TEST_P(HexFloatFP32ToE5M2Tests, NarrowingCasts) {
+ using HF = HexFloat<FloatProxy<float>>;
+ using HFE5M2 = HexFloat<FloatProxy<Float8_E5M2>>;
+ HF f(GetParam().source_float);
+ for (auto round : GetParam().directions) {
+ HFE5M2 e5m2(0);
+ f.castTo(e5m2, round);
+ EXPECT_EQ(GetParam().expected_half, e5m2.value().getAsFloat().get_value())
+ << get_round_text(round) << " " << std::hex
+ << BitwiseCast<uint32_t>(GetParam().source_float)
+ << " cast to: " << (uint32_t)e5m2.value().getAsFloat().get_value();
+ }
+}
+
+const uint8_t e5m2_positive_infinity = 0x7C;
+const uint8_t e5m2_negative_infinity = 0xFC;
+
+INSTANTIATE_TEST_SUITE_P(
+ F32ToE5M2, HexFloatFP32ToE5M2Tests,
+ ::testing::ValuesIn(std::vector<DownCastTest>({
+ // Exactly representable as half.
+ {0.f,
+ 0x0,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-0.f,
+ 0x80,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {1.0f,
+ 0x3C,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-1.0f,
+ 0xBC,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ {float_fractions({0, 1, 2}),
+ 0x3F,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-float_fractions({0, 1, 2}),
+ 0xBF,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(ldexp(float_fractions({0, 2}), 3)),
+ 0x49,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(float_fractions({0, 2}), 3)),
+ 0xC9,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Underflow
+ {static_cast<float>(ldexp(1.0f, -17)),
+ 0x0,
+ {RD::kToZero, RD::kToNegativeInfinity, RD::kToNearestEven}},
+ {static_cast<float>(ldexp(1.0f, -17)), 0x1, {RD::kToPositiveInfinity}},
+ {static_cast<float>(-ldexp(1.0f, -17)),
+ 0x80,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.0f, -16)),
+ 0x81,
+ {RD::kToNegativeInfinity}},
+ {static_cast<float>(ldexp(1.0f, -16)),
+ 0x1,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Overflow
+ {static_cast<float>(ldexp(1.0f, 16)),
+ e5m2_positive_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(ldexp(1.0f, 17)),
+ e5m2_positive_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(ldexp(1.3f, 16)),
+ e5m2_positive_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.0f, 16)),
+ e5m2_negative_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.0f, 17)),
+ e5m2_negative_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {static_cast<float>(-ldexp(1.3f, 16)),
+ e5m2_negative_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Transfer of Infinities
+ {std::numeric_limits<float>::infinity(),
+ e5m2_positive_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+ {-std::numeric_limits<float>::infinity(),
+ e5m2_negative_infinity,
+ {RD::kToZero, RD::kToPositiveInfinity, RD::kToNegativeInfinity,
+ RD::kToNearestEven}},
+
+ // Nans are below because we cannot test for equality.
+ })));
+
struct UpCastCase {
uint16_t source_half;
float expected_float;
@@ -1069,6 +1479,8 @@
TEST(HexFloatOperationTests, NanTests) {
using HF = HexFloat<FloatProxy<float>>;
using HF16 = HexFloat<FloatProxy<Float16>>;
+ using FE4M3 = HexFloat<FloatProxy<Float8_E4M3>>;
+ using FE5M2 = HexFloat<FloatProxy<Float8_E5M2>>;
round_direction rounding[] = {round_direction::kToZero,
round_direction::kToNearestEven,
round_direction::kToPositiveInfinity,
@@ -1078,6 +1490,8 @@
for (round_direction round : rounding) {
HF16 f16(0);
HF f(0.f);
+ FE4M3 fe4m3(0);
+ FE5M2 fe5m2(0);
HF(std::numeric_limits<float>::quiet_NaN()).castTo(f16, round);
EXPECT_TRUE(f16.value().isNan());
HF(std::numeric_limits<float>::signaling_NaN()).castTo(f16, round);
@@ -1093,6 +1507,34 @@
EXPECT_TRUE(f.value().isNan());
HF16(0xFF00).castTo(f, round);
EXPECT_TRUE(f.value().isNan());
+
+ HF(std::numeric_limits<float>::quiet_NaN()).castTo(fe4m3, round);
+ EXPECT_TRUE(fe4m3.value().isNan());
+ HF(std::numeric_limits<float>::signaling_NaN()).castTo(fe4m3, round);
+ EXPECT_TRUE(fe4m3.value().isNan());
+
+ FE4M3(0x7F).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+ FE4M3(0xFF).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+
+ HF(std::numeric_limits<float>::quiet_NaN()).castTo(fe5m2, round);
+ EXPECT_TRUE(fe5m2.value().isNan());
+ HF(std::numeric_limits<float>::signaling_NaN()).castTo(fe5m2, round);
+ EXPECT_TRUE(fe5m2.value().isNan());
+
+ FE5M2(0x7D).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+ FE5M2(0x7E).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+ FE5M2(0x7F).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+ FE5M2(0xFD).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+ FE5M2(0xFE).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
+ FE5M2(0xFF).castTo(f, round);
+ EXPECT_TRUE(f.value().isNan());
}
}
@@ -1214,6 +1656,92 @@
BadFloatParseCase<Float16>("+2.0", true, uint16_t{0}),
}));
+using ParseNormalFloatE4M3Test =
+ ::testing::TestWithParam<FloatParseCase<Float8_E4M3>>;
+
+TEST_P(ParseNormalFloatE4M3Test, Samples) {
+ std::stringstream input(GetParam().literal);
+ HexFloat<FloatProxy<Float8_E4M3>> parsed_value(0);
+ ParseNormalFloat(input, GetParam().negate_value, parsed_value);
+ EXPECT_NE(GetParam().expect_success, input.fail())
+ << " literal: " << GetParam().literal
+ << " negate: " << GetParam().negate_value;
+ if (GetParam().expect_success) {
+ EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value()))
+ << " literal: " << GetParam().literal
+ << " negate: " << GetParam().negate_value;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ FloatE4M3Parse, ParseNormalFloatE4M3Test,
+ ::testing::ValuesIn(std::vector<FloatParseCase<Float8_E4M3>>{
+ // Failing cases due to trivially incorrect syntax.
+ BadFloatParseCase<Float8_E4M3>("abc", false, uint8_t{0}),
+ BadFloatParseCase<Float8_E4M3>("abc", true, uint8_t{0}),
+
+ // Valid cases.
+ GoodFloatParseCase<Float8_E4M3>("0", false, uint8_t{0}),
+ GoodFloatParseCase<Float8_E4M3>("0.0", false, uint8_t{0}),
+ GoodFloatParseCase<Float8_E4M3>("-0.0", false, uint8_t{0x80}),
+ GoodFloatParseCase<Float8_E4M3>("2.0", false, uint8_t{0x40}),
+ GoodFloatParseCase<Float8_E4M3>("-2.0", false, uint8_t{0xc0}),
+ GoodFloatParseCase<Float8_E4M3>("+2.0", false, uint8_t{0x40}),
+ // Cases with negate_value being true.
+ GoodFloatParseCase<Float8_E4M3>("0.0", true, uint8_t{0x80}),
+ GoodFloatParseCase<Float8_E4M3>("2.0", true, uint8_t{0xc0}),
+
+ // When negate_value is true, we should not accept a leading minus or
+ // plus.
+ BadFloatParseCase<Float8_E4M3>("-0.0", true, uint8_t{0}),
+ BadFloatParseCase<Float8_E4M3>("-2.0", true, uint8_t{0}),
+ BadFloatParseCase<Float8_E4M3>("+0.0", true, uint8_t{0}),
+ BadFloatParseCase<Float8_E4M3>("+2.0", true, uint8_t{0}),
+ }));
+
+using ParseNormalFloatE5M2Test =
+ ::testing::TestWithParam<FloatParseCase<Float8_E5M2>>;
+
+TEST_P(ParseNormalFloatE5M2Test, Samples) {
+ std::stringstream input(GetParam().literal);
+ HexFloat<FloatProxy<Float8_E5M2>> parsed_value(0);
+ ParseNormalFloat(input, GetParam().negate_value, parsed_value);
+ EXPECT_NE(GetParam().expect_success, input.fail())
+ << " literal: " << GetParam().literal
+ << " negate: " << GetParam().negate_value;
+ if (GetParam().expect_success) {
+ EXPECT_THAT(parsed_value.value(), Eq(GetParam().expected_value.value()))
+ << " literal: " << GetParam().literal
+ << " negate: " << GetParam().negate_value;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ FloatE5M2Parse, ParseNormalFloatE5M2Test,
+ ::testing::ValuesIn(std::vector<FloatParseCase<Float8_E5M2>>{
+ // Failing cases due to trivially incorrect syntax.
+ BadFloatParseCase<Float8_E5M2>("abc", false, uint8_t{0}),
+ BadFloatParseCase<Float8_E5M2>("abc", true, uint8_t{0}),
+
+ // Valid cases.
+ GoodFloatParseCase<Float8_E5M2>("0", false, uint8_t{0}),
+ GoodFloatParseCase<Float8_E5M2>("0.0", false, uint8_t{0}),
+ GoodFloatParseCase<Float8_E5M2>("-0.0", false, uint8_t{0x80}),
+ GoodFloatParseCase<Float8_E5M2>("2.0", false, uint8_t{0x40}),
+ GoodFloatParseCase<Float8_E5M2>("-2.0", false, uint8_t{0xc0}),
+ GoodFloatParseCase<Float8_E5M2>("+2.0", false, uint8_t{0x40}),
+ // Cases with negate_value being true.
+ GoodFloatParseCase<Float8_E5M2>("0.0", true, uint8_t{0x80}),
+ GoodFloatParseCase<Float8_E5M2>("2.0", true, uint8_t{0xc0}),
+
+ // When negate_value is true, we should not accept a leading minus or
+ // plus.
+ BadFloatParseCase<Float8_E5M2>("-0.0", true, uint8_t{0}),
+ BadFloatParseCase<Float8_E5M2>("-2.0", true, uint8_t{0}),
+ BadFloatParseCase<Float8_E5M2>("+0.0", true, uint8_t{0}),
+ BadFloatParseCase<Float8_E5M2>("+2.0", true, uint8_t{0}),
+ }));
+
// A test case for detecting infinities.
template <typename T>
struct OverflowParseCase {
@@ -1307,6 +1835,68 @@
{"-1e400", false, uint16_t{0xfbff}},
})));
+using FloatProxyParseOverflowFloatE4M3Test =
+ ::testing::TestWithParam<OverflowParseCase<uint8_t>>;
+
+TEST_P(FloatProxyParseOverflowFloatE4M3Test, Sample) {
+ std::istringstream input(GetParam().input);
+ HexFloat<FloatProxy<Float8_E4M3>> value(0);
+ input >> value;
+ EXPECT_NE(GetParam().expect_success, input.fail())
+ << " literal: " << GetParam().input;
+ if (GetParam().expect_success) {
+ EXPECT_THAT(value.value().data(), Eq(GetParam().expected_value))
+ << " literal: " << GetParam().input;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ FloatE4M3Overflow, FloatProxyParseOverflowFloatE4M3Test,
+ ::testing::ValuesIn(std::vector<OverflowParseCase<uint8_t>>({
+ {"0", true, uint8_t{0}},
+ {"0.0", true, uint8_t{0}},
+ {"1.0", true, uint8_t{0x38}},
+ // Overflow for E4M3 float is an error, and returns max or
+ // lowest value.
+ {"1e38", false, uint8_t{0x7e}},
+ {"1e40", false, uint8_t{0x7e}},
+ {"1e400", false, uint8_t{0x7e}},
+ {"-1e38", false, uint8_t{0xfe}},
+ {"-1e40", false, uint8_t{0xfe}},
+ {"-1e400", false, uint8_t{0xfe}},
+ })));
+
+using FloatProxyParseOverflowFloatE5M2Test =
+ ::testing::TestWithParam<OverflowParseCase<uint8_t>>;
+
+TEST_P(FloatProxyParseOverflowFloatE5M2Test, Sample) {
+ std::istringstream input(GetParam().input);
+ HexFloat<FloatProxy<Float8_E5M2>> value(0);
+ input >> value;
+ EXPECT_NE(GetParam().expect_success, input.fail())
+ << " literal: " << GetParam().input;
+ if (GetParam().expect_success) {
+ EXPECT_THAT(value.value().data(), Eq(GetParam().expected_value))
+ << " literal: " << GetParam().input;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ FloatE5M2Overflow, FloatProxyParseOverflowFloatE5M2Test,
+ ::testing::ValuesIn(std::vector<OverflowParseCase<uint8_t>>({
+ {"0", true, uint8_t{0}},
+ {"0.0", true, uint8_t{0}},
+ {"1.0", true, uint8_t{0x3c}},
+ // Overflow for E5M2 float is an error, and returns max or
+ // lowest value.
+ {"1e38", false, uint8_t{0x7b}},
+ {"1e40", false, uint8_t{0x7b}},
+ {"1e400", false, uint8_t{0x7b}},
+ {"-1e38", false, uint8_t{0xfb}},
+ {"-1e40", false, uint8_t{0xfb}},
+ {"-1e400", false, uint8_t{0xfb}},
+ })));
+
TEST(FloatProxy, Max) {
EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(),
Eq(uint16_t{0x7bff}));
@@ -1351,6 +1941,10 @@
using Float32StreamParseTest = ::testing::TestWithParam<StreamParseCase<float>>;
using Float16StreamParseTest =
::testing::TestWithParam<StreamParseCase<Float16>>;
+using FloatE4M3StreamParseTest =
+ ::testing::TestWithParam<StreamParseCase<Float8_E4M3>>;
+using FloatE5M2StreamParseTest =
+ ::testing::TestWithParam<StreamParseCase<Float8_E5M2>>;
TEST_P(Float32StreamParseTest, Samples) {
std::stringstream input(GetParam().literal);
@@ -1620,6 +2214,160 @@
{"0x8.5a40000p0", true, "", makeF16(0, 3, 0x02d)},
{"0x8.5a7ffffp0", true, "", makeF16(0, 3, 0x02d)}}));
+// Returns a E4M3 constructed from its sign bit, unbiased exponent, and
+// mantissa.
+Float8_E4M3 makeE4M3(int sign_bit, int unbiased_exp, int mantissa) {
+ EXPECT_LE(0, sign_bit);
+ EXPECT_LE(sign_bit, 1);
+ // Exponent is 4 bits, with bias of 7.
+ EXPECT_LE(-7, unbiased_exp); // -7 means zero or subnormal
+ EXPECT_LE(unbiased_exp, 8);
+ EXPECT_LE(0, mantissa);
+ EXPECT_LE(mantissa, 0x7);
+ const unsigned biased_exp = 7 + unbiased_exp;
+ const uint32_t as_bits = sign_bit << 7 | (biased_exp << 3) | mantissa;
+ EXPECT_LE(as_bits, 0xffu);
+ return Float8_E4M3(static_cast<uint8_t>(as_bits));
+}
+
+TEST_P(FloatE4M3StreamParseTest, Samples) {
+ std::stringstream input(GetParam().literal);
+ HexFloat<FloatProxy<Float8_E4M3>> parsed_value(makeE4M3(0, 0, 0));
+ // Hex floats must be read with the stream input operator.
+ input >> parsed_value;
+ if (GetParam().expect_success) {
+ EXPECT_FALSE(input.fail());
+ std::string suffix;
+ input >> suffix;
+ const auto got = parsed_value.value();
+ const auto expected = GetParam().expected_value.value();
+ EXPECT_EQ(got.data(), expected.data())
+ << "got: " << got << " expected: " << expected;
+ } else {
+ EXPECT_TRUE(input.fail());
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ HexFloatE4M3IncreasingExponentsAndMantissa, FloatE4M3StreamParseTest,
+ ::testing::ValuesIn(std::vector<StreamParseCase<Float8_E4M3>>{
+ // Zero
+ {"0x0p0", true, "", makeE4M3(0, -7, 0x0)},
+ {"0x0p5000000000000", true, "", makeE4M3(0, -7, 0x0)},
+ {"-0x0p5000000000000", true, "", makeE4M3(1, -7, 0x0)},
+ // Leading 1
+ {"0x1p0", true, "", makeE4M3(0, 0, 0x0)},
+ {"0x1p1", true, "", makeE4M3(0, 1, 0x0)},
+ {"0x1p8", true, "", makeE4M3(0, 8, 0x0)},
+ {"0x1p-1", true, "", makeE4M3(0, -1, 0x0)},
+ {"0x1p-6", true, "", makeE4M3(0, -6, 0x0)},
+ // Leading 2
+ {"0x2p0", true, "", makeE4M3(0, 1, 0x0)},
+ {"0x2p1", true, "", makeE4M3(0, 2, 0x0)},
+ {"0x2p7", true, "", makeE4M3(0, 8, 0x0)},
+ {"0x2p-1", true, "", makeE4M3(0, 0, 0x0)},
+ {"0x2p-7", true, "", makeE4M3(0, -6, 0x0)},
+ // Leading 8
+ {"0x8p0", true, "", makeE4M3(0, 3, 0x0)},
+ {"0x8p1", true, "", makeE4M3(0, 4, 0x0)},
+ {"0x8p5", true, "", makeE4M3(0, 8, 0x0)},
+ {"0x8p-3", true, "", makeE4M3(0, 0, 0x0)},
+ {"0x8p-9", true, "", makeE4M3(0, -6, 0x0)},
+ // Leading 10
+ {"0x10.0p0", true, "", makeE4M3(0, 4, 0x0)},
+ {"0x10.0p1", true, "", makeE4M3(0, 5, 0x0)},
+ {"0x10.0p4", true, "", makeE4M3(0, 8, 0x0)},
+ {"0x10.0p-5", true, "", makeE4M3(0, -1, 0x0)},
+ {"0x10.0p-10", true, "", makeE4M3(0, -6, 0x0)},
+ // Samples that drop out bits *and* truncate significant bits
+ // that can't be represented.
+ // Progressively increase the leading digit.
+ {"0x1.5a40000p0", true, "", makeE4M3(0, 0, 0x2)},
+ {"0x1.5a7ffffp0", true, "", makeE4M3(0, 0, 0x2)},
+ {"0x2.5a40000p0", true, "", makeE4M3(0, 1, 0x1)},
+ {"0x2.5a7ffffp0", true, "", makeE4M3(0, 1, 0x1)},
+ {"0x4.5a40000p0", true, "", makeE4M3(0, 2, 0x0)},
+ {"0x4.5a7ffffp0", true, "", makeE4M3(0, 2, 0x0)},
+ {"0x8.5a40000p0", true, "", makeE4M3(0, 3, 0x0)},
+ {"0x8.5a7ffffp0", true, "", makeE4M3(0, 3, 0x0)}}));
+
+// Returns a E5M2 constructed from its sign bit, unbiased exponent, and
+// mantissa.
+Float8_E5M2 makeE5M2(int sign_bit, int unbiased_exp, int mantissa) {
+ EXPECT_LE(0, sign_bit);
+ EXPECT_LE(sign_bit, 1);
+ // Exponent is 5 bits, with bias of 15.
+ EXPECT_LE(-15, unbiased_exp); // -15 means zero or subnormal
+ EXPECT_LE(unbiased_exp, 16);
+ EXPECT_LE(0, mantissa);
+ EXPECT_LE(mantissa, 0x3);
+ const unsigned biased_exp = 15 + unbiased_exp;
+ const uint32_t as_bits = sign_bit << 7 | (biased_exp << 2) | mantissa;
+ EXPECT_LE(as_bits, 0xffu);
+ return Float8_E5M2(static_cast<uint8_t>(as_bits));
+}
+
+TEST_P(FloatE5M2StreamParseTest, Samples) {
+ std::stringstream input(GetParam().literal);
+ HexFloat<FloatProxy<Float8_E5M2>> parsed_value(makeE5M2(0, 0, 0));
+ // Hex floats must be read with the stream input operator.
+ input >> parsed_value;
+ if (GetParam().expect_success) {
+ EXPECT_FALSE(input.fail());
+ std::string suffix;
+ input >> suffix;
+ const auto got = parsed_value.value();
+ const auto expected = GetParam().expected_value.value();
+ EXPECT_EQ(got.data(), expected.data())
+ << "got: " << got << " expected: " << expected;
+ } else {
+ EXPECT_TRUE(input.fail());
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ HexFloatE5M2IncreasingExponentsAndMantissa, FloatE5M2StreamParseTest,
+ ::testing::ValuesIn(std::vector<StreamParseCase<Float8_E5M2>>{
+ // Zero
+ {"0x0p0", true, "", makeE5M2(0, -15, 0x0)},
+ {"0x0p5000000000000", true, "", makeE5M2(0, -15, 0x0)},
+ {"-0x0p5000000000000", true, "", makeE5M2(1, -15, 0x0)},
+ // Leading 1
+ {"0x1p0", true, "", makeE5M2(0, 0, 0x0)},
+ {"0x1p1", true, "", makeE5M2(0, 1, 0x0)},
+ {"0x1p16", true, "", makeE5M2(0, 16, 0x0)},
+ {"0x1p-1", true, "", makeE5M2(0, -1, 0x0)},
+ {"0x1p-14", true, "", makeE5M2(0, -14, 0x0)},
+ // Leading 2
+ {"0x2p0", true, "", makeE5M2(0, 1, 0x0)},
+ {"0x2p1", true, "", makeE5M2(0, 2, 0x0)},
+ {"0x2p15", true, "", makeE5M2(0, 16, 0x0)},
+ {"0x2p-1", true, "", makeE5M2(0, 0, 0x0)},
+ {"0x2p-15", true, "", makeE5M2(0, -14, 0x0)},
+ // Leading 8
+ {"0x8p0", true, "", makeE5M2(0, 3, 0x0)},
+ {"0x8p1", true, "", makeE5M2(0, 4, 0x0)},
+ {"0x8p13", true, "", makeE5M2(0, 16, 0x0)},
+ {"0x8p-3", true, "", makeE5M2(0, 0, 0x0)},
+ {"0x8p-17", true, "", makeE5M2(0, -14, 0x0)},
+ // Leading 10
+ {"0x10.0p0", true, "", makeE5M2(0, 4, 0x0)},
+ {"0x10.0p1", true, "", makeE5M2(0, 5, 0x0)},
+ {"0x10.0p12", true, "", makeE5M2(0, 16, 0x0)},
+ {"0x10.0p-5", true, "", makeE5M2(0, -1, 0x0)},
+ {"0x10.0p-18", true, "", makeE5M2(0, -14, 0x0)},
+ // Samples that drop out bits *and* truncate significant bits
+ // that can't be represented.
+ // Progressively increase the leading digit.
+ {"0x1.aa40000p0", true, "", makeE5M2(0, 0, 0x2)},
+ {"0x1.aa7ffffp0", true, "", makeE5M2(0, 0, 0x2)},
+ {"0x2.aa40000p0", true, "", makeE5M2(0, 1, 0x1)},
+ {"0x2.aa7ffffp0", true, "", makeE5M2(0, 1, 0x1)},
+ {"0x4.aa40000p0", true, "", makeE5M2(0, 2, 0x0)},
+ {"0x4.aa7ffffp0", true, "", makeE5M2(0, 2, 0x0)},
+ {"0x8.aa40000p0", true, "", makeE5M2(0, 3, 0x0)},
+ {"0x8.aa7ffffp0", true, "", makeE5M2(0, 3, 0x0)}}));
+
} // namespace
} // namespace utils
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/hex_to_text_test.cpp b/third_party/SPIRV-Tools/test/hex_to_text_test.cpp
new file mode 100644
index 0000000..cc5c673
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/hex_to_text_test.cpp
@@ -0,0 +1,429 @@
+// Copyright (c) 2024 Google LLC.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "test/test_fixture.h"
+#include "tools/io.h"
+
+namespace spvtools {
+namespace {
+
+using spvtest::ScopedContext;
+
+class HexToText : public ::testing::Test {
+ public:
+ void VerifyDisassembly(const char* hex_stream,
+ const char* expected_disassembly) {
+ std::vector<char> stream(hex_stream, hex_stream + strlen(hex_stream));
+ std::vector<uint32_t> binary;
+
+ // Convert hext to binary first.
+ EXPECT_TRUE(ConvertHexToBinary(stream, &binary));
+
+ // Then disassemble it.
+ spv_diagnostic diagnostic = nullptr;
+ spv_text disassembly = nullptr;
+ EXPECT_EQ(spvBinaryToText(ScopedContext().context, binary.data(),
+ binary.size(), SPV_BINARY_TO_TEXT_OPTION_NONE,
+ &disassembly, &diagnostic),
+ SPV_SUCCESS);
+ EXPECT_EQ(diagnostic, nullptr);
+
+ // Verify disassembly is as expected and clean up.
+ EXPECT_STREQ(disassembly->str, expected_disassembly);
+
+ spvDiagnosticDestroy(diagnostic);
+ spvTextDestroy(disassembly);
+ }
+
+ void EnsureError(const char* hex_stream) {
+ std::vector<char> stream(hex_stream, hex_stream + strlen(hex_stream));
+ std::vector<uint32_t> binary;
+
+ // Make sure there is a parse error
+ EXPECT_FALSE(ConvertHexToBinary(stream, &binary));
+ }
+};
+
+// The actual assembly doesn't matter, just the hex parsing. All the tests use
+// the following SPIR-V.
+constexpr char kDisassembly[] = R"(; SPIR-V
+; Version: 1.6
+; Generator: Khronos SPIR-V Tools Assembler; 0
+; Bound: 11
+; Schema: 0
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Vertex %1 "main" %2 %3
+OpName %2 "fancy_attribute"
+OpName %3 "useful_output"
+OpDecorate %2 Location 4
+OpDecorate %3 Location 2
+%4 = OpTypeFloat 32
+%5 = OpTypePointer Input %4
+%2 = OpVariable %5 Input
+%6 = OpTypePointer Output %4
+%3 = OpVariable %6 Output
+%7 = OpTypeVoid
+%8 = OpTypeFunction %7
+%1 = OpFunction %7 None %8
+%9 = OpLabel
+%10 = OpLoad %4 %2
+OpStore %3 %10
+OpReturn
+OpFunctionEnd
+)";
+
+TEST_F(HexToText, Words) {
+ constexpr char kHex[] = R"(0x07230203, 0x00010600, 0x00070000, 0x0000000b
+0x00000000, 0x00020011, 0x00000001, 0x0003000e
+0x00000000, 0x00000001, 0x0007000f, 0x00000000
+0x00000001, 0x6e69616d, 0x00000000, 0x00000002
+0x00000003, 0x00060005, 0x00000002, 0x636e6166
+0x74615f79, 0x62697274, 0x00657475, 0x00060005
+0x00000003, 0x66657375, 0x6f5f6c75, 0x75707475
+0x00000074, 0x00040047, 0x00000002, 0x0000001e
+0x00000004, 0x00040047, 0x00000003, 0x0000001e
+0x00000002, 0x00030016, 0x00000004, 0x00000020
+0x00040020, 0x00000005, 0x00000001, 0x00000004
+0x0004003b, 0x00000005, 0x00000002, 0x00000001
+0x00040020, 0x00000006, 0x00000003, 0x00000004
+0x0004003b, 0x00000006, 0x00000003, 0x00000003
+0x00020013, 0x00000007, 0x00030021, 0x00000008
+0x00000007, 0x00050036, 0x00000007, 0x00000001
+0x00000000, 0x00000008, 0x000200f8, 0x00000009
+0x0004003d, 0x00000004, 0x0000000a, 0x00000002
+0x0003003e, 0x00000003, 0x0000000a, 0x000100fd
+0x00010038)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, WordsLeadingSpace) {
+ constexpr char kHex[] = R"(
+x07230203, x00010600, x00070000, x0000000b
+x00000000, x00020011, x00000001, x0003000e
+x00000000, x00000001, x0007000f, x00000000
+x00000001, x6e69616d, x00000000, x00000002
+x00000003, x00060005, x00000002, x636e6166
+x74615f79, x62697274, x00657475, x00060005
+x00000003, x66657375, x6f5f6c75, x75707475
+x00000074, x00040047, x00000002, x0000001e
+x00000004, x00040047, x00000003, x0000001e
+x00000002, x00030016, x00000004, x00000020
+x00040020, x00000005, x00000001, x00000004
+x0004003b, x00000005, x00000002, x00000001
+x00040020, x00000006, x00000003, x00000004
+x0004003b, x00000006, x00000003, x00000003
+x00020013, x00000007, x00030021, x00000008
+x00000007, x00050036, x00000007, x00000001
+x00000000, x00000008, x000200f8, x00000009
+x0004003d, x00000004, x0000000a, x00000002
+x0003003e, x00000003, x0000000a, x000100fd
+x00010038)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, WordsTrailingSpace) {
+ constexpr char kHex[] = R"(0X7230203, 0X10600, 0X70000, 0XB
+0X0, 0X20011, 0X1, 0X3000E
+0X0, 0X1, 0X7000F, 0X0
+0X1, X6E69616D, 0X0, 0X2
+0X3, 0X60005, 0X2, X636E6166
+X74615F79, X62697274, 0X657475, 0X60005
+0X3, X66657375, X6F5F6C75, X75707475
+0X74, 0X40047, 0X2, 0X1E
+0X4, 0X40047, 0X3, 0X1E
+0X2, 0X30016, 0X4, 0X20
+0X40020, 0X5, 0X1, 0X4
+0X4003B, 0X5, 0X2, 0X1
+0X40020, 0X6, 0X3, 0X4
+0X4003B, 0X6, 0X3, 0X3
+0X20013, 0X7, 0X30021, 0X8
+0X7, 0X50036, 0X7, 0X1
+0X0, 0X8, 0X200F8, 0X9
+0X4003D, 0X4, 0XA, 0X2
+0X3003E, 0X3, 0XA, 0X100FD
+0X10038
+
+)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, BytesLittleEndian) {
+ constexpr char kHex[] = R"(
+0x03 0x02 0x23 0x07 0x00 0x06 0x01 0x00 0x00 0x00 0x07 0x00 0x0b 0x00 0x00 0x00
+0x00 0x00 0x00 0x00 0x11 0x00 0x02 0x00 0x01 0x00 0x00 0x00 0x0e 0x00 0x03 0x00
+0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x0f 0x00 0x07 0x00 0x00 0x00 0x00 0x00
+0x01 0x00 0x00 0x00 0x6d 0x61 0x69 0x6e 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00
+0x03 0x00 0x00 0x00 0x05 0x00 0x06 0x00 0x02 0x00 0x00 0x00 0x66 0x61 0x6e 0x63
+0x79 0x5f 0x61 0x74 0x74 0x72 0x69 0x62 0x75 0x74 0x65 0x00 0x05 0x00 0x06 0x00
+0x03 0x00 0x00 0x00 0x75 0x73 0x65 0x66 0x75 0x6c 0x5f 0x6f 0x75 0x74 0x70 0x75
+0x74 0x00 0x00 0x00 0x47 0x00 0x04 0x00 0x02 0x00 0x00 0x00 0x1e 0x00 0x00 0x00
+0x04 0x00 0x00 0x00 0x47 0x00 0x04 0x00 0x03 0x00 0x00 0x00 0x1e 0x00 0x00 0x00
+0x02 0x00 0x00 0x00 0x16 0x00 0x03 0x00 0x04 0x00 0x00 0x00 0x20 0x00 0x00 0x00
+0x20 0x00 0x04 0x00 0x05 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x04 0x00 0x00 0x00
+0x3b 0x00 0x04 0x00 0x05 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x01 0x00 0x00 0x00
+0x20 0x00 0x04 0x00 0x06 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x04 0x00 0x00 0x00
+0x3b 0x00 0x04 0x00 0x06 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x03 0x00 0x00 0x00
+0x13 0x00 0x02 0x00 0x07 0x00 0x00 0x00 0x21 0x00 0x03 0x00 0x08 0x00 0x00 0x00
+0x07 0x00 0x00 0x00 0x36 0x00 0x05 0x00 0x07 0x00 0x00 0x00 0x01 0x00 0x00 0x00
+0x00 0x00 0x00 0x00 0x08 0x00 0x00 0x00 0xf8 0x00 0x02 0x00 0x09 0x00 0x00 0x00
+0x3d 0x00 0x04 0x00 0x04 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x02 0x00 0x00 0x00
+0x3e 0x00 0x03 0x00 0x03 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0xfd 0x00 0x01 0x00
+0x38 0x00 0x01 0x00
+)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, BytesBigEndian) {
+ constexpr char kHex[] = R"(
+X07,X23,X02,X03, X00,X01,X06,X00, X00,X07,X00,X00, X00,X00,X00,X0B
+X00,X00,X00,X00, X00,X02,X00,X11, X00,X00,X00,X01, X00,X03,X00,X0E
+X00,X00,X00,X00, X00,X00,X00,X01, X00,X07,X00,X0F, X00,X00,X00,X00
+X00,X00,X00,X01, X6E,X69,X61,X6D, X00,X00,X00,X00, X00,X00,X00,X02
+X00,X00,X00,X03, X00,X06,X00,X05, X00,X00,X00,X02, X63,X6E,X61,X66
+X74,X61,X5F,X79, X62,X69,X72,X74, X00,X65,X74,X75, X00,X06,X00,X05
+X00,X00,X00,X03, X66,X65,X73,X75, X6F,X5F,X6C,X75, X75,X70,X74,X75
+X00,X00,X00,X74, X00,X04,X00,X47, X00,X00,X00,X02, X00,X00,X00,X1E
+X00,X00,X00,X04, X00,X04,X00,X47, X00,X00,X00,X03, X00,X00,X00,X1E
+X00,X00,X00,X02, X00,X03,X00,X16, X00,X00,X00,X04, X00,X00,X00,X20
+X00,X04,X00,X20, X00,X00,X00,X05, X00,X00,X00,X01, X00,X00,X00,X04
+X00,X04,X00,X3B, X00,X00,X00,X05, X00,X00,X00,X02, X00,X00,X00,X01
+X00,X04,X00,X20, X00,X00,X00,X06, X00,X00,X00,X03, X00,X00,X00,X04
+X00,X04,X00,X3B, X00,X00,X00,X06, X00,X00,X00,X03, X00,X00,X00,X03
+X00,X02,X00,X13, X00,X00,X00,X07, X00,X03,X00,X21, X00,X00,X00,X08
+X00,X00,X00,X07, X00,X05,X00,X36, X00,X00,X00,X07, X00,X00,X00,X01
+X00,X00,X00,X00, X00,X00,X00,X08, X00,X02,X00,XF8, X00,X00,X00,X09
+X00,X04,X00,X3D, X00,X00,X00,X04, X00,X00,X00,X0A, X00,X00,X00,X02
+X00,X03,X00,X3E, X00,X00,X00,X03, X00,X00,X00,X0A, X00,X01,X00,XFD
+X00,X01,X00,X38,
+)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, StreamLittleEndian) {
+ constexpr char kHex[] = R"(
+03 02 23 07 00 06 01 00 00 00 07 00 0b 00 00 00
+00 00 00 00 11 00 02 00 01 00 00 00 0e 00 03 00
+00 00 00 00 01 00 00 00 0f 00 07 00 00 00 00 00
+01 00 00 00 6d 61 69 6e 00 00 00 00 02 00 00 00
+03 00 00 00 05 00 06 00 02 00 00 00 66 61 6e 63
+79 5f 61 74 74 72 69 62 75 74 65 00 05 00 06 00
+03 00 00 00 75 73 65 66 75 6c 5f 6f 75 74 70 75
+74 00 00 00 47 00 04 00 02 00 00 00 1e 00 00 00
+04 00 00 00 47 00 04 00 03 00 00 00 1e 00 00 00
+02 00 00 00 16 00 03 00 04 00 00 00 20 00 00 00
+20 00 04 00 05 00 00 00 01 00 00 00 04 00 00 00
+3b 00 04 00 05 00 00 00 02 00 00 00 01 00 00 00
+20 00 04 00 06 00 00 00 03 00 00 00 04 00 00 00
+3b 00 04 00 06 00 00 00 03 00 00 00 03 00 00 00
+13 00 02 00 07 00 00 00 21 00 03 00 08 00 00 00
+07 00 00 00 36 00 05 00 07 00 00 00 01 00 00 00
+00 00 00 00 08 00 00 00 f8 00 02 00 09 00 00 00
+3d 00 04 00 04 00 00 00 0a 00 00 00 02 00 00 00
+3e 00 03 00 03 00 00 00 0a 00 00 00 fd 00 01 00
+38 00 01 00
+)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, StreamLittleEndianNoDelim) {
+ constexpr char kHex[] = R"(
+0302230700060100000007000B000000
+0000000011000200010000000E000300
+00000000010000000F00070000000000
+010000006D61696E0000000002000000
+03000000050006000200000066616E63
+795F6174747269627574650005000600
+0300000075736566756C5F6F75747075
+7400000047000400020000001E000000
+0400000047000400030000001E000000
+02000000160003000400000020000000
+20000400050000000100000004000000
+3B000400050000000200000001000000
+20000400060000000300000004000000
+3B000400060000000300000003000000
+13000200070000002100030008000000
+07000000360005000700000001000000
+0000000008000000F800020009000000
+3D000400040000000A00000002000000
+3E000300030000000A000000FD000100
+38000100
+)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, StreamBigEndian) {
+ constexpr char kHex[] = R"(
+07230203, 00010600, 00070000, 0000000b
+00000000, 00020011, 00000001, 0003000e
+00000000, 00000001, 0007000f, 00000000
+00000001, 6e69616d, 00000000, 00000002
+00000003, 00060005, 00000002, 636e6166
+74615f79, 62697274, 00657475, 00060005
+00000003, 66657375, 6f5f6c75, 75707475
+00000074, 00040047, 00000002, 0000001e
+00000004, 00040047, 00000003, 0000001e
+00000002, 00030016, 00000004, 00000020
+00040020, 00000005, 00000001, 00000004
+0004003b, 00000005, 00000002, 00000001
+00040020, 00000006, 00000003, 00000004
+0004003b, 00000006, 00000003, 00000003
+00020013, 00000007, 00030021, 00000008
+00000007, 00050036, 00000007, 00000001
+00000000, 00000008, 000200f8, 00000009
+0004003d, 00000004, 0000000a, 00000002
+0003003e, 00000003, 0000000a, 000100fd
+00010038,
+)";
+
+ VerifyDisassembly(kHex, kDisassembly);
+}
+
+TEST_F(HexToText, WordsNoDelimieter) {
+ constexpr char kHex[] = R"(0x07230203 0x00010600 0x00070000 0x0000000b
+0x00000000 0x00020011 0x00000001 0x0003000e
+0x00000000 0x00000001 0x0007000f 0x00000000
+0x00000001 0x6e69616d 0x00000000 0x00000002
+0x00000003 0x00060005 0x00000002 0x636e6166
+0x74615f79 0x62697274 0x00657475 0x00060005
+0x00000003 0x666573750x6f5f6c75 0x75707475
+0x00000074 0x00040047 0x00000002 0x0000001e
+0x00000004 0x00040047 0x00000003 0x0000001e
+0x00000002 0x00030016 0x00000004 0x00000020
+0x00040020 0x00000005 0x00000001 0x00000004
+0x0004003b 0x00000005 0x00000002 0x00000001
+0x00040020 0x00000006 0x00000003 0x00000004
+0x0004003b 0x00000006 0x00000003 0x00000003
+0x00020013 0x00000007 0x00030021 0x00000008
+0x00000007 0x00050036 0x00000007 0x00000001
+0x00000000 0x00000008 0x000200f8 0x00000009
+0x0004003d 0x00000004 0x0000000a 0x00000002
+0x0003003e 0x00000003 0x0000000a 0x000100fd
+0x00010038)";
+
+ EnsureError(kHex);
+}
+
+TEST_F(HexToText, InvalidFirstToken) {
+ constexpr char kHex[] = R"(0x17230203, 0x00010600, 0x00070000, 0x0000000b
+0x00000000, 0x00020011, 0x00000001, 0x0003000e
+0x00000000, 0x00000001, 0x0007000f, 0x00000000
+0x00000001, 0x6e69616d, 0x00000000, 0x00000002
+0x00000003, 0x00060005, 0x00000002, 0x636e6166
+0x74615f79, 0x62697274, 0x00657475, 0x00060005
+0x00000003, 0x66657375, 0x6f5f6c75, 0x75707475
+0x00000074, 0x00040047, 0x00000002, 0x0000001e
+0x00000004, 0x00040047, 0x00000003, 0x0000001e
+0x00000002, 0x00030016, 0x00000004, 0x00000020
+0x00040020, 0x00000005, 0x00000001, 0x00000004
+0x0004003b, 0x00000005, 0x00000002, 0x00000001
+0x00040020, 0x00000006, 0x00000003, 0x00000004
+0x0004003b, 0x00000006, 0x00000003, 0x00000003
+0x00020013, 0x00000007, 0x00030021, 0x00000008
+0x00000007, 0x00050036, 0x00000007, 0x00000001
+0x00000000, 0x00000008, 0x000200f8, 0x00000009
+0x0004003d, 0x00000004, 0x0000000a, 0x00000002
+0x0003003e, 0x00000003, 0x0000000a, 0x000100fd
+0x00010038)";
+
+ EnsureError(kHex);
+}
+
+TEST_F(HexToText, NonHexCharacter) {
+ // Note: a 6 is replaced with G in this stream
+ constexpr char kHex[] = R"(0x07230203, 0x00010600, 0x00070000, 0x0000000b
+0x00000000, 0x00020011, 0x00000001, 0x0003000e
+0x00000000, 0x00000001, 0x0007000f, 0x00000000
+0x00000001, 0x6e69616d, 0x00000000, 0x00000002
+0x00000003, 0x00060005, 0x00000002, 0x636e6166
+0x74615f79, 0x62697274, 0x00657475, 0x00060005
+0x00000003, 0x66657375, 0x6f5f6c75, 0x75707475
+0x00000074, 0x00040047, 0x00000002, 0x0000001e
+0x00000004, 0x00040047, 0x00000003, 0x0000001e
+0x00000002, 0x0003001G, 0x00000004, 0x00000020
+0x00040020, 0x00000005, 0x00000001, 0x00000004
+0x0004003b, 0x00000005, 0x00000002, 0x00000001
+0x00040020, 0x00000006, 0x00000003, 0x00000004
+0x0004003b, 0x00000006, 0x00000003, 0x00000003
+0x00020013, 0x00000007, 0x00030021, 0x00000008
+0x00000007, 0x00050036, 0x00000007, 0x00000001
+0x00000000, 0x00000008, 0x000200f8, 0x00000009
+0x0004003d, 0x00000004, 0x0000000a, 0x00000002
+0x0003003e, 0x00000003, 0x0000000a, 0x000100fd
+0x00010038)";
+
+ EnsureError(kHex);
+}
+
+TEST_F(HexToText, MissingExpectedPrefix) {
+ constexpr char kHex[] = R"(0x07230203, 0x00010600, 0x00070000, 0x0000000b
+0x00000000, 0x00020011, 0x00000001, 0x0003000e
+0x00000000, 0x00000001, 0x0007000f, 0x00000000
+0x00000001, 0x6e69616d, 0x00000000, 0x00000002
+0x00000003, 0x00060005, 0x00000002, 0x636e6166
+0x74615f79, 0x62697274, 0x00657475, 0x00060005
+0x00000003, 0x66657375, 0x6f5f6c75, 0x75707475
+0x00000074, 0x00040047, 0x00000002, 0x0000001e
+0x00000004, 0x00040047, 0x00000003, 0x0000001e
+0x00000002, 0x00030016, 0x00000004, 0x00000020
+0x00040020, 0x00000005, 00000001, 0x00000004
+0x0004003b, 0x00000005, 0x00000002, 0x00000001
+0x00040020, 0x00000006, 0x00000003, 0x00000004
+0x0004003b, 0x00000006, 0x00000003, 0x00000003
+0x00020013, 0x00000007, 0x00030021, 0x00000008
+0x00000007, 0x00050036, 0x00000007, 0x00000001
+0x00000000, 0x00000008, 0x000200f8, 0x00000009
+0x0004003d, 0x00000004, 0x0000000a, 0x00000002
+0x0003003e, 0x00000003, 0x0000000a, 0x000100fd
+0x00010038)";
+
+ EnsureError(kHex);
+}
+
+TEST_F(HexToText, UnexpectedPrefix) {
+ constexpr char kHex[] = R"(07230203, 00010600, 00070000, 0000000b
+00000000, 00020011, 00000001, 0003000e
+00000000, 00000001, 0007000f, 00000000
+00000001, 6e69616d, 00000000, 00000002
+00000003, 00060005, 00000002, 636e6166
+74615f79, 62697274, 00657475, 00060005
+00000003, 66657375, 6f5f6c75, 75707475
+00000074, 00040047, 00000002, 0000001e
+00000004, 00040047, 00000003, 0000001e
+00000002, 00030016, 00000004, 00000020
+00040020, 00000005, 0x00000001, 00000004
+0004003b, 00000005, 00000002, 00000001
+00040020, 00000006, 00000003, 00000004
+0004003b, 00000006, 00000003, 00000003
+00020013, 00000007, 00030021, 00000008
+00000007, 00050036, 00000007, 00000001
+00000000, 00000008, 000200f8, 00000009
+0004003d, 00000004, 0000000a, 00000002
+0003003e, 00000003, 0000000a, 000100fd
+00010038)";
+
+ EnsureError(kHex);
+}
+} // namespace
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/immediate_int_test.cpp b/third_party/SPIRV-Tools/test/immediate_int_test.cpp
index 8e7a8fd..44f96e2 100644
--- a/third_party/SPIRV-Tools/test/immediate_int_test.cpp
+++ b/third_party/SPIRV-Tools/test/immediate_int_test.cpp
@@ -136,19 +136,25 @@
}
// Literal floats after !<integer> are handled correctly.
+// Insert OpNop to avoid reading the immediate value as the extra FP encoding
+// operand to OpTypeFloat.
TEST_F(ImmediateIntTest, FloatFollowingImmediate) {
- EXPECT_EQ(
- CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 0.123"),
- CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 !2 0.123"));
- EXPECT_EQ(
- CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0.5"),
- CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 !2 -0.5"));
- EXPECT_EQ(
- CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 0.123"),
- CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 %2 0.123"));
- EXPECT_EQ(
- CompiledInstructions("%1 = OpTypeFloat 32\n%2 = OpConstant %1 -0.5"),
- CompiledInstructions("%1 = OpTypeFloat 32\n!0x0004002b %1 %2 -0.5"));
+ EXPECT_EQ(CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop %2 = OpConstant %1 0.123"),
+ CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop !0x0004002b %1 !2 0.123"));
+ EXPECT_EQ(CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop %2 = OpConstant %1 -0.5"),
+ CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop !0x0004002b %1 !2 -0.5"));
+ EXPECT_EQ(CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop %2 = OpConstant %1 0.123"),
+ CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop !0x0004002b %1 %2 0.123"));
+ EXPECT_EQ(CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop %2 = OpConstant %1 -0.5"),
+ CompiledInstructions(
+ "%1 = OpTypeFloat 32\nOpNop !0x0004002b %1 %2 -0.5"));
EXPECT_EQ(Concatenate({
MakeInstruction(spv::Op::OpTypeInt, {1, 64, 0}),
@@ -203,9 +209,9 @@
TEST_F(ImmediateIntTest, InvalidStatementBetweenValidOnes) {
EXPECT_THAT(Subvector(CompileSuccessfully(
- "%10 = OpTypeFloat 32 !5 !6 !7 OpEmitVertex"),
+ "%10 = OpTypeInt 32 0 !5 !6 !7 OpEmitVertex"),
kFirstInstruction),
- ElementsAre(spvOpcodeMake(3, spv::Op::OpTypeFloat), 1, 32, 5, 6,
+ ElementsAre(spvOpcodeMake(4, spv::Op::OpTypeInt), 1, 32, 0, 5, 6,
7, spvOpcodeMake(1, spv::Op::OpEmitVertex)));
}
diff --git a/third_party/SPIRV-Tools/test/link/linker_fixture.h b/third_party/SPIRV-Tools/test/link/linker_fixture.h
index d005288..08a2880 100644
--- a/third_party/SPIRV-Tools/test/link/linker_fixture.h
+++ b/third_party/SPIRV-Tools/test/link/linker_fixture.h
@@ -155,6 +155,19 @@
}
}
+ void Match(const std::string& templateBody,
+ const spvtest::Binary& linked_binary) {
+ std::string result;
+ EXPECT_TRUE(
+ tools_.Disassemble(linked_binary, &result, disassemble_options_))
+ << GetErrorMessage();
+ auto match_res = effcee::Match(result, templateBody);
+ EXPECT_EQ(effcee::Result::Status::Ok, match_res.status())
+ << match_res.message() << "\nExpanded from:\n"
+ << templateBody << "\nChecking result:\n"
+ << result;
+ }
+
// An alternative to ExpandAndCheck, which uses the |templateBody| as the
// match pattern for the disassembled linked result.
void ExpandAndMatch(
@@ -165,15 +178,7 @@
EXPECT_EQ(SPV_SUCCESS, res) << GetErrorMessage() << "\nExpanded from:\n"
<< templateBody;
if (res == SPV_SUCCESS) {
- std::string result;
- EXPECT_TRUE(
- tools_.Disassemble(linked_binary, &result, disassemble_options_))
- << GetErrorMessage();
- auto match_res = effcee::Match(result, templateBody);
- EXPECT_EQ(effcee::Result::Status::Ok, match_res.status())
- << match_res.message() << "\nExpanded from:\n"
- << templateBody << "\nChecking result:\n"
- << result;
+ Match(templateBody, linked_binary);
}
}
diff --git a/third_party/SPIRV-Tools/test/link/matching_imports_to_exports_test.cpp b/third_party/SPIRV-Tools/test/link/matching_imports_to_exports_test.cpp
index 6b02fc4..db94cb8 100644
--- a/third_party/SPIRV-Tools/test/link/matching_imports_to_exports_test.cpp
+++ b/third_party/SPIRV-Tools/test/link/matching_imports_to_exports_test.cpp
@@ -15,6 +15,7 @@
#include <string>
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
#include "test/link/linker_fixture.h"
namespace spvtools {
@@ -174,14 +175,18 @@
%1 = OpVariable %2 Uniform %3
)";
- spvtest::Binary linked_binary;
- EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
- AssembleAndLink({body1, body2}, &linked_binary))
- << GetErrorMessage();
- EXPECT_THAT(
- GetErrorMessage(),
- HasSubstr("Type mismatch on symbol \"foo\" between imported "
- "variable/function %1 and exported variable/function %4"));
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
+ "variable/function %1 and exported variable/function %4"));
+ }
}
TEST_F(MatchingImportsToExports, MultipleDefinitions) {
@@ -216,13 +221,17 @@
%1 = OpVariable %2 Uniform %3
)";
- spvtest::Binary linked_binary;
- EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
- AssembleAndLink({body1, body2, body3}, &linked_binary))
- << GetErrorMessage();
- EXPECT_THAT(GetErrorMessage(),
- HasSubstr("Too many external references, 2, were found "
- "for \"foo\"."));
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2, body3}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(GetErrorMessage(),
+ HasSubstr("Too many external references, 2, were found "
+ "for \"foo\"."));
+ }
}
TEST_F(MatchingImportsToExports, SameNameDifferentTypes) {
@@ -289,14 +298,18 @@
%1 = OpVariable %2 Uniform %3
)";
- spvtest::Binary linked_binary;
- EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
- AssembleAndLink({body1, body2}, &linked_binary))
- << GetErrorMessage();
- EXPECT_THAT(
- GetErrorMessage(),
- HasSubstr("Type mismatch on symbol \"foo\" between imported "
- "variable/function %1 and exported variable/function %4"));
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
+ "variable/function %1 and exported variable/function %4"));
+ }
}
TEST_F(MatchingImportsToExports,
@@ -557,5 +570,460 @@
EXPECT_EQ(expected_res, res_body);
}
+TEST_F(MatchingImportsToExports, FunctionCall) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %3 "param"
+OpDecorate %1 LinkageAttributes "foo" Import
+ %5 = OpTypeVoid
+ %6 = OpTypeInt 32 0
+ %9 = OpTypePointer Function %6
+ %7 = OpTypeFunction %5 %9
+ %1 = OpFunction %5 None %7
+ %3 = OpFunctionParameter %9
+OpFunctionEnd
+ %8 = OpFunction %5 None %7
+ %4 = OpFunctionParameter %9
+%10 = OpLabel
+%11 = OpFunctionCall %5 %1 %4
+OpReturn
+OpFunctionEnd
+)";
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpDecorate %1 LinkageAttributes "foo" Export
+%3 = OpTypeVoid
+%4 = OpTypeInt 32 0
+%7 = OpTypePointer Function %4
+%5 = OpTypeFunction %3 %7
+%1 = OpFunction %3 None %5
+%2 = OpFunctionParameter %7
+%6 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ ASSERT_EQ(SPV_SUCCESS,
+ AssembleAndLink({body1, body2}, &linked_binary, options))
+ << GetErrorMessage();
+
+ const std::string expected_res = R"(OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpModuleProcessed "Linked by SPIR-V Tools Linker"
+%3 = OpTypeVoid
+%4 = OpTypeInt 32 0
+%5 = OpTypePointer Function %4
+%6 = OpTypeFunction %3 %5
+%7 = OpFunction %3 None %6
+%8 = OpFunctionParameter %5
+%9 = OpLabel
+%10 = OpFunctionCall %3 %1 %8
+OpReturn
+OpFunctionEnd
+%1 = OpFunction %3 None %6
+%2 = OpFunctionParameter %5
+%11 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ std::string res_body;
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body))
+ << GetErrorMessage();
+ EXPECT_EQ(expected_res, res_body);
+ }
+}
+
+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchPointer) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %3 "param"
+OpDecorate %1 LinkageAttributes "foo" Import
+ %5 = OpTypeVoid
+ %6 = OpTypeInt 8 0
+ %9 = OpTypePointer Function %6
+ %7 = OpTypeFunction %5 %9
+ %1 = OpFunction %5 None %7
+ %3 = OpFunctionParameter %9
+OpFunctionEnd
+ %8 = OpFunction %5 None %7
+ %4 = OpFunctionParameter %9
+%10 = OpLabel
+%11 = OpFunctionCall %5 %1 %4
+OpReturn
+OpFunctionEnd
+)";
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpDecorate %1 LinkageAttributes "foo" Export
+%3 = OpTypeVoid
+%4 = OpTypeInt 32 0
+%7 = OpTypePointer Function %4
+%5 = OpTypeFunction %3 %7
+%1 = OpFunction %3 None %5
+%2 = OpFunctionParameter %7
+%6 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ spvtest::Binary linked_binary;
+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
+ "variable/function %1 and exported variable/function %11"));
+
+ LinkerOptions options;
+ options.SetAllowPtrTypeMismatch(true);
+ ASSERT_EQ(SPV_SUCCESS,
+ AssembleAndLink({body1, body2}, &linked_binary, options))
+ << GetErrorMessage();
+
+ const std::string expected_res = R"(OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpModuleProcessed "Linked by SPIR-V Tools Linker"
+%3 = OpTypeVoid
+%4 = OpTypeInt 8 0
+%5 = OpTypePointer Function %4
+%6 = OpTypeFunction %3 %5
+%7 = OpTypeInt 32 0
+%8 = OpTypePointer Function %7
+%9 = OpTypeFunction %3 %8
+%10 = OpFunction %3 None %6
+%11 = OpFunctionParameter %5
+%12 = OpLabel
+%13 = OpBitcast %8 %11
+%14 = OpFunctionCall %3 %1 %13
+OpReturn
+OpFunctionEnd
+%1 = OpFunction %3 None %9
+%2 = OpFunctionParameter %8
+%15 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+ std::string res_body;
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ ASSERT_EQ(SPV_SUCCESS, Disassemble(linked_binary, &res_body))
+ << GetErrorMessage();
+ EXPECT_EQ(expected_res, res_body);
+}
+
+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchValue) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %3 "param"
+OpDecorate %1 LinkageAttributes "foo" Import
+ %5 = OpTypeVoid
+ %6 = OpTypeInt 8 0
+ %7 = OpTypeFunction %5 %6
+ %1 = OpFunction %5 None %7
+ %3 = OpFunctionParameter %6
+OpFunctionEnd
+ %8 = OpFunction %5 None %7
+ %4 = OpFunctionParameter %6
+%10 = OpLabel
+%11 = OpFunctionCall %5 %1 %4
+OpReturn
+OpFunctionEnd
+)";
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpDecorate %1 LinkageAttributes "foo" Export
+%3 = OpTypeVoid
+%4 = OpTypeInt 32 0
+%5 = OpTypeFunction %3 %4
+%1 = OpFunction %3 None %5
+%2 = OpFunctionParameter %4
+%6 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
+ "variable/function %1 and exported variable/function %10"));
+ }
+}
+
+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchTypePointerInt) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %3 "param"
+OpDecorate %1 LinkageAttributes "foo" Import
+ %5 = OpTypeVoid
+ %6 = OpTypeInt 64 0
+ %7 = OpTypeFunction %5 %6
+ %1 = OpFunction %5 None %7
+ %3 = OpFunctionParameter %6
+OpFunctionEnd
+ %8 = OpFunction %5 None %7
+ %4 = OpFunctionParameter %6
+%10 = OpLabel
+%11 = OpFunctionCall %5 %1 %4
+OpReturn
+OpFunctionEnd
+)";
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpDecorate %1 LinkageAttributes "foo" Export
+%3 = OpTypeVoid
+%4 = OpTypeInt 64 0
+%7 = OpTypePointer Function %4
+%5 = OpTypeFunction %3 %7
+%1 = OpFunction %3 None %5
+%2 = OpFunctionParameter %7
+%6 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
+ "variable/function %1 and exported variable/function %10"));
+ }
+}
+
+TEST_F(MatchingImportsToExports, FunctionSignatureMismatchTypeIntPointer) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %3 "param"
+OpDecorate %1 LinkageAttributes "foo" Import
+ %5 = OpTypeVoid
+ %6 = OpTypeInt 64 0
+ %9 = OpTypePointer Function %6
+ %7 = OpTypeFunction %5 %9
+ %1 = OpFunction %5 None %7
+ %3 = OpFunctionParameter %9
+OpFunctionEnd
+ %8 = OpFunction %5 None %7
+ %4 = OpFunctionParameter %9
+%10 = OpLabel
+%11 = OpFunctionCall %5 %1 %4
+OpReturn
+OpFunctionEnd
+)";
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpName %1 "foo"
+OpName %2 "param"
+OpDecorate %1 LinkageAttributes "foo" Export
+%3 = OpTypeVoid
+%4 = OpTypeInt 64 0
+%5 = OpTypeFunction %3 %4
+%1 = OpFunction %3 None %5
+%2 = OpFunctionParameter %4
+%6 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ LinkerOptions options;
+ for (int i = 0; i < 2; i++) {
+ spvtest::Binary linked_binary;
+ options.SetAllowPtrTypeMismatch(i == 1);
+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Type mismatch on symbol \"foo\" between imported "
+ "variable/function %1 and exported variable/function %11"));
+ }
+}
+
+TEST_F(MatchingImportsToExports, LinkOnceODRLinkageVarSingle) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" LinkOnceODR
+%2 = OpTypeFloat 32
+%3 = OpConstant %2 3.1415
+%1 = OpVariable %2 Uniform %3
+)";
+
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" Import
+%2 = OpTypeFloat 32
+%1 = OpVariable %2 Uniform
+)";
+
+ const std::string matchTemplate = R"(
+; CHECK-NOT: OpDecorate {{.*}} Import
+; CHECK-NOT: OpDecorate {{.*}} LinkOnceODR
+)";
+
+ spvtest::Binary linked_binary;
+ EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ Match(matchTemplate, linked_binary);
+}
+
+TEST_F(MatchingImportsToExports, LinkOnceODRLinkageFunMultiple) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" LinkOnceODR
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%1 = OpFunction %2 Inline %3
+%4 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" Import
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%1 = OpFunction %2 None %3
+OpFunctionEnd
+)";
+
+ const std::string matchTemplate = R"(
+; CHECK-NOT: OpDecorate {{.*}} Import
+; CHECK-NOT: OpDecorate {{.*}} LinkOnceODR
+)";
+
+ spvtest::Binary linked_binary;
+ EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body1, body2}, &linked_binary))
+ << GetErrorMessage();
+ Match(matchTemplate, linked_binary);
+}
+
+TEST_F(MatchingImportsToExports, LinkOnceODRAndExport) {
+ const std::string body1 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" LinkOnceODR
+%2 = OpTypeFloat 32
+%3 = OpConstant %2 3.1415
+%1 = OpVariable %2 Uniform %3
+)";
+
+ const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" Export
+%2 = OpTypeFloat 32
+%3 = OpConstant %2 2.7183
+%1 = OpVariable %2 Uniform %3
+)";
+
+ const std::string body3 = R"(
+OpCapability Linkage
+OpCapability Addresses
+OpCapability Kernel
+OpExtension "SPV_KHR_linkonce_odr"
+OpMemoryModel Physical64 OpenCL
+OpDecorate %1 LinkageAttributes "foo" Import
+%2 = OpTypeFloat 32
+%1 = OpVariable %2 Uniform
+)";
+ spvtest::Binary linked_binary;
+ ASSERT_EQ(SPV_ERROR_INVALID_BINARY,
+ AssembleAndLink({body1, body2, body3}, &linked_binary))
+ << GetErrorMessage();
+ EXPECT_THAT(
+ GetErrorMessage(),
+ HasSubstr("Combination of Export and LinkOnceODR is not allowed, found "
+ "for \"foo\""));
+}
+
} // namespace
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/op_unknown_test.cpp b/third_party/SPIRV-Tools/test/op_unknown_test.cpp
new file mode 100644
index 0000000..d41174e
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/op_unknown_test.cpp
@@ -0,0 +1,128 @@
+// Copyright (c) 2025 The Khronos Group Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <cassert>
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "source/util/bitutils.h"
+#include "test/test_fixture.h"
+
+namespace spvtools {
+namespace utils {
+namespace {
+
+using spvtest::Concatenate;
+using spvtest::MakeInstruction;
+using spvtest::ScopedContext;
+using spvtest::TextToBinaryTest;
+using ::testing::ElementsAre;
+using ::testing::Eq;
+using ::testing::HasSubstr;
+using ::testing::StrEq;
+
+using OpUnknownTest = TextToBinaryTest;
+
+TEST_F(OpUnknownTest, OpUnknown) {
+ SetText("OpUnknown(255, 1)");
+ ASSERT_EQ(SPV_SUCCESS, spvTextToBinary(ScopedContext().context, text.str,
+ text.length, &binary, &diagnostic));
+ EXPECT_EQ(0x000100FFu, binary->code[5]);
+ if (diagnostic) {
+ spvDiagnosticPrint(diagnostic);
+ }
+}
+
+TEST_F(OpUnknownTest, HandlesOperands) {
+ EXPECT_THAT(CompiledInstructions("OpUnknown(24, 4) %a %b %123"),
+ Eq(MakeInstruction(spv::Op::OpTypeMatrix, {1, 2, 3})));
+ EXPECT_THAT(CompiledInstructions("OpUnknown(24, 4) !1 %b %123"),
+ Eq(MakeInstruction(spv::Op::OpTypeMatrix, {1, 1, 2})));
+}
+
+TEST_F(OpUnknownTest, HandlesWhitespace) {
+ EXPECT_THAT(CompiledInstructions("OpUnknown ( 24 , 4 ) %a %b %123"),
+ Eq(MakeInstruction(spv::Op::OpTypeMatrix, {1, 2, 3})));
+ EXPECT_THAT(CompiledInstructions("OpUnknown(24,4) %a %b %123"),
+ Eq(MakeInstruction(spv::Op::OpTypeMatrix, {1, 2, 3})));
+}
+
+TEST_F(OpUnknownTest, MultipleInstructions) {
+ EXPECT_THAT(
+ CompiledInstructions(
+ "%a = OpTypeFunction %b\nOpUnknown(21, 5) %c %d 32 1\nOpNop"),
+ Eq(Concatenate({MakeInstruction(spv::Op::OpTypeFunction, {1, 2}),
+ MakeInstruction(spv::Op::OpTypeInt, {3, 4, 32, 1}),
+ MakeInstruction(spv::Op::OpNop, {})})));
+}
+
+TEST_F(OpUnknownTest, OpUnknownInAssignment) {
+ EXPECT_EQ(
+ "OpUnknown not allowed in assignment. Use an explicit result id operand "
+ "instead.",
+ CompileFailure("%2 = OpUnknown(22, 3) 32"));
+ EXPECT_EQ("OpUnknown not allowed before =.",
+ CompileFailure("OpUnknown(22, 3) = OpTypeFloat 32"));
+}
+
+TEST_F(OpUnknownTest, ParsingErrors) {
+ EXPECT_EQ("Expected '(', found end of stream.", CompileFailure("OpUnknown"));
+ EXPECT_EQ("'(' expected after OpUnknown but found 'a'.",
+ CompileFailure("OpUnknown abc"));
+
+ EXPECT_EQ("Expected opcode enumerant, found end of stream.",
+ CompileFailure("OpUnknown("));
+ EXPECT_EQ("Invalid opcode enumerant: \"abc\".",
+ CompileFailure("OpUnknown(abc"));
+ // Opcode enumerant must fit in 16 bits.
+ EXPECT_EQ("Invalid opcode enumerant: \"70000\".",
+ CompileFailure("OpUnknown(70000"));
+
+ EXPECT_EQ("Expected ',', found end of stream.",
+ CompileFailure("OpUnknown(22"));
+ EXPECT_EQ("',' expected after opcode enumerant but found 'a'.",
+ CompileFailure("OpUnknown(22 abc"));
+
+ EXPECT_EQ("Expected number of words, found end of stream.",
+ CompileFailure("OpUnknown(22,"));
+ EXPECT_EQ("Invalid number of words: \"abc\".",
+ CompileFailure("OpUnknown(22, abc"));
+ // Number of words must fit in 16 bits.
+ EXPECT_EQ("Invalid number of words: \"70000\".",
+ CompileFailure("OpUnknown(22, 70000"));
+ EXPECT_EQ(
+ "Number of words (which includes the opcode) must be greater than zero.",
+ CompileFailure("OpUnknown(22, 0"));
+
+ EXPECT_EQ("Expected ')', found end of stream.",
+ CompileFailure("OpUnknown(22, 3"));
+ EXPECT_EQ("')' expected after number of words but found 'a'.",
+ CompileFailure("OpUnknown(22, 3 abc"));
+
+ EXPECT_EQ(
+ "Unexpected start of new instruction: \"OpNop\". Expected 2 more "
+ "operands",
+ CompileFailure("OpUnknown(22, 3) OpNop"));
+ EXPECT_EQ("Expected 2 more operands, found end of stream.",
+ CompileFailure("OpUnknown(22, 3)"));
+
+ EXPECT_EQ(CompileFailure("OpUnknown(21, 4) %c %d 32 1"),
+ "Expected <opcode> or <result-id> at the beginning of an "
+ "instruction, found '1'.");
+}
+
+} // namespace
+} // namespace utils
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opcode_lookup_test.cpp b/third_party/SPIRV-Tools/test/opcode_lookup_test.cpp
new file mode 100644
index 0000000..c3d2dd1
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/opcode_lookup_test.cpp
@@ -0,0 +1,232 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <array>
+#include <iostream>
+
+#include "gmock/gmock.h"
+#include "source/spirv_target_env.h"
+#include "source/table2.h"
+#include "test/unit_spirv.h"
+
+using ::testing::ContainerEq;
+using ::testing::ValuesIn;
+
+namespace spvtools {
+namespace {
+
+struct OpcodeLookupCase {
+ std::string name;
+ uint32_t opcode;
+ bool expect_pass = true;
+};
+
+std::ostream& operator<<(std::ostream& os, const OpcodeLookupCase& olc) {
+ os << "OLC('" << olc.name << "', " << olc.opcode << ", expect pass? "
+ << olc.expect_pass << ")";
+ return os;
+}
+
+using OpcodeLookupTest = ::testing::TestWithParam<OpcodeLookupCase>;
+
+TEST_P(OpcodeLookupTest, OpcodeLookup_ByName) {
+ const InstructionDesc* desc = nullptr;
+ auto status = LookupOpcode(GetParam().name.data(), &desc);
+ if (GetParam().expect_pass) {
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(static_cast<uint32_t>(desc->opcode), GetParam().opcode);
+ } else {
+ EXPECT_NE(status, SPV_SUCCESS);
+ EXPECT_EQ(desc, nullptr);
+ }
+}
+
+TEST_P(OpcodeLookupTest, OpcodeLookup_ByOpcode_Success) {
+ const InstructionDesc* desc = nullptr;
+ if (GetParam().expect_pass) {
+ spv::Op opcode = static_cast<spv::Op>(GetParam().opcode);
+ auto status = LookupOpcode(opcode, &desc);
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(desc->opcode, opcode);
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(Samples, OpcodeLookupTest,
+ ValuesIn(std::vector<OpcodeLookupCase>{
+ {"Nop", 0},
+ {"WritePipe", 275},
+ {"TypeAccelerationStructureKHR", 5341},
+ {"TypeAccelerationStructureNV", 5341},
+ {"does not exist", 0, false},
+ {"CopyLogical", 400},
+ {"FPGARegINTEL", 5949},
+ {"SubgroupMatrixMultiplyAccumulateINTEL", 6237},
+ }));
+
+TEST(OpcodeLookupSingleTest, OpcodeLookup_ByOpcode_Fails) {
+ // This list may need adjusting over time.
+ std::array<uint32_t, 3> bad_opcodes = {{99999, 37737, 110101}};
+ for (auto bad_opcode : bad_opcodes) {
+ const InstructionDesc* desc = nullptr;
+ spv::Op opcode = static_cast<spv::Op>(bad_opcode);
+ auto status = LookupOpcode(opcode, &desc);
+ EXPECT_NE(status, SPV_SUCCESS);
+ ASSERT_EQ(desc, nullptr);
+ }
+}
+
+struct OpcodeLookupEnvCase {
+ std::string name;
+ uint32_t opcode;
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_0;
+ bool expect_pass = true;
+};
+
+std::ostream& operator<<(std::ostream& os, const OpcodeLookupEnvCase& olec) {
+ os << "OLC('" << olec.name << "', " << olec.opcode << ", env "
+ << spvTargetEnvDescription(olec.env) << ", expect pass? "
+ << olec.expect_pass << ")";
+ return os;
+}
+
+using OpcodeLookupEnvTest = ::testing::TestWithParam<OpcodeLookupEnvCase>;
+
+TEST_P(OpcodeLookupEnvTest, OpcodeLookupForEnv_ByName) {
+ const InstructionDesc* desc = nullptr;
+ auto status =
+ LookupOpcodeForEnv(GetParam().env, GetParam().name.data(), &desc);
+ if (GetParam().expect_pass) {
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(static_cast<uint32_t>(desc->opcode), GetParam().opcode);
+ } else {
+ EXPECT_NE(status, SPV_SUCCESS);
+ EXPECT_EQ(desc, nullptr);
+ }
+}
+
+TEST_P(OpcodeLookupEnvTest, OpcodeLookupForEnv_ByOpcode) {
+ const InstructionDesc* desc = nullptr;
+ spv::Op opcode = static_cast<spv::Op>(GetParam().opcode);
+ auto status = LookupOpcodeForEnv(GetParam().env, opcode, &desc);
+ if (GetParam().expect_pass) {
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(desc->opcode, opcode);
+ } else {
+ // Skip nonsense cases created for the lookup-by-name case.
+ if (GetParam().name != "does not exist") {
+ EXPECT_NE(status, SPV_SUCCESS);
+ EXPECT_EQ(desc, nullptr);
+ }
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(Samples, OpcodeLookupEnvTest,
+ ValuesIn(std::vector<OpcodeLookupEnvCase>{
+ {"Nop", 0},
+ {"WritePipe", 275},
+ {"TypeAccelerationStructureKHR", 5341},
+ {"TypeAccelerationStructureNV", 5341},
+ {"does not exist", 0, SPV_ENV_UNIVERSAL_1_0,
+ false},
+ {"CopyLogical", 400, SPV_ENV_UNIVERSAL_1_0, false},
+ {"CopyLogical", 400, SPV_ENV_UNIVERSAL_1_3, false},
+ {"CopyLogical", 400, SPV_ENV_UNIVERSAL_1_4, true},
+ {"FPGARegINTEL", 5949},
+ {"SubgroupMatrixMultiplyAccumulateINTEL", 6237},
+ }));
+
+TEST(OpcodeLookupExtInstTest, Operands) {
+ // The SPIR-V spec grammar has a single rule for OpExtInst, where the last
+ // item is "sequence of Ids". SPIRV-Tools handles it differently. It drops
+ // that last item, and instead specifies those operands as operands of the
+ // extended instruction enum, such as 'cos'.
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/233
+ // Test the exact sequence of operand types extracted for OpExtInst.
+ const InstructionDesc* desc = nullptr;
+ auto status = LookupOpcode("ExtInst", &desc);
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+
+ EXPECT_EQ(desc->operands_range.count(), 4u);
+
+ auto operands = desc->operands();
+ using vtype = std::vector<spv_operand_type_t>;
+
+ EXPECT_THAT(
+ vtype(operands.begin(), operands.end()),
+ ContainerEq(vtype{SPV_OPERAND_TYPE_TYPE_ID, SPV_OPERAND_TYPE_RESULT_ID,
+ SPV_OPERAND_TYPE_ID,
+ SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER}));
+}
+
+// Test printingClass
+
+struct OpcodePrintingClassCase {
+ std::string name;
+ PrintingClass expected;
+};
+
+std::ostream& operator<<(std::ostream& os,
+ const OpcodePrintingClassCase& opcc) {
+ os << "OPCC('" << opcc.name << "', " << static_cast<int>(opcc.expected)
+ << ")";
+ return os;
+}
+
+using OpcodePrintingClassTest =
+ ::testing::TestWithParam<OpcodePrintingClassCase>;
+
+TEST_P(OpcodePrintingClassTest, OpcodeLookup_ByName) {
+ const InstructionDesc* desc = nullptr;
+ auto status = LookupOpcode(GetParam().name.data(), &desc);
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(desc->printingClass, GetParam().expected);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ Samples, OpcodePrintingClassTest,
+ ValuesIn(std::vector<OpcodePrintingClassCase>{
+ {"ConstantFunctionPointerINTEL", PrintingClass::k_exclude},
+ {"Nop", PrintingClass::kMiscellaneous},
+ {"SourceContinued", PrintingClass::kDebug},
+ {"Decorate", PrintingClass::kAnnotation},
+ {"Extension", PrintingClass::kExtension},
+ {"MemoryModel", PrintingClass::kMode_Setting},
+ {"Variable", PrintingClass::kMemory},
+ {"CooperativeMatrixPerElementOpNV", PrintingClass::kFunction},
+ {"SampledImage", PrintingClass::kImage},
+ {"ConvertFToU", PrintingClass::kConversion},
+ {"VectorExtractDynamic", PrintingClass::kComposite},
+ {"IAdd", PrintingClass::kArithmetic},
+ {"ShiftRightLogical", PrintingClass::kBit},
+ {"Any", PrintingClass::kRelational_and_Logical},
+ {"DPdx", PrintingClass::kDerivative},
+ {"Branch", PrintingClass::kControl_Flow},
+ {"AtomicLoad", PrintingClass::kAtomic},
+ {"ControlBarrier", PrintingClass::kBarrier},
+ {"GroupAll", PrintingClass::kGroup},
+ {"EnqueueMarker", PrintingClass::kDevice_Side_Enqueue},
+ {"ReadPipe", PrintingClass::kPipe},
+ {"GroupNonUniformElect", PrintingClass::kNon_Uniform},
+ // Skipping "Reserved" because it's probably an
+ // unstable class.
+ }));
+
+} // namespace
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opcode_require_capabilities_test.cpp b/third_party/SPIRV-Tools/test/opcode_require_capabilities_test.cpp
index 37097c6..3694f14 100644
--- a/third_party/SPIRV-Tools/test/opcode_require_capabilities_test.cpp
+++ b/third_party/SPIRV-Tools/test/opcode_require_capabilities_test.cpp
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "test/unit_spirv.h"
-
#include "source/enum_set.h"
+#include "source/table2.h"
+#include "test/unit_spirv.h"
namespace spvtools {
namespace {
@@ -31,15 +31,12 @@
::testing::TestWithParam<ExpectedOpCodeCapabilities>;
TEST_P(OpcodeTableCapabilitiesTest, TableEntryMatchesExpectedCapabilities) {
- auto env = SPV_ENV_UNIVERSAL_1_1;
- spv_opcode_table opcodeTable;
- ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableGet(&opcodeTable, env));
- spv_opcode_desc entry;
- ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableValueLookup(env, opcodeTable,
- GetParam().opcode, &entry));
- EXPECT_EQ(
- ElementsIn(GetParam().capabilities),
- ElementsIn(CapabilitySet(entry->numCapabilities, entry->capabilities)));
+ const spvtools::InstructionDesc* desc = nullptr;
+ ASSERT_EQ(SPV_SUCCESS, spvtools::LookupOpcode(GetParam().opcode, &desc));
+ auto caps = desc->capabilities();
+ EXPECT_EQ(ElementsIn(GetParam().capabilities),
+ ElementsIn(CapabilitySet(static_cast<uint32_t>(caps.size()),
+ caps.data())));
}
INSTANTIATE_TEST_SUITE_P(
@@ -61,8 +58,33 @@
ExpectedOpCodeCapabilities{
spv::Op::OpImageSparseSampleImplicitLod,
CapabilitySet{spv::Capability::SparseResidency}},
- ExpectedOpCodeCapabilities{spv::Op::OpCopyMemorySized,
- CapabilitySet{spv::Capability::Addresses}},
+ ExpectedOpCodeCapabilities{
+ spv::Op::OpCopyMemorySized,
+ CapabilitySet{spv::Capability::Addresses,
+ spv::Capability::UntypedPointersKHR}},
+ ExpectedOpCodeCapabilities{spv::Op::OpArrayLength,
+ CapabilitySet{spv::Capability::Shader}},
+ ExpectedOpCodeCapabilities{spv::Op::OpFunction, CapabilitySet()},
+ ExpectedOpCodeCapabilities{spv::Op::OpConvertFToS, CapabilitySet()},
+ ExpectedOpCodeCapabilities{
+ spv::Op::OpEmitStreamVertex,
+ CapabilitySet{spv::Capability::GeometryStreams}},
+ ExpectedOpCodeCapabilities{
+ spv::Op::OpTypeNamedBarrier,
+ CapabilitySet{spv::Capability::NamedBarrier}},
+ ExpectedOpCodeCapabilities{
+ spv::Op::OpGetKernelMaxNumSubgroups,
+ CapabilitySet{spv::Capability::SubgroupDispatch}},
+ ExpectedOpCodeCapabilities{spv::Op::OpImageQuerySamples,
+ CapabilitySet{spv::Capability::Kernel,
+ spv::Capability::ImageQuery}},
+ ExpectedOpCodeCapabilities{
+ spv::Op::OpImageSparseSampleImplicitLod,
+ CapabilitySet{spv::Capability::SparseResidency}},
+ ExpectedOpCodeCapabilities{
+ spv::Op::OpCopyMemorySized,
+ CapabilitySet{spv::Capability::Addresses,
+ spv::Capability::UntypedPointersKHR}},
ExpectedOpCodeCapabilities{spv::Op::OpArrayLength,
CapabilitySet{spv::Capability::Shader}},
ExpectedOpCodeCapabilities{spv::Op::OpFunction, CapabilitySet()},
diff --git a/third_party/SPIRV-Tools/test/opcode_table_get_test.cpp b/third_party/SPIRV-Tools/test/opcode_table_get_test.cpp
deleted file mode 100644
index 4ff67d9..0000000
--- a/third_party/SPIRV-Tools/test/opcode_table_get_test.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2015-2016 The Khronos Group Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "gmock/gmock.h"
-#include "test/unit_spirv.h"
-
-namespace spvtools {
-namespace {
-
-using GetTargetOpcodeTableGetTest = ::testing::TestWithParam<spv_target_env>;
-using ::testing::ValuesIn;
-
-TEST_P(GetTargetOpcodeTableGetTest, IntegrityCheck) {
- spv_opcode_table table;
- ASSERT_EQ(SPV_SUCCESS, spvOpcodeTableGet(&table, GetParam()));
- ASSERT_NE(0u, table->count);
- ASSERT_NE(nullptr, table->entries);
-}
-
-TEST_P(GetTargetOpcodeTableGetTest, InvalidPointerTable) {
- ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOpcodeTableGet(nullptr, GetParam()));
-}
-
-INSTANTIATE_TEST_SUITE_P(OpcodeTableGet, GetTargetOpcodeTableGetTest,
- ValuesIn(spvtest::AllTargetEnvironments()));
-
-} // namespace
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/operand_capabilities_test.cpp b/third_party/SPIRV-Tools/test/operand_capabilities_test.cpp
index 53dbe07..cecde9e 100644
--- a/third_party/SPIRV-Tools/test/operand_capabilities_test.cpp
+++ b/third_party/SPIRV-Tools/test/operand_capabilities_test.cpp
@@ -23,6 +23,7 @@
#include "source/operand.h"
#include "source/spirv_target_env.h"
#include "source/table.h"
+#include "source/table2.h"
#include "spirv-tools/libspirv.h"
#include "test/unit_spirv.h"
@@ -80,13 +81,13 @@
const auto env = std::get<0>(GetParam());
const auto context = spvContextCreate(env);
const AssemblyGrammar grammar(context);
- spv_operand_desc entry;
+ const spvtools::OperandDesc* entry = nullptr;
ASSERT_EQ(SPV_SUCCESS,
- grammar.lookupOperand(std::get<1>(GetParam()).type,
- std::get<1>(GetParam()).value, &entry));
- const auto cap_set = grammar.filterCapsAgainstTargetEnv(
- entry->capabilities, entry->numCapabilities);
+ spvtools::LookupOperand(std::get<1>(GetParam()).type,
+ std::get<1>(GetParam()).value, &entry));
+ const auto cap_set =
+ grammar.filterCapsAgainstTargetEnv(entry->capabilities());
EXPECT_THAT(ElementsIn(cap_set),
Eq(ElementsIn(std::get<1>(GetParam()).expected_capabilities)))
diff --git a/third_party/SPIRV-Tools/test/operand_lookup_test.cpp b/third_party/SPIRV-Tools/test/operand_lookup_test.cpp
new file mode 100644
index 0000000..8fbf7bf
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/operand_lookup_test.cpp
@@ -0,0 +1,133 @@
+// Copyright 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <array>
+#include <iostream>
+
+#include "gmock/gmock.h"
+#include "source/operand.h"
+#include "source/table2.h"
+#include "spirv-tools/libspirv.h"
+#include "test/unit_spirv.h"
+
+using ::testing::ContainerEq;
+using ::testing::ValuesIn;
+
+namespace spvtools {
+namespace {
+
+struct OperandLookupCase {
+ spv_operand_type_t type;
+ std::string name;
+ size_t name_length;
+ uint32_t value;
+ bool expect_pass = true;
+};
+
+std::ostream& operator<<(std::ostream& os, const OperandLookupCase& olc) {
+ os << "OLC('" << spvOperandTypeStr(olc.type) << " '" << olc.name
+ << "', len:" << olc.name_length << ", value:" << olc.value
+ << ", expect pass? " << olc.expect_pass << ")";
+ return os;
+}
+
+using OperandLookupTest = ::testing::TestWithParam<OperandLookupCase>;
+
+TEST_P(OperandLookupTest, OperandLookup_ByName) {
+ const OperandDesc* desc = nullptr;
+ auto status = LookupOperand(GetParam().type, GetParam().name.data(),
+ GetParam().name_length, &desc);
+ if (GetParam().expect_pass) {
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(desc->value, GetParam().value);
+ } else {
+ EXPECT_NE(status, SPV_SUCCESS);
+ EXPECT_EQ(desc, nullptr);
+ }
+}
+
+TEST_P(OperandLookupTest, OperandLookup_ByValue_Success) {
+ const OperandDesc* desc = nullptr;
+ if (GetParam().expect_pass) {
+ const auto value = GetParam().value;
+ auto status = LookupOperand(GetParam().type, GetParam().value, &desc);
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+ EXPECT_EQ(desc->value, value);
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ Samples, OperandLookupTest,
+ ValuesIn(std::vector<OperandLookupCase>{
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, "Relaxed", 7, 0},
+ // "None" is an alias for "Relaxed"
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, "None", 4, 0},
+ // "NonPrivatePointer" is the canonical name that appeared
+ // in an extension and incorporated in SPIR-V 1.5.
+ {SPV_OPERAND_TYPE_MEMORY_ACCESS, "NonPrivatePointer", 17, 32},
+ // "NonPrivatePointerKHR" is the name from the extension.
+ {SPV_OPERAND_TYPE_MEMORY_ACCESS, "NonPrivatePointerKHR", 20, 32},
+ // "NoAliasINTELMask" is only in an extension
+ {SPV_OPERAND_TYPE_MEMORY_ACCESS, "NoAliasINTELMask", 16, 0x20000},
+ {SPV_OPERAND_TYPE_RAY_FLAGS, "TerminateOnFirstHitKHR", 22, 4},
+ {SPV_OPERAND_TYPE_FPENCODING, "BFloat16KHR", 11, 0},
+ // Lookup on An optional operand type should match the base lookup.
+ {SPV_OPERAND_TYPE_OPTIONAL_FPENCODING, "BFloat16KHR", 11, 0},
+ // Lookup is type-specific.
+ {SPV_OPERAND_TYPE_OPTIONAL_FPENCODING, "Relaxed", 7, 0, false},
+ // Invalid string
+ {SPV_OPERAND_TYPE_RAY_FLAGS, "does_not_exist", 14, 0, false},
+ // Check lengths
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, "Relaxed", 6, 0, false},
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, "Relaxed", 7, 0, true},
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, "Relaxed|", 7, 0, true},
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, "Relaxed|", 8, 0, false},
+ }));
+
+TEST(OperandLookupSingleTest, OperandLookup_ByValue_Fails) {
+ // This list may need adjusting over time.
+ std::array<spv_operand_type_t, 3> types = {
+ {SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID, SPV_OPERAND_TYPE_RAY_FLAGS,
+ SPV_OPERAND_TYPE_FPENCODING}};
+ std::array<uint32_t, 3> bad_values = {{99999, 37737, 110101}};
+ for (auto type : types) {
+ for (auto bad_value : bad_values) {
+ const OperandDesc* desc = nullptr;
+ auto status = LookupOperand(type, bad_value, &desc);
+ EXPECT_NE(status, SPV_SUCCESS);
+ ASSERT_EQ(desc, nullptr);
+ }
+ }
+}
+
+TEST(OperandLookupOperands, Sample) {
+ // Check the operand list for a valid operand lookup.
+ const OperandDesc* desc = nullptr;
+ auto status = LookupOperand(SPV_OPERAND_TYPE_IMAGE, "Grad", 4, &desc);
+ EXPECT_EQ(status, SPV_SUCCESS);
+ ASSERT_NE(desc, nullptr);
+
+ EXPECT_EQ(desc->operands_range.count(), 2u);
+
+ auto operands = desc->operands();
+ using vtype = std::vector<spv_operand_type_t>;
+
+ EXPECT_THAT(vtype(operands.begin(), operands.end()),
+ ContainerEq(vtype{SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID}));
+}
+
+} // namespace
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/operand_pattern_test.cpp b/third_party/SPIRV-Tools/test/operand_pattern_test.cpp
index 58b8a08..2138c3f 100644
--- a/third_party/SPIRV-Tools/test/operand_pattern_test.cpp
+++ b/third_party/SPIRV-Tools/test/operand_pattern_test.cpp
@@ -69,13 +69,8 @@
using MaskExpansionTest = ::testing::TestWithParam<MaskExpansionCase>;
TEST_P(MaskExpansionTest, Sample) {
- spv_operand_table operandTable = nullptr;
- auto env = SPV_ENV_UNIVERSAL_1_0;
- ASSERT_EQ(SPV_SUCCESS, spvOperandTableGet(&operandTable, env));
-
spv_operand_pattern_t pattern(GetParam().initial);
- spvPushOperandTypesForMask(env, operandTable, GetParam().type,
- GetParam().mask, &pattern);
+ spvPushOperandTypesForMask(GetParam().type, GetParam().mask, &pattern);
EXPECT_THAT(pattern, Eq(GetParam().expected));
}
diff --git a/third_party/SPIRV-Tools/test/operand_test.cpp b/third_party/SPIRV-Tools/test/operand_test.cpp
index ec45da5..4cc0818 100644
--- a/third_party/SPIRV-Tools/test/operand_test.cpp
+++ b/third_party/SPIRV-Tools/test/operand_test.cpp
@@ -19,25 +19,8 @@
namespace spvtools {
namespace {
-using GetTargetTest = ::testing::TestWithParam<spv_target_env>;
using ::testing::ValuesIn;
-TEST_P(GetTargetTest, Default) {
- spv_operand_table table;
- ASSERT_EQ(SPV_SUCCESS, spvOperandTableGet(&table, GetParam()));
- ASSERT_NE(0u, table->count);
- ASSERT_NE(nullptr, table->types);
-}
-
-TEST_P(GetTargetTest, InvalidPointerTable) {
- ASSERT_EQ(SPV_ERROR_INVALID_POINTER, spvOperandTableGet(nullptr, GetParam()));
-}
-
-INSTANTIATE_TEST_SUITE_P(OperandTableGet, GetTargetTest,
- ValuesIn(std::vector<spv_target_env>{
- SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
- SPV_ENV_VULKAN_1_0}));
-
TEST(OperandString, AllAreDefinedExceptVariable) {
// None has no string, so don't test it.
EXPECT_EQ(0u, SPV_OPERAND_TYPE_NONE);
diff --git a/third_party/SPIRV-Tools/test/opt/CMakeLists.txt b/third_party/SPIRV-Tools/test/opt/CMakeLists.txt
index 92d266b..9df0bb7 100644
--- a/third_party/SPIRV-Tools/test/opt/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/test/opt/CMakeLists.txt
@@ -60,9 +60,6 @@
inline_opaque_test.cpp
inline_test.cpp
insert_extract_elim_test.cpp
- inst_bindless_check_test.cpp
- inst_buff_addr_check_test.cpp
- inst_debug_printf_test.cpp
instruction_list_test.cpp
instruction_test.cpp
interface_var_sroa_test.cpp
@@ -81,6 +78,7 @@
modify_maximal_reconvergence_test.cpp
module_test.cpp
module_utils.h
+ opextinst_forward_ref_fixup_pass_test.cpp
optimizer_test.cpp
pass_manager_test.cpp
pass_merge_return_test.cpp
@@ -90,21 +88,25 @@
propagator_test.cpp
reduce_load_size_test.cpp
redundancy_elimination_test.cpp
+ canonicalize_ids_test.cpp
remove_dontinline_test.cpp
remove_unused_interface_variables_test.cpp
register_liveness.cpp
relax_float_ops_test.cpp
replace_desc_array_access_using_var_index_test.cpp
replace_invalid_opc_test.cpp
+ resolve_binding_conflicts_pass_test.cpp
scalar_analysis.cpp
scalar_replacement_test.cpp
set_spec_const_default_value_test.cpp
simplification_test.cpp
+ split_combined_image_sampler_pass_test.cpp
spread_volatile_semantics_test.cpp
strength_reduction_test.cpp
strip_debug_info_test.cpp
strip_nonsemantic_info_test.cpp
struct_cfg_analysis_test.cpp
+ struct_packing_test.cpp
switch_descriptorset_test.cpp
trim_capabilities_pass_test.cpp
type_manager_test.cpp
diff --git a/third_party/SPIRV-Tools/test/opt/aggressive_dead_code_elim_test.cpp b/third_party/SPIRV-Tools/test/opt/aggressive_dead_code_elim_test.cpp
index 845c6a5..b255696 100644
--- a/third_party/SPIRV-Tools/test/opt/aggressive_dead_code_elim_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/aggressive_dead_code_elim_test.cpp
@@ -16,6 +16,7 @@
#include <string>
#include <vector>
+#include "gmock/gmock.h"
#include "test/opt/assembly_builder.h"
#include "test/opt/pass_fixture.h"
#include "test/opt/pass_utils.h"
@@ -26,6 +27,8 @@
using AggressiveDCETest = PassTest<::testing::Test>;
+using ::testing::HasSubstr;
+
TEST_F(AggressiveDCETest, EliminateExtendedInst) {
// #version 140
//
@@ -7568,7 +7571,7 @@
OpExtension "SPV_KHR_ray_tracing"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
-OpEntryPoint RayGenerationNV %2 "main" %3 %4
+OpEntryPoint RayGenerationKHR %2 "main" %3 %4
OpDecorate %3 Location 0
OpDecorate %4 DescriptorSet 2
OpDecorate %4 Binding 0
@@ -7577,8 +7580,8 @@
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%float = OpTypeFloat 32
-%_ptr_CallableDataNV_float = OpTypePointer CallableDataNV %float
-%3 = OpVariable %_ptr_CallableDataNV_float CallableDataNV
+%_ptr_CallableDataKHR_float = OpTypePointer CallableDataKHR %float
+%3 = OpVariable %_ptr_CallableDataKHR_float CallableDataKHR
%13 = OpTypeAccelerationStructureKHR
%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
%4 = OpVariable %_ptr_UniformConstant_13 UniformConstant
@@ -7992,6 +7995,489 @@
SinglePassRunAndCheck<AggressiveDCEPass>(test, test, true, true);
}
+TEST_F(AggressiveDCETest, StoringAPointer) {
+ // A store that stores a pointer should not be kept live because the value
+ // being stored is eventually loaded from.
+
+ const std::string text = R"(
+ OpCapability CooperativeMatrixKHR
+ OpCapability Shader
+ OpCapability VulkanMemoryModelKHR
+ OpExtension "SPV_KHR_cooperative_matrix"
+ OpExtension "SPV_KHR_vulkan_memory_model"
+ OpMemoryModel Logical VulkanKHR
+ OpEntryPoint GLCompute %1 "main" %2
+ OpExecutionMode %1 LocalSize 64 1 1
+ OpSource HLSL 600
+ OpDecorate %2 DescriptorSet 0
+ OpDecorate %2 Binding 0
+ OpDecorate %_runtimearr_int ArrayStride 4
+ OpMemberDecorate %_struct_4 0 Offset 0
+ OpDecorate %_struct_4 Block
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %uint_64 = OpConstant %uint 64
+ %uint_3 = OpConstant %uint 3
+ %uint_16 = OpConstant %uint 16
+ %uint_4 = OpConstant %uint 4
+%coop_stride = OpConstant %int 42
+%_runtimearr_int = OpTypeRuntimeArray %int
+ %_struct_4 = OpTypeStruct %_runtimearr_int
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+; CHECK: [[mat:%\w+]] = OpTypeCooperativeMatrixKHR %int %uint_3 %uint_16 %uint_4 %uint_0
+ %17 = OpTypeCooperativeMatrixKHR %int %uint_3 %uint_16 %uint_4 %uint_0
+; CHECK: [[struct:%\w+]] = OpTypeStruct [[mat]]
+ %_struct_18 = OpTypeStruct %17
+; CHECK: [[ptr:%\w+]] = OpTypePointer Function [[struct]]
+%_ptr_Function__struct_18 = OpTypePointer Function %_struct_18
+%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
+%_ptr_Function_17 = OpTypePointer Function %17
+%_ptr_Function_int = OpTypePointer Function %int
+%_ptr_Function__ptr_Function_int = OpTypePointer Function %_ptr_Function_int
+ %2 = OpVariable %_ptr_StorageBuffer__struct_4 StorageBuffer
+
+; The stored to the fist two variables should be removed and the variables
+; as well. The only function scope variable should be the cooperative matrix.
+; CHECK: OpFunction
+; CHECK-NOT: OpVariable %_ptr_Function__ptr_Function_int Function
+; CHECK: OpVariable [[ptr]] Function
+; CHECK-NOT: OpVariable
+ %1 = OpFunction %void None %16
+ %24 = OpLabel
+ %25 = OpVariable %_ptr_Function__ptr_Function_int Function
+ %26 = OpVariable %_ptr_Function__ptr_Function_int Function
+ %27 = OpVariable %_ptr_Function__struct_18 Function
+ %28 = OpAccessChain %_ptr_StorageBuffer_int %2 %int_0 %uint_0
+ %29 = OpCooperativeMatrixLoadKHR %17 %28 %int_1 %coop_stride
+ %30 = OpCompositeConstruct %_struct_18 %29
+ OpStore %27 %30
+ %31 = OpAccessChain %_ptr_Function_17 %27 %int_0
+ %32 = OpAccessChain %_ptr_Function_int %27 %int_0 %uint_0
+ OpStore %26 %32
+ %33 = OpLoad %int %32
+ %34 = OpIAdd %int %33 %int_1
+ OpStore %25 %32
+ OpStore %32 %34
+ %35 = OpAccessChain %_ptr_StorageBuffer_int %2 %int_0 %uint_64
+ %36 = OpLoad %17 %31
+ OpCooperativeMatrixStoreKHR %35 %36 %int_0 %coop_stride
+ OpReturn
+ OpFunctionEnd
+)";
+
+ // For physical storage buffer support
+ SetTargetEnv(SPV_ENV_VULKAN_1_2);
+ SinglePassRunAndMatch<AggressiveDCEPass>(text, true);
+}
+
+TEST_F(AggressiveDCETest, FunctionDeclaration) {
+ // Ensure the optimizer can handle traversing over a function declaration
+ // 'myfunc' which has no blocks
+
+ const std::string text = R"(OpCapability Linkage
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %PSMain "main" %entryPointParam_PSMain
+OpExecutionMode %PSMain OriginUpperLeft
+OpSource Slang 1
+OpName %myfunc "myfunc"
+OpName %entryPointParam_PSMain "entryPointParam_PSMain"
+OpName %PSMain "PSMain"
+OpDecorate %myfunc LinkageAttributes "_S6myfuncp0pv4f" Import
+OpDecorate %entryPointParam_PSMain Location 0
+%void = OpTypeVoid
+%5 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%8 = OpTypeFunction %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%entryPointParam_PSMain = OpVariable %_ptr_Output_v4float Output
+%myfunc = OpFunction %v4float None %8
+OpFunctionEnd
+%PSMain = OpFunction %void None %5
+%10 = OpLabel
+%11 = OpFunctionCall %v4float %myfunc
+OpStore %entryPointParam_PSMain %11
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SinglePassRunAndCheck<AggressiveDCEPass>(text, text, true, true);
+}
+
+TEST_F(AggressiveDCETest, MarkCentroidInterpolantLive) {
+ const std::string spirv =
+ R"(OpCapability InterpolationFunction
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_COLOR %out_var_SV_Target
+OpExecutionMode %main OriginUpperLeft
+OpSource HLSL 680
+OpName %in_var_COLOR "in.var.COLOR"
+OpName %out_var_SV_Target "out.var.SV_Target"
+OpName %main "main"
+OpName %param_var_p1 "param.var.p1"
+OpDecorate %in_var_COLOR Location 0
+OpDecorate %out_var_SV_Target Location 0
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%void = OpTypeVoid
+%11 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%in_var_COLOR = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+%main = OpFunction %void None %11
+%13 = OpLabel
+%14 = OpVariable %_ptr_Function_v4float Function
+%param_var_p1 = OpVariable %_ptr_Function_v4float Function
+%15 = OpLoad %v4float %in_var_COLOR
+OpStore %param_var_p1 %15
+%16 = OpExtInst %v4float %1 InterpolateAtCentroid %param_var_p1
+OpStore %14 %16
+%17 = OpLoad %v4float %14
+OpStore %out_var_SV_Target %17
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndCheck<AggressiveDCEPass>(spirv, spirv, true, false);
+}
+
+TEST_F(AggressiveDCETest, MarkSampleInterpolantLive) {
+ const std::string spirv =
+ R"(OpCapability InterpolationFunction
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_COLOR %out_var_SV_Target
+OpExecutionMode %main OriginUpperLeft
+OpSource HLSL 680
+OpName %in_var_COLOR "in.var.COLOR"
+OpName %out_var_SV_Target "out.var.SV_Target"
+OpName %main "main"
+OpName %param_var_p1 "param.var.p1"
+OpDecorate %in_var_COLOR Location 0
+OpDecorate %out_var_SV_Target Location 0
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 1
+%v4float = OpTypeVector %float 4
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%void = OpTypeVoid
+%12 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%in_var_COLOR = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+%int_123 = OpConstant %int 123
+%main = OpFunction %void None %12
+%15 = OpLabel
+%16 = OpVariable %_ptr_Function_v4float Function
+%param_var_p1 = OpVariable %_ptr_Function_v4float Function
+%17 = OpLoad %v4float %in_var_COLOR
+OpStore %param_var_p1 %17
+%18 = OpExtInst %v4float %1 InterpolateAtSample %param_var_p1 %int_123
+OpStore %16 %18
+%19 = OpLoad %v4float %16
+OpStore %out_var_SV_Target %19
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndCheck<AggressiveDCEPass>(spirv, spirv, true, false);
+}
+
+TEST_F(AggressiveDCETest, MarkOffsetInterpolantLive) {
+ const std::string spirv =
+ R"(OpCapability InterpolationFunction
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_COLOR %out_var_SV_Target
+OpExecutionMode %main OriginUpperLeft
+OpSource HLSL 680
+OpName %in_var_COLOR "in.var.COLOR"
+OpName %out_var_SV_Target "out.var.SV_Target"
+OpName %main "main"
+OpName %param_var_p1 "param.var.p1"
+OpDecorate %in_var_COLOR Location 0
+OpDecorate %out_var_SV_Target Location 0
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 1
+%v4float = OpTypeVector %float 4
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%void = OpTypeVoid
+%12 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%in_var_COLOR = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+%int_123 = OpConstant %int 123
+%main = OpFunction %void None %12
+%15 = OpLabel
+%16 = OpVariable %_ptr_Function_v4float Function
+%param_var_p1 = OpVariable %_ptr_Function_v4float Function
+%17 = OpLoad %v4float %in_var_COLOR
+OpStore %param_var_p1 %17
+%18 = OpExtInst %v4float %1 InterpolateAtOffset %param_var_p1 %int_123
+OpStore %16 %18
+%19 = OpLoad %v4float %16
+OpStore %out_var_SV_Target %19
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndCheck<AggressiveDCEPass>(spirv, spirv, true, false);
+}
+
+TEST_F(AggressiveDCETest, NoEliminateOpSource) {
+ // Should not eliminate OpSource
+
+ const std::string text =
+ R"(OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_COLOR %out_var_SV_TARGET
+OpExecutionMode %main OriginUpperLeft
+%4 = OpString "D:\\directxshadercompiler\\tools\\clang\\test\\CodeGenSPIRV\\spirv.debug.opsource.include.hlsl"
+%5 = OpString "D:\\directxshadercompiler\\tools\\clang\\test\\CodeGenSPIRV/spirv.debug.opsource.include-file.hlsli"
+OpSource HLSL 600 %4 "// RUN: %dxc -T ps_6_0 -E main -Zi %s -spirv | FileCheck %s
+#include \"spirv.debug.opsource.include-file.hlsli\"
+
+struct ColorType
+{
+ float4 position : SV_POSITION;
+ float4 color : COLOR;
+};
+
+float4 main(UBER_TYPE(Color) input) : SV_TARGET
+{
+ return input.color;
+}
+"
+OpSource HLSL 600 %5 "#define UBER_TYPE(x) x ## Type
+"
+OpName %in_var_COLOR "in.var.COLOR"
+OpName %out_var_SV_TARGET "out.var.SV_TARGET"
+OpName %main "main"
+OpDecorate %in_var_COLOR Location 0
+OpDecorate %out_var_SV_TARGET Location 0
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%void = OpTypeVoid
+%11 = OpTypeFunction %void
+%in_var_COLOR = OpVariable %_ptr_Input_v4float Input
+%out_var_SV_TARGET = OpVariable %_ptr_Output_v4float Output
+OpLine %4 22 1
+%main = OpFunction %void None %11
+OpNoLine
+%12 = OpLabel
+OpLine %4 22 1
+%13 = OpLoad %v4float %in_var_COLOR
+OpStore %out_var_SV_TARGET %13
+OpLine %4 25 1
+OpReturn
+OpFunctionEnd
+)";
+
+ auto result = SinglePassRunAndDisassemble<AggressiveDCEPass>(
+ text, /* skip_nop = */ true, /* skip_validation = */ false);
+
+ EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
+ const std::string& output = std::get<0>(result);
+ EXPECT_THAT(
+ output,
+ HasSubstr("OpSource HLSL 600 %5 \"#define UBER_TYPE(x) x ## Type"));
+}
+
+TEST_F(AggressiveDCETest, EliminateCopyLogical) {
+ const std::string before = R"(
+; CHECK: [[float32:%\w+]] = OpTypeFloat 32
+; CHECK: [[v4float:%\w+]] = OpTypeVector [[float32]] 4
+; CHECK-NOT: %10 = OpTypeArray [[v4float]] %9
+; CHECK-NOT: %11 = OpTypeStruct %10 %10
+; CHECK-NOT: %22 = OpTypePointer Uniform %16
+; CHECK-NOT: %38 = OpTypePointer Function [[v4float]]
+; CHECK-NOT: %43 = OpTypePointer Function %10
+; CHECK-NOT: %44 = OpVariable %42 Function
+; CHECK-NOT: %23 = OpAccessChain %22 %19 %21
+; CHECK-NOT: %24 = OpLoad %16 %23
+; CHECK-NOT: %25 = OpCopyLogical %11 %24
+; CHECK-NOT: %46 = OpCompositeExtract %10 %25 0
+; CHECK-NOT: OpStore %44 %46
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %4 "main" %19 %30 %32
+ OpSource GLSL 430
+ OpName %4 "main"
+ OpDecorate %14 ArrayStride 16
+ OpDecorate %15 ArrayStride 16
+ OpMemberDecorate %16 0 Offset 0
+ OpMemberDecorate %16 1 Offset 32
+ OpDecorate %17 Block
+ OpMemberDecorate %17 0 Offset 0
+ OpDecorate %19 Binding 0
+ OpDecorate %19 DescriptorSet 0
+ OpDecorate %28 Block
+ OpMemberDecorate %28 0 BuiltIn Position
+ OpMemberDecorate %28 1 BuiltIn PointSize
+ OpMemberDecorate %28 2 BuiltIn ClipDistance
+ OpDecorate %32 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 2
+%10 = OpTypeArray %7 %9
+%11 = OpTypeStruct %10 %10
+%14 = OpTypeArray %7 %9
+%15 = OpTypeArray %7 %9
+%16 = OpTypeStruct %14 %15
+%17 = OpTypeStruct %16
+%18 = OpTypePointer Uniform %17
+%19 = OpVariable %18 Uniform
+%20 = OpTypeInt 32 1
+%21 = OpConstant %20 0
+%22 = OpTypePointer Uniform %16
+%26 = OpConstant %8 1
+%27 = OpTypeArray %6 %26
+%28 = OpTypeStruct %7 %6 %27
+%29 = OpTypePointer Output %28
+%30 = OpVariable %29 Output
+%31 = OpTypePointer Input %7
+%32 = OpVariable %31 Input
+%33 = OpConstant %8 0
+%34 = OpTypePointer Input %6
+%38 = OpTypePointer Function %7
+%41 = OpTypePointer Output %7
+%43 = OpTypePointer Function %10
+%48 = OpTypePointer Uniform %14
+%49 = OpTypePointer Uniform %7
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+%44 = OpVariable %43 Function
+%23 = OpAccessChain %22 %19 %21
+%24 = OpLoad %16 %23
+%25 = OpCopyLogical %11 %24
+%46 = OpCompositeExtract %10 %25 0
+%50 = OpAccessChain %48 %19 %21 %33
+ OpStore %44 %46
+%35 = OpAccessChain %34 %32 %33
+%36 = OpLoad %6 %35
+%37 = OpConvertFToS %20 %36
+%47 = OpAccessChain %49 %50 %37
+%40 = OpLoad %7 %47
+%42 = OpAccessChain %41 %30 %21
+ OpStore %42 %40
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_UNIVERSAL_1_6);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndMatch<AggressiveDCEPass>(before, true);
+}
+
+TEST_F(AggressiveDCETest, KeepCopyLogical) {
+ const std::string before = R"(
+; CHECK: OpCopyLogical
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %4 "main" %15 %23 %38
+ OpExecutionMode %4 LocalSize 32 32 1
+ OpSource GLSL 430
+ OpName %4 "main"
+ OpDecorate %10 ArrayStride 16
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpMemberDecorate %12 1 Offset 2048
+ OpDecorate %13 Block
+ OpMemberDecorate %13 0 NonReadable
+ OpMemberDecorate %13 0 Offset 0
+ OpDecorate %15 NonReadable
+ OpDecorate %15 Binding 1
+ OpDecorate %15 DescriptorSet 0
+ OpDecorate %18 ArrayStride 16
+ OpDecorate %19 ArrayStride 16
+ OpMemberDecorate %20 0 Offset 0
+ OpMemberDecorate %20 1 Offset 2048
+ OpDecorate %21 Block
+ OpMemberDecorate %21 0 NonWritable
+ OpMemberDecorate %21 0 Offset 0
+ OpDecorate %23 NonWritable
+ OpDecorate %23 Binding 0
+ OpDecorate %23 DescriptorSet 0
+ OpDecorate %30 ArrayStride 16
+ OpDecorate %31 ArrayStride 16
+ OpMemberDecorate %32 0 Offset 0
+ OpMemberDecorate %32 1 Offset 2048
+ OpDecorate %34 ArrayStride 4096
+ OpMemberDecorate %35 0 Offset 0
+ OpDecorate %36 Block
+ OpMemberDecorate %36 0 Offset 0
+ OpDecorate %38 Binding 0
+ OpDecorate %38 DescriptorSet 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 128
+%10 = OpTypeArray %7 %9
+%11 = OpTypeArray %7 %9
+%12 = OpTypeStruct %10 %11
+%13 = OpTypeStruct %12
+%14 = OpTypePointer StorageBuffer %13
+%15 = OpVariable %14 StorageBuffer
+%16 = OpTypeInt 32 1
+%17 = OpConstant %16 0
+%18 = OpTypeArray %7 %9
+%19 = OpTypeArray %7 %9
+%20 = OpTypeStruct %18 %19
+%21 = OpTypeStruct %20
+%22 = OpTypePointer StorageBuffer %21
+%23 = OpVariable %22 StorageBuffer
+%24 = OpTypePointer StorageBuffer %20
+%27 = OpTypePointer StorageBuffer %12
+%30 = OpTypeArray %7 %9
+%31 = OpTypeArray %7 %9
+%32 = OpTypeStruct %30 %31
+%33 = OpConstant %8 8
+%34 = OpTypeArray %32 %33
+%35 = OpTypeStruct %34
+%36 = OpTypeStruct %35
+%37 = OpTypePointer Uniform %36
+%38 = OpVariable %37 Uniform
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+%25 = OpAccessChain %24 %23 %17
+%26 = OpLoad %20 %25
+%28 = OpAccessChain %27 %15 %17
+%29 = OpCopyLogical %12 %26
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_UNIVERSAL_1_6);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndMatch<AggressiveDCEPass>(before, true);
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/canonicalize_ids_test.cpp b/third_party/SPIRV-Tools/test/opt/canonicalize_ids_test.cpp
new file mode 100644
index 0000000..a968253
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/opt/canonicalize_ids_test.cpp
@@ -0,0 +1,2013 @@
+// Copyright (c) 2025 LunarG Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "gmock/gmock.h"
+#include "test/opt/pass_fixture.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+using CanonicalizeIdsTest = PassTest<::testing::Test>;
+
+// ported from remap.basic.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_basic) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %9 %11
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "main"
+OpName %9 "outf4"
+OpName %11 "inf"
+OpDecorate %9 Location 0
+OpDecorate %11 Location 0
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 4
+%8 = OpTypePointer Output %7
+%9 = OpVariable %8 Output
+%10 = OpTypePointer Input %6
+%11 = OpVariable %10 Input
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%12 = OpLoad %6 %11
+%13 = OpCompositeConstruct %7 %12 %12 %12 %12
+OpStore %9 %13
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %4539 %3773
+OpExecutionMode %5663 OriginUpperLeft
+OpSource GLSL 450
+OpName %5663 "main"
+OpName %4539 "outf4"
+OpName %3773 "inf"
+OpDecorate %4539 Location 0
+OpDecorate %3773 Location 0
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%13 = OpTypeFloat 32
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Output %29
+%4539 = OpVariable %666 Output
+%650 = OpTypePointer Input %13
+%3773 = OpVariable %650 Input
+%5663 = OpFunction %8 None %1282
+%24968 = OpLabel
+%17486 = OpLoad %13 %3773
+%17691 = OpCompositeConstruct %29 %17486 %17486 %17486 %17486
+OpStore %4539 %17691
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.hlsl.sample.basic.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_hlsl_sample_basic) {
+ const std::string before =
+ R"(OpCapability Shader
+OpCapability Sampled1D
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %188 %192
+OpExecutionMode %4 OriginUpperLeft
+OpExecutionMode %4 DepthReplacing
+OpSource HLSL 500
+OpName %4 "main"
+OpName %8 "PS_OUTPUT"
+OpMemberName %8 0 "Color"
+OpMemberName %8 1 "Depth"
+OpName %10 "@main("
+OpName %13 "MemberTest"
+OpMemberName %13 0 "Sample"
+OpMemberName %13 1 "CalculateLevelOfDetail"
+OpMemberName %13 2 "CalculateLevelOfDetailUnclamped"
+OpMemberName %13 3 "Gather"
+OpMemberName %13 4 "GetDimensions"
+OpMemberName %13 5 "GetSamplePosition"
+OpMemberName %13 6 "Load"
+OpMemberName %13 7 "SampleBias"
+OpMemberName %13 8 "SampleCmp"
+OpMemberName %13 9 "SampleCmpLevelZero"
+OpMemberName %13 10 "SampleGrad"
+OpMemberName %13 11 "SampleLevel"
+OpName %15 "mtest"
+OpName %54 "txval10"
+OpName %45 "g_tTex1df4"
+OpName %49 "g_sSamp"
+OpName %66 "txval11"
+OpName %60 "g_tTex1di4"
+OpName %79 "txval12"
+OpName %73 "g_tTex1du4"
+OpName %90 "txval20"
+OpName %83 "g_tTex2df4"
+OpName %101 "txval21"
+OpName %94 "g_tTex2di4"
+OpName %113 "txval22"
+OpName %105 "g_tTex2du4"
+OpName %124 "txval30"
+OpName %117 "g_tTex3df4"
+OpName %134 "txval31"
+OpName %128 "g_tTex3di4"
+OpName %147 "txval32"
+OpName %138 "g_tTex3du4"
+OpName %156 "txval40"
+OpName %151 "g_tTexcdf4"
+OpName %165 "txval41"
+OpName %160 "g_tTexcdi4"
+OpName %174 "txval42"
+OpName %169 "g_tTexcdu4"
+OpName %176 "psout"
+OpName %185 "flattenTemp"
+OpName %188 "@entryPointOutput.Color"
+OpName %192 "@entryPointOutput.Depth"
+OpDecorate %45 Binding 0
+OpDecorate %45 DescriptorSet 0
+OpDecorate %49 Binding 0
+OpDecorate %49 DescriptorSet 0
+OpDecorate %60 Binding 2
+OpDecorate %60 DescriptorSet 0
+OpDecorate %73 Binding 3
+OpDecorate %73 DescriptorSet 0
+OpDecorate %83 Binding 4
+OpDecorate %83 DescriptorSet 0
+OpDecorate %94 Binding 5
+OpDecorate %94 DescriptorSet 0
+OpDecorate %105 Binding 6
+OpDecorate %105 DescriptorSet 0
+OpDecorate %117 Binding 7
+OpDecorate %117 DescriptorSet 0
+OpDecorate %128 Binding 8
+OpDecorate %128 DescriptorSet 0
+OpDecorate %138 Binding 9
+OpDecorate %138 DescriptorSet 0
+OpDecorate %151 Binding 10
+OpDecorate %151 DescriptorSet 0
+OpDecorate %160 Binding 11
+OpDecorate %160 DescriptorSet 0
+OpDecorate %169 Binding 12
+OpDecorate %169 DescriptorSet 0
+OpDecorate %188 Location 0
+OpDecorate %192 BuiltIn FragDepth
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 4
+%8 = OpTypeStruct %7 %6
+%9 = OpTypeFunction %8
+%12 = OpTypeInt 32 1
+%13 = OpTypeStruct %12 %12 %12 %12 %12 %12 %12 %12 %12 %12 %12 %12
+%14 = OpTypePointer Function %13
+%16 = OpConstant %12 1
+%17 = OpTypePointer Function %12
+%19 = OpConstant %12 2
+%21 = OpConstant %12 3
+%23 = OpConstant %12 4
+%25 = OpConstant %12 5
+%27 = OpConstant %12 6
+%29 = OpConstant %12 0
+%31 = OpConstant %12 7
+%33 = OpConstant %12 8
+%35 = OpConstant %12 9
+%37 = OpConstant %12 10
+%39 = OpConstant %12 11
+%41 = OpTypePointer Function %7
+%43 = OpTypeImage %6 1D 0 0 0 1 Unknown
+%44 = OpTypePointer UniformConstant %43
+%45 = OpVariable %44 UniformConstant
+%47 = OpTypeSampler
+%48 = OpTypePointer UniformConstant %47
+%49 = OpVariable %48 UniformConstant
+%51 = OpTypeSampledImage %43
+%53 = OpConstant %6 0.100000001
+%55 = OpTypeVector %12 4
+%58 = OpTypeImage %12 1D 0 0 0 1 Unknown
+%59 = OpTypePointer UniformConstant %58
+%60 = OpVariable %59 UniformConstant
+%63 = OpTypeSampledImage %58
+%65 = OpConstant %6 0.200000003
+%67 = OpTypeInt 32 0
+%68 = OpTypeVector %67 4
+%71 = OpTypeImage %67 1D 0 0 0 1 Unknown
+%72 = OpTypePointer UniformConstant %71
+%73 = OpVariable %72 UniformConstant
+%76 = OpTypeSampledImage %71
+%78 = OpConstant %6 0.300000012
+%81 = OpTypeImage %6 2D 0 0 0 1 Unknown
+%82 = OpTypePointer UniformConstant %81
+%83 = OpVariable %82 UniformConstant
+%86 = OpTypeSampledImage %81
+%88 = OpTypeVector %6 2
+%89 = OpConstantComposite %88 %53 %65
+%92 = OpTypeImage %12 2D 0 0 0 1 Unknown
+%93 = OpTypePointer UniformConstant %92
+%94 = OpVariable %93 UniformConstant
+%97 = OpTypeSampledImage %92
+%99 = OpConstant %6 0.400000006
+%100 = OpConstantComposite %88 %78 %99
+%103 = OpTypeImage %67 2D 0 0 0 1 Unknown
+%104 = OpTypePointer UniformConstant %103
+%105 = OpVariable %104 UniformConstant
+%108 = OpTypeSampledImage %103
+%110 = OpConstant %6 0.5
+%111 = OpConstant %6 0.600000024
+%112 = OpConstantComposite %88 %110 %111
+%115 = OpTypeImage %6 3D 0 0 0 1 Unknown
+%116 = OpTypePointer UniformConstant %115
+%117 = OpVariable %116 UniformConstant
+%120 = OpTypeSampledImage %115
+%122 = OpTypeVector %6 3
+%123 = OpConstantComposite %122 %53 %65 %78
+%126 = OpTypeImage %12 3D 0 0 0 1 Unknown
+%127 = OpTypePointer UniformConstant %126
+%128 = OpVariable %127 UniformConstant
+%131 = OpTypeSampledImage %126
+%133 = OpConstantComposite %122 %99 %110 %111
+%136 = OpTypeImage %67 3D 0 0 0 1 Unknown
+%137 = OpTypePointer UniformConstant %136
+%138 = OpVariable %137 UniformConstant
+%141 = OpTypeSampledImage %136
+%143 = OpConstant %6 0.699999988
+%144 = OpConstant %6 0.800000012
+%145 = OpConstant %6 0.899999976
+%146 = OpConstantComposite %122 %143 %144 %145
+%149 = OpTypeImage %6 Cube 0 0 0 1 Unknown
+%150 = OpTypePointer UniformConstant %149
+%151 = OpVariable %150 UniformConstant
+%154 = OpTypeSampledImage %149
+%158 = OpTypeImage %12 Cube 0 0 0 1 Unknown
+%159 = OpTypePointer UniformConstant %158
+%160 = OpVariable %159 UniformConstant
+%163 = OpTypeSampledImage %158
+%167 = OpTypeImage %67 Cube 0 0 0 1 Unknown
+%168 = OpTypePointer UniformConstant %167
+%169 = OpVariable %168 UniformConstant
+%172 = OpTypeSampledImage %167
+%175 = OpTypePointer Function %8
+%177 = OpConstant %6 1
+%178 = OpConstantComposite %7 %177 %177 %177 %177
+%180 = OpTypePointer Function %6
+%187 = OpTypePointer Output %7
+%188 = OpVariable %187 Output
+%191 = OpTypePointer Output %6
+%192 = OpVariable %191 Output
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%185 = OpVariable %175 Function
+%186 = OpFunctionCall %8 %10
+OpStore %185 %186
+%189 = OpAccessChain %41 %185 %29
+%190 = OpLoad %7 %189
+OpStore %188 %190
+%193 = OpAccessChain %180 %185 %16
+%194 = OpLoad %6 %193
+OpStore %192 %194
+OpReturn
+OpFunctionEnd
+%10 = OpFunction %8 None %9
+%11 = OpLabel
+%15 = OpVariable %14 Function
+%176 = OpVariable %175 Function
+%18 = OpAccessChain %17 %15 %16
+OpStore %18 %16
+%20 = OpAccessChain %17 %15 %19
+OpStore %20 %16
+%22 = OpAccessChain %17 %15 %21
+OpStore %22 %16
+%24 = OpAccessChain %17 %15 %23
+OpStore %24 %16
+%26 = OpAccessChain %17 %15 %25
+OpStore %26 %16
+%28 = OpAccessChain %17 %15 %27
+OpStore %28 %16
+%30 = OpAccessChain %17 %15 %29
+OpStore %30 %16
+%32 = OpAccessChain %17 %15 %31
+OpStore %32 %16
+%34 = OpAccessChain %17 %15 %33
+OpStore %34 %16
+%36 = OpAccessChain %17 %15 %35
+OpStore %36 %16
+%38 = OpAccessChain %17 %15 %37
+OpStore %38 %16
+%40 = OpAccessChain %17 %15 %39
+OpStore %40 %16
+%46 = OpLoad %43 %45
+%50 = OpLoad %47 %49
+%52 = OpSampledImage %51 %46 %50
+%54 = OpImageSampleImplicitLod %7 %52 %53
+%61 = OpLoad %58 %60
+%62 = OpLoad %47 %49
+%64 = OpSampledImage %63 %61 %62
+%66 = OpImageSampleImplicitLod %55 %64 %65
+%74 = OpLoad %71 %73
+%75 = OpLoad %47 %49
+%77 = OpSampledImage %76 %74 %75
+%79 = OpImageSampleImplicitLod %68 %77 %78
+%84 = OpLoad %81 %83
+%85 = OpLoad %47 %49
+%87 = OpSampledImage %86 %84 %85
+%90 = OpImageSampleImplicitLod %7 %87 %89
+%95 = OpLoad %92 %94
+%96 = OpLoad %47 %49
+%98 = OpSampledImage %97 %95 %96
+%101 = OpImageSampleImplicitLod %55 %98 %100
+%106 = OpLoad %103 %105
+%107 = OpLoad %47 %49
+%109 = OpSampledImage %108 %106 %107
+%113 = OpImageSampleImplicitLod %68 %109 %112
+%118 = OpLoad %115 %117
+%119 = OpLoad %47 %49
+%121 = OpSampledImage %120 %118 %119
+%124 = OpImageSampleImplicitLod %7 %121 %123
+%129 = OpLoad %126 %128
+%130 = OpLoad %47 %49
+%132 = OpSampledImage %131 %129 %130
+%134 = OpImageSampleImplicitLod %55 %132 %133
+%139 = OpLoad %136 %138
+%140 = OpLoad %47 %49
+%142 = OpSampledImage %141 %139 %140
+%147 = OpImageSampleImplicitLod %68 %142 %146
+%152 = OpLoad %149 %151
+%153 = OpLoad %47 %49
+%155 = OpSampledImage %154 %152 %153
+%156 = OpImageSampleImplicitLod %7 %155 %123
+%161 = OpLoad %158 %160
+%162 = OpLoad %47 %49
+%164 = OpSampledImage %163 %161 %162
+%165 = OpImageSampleImplicitLod %55 %164 %133
+%170 = OpLoad %167 %169
+%171 = OpLoad %47 %49
+%173 = OpSampledImage %172 %170 %171
+%174 = OpImageSampleImplicitLod %68 %173 %146
+%179 = OpAccessChain %41 %176 %29
+OpStore %179 %178
+%181 = OpAccessChain %180 %176 %16
+OpStore %181 %177
+%182 = OpLoad %8 %176
+OpReturnValue %182
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+OpCapability Sampled1D
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %4253 %3709
+OpExecutionMode %5663 OriginUpperLeft
+OpExecutionMode %5663 DepthReplacing
+OpSource HLSL 500
+OpName %5663 "main"
+OpName %1032 "PS_OUTPUT"
+OpMemberName %1032 0 "Color"
+OpMemberName %1032 1 "Depth"
+OpName %3317 "@main("
+OpName %1335 "MemberTest"
+OpMemberName %1335 0 "Sample"
+OpMemberName %1335 1 "CalculateLevelOfDetail"
+OpMemberName %1335 2 "CalculateLevelOfDetailUnclamped"
+OpMemberName %1335 3 "Gather"
+OpMemberName %1335 4 "GetDimensions"
+OpMemberName %1335 5 "GetSamplePosition"
+OpMemberName %1335 6 "Load"
+OpMemberName %1335 7 "SampleBias"
+OpMemberName %1335 8 "SampleCmp"
+OpMemberName %1335 9 "SampleCmpLevelZero"
+OpMemberName %1335 10 "SampleGrad"
+OpMemberName %1335 11 "SampleLevel"
+OpName %5830 "mtest"
+OpName %3559 "txval10"
+OpName %4727 "g_tTex1df4"
+OpName %3305 "g_sSamp"
+OpName %3560 "txval11"
+OpName %4743 "g_tTex1di4"
+OpName %3561 "txval12"
+OpName %4807 "g_tTex1du4"
+OpName %4568 "txval20"
+OpName %5042 "g_tTex2df4"
+OpName %4569 "txval21"
+OpName %5058 "g_tTex2di4"
+OpName %4570 "txval22"
+OpName %5122 "g_tTex2du4"
+OpName %5577 "txval30"
+OpName %3967 "g_tTex3df4"
+OpName %5578 "txval31"
+OpName %3983 "g_tTex3di4"
+OpName %5579 "txval32"
+OpName %4047 "g_tTex3du4"
+OpName %3575 "txval40"
+OpName %3789 "g_tTexcdf4"
+OpName %3576 "txval41"
+OpName %3805 "g_tTexcdi4"
+OpName %3577 "txval42"
+OpName %3869 "g_tTexcdu4"
+OpName %5072 "psout"
+OpName %4104 "flattenTemp"
+OpName %4253 "@entryPointOutput.Color"
+OpName %3709 "@entryPointOutput.Depth"
+OpDecorate %4727 Binding 0
+OpDecorate %4727 DescriptorSet 0
+OpDecorate %3305 Binding 0
+OpDecorate %3305 DescriptorSet 0
+OpDecorate %4743 Binding 2
+OpDecorate %4743 DescriptorSet 0
+OpDecorate %4807 Binding 3
+OpDecorate %4807 DescriptorSet 0
+OpDecorate %5042 Binding 4
+OpDecorate %5042 DescriptorSet 0
+OpDecorate %5058 Binding 5
+OpDecorate %5058 DescriptorSet 0
+OpDecorate %5122 Binding 6
+OpDecorate %5122 DescriptorSet 0
+OpDecorate %3967 Binding 7
+OpDecorate %3967 DescriptorSet 0
+OpDecorate %3983 Binding 8
+OpDecorate %3983 DescriptorSet 0
+OpDecorate %4047 Binding 9
+OpDecorate %4047 DescriptorSet 0
+OpDecorate %3789 Binding 10
+OpDecorate %3789 DescriptorSet 0
+OpDecorate %3805 Binding 11
+OpDecorate %3805 DescriptorSet 0
+OpDecorate %3869 Binding 12
+OpDecorate %3869 DescriptorSet 0
+OpDecorate %4253 Location 0
+OpDecorate %3709 BuiltIn FragDepth
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%13 = OpTypeFloat 32
+%29 = OpTypeVector %13 4
+%1032 = OpTypeStruct %29 %13
+%319 = OpTypeFunction %1032
+%12 = OpTypeInt 32 1
+%1335 = OpTypeStruct %12 %12 %12 %12 %12 %12 %12 %12 %12 %12 %12 %12
+%1972 = OpTypePointer Function %1335
+%2574 = OpConstant %12 1
+%649 = OpTypePointer Function %12
+%2577 = OpConstant %12 2
+%2580 = OpConstant %12 3
+%2583 = OpConstant %12 4
+%2586 = OpConstant %12 5
+%2589 = OpConstant %12 6
+%2571 = OpConstant %12 0
+%2592 = OpConstant %12 7
+%2595 = OpConstant %12 8
+%2598 = OpConstant %12 9
+%2601 = OpConstant %12 10
+%2604 = OpConstant %12 11
+%666 = OpTypePointer Function %29
+%149 = OpTypeImage %13 1D 0 0 0 1 Unknown
+%786 = OpTypePointer UniformConstant %149
+%4727 = OpVariable %786 UniformConstant
+%508 = OpTypeSampler
+%1145 = OpTypePointer UniformConstant %508
+%3305 = OpVariable %1145 UniformConstant
+%510 = OpTypeSampledImage %149
+%2935 = OpConstant %13 0.100000001
+%26 = OpTypeVector %12 4
+%148 = OpTypeImage %12 1D 0 0 0 1 Unknown
+%785 = OpTypePointer UniformConstant %148
+%4743 = OpVariable %785 UniformConstant
+%511 = OpTypeSampledImage %148
+%2821 = OpConstant %13 0.200000003
+%11 = OpTypeInt 32 0
+%23 = OpTypeVector %11 4
+%147 = OpTypeImage %11 1D 0 0 0 1 Unknown
+%784 = OpTypePointer UniformConstant %147
+%4807 = OpVariable %784 UniformConstant
+%512 = OpTypeSampledImage %147
+%2151 = OpConstant %13 0.300000012
+%150 = OpTypeImage %13 2D 0 0 0 1 Unknown
+%787 = OpTypePointer UniformConstant %150
+%5042 = OpVariable %787 UniformConstant
+%513 = OpTypeSampledImage %150
+%19 = OpTypeVector %13 2
+%1825 = OpConstantComposite %19 %2935 %2821
+%151 = OpTypeImage %12 2D 0 0 0 1 Unknown
+%788 = OpTypePointer UniformConstant %151
+%5058 = OpVariable %788 UniformConstant
+%514 = OpTypeSampledImage %151
+%2707 = OpConstant %13 0.400000006
+%2028 = OpConstantComposite %19 %2151 %2707
+%152 = OpTypeImage %11 2D 0 0 0 1 Unknown
+%789 = OpTypePointer UniformConstant %152
+%5122 = OpVariable %789 UniformConstant
+%515 = OpTypeSampledImage %152
+%252 = OpConstant %13 0.5
+%2037 = OpConstant %13 0.600000024
+%2684 = OpConstantComposite %19 %252 %2037
+%153 = OpTypeImage %13 3D 0 0 0 1 Unknown
+%790 = OpTypePointer UniformConstant %153
+%3967 = OpVariable %790 UniformConstant
+%516 = OpTypeSampledImage %153
+%24 = OpTypeVector %13 3
+%1660 = OpConstantComposite %24 %2935 %2821 %2151
+%154 = OpTypeImage %12 3D 0 0 0 1 Unknown
+%791 = OpTypePointer UniformConstant %154
+%3983 = OpVariable %791 UniformConstant
+%517 = OpTypeSampledImage %154
+%2174 = OpConstantComposite %24 %2707 %252 %2037
+%155 = OpTypeImage %11 3D 0 0 0 1 Unknown
+%792 = OpTypePointer UniformConstant %155
+%4047 = OpVariable %792 UniformConstant
+%518 = OpTypeSampledImage %155
+%808 = OpConstant %13 0.699999988
+%2593 = OpConstant %13 0.800000012
+%1364 = OpConstant %13 0.899999976
+%2476 = OpConstantComposite %24 %808 %2593 %1364
+%156 = OpTypeImage %13 Cube 0 0 0 1 Unknown
+%793 = OpTypePointer UniformConstant %156
+%3789 = OpVariable %793 UniformConstant
+%519 = OpTypeSampledImage %156
+%157 = OpTypeImage %12 Cube 0 0 0 1 Unknown
+%794 = OpTypePointer UniformConstant %157
+%3805 = OpVariable %794 UniformConstant
+%520 = OpTypeSampledImage %157
+%158 = OpTypeImage %11 Cube 0 0 0 1 Unknown
+%795 = OpTypePointer UniformConstant %158
+%3869 = OpVariable %795 UniformConstant
+%521 = OpTypeSampledImage %158
+%1669 = OpTypePointer Function %1032
+%138 = OpConstant %13 1
+%1284 = OpConstantComposite %29 %138 %138 %138 %138
+%650 = OpTypePointer Function %13
+%667 = OpTypePointer Output %29
+%4253 = OpVariable %667 Output
+%651 = OpTypePointer Output %13
+%3709 = OpVariable %651 Output
+%5663 = OpFunction %8 None %1282
+%24877 = OpLabel
+%4104 = OpVariable %1669 Function
+%18803 = OpFunctionCall %1032 %3317
+OpStore %4104 %18803
+%13396 = OpAccessChain %666 %4104 %2571
+%7967 = OpLoad %29 %13396
+OpStore %4253 %7967
+%16622 = OpAccessChain %650 %4104 %2574
+%11539 = OpLoad %13 %16622
+OpStore %3709 %11539
+OpReturn
+OpFunctionEnd
+%3317 = OpFunction %1032 None %319
+%12442 = OpLabel
+%5830 = OpVariable %1972 Function
+%5072 = OpVariable %1669 Function
+%22671 = OpAccessChain %649 %5830 %2574
+OpStore %22671 %2574
+%20306 = OpAccessChain %649 %5830 %2577
+OpStore %20306 %2574
+%20307 = OpAccessChain %649 %5830 %2580
+OpStore %20307 %2574
+%20308 = OpAccessChain %649 %5830 %2583
+OpStore %20308 %2574
+%20309 = OpAccessChain %649 %5830 %2586
+OpStore %20309 %2574
+%20310 = OpAccessChain %649 %5830 %2589
+OpStore %20310 %2574
+%20311 = OpAccessChain %649 %5830 %2571
+OpStore %20311 %2574
+%20312 = OpAccessChain %649 %5830 %2592
+OpStore %20312 %2574
+%20313 = OpAccessChain %649 %5830 %2595
+OpStore %20313 %2574
+%20314 = OpAccessChain %649 %5830 %2598
+OpStore %20314 %2574
+%20315 = OpAccessChain %649 %5830 %2601
+OpStore %20315 %2574
+%20230 = OpAccessChain %649 %5830 %2604
+OpStore %20230 %2574
+%15508 = OpLoad %149 %4727
+%12260 = OpLoad %508 %3305
+%12514 = OpSampledImage %510 %15508 %12260
+%3559 = OpImageSampleImplicitLod %29 %12514 %2935
+%9477 = OpLoad %148 %4743
+%16280 = OpLoad %508 %3305
+%12515 = OpSampledImage %511 %9477 %16280
+%3560 = OpImageSampleImplicitLod %26 %12515 %2821
+%9478 = OpLoad %147 %4807
+%16281 = OpLoad %508 %3305
+%12516 = OpSampledImage %512 %9478 %16281
+%3561 = OpImageSampleImplicitLod %23 %12516 %2151
+%9479 = OpLoad %150 %5042
+%16282 = OpLoad %508 %3305
+%12517 = OpSampledImage %513 %9479 %16282
+%4568 = OpImageSampleImplicitLod %29 %12517 %1825
+%9480 = OpLoad %151 %5058
+%16283 = OpLoad %508 %3305
+%12518 = OpSampledImage %514 %9480 %16283
+%4569 = OpImageSampleImplicitLod %26 %12518 %2028
+%9481 = OpLoad %152 %5122
+%16284 = OpLoad %508 %3305
+%12519 = OpSampledImage %515 %9481 %16284
+%4570 = OpImageSampleImplicitLod %23 %12519 %2684
+%9482 = OpLoad %153 %3967
+%16285 = OpLoad %508 %3305
+%12520 = OpSampledImage %516 %9482 %16285
+%5577 = OpImageSampleImplicitLod %29 %12520 %1660
+%9483 = OpLoad %154 %3983
+%16286 = OpLoad %508 %3305
+%12521 = OpSampledImage %517 %9483 %16286
+%5578 = OpImageSampleImplicitLod %26 %12521 %2174
+%9484 = OpLoad %155 %4047
+%16287 = OpLoad %508 %3305
+%12522 = OpSampledImage %518 %9484 %16287
+%5579 = OpImageSampleImplicitLod %23 %12522 %2476
+%9485 = OpLoad %156 %3789
+%16288 = OpLoad %508 %3305
+%12523 = OpSampledImage %519 %9485 %16288
+%3575 = OpImageSampleImplicitLod %29 %12523 %1660
+%9486 = OpLoad %157 %3805
+%16289 = OpLoad %508 %3305
+%12524 = OpSampledImage %520 %9486 %16289
+%3576 = OpImageSampleImplicitLod %26 %12524 %2174
+%9487 = OpLoad %158 %3869
+%16290 = OpLoad %508 %3305
+%12590 = OpSampledImage %521 %9487 %16290
+%3577 = OpImageSampleImplicitLod %23 %12590 %2476
+%14275 = OpAccessChain %666 %5072 %2571
+OpStore %14275 %1284
+%20231 = OpAccessChain %650 %5072 %2574
+OpStore %20231 %138
+%8692 = OpLoad %1032 %5072
+OpReturnValue %8692
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.hlsl.templatetypes.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_hlsl_templatetypes) {
+ const std::string before =
+ R"(OpCapability Shader
+OpCapability Float64
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %153 %156
+OpExecutionMode %4 OriginUpperLeft
+OpSource HLSL 500
+OpName %4 "main"
+OpName %11 "@main(vf4;"
+OpName %10 "input"
+OpName %18 "r00"
+OpName %21 "r01"
+OpName %25 "r12"
+OpName %29 "r13"
+OpName %14 "r14"
+OpName %35 "r15"
+OpName %39 "r16"
+OpName %44 "r20"
+OpName %49 "r21"
+OpName %53 "r22"
+OpName %58 "r23"
+OpName %63 "r24"
+OpName %67 "r30"
+OpName %72 "r31"
+OpName %76 "r32"
+OpName %81 "r33"
+OpName %86 "r34"
+OpName %90 "r40"
+OpName %95 "r41"
+OpName %18 "r42"
+OpName %101 "r43"
+OpName %106 "r44"
+OpName %125 "r50"
+OpName %125 "r51"
+OpName %131 "r61"
+OpName %137 "r62"
+OpName %142 "r65"
+OpName %148 "r66"
+OpName %154 "input"
+OpName %153 "input"
+OpName %156 "@entryPointOutput"
+OpName %157 "param"
+OpDecorate %153 Location 0
+OpDecorate %156 Location 0
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 4
+%8 = OpTypePointer Function %7
+%9 = OpTypeFunction %6 %8
+%14 = OpConstant %6 1
+%15 = OpConstant %6 2
+%16 = OpConstant %6 3
+%17 = OpConstant %6 4
+%18 = OpConstantComposite %7 %14 %15 %16 %17
+%20 = OpConstant %6 5
+%21 = OpConstantComposite %7 %15 %16 %17 %20
+%22 = OpTypeBool
+%25 = OpConstantFalse %22
+%26 = OpTypeInt 32 1
+%29 = OpConstant %26 1
+%32 = OpTypeFloat 64
+%35 = OpConstant %32 1
+%36 = OpTypeInt 32 0
+%39 = OpConstant %36 1
+%40 = OpTypeVector %22 2
+%43 = OpConstantTrue %22
+%44 = OpConstantComposite %40 %25 %43
+%45 = OpTypeVector %26 2
+%48 = OpConstant %26 2
+%49 = OpConstantComposite %45 %29 %48
+%50 = OpTypeVector %6 2
+%53 = OpConstantComposite %50 %14 %15
+%54 = OpTypeVector %32 2
+%57 = OpConstant %32 2
+%58 = OpConstantComposite %54 %35 %57
+%59 = OpTypeVector %36 2
+%62 = OpConstant %36 2
+%63 = OpConstantComposite %59 %39 %62
+%64 = OpTypeVector %22 3
+%67 = OpConstantComposite %64 %25 %43 %43
+%68 = OpTypeVector %26 3
+%71 = OpConstant %26 3
+%72 = OpConstantComposite %68 %29 %48 %71
+%73 = OpTypeVector %6 3
+%76 = OpConstantComposite %73 %14 %15 %16
+%77 = OpTypeVector %32 3
+%80 = OpConstant %32 3
+%81 = OpConstantComposite %77 %35 %57 %80
+%82 = OpTypeVector %36 3
+%85 = OpConstant %36 3
+%86 = OpConstantComposite %82 %39 %62 %85
+%87 = OpTypeVector %22 4
+%90 = OpConstantComposite %87 %25 %43 %43 %25
+%91 = OpTypeVector %26 4
+%94 = OpConstant %26 4
+%95 = OpConstantComposite %91 %29 %48 %71 %94
+%97 = OpTypeVector %32 4
+%100 = OpConstant %32 4
+%101 = OpConstantComposite %97 %35 %57 %80 %100
+%102 = OpTypeVector %36 4
+%105 = OpConstant %36 4
+%106 = OpConstantComposite %102 %39 %62 %85 %105
+%107 = OpTypeMatrix %7 4
+%110 = OpConstant %6 0
+%111 = OpConstantComposite %7 %110 %14 %15 %16
+%112 = OpConstant %6 6
+%113 = OpConstant %6 7
+%114 = OpConstantComposite %7 %17 %20 %112 %113
+%115 = OpConstant %6 8
+%116 = OpConstant %6 9
+%117 = OpConstant %6 10
+%118 = OpConstant %6 11
+%119 = OpConstantComposite %7 %115 %116 %117 %118
+%120 = OpConstant %6 12
+%121 = OpConstant %6 13
+%122 = OpConstant %6 14
+%123 = OpConstant %6 15
+%124 = OpConstantComposite %7 %120 %121 %122 %123
+%125 = OpConstantComposite %107 %111 %114 %119 %124
+%127 = OpTypeMatrix %73 2
+%130 = OpConstantComposite %73 %17 %20 %112
+%131 = OpConstantComposite %127 %76 %130
+%132 = OpTypeMatrix %50 3
+%135 = OpConstantComposite %50 %16 %17
+%136 = OpConstantComposite %50 %20 %112
+%137 = OpConstantComposite %132 %53 %135 %136
+%138 = OpTypeMatrix %50 4
+%141 = OpConstantComposite %50 %113 %115
+%142 = OpConstantComposite %138 %53 %135 %136 %141
+%143 = OpTypeMatrix %73 4
+%146 = OpConstantComposite %73 %113 %115 %116
+%147 = OpConstantComposite %73 %117 %118 %120
+%148 = OpConstantComposite %143 %76 %130 %146 %147
+%152 = OpTypePointer Input %7
+%153 = OpVariable %152 Input
+%155 = OpTypePointer Output %6
+%156 = OpVariable %155 Output
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%157 = OpVariable %8 Function
+%154 = OpLoad %7 %153
+OpStore %157 %154
+%159 = OpFunctionCall %6 %11 %157
+OpStore %156 %159
+OpReturn
+OpFunctionEnd
+%11 = OpFunction %6 None %9
+%10 = OpFunctionParameter %8
+%12 = OpLabel
+OpReturnValue %110
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+OpCapability Float64
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %4872 %4045
+OpExecutionMode %5663 OriginUpperLeft
+OpSource HLSL 500
+OpName %5663 "main"
+OpName %3917 "@main(vf4;"
+OpName %10636 "input"
+OpName %1616 "r00"
+OpName %590 "r01"
+OpName %1927 "r12"
+OpName %2574 "r13"
+OpName %138 "r14"
+OpName %1201 "r15"
+OpName %2573 "r16"
+OpName %311 "r20"
+OpName %1848 "r21"
+OpName %312 "r22"
+OpName %490 "r23"
+OpName %1840 "r24"
+OpName %869 "r30"
+OpName %2668 "r31"
+OpName %1271 "r32"
+OpName %1108 "r33"
+OpName %2654 "r34"
+OpName %340 "r40"
+OpName %56 "r41"
+OpName %1616 "r42"
+OpName %1328 "r43"
+OpName %35 "r44"
+OpName %1294 "r50"
+OpName %1294 "r51"
+OpName %1207 "r61"
+OpName %162 "r62"
+OpName %2695 "r65"
+OpName %55 "r66"
+OpName %24021 "input"
+OpName %4872 "input"
+OpName %4045 "@entryPointOutput"
+OpName %5786 "param"
+OpDecorate %4872 Location 0
+OpDecorate %4045 Location 0
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%13 = OpTypeFloat 32
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Function %29
+%255 = OpTypeFunction %13 %666
+%138 = OpConstant %13 1
+%24 = OpConstant %13 2
+%2978 = OpConstant %13 3
+%2921 = OpConstant %13 4
+%1616 = OpConstantComposite %29 %138 %24 %2978 %2921
+%1387 = OpConstant %13 5
+%590 = OpConstantComposite %29 %24 %2978 %2921 %1387
+%9 = OpTypeBool
+%1927 = OpConstantFalse %9
+%12 = OpTypeInt 32 1
+%2574 = OpConstant %12 1
+%14 = OpTypeFloat 64
+%1201 = OpConstant %14 1
+%11 = OpTypeInt 32 0
+%2573 = OpConstant %11 1
+%15 = OpTypeVector %9 2
+%1926 = OpConstantTrue %9
+%311 = OpConstantComposite %15 %1927 %1926
+%18 = OpTypeVector %12 2
+%2577 = OpConstant %12 2
+%1848 = OpConstantComposite %18 %2574 %2577
+%19 = OpTypeVector %13 2
+%312 = OpConstantComposite %19 %138 %24
+%20 = OpTypeVector %14 2
+%2572 = OpConstant %14 2
+%490 = OpConstantComposite %20 %1201 %2572
+%17 = OpTypeVector %11 2
+%2576 = OpConstant %11 2
+%1840 = OpConstantComposite %17 %2573 %2576
+%16 = OpTypeVector %9 3
+%869 = OpConstantComposite %16 %1927 %1926 %1926
+%22 = OpTypeVector %12 3
+%2580 = OpConstant %12 3
+%2668 = OpConstantComposite %22 %2574 %2577 %2580
+%25 = OpTypeVector %13 3
+%1271 = OpConstantComposite %25 %138 %24 %2978
+%26 = OpTypeVector %14 3
+%1057 = OpConstant %14 3
+%1108 = OpConstantComposite %26 %1201 %2572 %1057
+%21 = OpTypeVector %11 3
+%2579 = OpConstant %11 3
+%2654 = OpConstantComposite %21 %2573 %2576 %2579
+%23 = OpTypeVector %9 4
+%340 = OpConstantComposite %23 %1927 %1926 %1926 %1927
+%27 = OpTypeVector %12 4
+%2583 = OpConstant %12 4
+%56 = OpConstantComposite %27 %2574 %2577 %2580 %2583
+%30 = OpTypeVector %14 4
+%2553 = OpConstant %14 4
+%1328 = OpConstantComposite %30 %1201 %2572 %1057 %2553
+%28 = OpTypeVector %11 4
+%2582 = OpConstant %11 4
+%35 = OpConstantComposite %28 %2573 %2576 %2579 %2582
+%101 = OpTypeMatrix %29 4
+%2575 = OpConstant %13 0
+%1199 = OpConstantComposite %29 %2575 %138 %24 %2978
+%2864 = OpConstant %13 6
+%1330 = OpConstant %13 7
+%2290 = OpConstantComposite %29 %2921 %1387 %2864 %1330
+%2807 = OpConstant %13 8
+%2040 = OpConstant %13 9
+%1273 = OpConstant %13 10
+%506 = OpConstant %13 11
+%694 = OpConstantComposite %29 %2807 %2040 %1273 %506
+%2750 = OpConstant %13 12
+%1983 = OpConstant %13 13
+%1216 = OpConstant %13 14
+%449 = OpConstant %13 15
+%2679 = OpConstantComposite %29 %2750 %1983 %1216 %449
+%1294 = OpConstantComposite %101 %1199 %2290 %694 %2679
+%54 = OpTypeMatrix %25 2
+%837 = OpConstantComposite %25 %2921 %1387 %2864
+%1207 = OpConstantComposite %54 %1271 %837
+%60 = OpTypeMatrix %19 3
+%2354 = OpConstantComposite %19 %2978 %2921
+%364 = OpConstantComposite %19 %1387 %2864
+%162 = OpConstantComposite %60 %312 %2354 %364
+%71 = OpTypeMatrix %19 4
+%2976 = OpConstantComposite %19 %1330 %2807
+%2695 = OpConstantComposite %71 %312 %2354 %364 %2976
+%86 = OpTypeMatrix %25 4
+%635 = OpConstantComposite %25 %1330 %2807 %2040
+%832 = OpConstantComposite %25 %1273 %506 %2750
+%55 = OpConstantComposite %86 %1271 %837 %635 %832
+%667 = OpTypePointer Input %29
+%4872 = OpVariable %667 Input
+%650 = OpTypePointer Output %13
+%4045 = OpVariable %650 Output
+%5663 = OpFunction %8 None %1282
+%24953 = OpLabel
+%5786 = OpVariable %666 Function
+%24021 = OpLoad %29 %4872
+OpStore %5786 %24021
+%9338 = OpFunctionCall %13 %3917 %5786
+OpStore %4045 %9338
+OpReturn
+OpFunctionEnd
+%3917 = OpFunction %13 None %255
+%10636 = OpFunctionParameter %666
+%10637 = OpLabel
+OpReturnValue %2575
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.if.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_if) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %8 %17
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "main"
+OpName %8 "inf"
+OpName %17 "outf4"
+OpDecorate %8 Location 0
+OpDecorate %17 Location 0
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypePointer Input %6
+%8 = OpVariable %7 Input
+%10 = OpConstant %6 2
+%11 = OpTypeBool
+%15 = OpTypeVector %6 4
+%16 = OpTypePointer Output %15
+%17 = OpVariable %16 Output
+%22 = OpConstant %6 -0.5
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%9 = OpLoad %6 %8
+%12 = OpFOrdGreaterThan %11 %9 %10
+OpSelectionMerge %14 None
+OpBranchConditional %12 %13 %20
+%13 = OpLabel
+%18 = OpLoad %6 %8
+%19 = OpCompositeConstruct %15 %18 %18 %18 %18
+OpStore %17 %19
+OpBranch %14
+%20 = OpLabel
+%21 = OpLoad %6 %8
+%23 = OpFAdd %6 %21 %22
+%24 = OpCompositeConstruct %15 %23 %23 %23 %23
+OpStore %17 %24
+OpBranch %14
+%14 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %3773 %4539
+OpExecutionMode %5663 OriginUpperLeft
+OpSource GLSL 450
+OpName %5663 "main"
+OpName %3773 "inf"
+OpName %4539 "outf4"
+OpDecorate %3773 Location 0
+OpDecorate %4539 Location 0
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%13 = OpTypeFloat 32
+%650 = OpTypePointer Input %13
+%3773 = OpVariable %650 Input
+%24 = OpConstant %13 2
+%9 = OpTypeBool
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Output %29
+%4539 = OpVariable %666 Output
+%947 = OpConstant %13 -0.5
+%5663 = OpFunction %8 None %1282
+%7911 = OpLabel
+%21734 = OpLoad %13 %3773
+%13508 = OpFOrdGreaterThan %9 %21734 %24
+OpSelectionMerge %19578 None
+OpBranchConditional %13508 %13182 %10142
+%13182 = OpLabel
+%9496 = OpLoad %13 %3773
+%17615 = OpCompositeConstruct %29 %9496 %9496 %9496 %9496
+OpStore %4539 %17615
+OpBranch %19578
+%10142 = OpLabel
+%22854 = OpLoad %13 %3773
+%9982 = OpFAdd %13 %22854 %947
+%12421 = OpCompositeConstruct %29 %9982 %9982 %9982 %9982
+OpStore %4539 %12421
+OpBranch %19578
+%19578 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.similar_1a.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_similar_1a) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %53 %73 %75
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "main"
+OpName %11 "Test1(i1;"
+OpName %10 "bound"
+OpName %14 "Test2(i1;"
+OpName %13 "bound"
+OpName %17 "r"
+OpName %19 "x"
+OpName %44 "param"
+OpName %53 "ini4"
+OpName %73 "outf4"
+OpName %75 "inf"
+OpName %78 "param"
+OpName %82 "param"
+OpDecorate %53 Flat
+OpDecorate %53 Location 1
+OpDecorate %73 Location 0
+OpDecorate %75 Location 0
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeInt 32 1
+%7 = OpTypePointer Function %6
+%8 = OpTypeFloat 32
+%9 = OpTypeFunction %8 %7
+%16 = OpTypePointer Function %8
+%18 = OpConstant %8 0
+%20 = OpConstant %6 0
+%28 = OpTypeBool
+%30 = OpConstant %8 0.5
+%34 = OpConstant %6 1
+%40 = OpConstant %6 2
+%51 = OpTypeVector %6 4
+%52 = OpTypePointer Input %51
+%53 = OpVariable %52 Input
+%54 = OpTypeInt 32 0
+%55 = OpConstant %54 1
+%56 = OpTypePointer Input %6
+%59 = OpConstant %54 2
+%64 = OpConstant %54 0
+%71 = OpTypeVector %8 4
+%72 = OpTypePointer Output %71
+%73 = OpVariable %72 Output
+%74 = OpTypePointer Input %8
+%75 = OpVariable %74 Input
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%78 = OpVariable %7 Function
+%82 = OpVariable %7 Function
+%76 = OpLoad %8 %75
+%77 = OpConvertFToS %6 %76
+OpStore %78 %77
+%79 = OpFunctionCall %8 %11 %78
+%80 = OpLoad %8 %75
+%81 = OpConvertFToS %6 %80
+OpStore %82 %81
+%83 = OpFunctionCall %8 %14 %82
+%84 = OpFAdd %8 %79 %83
+%85 = OpCompositeConstruct %71 %84 %84 %84 %84
+OpStore %73 %85
+OpReturn
+OpFunctionEnd
+%11 = OpFunction %8 None %9
+%10 = OpFunctionParameter %7
+%12 = OpLabel
+%17 = OpVariable %16 Function
+%19 = OpVariable %7 Function
+OpStore %17 %18
+OpStore %19 %20
+OpBranch %21
+%21 = OpLabel
+OpLoopMerge %23 %24 None
+OpBranch %25
+%25 = OpLabel
+%26 = OpLoad %6 %19
+%27 = OpLoad %6 %10
+%29 = OpSLessThan %28 %26 %27
+OpBranchConditional %29 %22 %23
+%22 = OpLabel
+%31 = OpLoad %8 %17
+%32 = OpFAdd %8 %31 %30
+OpStore %17 %32
+OpBranch %24
+%24 = OpLabel
+%33 = OpLoad %6 %19
+%35 = OpIAdd %6 %33 %34
+OpStore %19 %35
+OpBranch %21
+%23 = OpLabel
+%36 = OpLoad %8 %17
+OpReturnValue %36
+OpFunctionEnd
+%14 = OpFunction %8 None %9
+%13 = OpFunctionParameter %7
+%15 = OpLabel
+%44 = OpVariable %7 Function
+%39 = OpLoad %6 %13
+%41 = OpSGreaterThan %28 %39 %40
+OpSelectionMerge %43 None
+OpBranchConditional %41 %42 %48
+%42 = OpLabel
+%45 = OpLoad %6 %13
+OpStore %44 %45
+%46 = OpFunctionCall %8 %11 %44
+OpReturnValue %46
+%48 = OpLabel
+%49 = OpLoad %6 %13
+%50 = OpIMul %6 %49 %40
+%57 = OpAccessChain %56 %53 %55
+%58 = OpLoad %6 %57
+%60 = OpAccessChain %56 %53 %59
+%61 = OpLoad %6 %60
+%62 = OpIMul %6 %58 %61
+%63 = OpIAdd %6 %50 %62
+%65 = OpAccessChain %56 %53 %64
+%66 = OpLoad %6 %65
+%67 = OpIAdd %6 %63 %66
+%68 = OpConvertSToF %8 %67
+OpReturnValue %68
+%43 = OpLabel
+OpUnreachable
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %4201 %4539 %3773
+OpExecutionMode %5663 OriginUpperLeft
+OpSource GLSL 450
+OpName %5663 "main"
+OpName %3782 "Test1(i1;"
+OpName %6931 "bound"
+OpName %3836 "Test2(i1;"
+OpName %4408 "bound"
+OpName %4292 "r"
+OpName %4298 "x"
+OpName %22102 "param"
+OpName %4201 "ini4"
+OpName %4539 "outf4"
+OpName %3773 "inf"
+OpName %18415 "param"
+OpName %5786 "param"
+OpDecorate %4201 Flat
+OpDecorate %4201 Location 1
+OpDecorate %4539 Location 0
+OpDecorate %3773 Location 0
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%12 = OpTypeInt 32 1
+%649 = OpTypePointer Function %12
+%13 = OpTypeFloat 32
+%204 = OpTypeFunction %13 %649
+%650 = OpTypePointer Function %13
+%2572 = OpConstant %13 0
+%2571 = OpConstant %12 0
+%9 = OpTypeBool
+%252 = OpConstant %13 0.5
+%2574 = OpConstant %12 1
+%2577 = OpConstant %12 2
+%26 = OpTypeVector %12 4
+%663 = OpTypePointer Input %26
+%4201 = OpVariable %663 Input
+%11 = OpTypeInt 32 0
+%2573 = OpConstant %11 1
+%651 = OpTypePointer Input %12
+%2576 = OpConstant %11 2
+%2570 = OpConstant %11 0
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Output %29
+%4539 = OpVariable %666 Output
+%652 = OpTypePointer Input %13
+%3773 = OpVariable %652 Input
+%5663 = OpFunction %8 None %1282
+%24915 = OpLabel
+%18415 = OpVariable %649 Function
+%5786 = OpVariable %649 Function
+%8366 = OpLoad %13 %3773
+%8654 = OpConvertFToS %12 %8366
+OpStore %18415 %8654
+%17256 = OpFunctionCall %13 %3782 %18415
+%14512 = OpLoad %13 %3773
+%7041 = OpConvertFToS %12 %14512
+OpStore %5786 %7041
+%23993 = OpFunctionCall %13 %3836 %5786
+%9180 = OpFAdd %13 %17256 %23993
+%15728 = OpCompositeConstruct %29 %9180 %9180 %9180 %9180
+OpStore %4539 %15728
+OpReturn
+OpFunctionEnd
+%3782 = OpFunction %13 None %204
+%6931 = OpFunctionParameter %649
+%12220 = OpLabel
+%4292 = OpVariable %650 Function
+%4298 = OpVariable %649 Function
+OpStore %4292 %2572
+OpStore %4298 %2571
+OpBranch %14924
+%14924 = OpLabel
+OpLoopMerge %8882 %6488 None
+OpBranch %11857
+%11857 = OpLabel
+%13755 = OpLoad %12 %4298
+%22731 = OpLoad %12 %6931
+%20007 = OpSLessThan %9 %13755 %22731
+OpBranchConditional %20007 %24750 %8882
+%24750 = OpLabel
+%22912 = OpLoad %13 %4292
+%19471 = OpFAdd %13 %22912 %252
+OpStore %4292 %19471
+OpBranch %6488
+%6488 = OpLabel
+%19050 = OpLoad %12 %4298
+%8593 = OpIAdd %12 %19050 %2574
+OpStore %4298 %8593
+OpBranch %14924
+%8882 = OpLabel
+%11601 = OpLoad %13 %4292
+OpReturnValue %11601
+OpFunctionEnd
+%3836 = OpFunction %13 None %204
+%4408 = OpFunctionParameter %649
+%12143 = OpLabel
+%22102 = OpVariable %649 Function
+%24151 = OpLoad %12 %4408
+%13868 = OpSGreaterThan %9 %24151 %2577
+OpSelectionMerge %14966 None
+OpBranchConditional %13868 %9492 %17416
+%9492 = OpLabel
+%15624 = OpLoad %12 %4408
+OpStore %22102 %15624
+%17278 = OpFunctionCall %13 %3782 %22102
+OpReturnValue %17278
+%17416 = OpLabel
+%19506 = OpLoad %12 %4408
+%22773 = OpIMul %12 %19506 %2577
+%13472 = OpAccessChain %651 %4201 %2573
+%15280 = OpLoad %12 %13472
+%18079 = OpAccessChain %651 %4201 %2576
+%15199 = OpLoad %12 %18079
+%9343 = OpIMul %12 %15280 %15199
+%11462 = OpIAdd %12 %22773 %9343
+%11885 = OpAccessChain %651 %4201 %2570
+%21176 = OpLoad %12 %11885
+%10505 = OpIAdd %12 %11462 %21176
+%14626 = OpConvertSToF %13 %10505
+OpReturnValue %14626
+%14966 = OpLabel
+OpUnreachable
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.similar_1b.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_similar_1b) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %58 %78 %80
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "main"
+OpName %11 "Test1(i1;"
+OpName %10 "bound"
+OpName %14 "Test2(i1;"
+OpName %13 "bound"
+OpName %17 "r"
+OpName %19 "x"
+OpName %49 "param"
+OpName %58 "ini4"
+OpName %78 "outf4"
+OpName %80 "inf"
+OpName %83 "param"
+OpName %87 "param"
+OpDecorate %58 Flat
+OpDecorate %58 Location 0
+OpDecorate %78 Location 0
+OpDecorate %80 Location 1
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeInt 32 1
+%7 = OpTypePointer Function %6
+%8 = OpTypeFloat 32
+%9 = OpTypeFunction %8 %7
+%16 = OpTypePointer Function %8
+%18 = OpConstant %8 0
+%20 = OpConstant %6 0
+%28 = OpTypeBool
+%30 = OpConstant %8 0.5
+%34 = OpConstant %6 1
+%36 = OpConstant %8 0.200000003
+%43 = OpConstant %6 2
+%54 = OpConstant %6 4
+%56 = OpTypeVector %6 4
+%57 = OpTypePointer Input %56
+%58 = OpVariable %57 Input
+%59 = OpTypeInt 32 0
+%60 = OpConstant %59 1
+%61 = OpTypePointer Input %6
+%64 = OpConstant %59 2
+%69 = OpConstant %59 0
+%76 = OpTypeVector %8 4
+%77 = OpTypePointer Output %76
+%78 = OpVariable %77 Output
+%79 = OpTypePointer Input %8
+%80 = OpVariable %79 Input
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%83 = OpVariable %7 Function
+%87 = OpVariable %7 Function
+%81 = OpLoad %8 %80
+%82 = OpConvertFToS %6 %81
+OpStore %83 %82
+%84 = OpFunctionCall %8 %11 %83
+%85 = OpLoad %8 %80
+%86 = OpConvertFToS %6 %85
+OpStore %87 %86
+%88 = OpFunctionCall %8 %14 %87
+%89 = OpFAdd %8 %84 %88
+%90 = OpCompositeConstruct %76 %89 %89 %89 %89
+OpStore %78 %90
+OpReturn
+OpFunctionEnd
+%11 = OpFunction %8 None %9
+%10 = OpFunctionParameter %7
+%12 = OpLabel
+%17 = OpVariable %16 Function
+%19 = OpVariable %7 Function
+OpStore %17 %18
+OpStore %19 %20
+OpBranch %21
+%21 = OpLabel
+OpLoopMerge %23 %24 None
+OpBranch %25
+%25 = OpLabel
+%26 = OpLoad %6 %19
+%27 = OpLoad %6 %10
+%29 = OpSLessThan %28 %26 %27
+OpBranchConditional %29 %22 %23
+%22 = OpLabel
+%31 = OpLoad %8 %17
+%32 = OpFAdd %8 %31 %30
+OpStore %17 %32
+OpBranch %24
+%24 = OpLabel
+%33 = OpLoad %6 %19
+%35 = OpIAdd %6 %33 %34
+OpStore %19 %35
+OpBranch %21
+%23 = OpLabel
+%37 = OpLoad %8 %17
+%38 = OpFAdd %8 %37 %36
+OpStore %17 %38
+%39 = OpLoad %8 %17
+OpReturnValue %39
+OpFunctionEnd
+%14 = OpFunction %8 None %9
+%13 = OpFunctionParameter %7
+%15 = OpLabel
+%49 = OpVariable %7 Function
+%42 = OpLoad %6 %13
+%44 = OpSGreaterThan %28 %42 %43
+OpSelectionMerge %46 None
+OpBranchConditional %44 %45 %52
+%45 = OpLabel
+%47 = OpLoad %6 %13
+%48 = OpIMul %6 %47 %43
+OpStore %49 %48
+%50 = OpFunctionCall %8 %11 %49
+OpReturnValue %50
+%52 = OpLabel
+%53 = OpLoad %6 %13
+%55 = OpIMul %6 %53 %54
+%62 = OpAccessChain %61 %58 %60
+%63 = OpLoad %6 %62
+%65 = OpAccessChain %61 %58 %64
+%66 = OpLoad %6 %65
+%67 = OpIMul %6 %63 %66
+%68 = OpIAdd %6 %55 %67
+%70 = OpAccessChain %61 %58 %69
+%71 = OpLoad %6 %70
+%72 = OpIAdd %6 %68 %71
+%73 = OpConvertSToF %8 %72
+OpReturnValue %73
+%46 = OpLabel
+OpUnreachable
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %4201 %4539 %3773
+OpExecutionMode %5663 OriginUpperLeft
+OpSource GLSL 450
+OpName %5663 "main"
+OpName %3782 "Test1(i1;"
+OpName %6931 "bound"
+OpName %3836 "Test2(i1;"
+OpName %4408 "bound"
+OpName %4292 "r"
+OpName %4298 "x"
+OpName %22102 "param"
+OpName %4201 "ini4"
+OpName %4539 "outf4"
+OpName %3773 "inf"
+OpName %18415 "param"
+OpName %5786 "param"
+OpDecorate %4201 Flat
+OpDecorate %4201 Location 0
+OpDecorate %4539 Location 0
+OpDecorate %3773 Location 1
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%12 = OpTypeInt 32 1
+%649 = OpTypePointer Function %12
+%13 = OpTypeFloat 32
+%204 = OpTypeFunction %13 %649
+%650 = OpTypePointer Function %13
+%2572 = OpConstant %13 0
+%2571 = OpConstant %12 0
+%9 = OpTypeBool
+%252 = OpConstant %13 0.5
+%2574 = OpConstant %12 1
+%2821 = OpConstant %13 0.200000003
+%2577 = OpConstant %12 2
+%2583 = OpConstant %12 4
+%26 = OpTypeVector %12 4
+%663 = OpTypePointer Input %26
+%4201 = OpVariable %663 Input
+%11 = OpTypeInt 32 0
+%2573 = OpConstant %11 1
+%651 = OpTypePointer Input %12
+%2576 = OpConstant %11 2
+%2570 = OpConstant %11 0
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Output %29
+%4539 = OpVariable %666 Output
+%652 = OpTypePointer Input %13
+%3773 = OpVariable %652 Input
+%5663 = OpFunction %8 None %1282
+%24915 = OpLabel
+%18415 = OpVariable %649 Function
+%5786 = OpVariable %649 Function
+%8366 = OpLoad %13 %3773
+%8654 = OpConvertFToS %12 %8366
+OpStore %18415 %8654
+%17256 = OpFunctionCall %13 %3782 %18415
+%14512 = OpLoad %13 %3773
+%7041 = OpConvertFToS %12 %14512
+OpStore %5786 %7041
+%23993 = OpFunctionCall %13 %3836 %5786
+%9180 = OpFAdd %13 %17256 %23993
+%15728 = OpCompositeConstruct %29 %9180 %9180 %9180 %9180
+OpStore %4539 %15728
+OpReturn
+OpFunctionEnd
+%3782 = OpFunction %13 None %204
+%6931 = OpFunctionParameter %649
+%12220 = OpLabel
+%4292 = OpVariable %650 Function
+%4298 = OpVariable %649 Function
+OpStore %4292 %2572
+OpStore %4298 %2571
+OpBranch %14924
+%14924 = OpLabel
+OpLoopMerge %6507 %6488 None
+OpBranch %11857
+%11857 = OpLabel
+%13755 = OpLoad %12 %4298
+%22731 = OpLoad %12 %6931
+%20007 = OpSLessThan %9 %13755 %22731
+OpBranchConditional %20007 %24750 %6507
+%24750 = OpLabel
+%22912 = OpLoad %13 %4292
+%19471 = OpFAdd %13 %22912 %252
+OpStore %4292 %19471
+OpBranch %6488
+%6488 = OpLabel
+%19050 = OpLoad %12 %4298
+%8593 = OpIAdd %12 %19050 %2574
+OpStore %4298 %8593
+OpBranch %14924
+%6507 = OpLabel
+%18877 = OpLoad %13 %4292
+%15899 = OpFAdd %13 %18877 %2821
+OpStore %4292 %15899
+%20342 = OpLoad %13 %4292
+OpReturnValue %20342
+OpFunctionEnd
+%3836 = OpFunction %13 None %204
+%4408 = OpFunctionParameter %649
+%12143 = OpLabel
+%22102 = OpVariable %649 Function
+%24151 = OpLoad %12 %4408
+%13868 = OpSGreaterThan %9 %24151 %2577
+OpSelectionMerge %14966 None
+OpBranchConditional %13868 %10822 %17416
+%10822 = OpLabel
+%22680 = OpLoad %12 %4408
+%23216 = OpIMul %12 %22680 %2577
+OpStore %22102 %23216
+%7042 = OpFunctionCall %13 %3782 %22102
+OpReturnValue %7042
+%17416 = OpLabel
+%19506 = OpLoad %12 %4408
+%22773 = OpIMul %12 %19506 %2583
+%13472 = OpAccessChain %651 %4201 %2573
+%15280 = OpLoad %12 %13472
+%18079 = OpAccessChain %651 %4201 %2576
+%15199 = OpLoad %12 %18079
+%9343 = OpIMul %12 %15280 %15199
+%11462 = OpIAdd %12 %22773 %9343
+%11885 = OpAccessChain %651 %4201 %2570
+%21176 = OpLoad %12 %11885
+%10505 = OpIAdd %12 %11462 %21176
+%14626 = OpConvertSToF %13 %10505
+OpReturnValue %14626
+%14966 = OpLabel
+OpUnreachable
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.specconst.comp
+TEST_F(CanonicalizeIdsTest, remap_specconst) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %4 "main"
+OpExecutionMode %4 LocalSize 1 1 1
+OpSource GLSL 450
+OpName %4 "main"
+OpDecorate %7 SpecId 0
+OpDecorate %8 SpecId 1
+OpDecorate %9 SpecId 2
+OpDecorate %11 BuiltIn WorkgroupSize
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeInt 32 0
+%7 = OpSpecConstant %6 1
+%8 = OpSpecConstant %6 1
+%9 = OpSpecConstant %6 1
+%10 = OpTypeVector %6 3
+%11 = OpSpecConstantComposite %10 %7 %8 %9
+%14 = OpSpecConstantOp %6 CompositeExtract %11 0
+%16 = OpSpecConstantOp %6 CompositeExtract %11 1
+%18 = OpSpecConstantOp %6 CompositeExtract %11 2
+%19 = OpSpecConstantOp %6 IMul %16 %18
+%20 = OpSpecConstantOp %6 IAdd %14 %19
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %5663 "main"
+OpExecutionMode %5663 LocalSize 1 1 1
+OpSource GLSL 450
+OpName %5663 "main"
+OpDecorate %2 SpecId 0
+OpDecorate %3 SpecId 1
+OpDecorate %4 SpecId 2
+OpDecorate %5 BuiltIn WorkgroupSize
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%11 = OpTypeInt 32 0
+%2 = OpSpecConstant %11 1
+%3 = OpSpecConstant %11 1
+%4 = OpSpecConstant %11 1
+%20 = OpTypeVector %11 3
+%5 = OpSpecConstantComposite %20 %2 %3 %4
+%6 = OpSpecConstantOp %11 CompositeExtract %5 0
+%7 = OpSpecConstantOp %11 CompositeExtract %5 1
+%9 = OpSpecConstantOp %11 CompositeExtract %5 2
+%10 = OpSpecConstantOp %11 IMul %7 %9
+%12 = OpSpecConstantOp %11 IAdd %6 %10
+%5663 = OpFunction %8 None %1282
+%16103 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.switch.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_switch) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %9 %23
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 450
+OpName %4 "main"
+OpName %9 "in0"
+OpName %23 "FragColor"
+OpDecorate %9 Location 0
+OpDecorate %23 RelaxedPrecision
+OpDecorate %23 Location 0
+OpDecorate %29 RelaxedPrecision
+OpDecorate %36 RelaxedPrecision
+OpDecorate %43 RelaxedPrecision
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 4
+%8 = OpTypePointer Input %7
+%9 = OpVariable %8 Input
+%10 = OpTypeInt 32 0
+%11 = OpConstant %10 3
+%12 = OpTypePointer Input %6
+%15 = OpTypeInt 32 1
+%22 = OpTypePointer Output %7
+%23 = OpVariable %22 Output
+%24 = OpConstant %10 0
+%27 = OpConstant %6 0
+%31 = OpConstant %10 1
+%34 = OpConstant %6 1
+%38 = OpConstant %10 2
+%41 = OpConstant %6 2
+%45 = OpConstant %6 -1
+%46 = OpConstantComposite %7 %45 %45 %45 %45
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%13 = OpAccessChain %12 %9 %11
+%14 = OpLoad %6 %13
+%16 = OpConvertFToS %15 %14
+OpSelectionMerge %21 None
+OpSwitch %16 %20 0 %17 1 %18 2 %19
+%20 = OpLabel
+OpStore %23 %46
+OpBranch %21
+%17 = OpLabel
+%25 = OpAccessChain %12 %9 %24
+%26 = OpLoad %6 %25
+%28 = OpFAdd %6 %26 %27
+%29 = OpCompositeConstruct %7 %28 %28 %28 %28
+OpStore %23 %29
+OpBranch %21
+%18 = OpLabel
+%32 = OpAccessChain %12 %9 %31
+%33 = OpLoad %6 %32
+%35 = OpFAdd %6 %33 %34
+%36 = OpCompositeConstruct %7 %35 %35 %35 %35
+OpStore %23 %36
+OpBranch %21
+%19 = OpLabel
+%39 = OpAccessChain %12 %9 %38
+%40 = OpLoad %6 %39
+%42 = OpFAdd %6 %40 %41
+%43 = OpCompositeConstruct %7 %42 %42 %42 %42
+OpStore %23 %43
+OpBranch %21
+%21 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %3719 %3994
+OpExecutionMode %5663 OriginUpperLeft
+OpSource GLSL 450
+OpName %5663 "main"
+OpName %3719 "in0"
+OpName %3994 "FragColor"
+OpDecorate %3719 Location 0
+OpDecorate %3994 RelaxedPrecision
+OpDecorate %3994 Location 0
+OpDecorate %12421 RelaxedPrecision
+OpDecorate %12422 RelaxedPrecision
+OpDecorate %12423 RelaxedPrecision
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%13 = OpTypeFloat 32
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Input %29
+%3719 = OpVariable %666 Input
+%11 = OpTypeInt 32 0
+%2579 = OpConstant %11 3
+%650 = OpTypePointer Input %13
+%12 = OpTypeInt 32 1
+%667 = OpTypePointer Output %29
+%3994 = OpVariable %667 Output
+%2570 = OpConstant %11 0
+%2572 = OpConstant %13 0
+%2573 = OpConstant %11 1
+%138 = OpConstant %13 1
+%2576 = OpConstant %11 2
+%24 = OpConstant %13 2
+%833 = OpConstant %13 -1
+%1284 = OpConstantComposite %29 %833 %833 %833 %833
+%5663 = OpFunction %8 None %1282
+%23915 = OpLabel
+%7984 = OpAccessChain %650 %3719 %2579
+%11376 = OpLoad %13 %7984
+%16859 = OpConvertFToS %12 %11376
+OpSelectionMerge %19578 None
+OpSwitch %16859 %15971 0 %8158 1 %8159 2 %8160
+%15971 = OpLabel
+OpStore %3994 %1284
+OpBranch %19578
+%8158 = OpLabel
+%21848 = OpAccessChain %650 %3719 %2570
+%23987 = OpLoad %13 %21848
+%19989 = OpFAdd %13 %23987 %2572
+%12421 = OpCompositeConstruct %29 %19989 %19989 %19989 %19989
+OpStore %3994 %12421
+OpBranch %19578
+%8159 = OpLabel
+%21849 = OpAccessChain %650 %3719 %2573
+%23988 = OpLoad %13 %21849
+%19990 = OpFAdd %13 %23988 %138
+%12422 = OpCompositeConstruct %29 %19990 %19990 %19990 %19990
+OpStore %3994 %12422
+OpBranch %19578
+%8160 = OpLabel
+%21850 = OpAccessChain %650 %3719 %2576
+%23989 = OpLoad %13 %21850
+%19991 = OpFAdd %13 %23989 %24
+%12423 = OpCompositeConstruct %29 %19991 %19991 %19991 %19991
+OpStore %3994 %12423
+OpBranch %19578
+%19578 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+// ported from remap.uniformarray.everything.frag
+TEST_F(CanonicalizeIdsTest, remap_uniformarray) {
+ const std::string before =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %4 "main" %14 %25 %43 %54
+OpExecutionMode %4 OriginUpperLeft
+OpSource GLSL 140
+OpName %4 "main"
+OpName %9 "texColor"
+OpName %14 "color"
+OpName %25 "inColor"
+OpName %43 "alpha"
+OpName %54 "gl_FragColor"
+OpDecorate %14 Location 1
+OpDecorate %25 Location 0
+OpDecorate %43 Location 7
+OpDecorate %54 Location 0
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 4
+%8 = OpTypePointer Function %7
+%10 = OpTypeInt 32 0
+%11 = OpConstant %10 6
+%12 = OpTypeArray %7 %11
+%13 = OpTypePointer Input %12
+%14 = OpVariable %13 Input
+%15 = OpTypeInt 32 1
+%16 = OpConstant %15 1
+%17 = OpTypePointer Input %7
+%23 = OpTypeVector %6 3
+%24 = OpTypePointer Input %23
+%25 = OpVariable %24 Input
+%30 = OpConstant %10 0
+%31 = OpTypePointer Function %6
+%34 = OpConstant %10 1
+%37 = OpConstant %10 2
+%40 = OpConstant %10 16
+%41 = OpTypeArray %6 %40
+%42 = OpTypePointer Input %41
+%43 = OpVariable %42 Input
+%44 = OpConstant %15 12
+%45 = OpTypePointer Input %6
+%48 = OpConstant %10 3
+%53 = OpTypePointer Output %7
+%54 = OpVariable %53 Output
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%9 = OpVariable %8 Function
+%18 = OpAccessChain %17 %14 %16
+%19 = OpLoad %7 %18
+%20 = OpAccessChain %17 %14 %16
+%21 = OpLoad %7 %20
+%22 = OpFAdd %7 %19 %21
+OpStore %9 %22
+%26 = OpLoad %23 %25
+%27 = OpLoad %7 %9
+%28 = OpVectorShuffle %23 %27 %27 0 1 2
+%29 = OpFAdd %23 %28 %26
+%32 = OpAccessChain %31 %9 %30
+%33 = OpCompositeExtract %6 %29 0
+OpStore %32 %33
+%35 = OpAccessChain %31 %9 %34
+%36 = OpCompositeExtract %6 %29 1
+OpStore %35 %36
+%38 = OpAccessChain %31 %9 %37
+%39 = OpCompositeExtract %6 %29 2
+OpStore %38 %39
+%46 = OpAccessChain %45 %43 %44
+%47 = OpLoad %6 %46
+%49 = OpAccessChain %31 %9 %48
+%50 = OpLoad %6 %49
+%51 = OpFAdd %6 %50 %47
+%52 = OpAccessChain %31 %9 %48
+OpStore %52 %51
+%55 = OpLoad %7 %9
+OpStore %54 %55
+OpReturn
+OpFunctionEnd
+)";
+
+ const std::string after =
+ R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %5663 "main" %3608 %4957 %4339 %5139
+OpExecutionMode %5663 OriginUpperLeft
+OpSource GLSL 140
+OpName %5663 "main"
+OpName %4902 "texColor"
+OpName %3608 "color"
+OpName %4957 "inColor"
+OpName %4339 "alpha"
+OpName %5139 "gl_FragColor"
+OpDecorate %3608 Location 1
+OpDecorate %4957 Location 0
+OpDecorate %4339 Location 7
+OpDecorate %5139 Location 0
+%8 = OpTypeVoid
+%1282 = OpTypeFunction %8
+%13 = OpTypeFloat 32
+%29 = OpTypeVector %13 4
+%666 = OpTypePointer Function %29
+%11 = OpTypeInt 32 0
+%2588 = OpConstant %11 6
+%740 = OpTypeArray %29 %2588
+%1377 = OpTypePointer Input %740
+%3608 = OpVariable %1377 Input
+%12 = OpTypeInt 32 1
+%2574 = OpConstant %12 1
+%667 = OpTypePointer Input %29
+%24 = OpTypeVector %13 3
+%661 = OpTypePointer Input %24
+%4957 = OpVariable %661 Input
+%2570 = OpConstant %11 0
+%650 = OpTypePointer Function %13
+%2573 = OpConstant %11 1
+%2576 = OpConstant %11 2
+%2618 = OpConstant %11 16
+%709 = OpTypeArray %13 %2618
+%1346 = OpTypePointer Input %709
+%4339 = OpVariable %1346 Input
+%2607 = OpConstant %12 12
+%651 = OpTypePointer Input %13
+%2579 = OpConstant %11 3
+%668 = OpTypePointer Output %29
+%5139 = OpVariable %668 Output
+%5663 = OpFunction %8 None %1282
+%25029 = OpLabel
+%4902 = OpVariable %666 Function
+%10645 = OpAccessChain %667 %3608 %2574
+%8181 = OpLoad %29 %10645
+%21370 = OpAccessChain %667 %3608 %2574
+%11355 = OpLoad %29 %21370
+%23084 = OpFAdd %29 %8181 %11355
+OpStore %4902 %23084
+%21218 = OpLoad %24 %4957
+%13695 = OpLoad %29 %4902
+%23959 = OpVectorShuffle %24 %13695 %13695 0 1 2
+%14937 = OpFAdd %24 %23959 %21218
+%15653 = OpAccessChain %650 %4902 %2570
+%21354 = OpCompositeExtract %13 %14937 0
+OpStore %15653 %21354
+%16378 = OpAccessChain %650 %4902 %2573
+%15746 = OpCompositeExtract %13 %14937 1
+OpStore %16378 %15746
+%16379 = OpAccessChain %650 %4902 %2576
+%15747 = OpCompositeExtract %13 %14937 2
+OpStore %16379 %15747
+%19895 = OpAccessChain %651 %4339 %2607
+%7372 = OpLoad %13 %19895
+%21371 = OpAccessChain %650 %4902 %2579
+%11412 = OpLoad %13 %21371
+%22584 = OpFAdd %13 %11412 %7372
+%17318 = OpAccessChain %650 %4902 %2579
+OpStore %17318 %22584
+%17934 = OpLoad %29 %4902
+OpStore %5139 %17934
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndCheck<CanonicalizeIdsPass>(before, after, false, false);
+}
+
+} // namespace
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/copy_prop_array_test.cpp b/third_party/SPIRV-Tools/test/opt/copy_prop_array_test.cpp
index 16719b8..de25ab9 100644
--- a/third_party/SPIRV-Tools/test/opt/copy_prop_array_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/copy_prop_array_test.cpp
@@ -1977,6 +1977,504 @@
SinglePassRunAndCheck<CopyPropagateArrays>(text, text, false);
}
+
+TEST_F(CopyPropArrayPassTest, InterpolateFunctions) {
+ const std::string before = R"(OpCapability InterpolationFunction
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_COLOR
+OpExecutionMode %main OriginUpperLeft
+OpSource HLSL 680
+OpName %in_var_COLOR "in.var.COLOR"
+OpName %main "main"
+OpName %offset "offset"
+OpDecorate %in_var_COLOR Location 0
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%float = OpTypeFloat 32
+%float_0 = OpConstant %float 0
+%v2float = OpTypeVector %float 2
+%v4float = OpTypeVector %float 4
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%void = OpTypeVoid
+%19 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%in_var_COLOR = OpVariable %_ptr_Input_v4float Input
+%main = OpFunction %void None %19
+%20 = OpLabel
+%45 = OpVariable %_ptr_Function_v4float Function
+%25 = OpLoad %v4float %in_var_COLOR
+OpStore %45 %25
+; CHECK: OpExtInst %v4float %1 InterpolateAtCentroid %in_var_COLOR
+%52 = OpExtInst %v4float %1 InterpolateAtCentroid %45
+; CHECK: OpExtInst %v4float %1 InterpolateAtSample %in_var_COLOR %int_0
+%54 = OpExtInst %v4float %1 InterpolateAtSample %45 %int_0
+%offset = OpCompositeConstruct %v2float %float_0 %float_0
+; CHECK: OpExtInst %v4float %1 InterpolateAtOffset %in_var_COLOR %offset
+%56 = OpExtInst %v4float %1 InterpolateAtOffset %45 %offset
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER |
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, false);
+}
+
+TEST_F(CopyPropArrayPassTest, InterpolateMultiPropagation) {
+ const std::string before = R"(OpCapability InterpolationFunction
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_COLOR
+OpExecutionMode %main OriginUpperLeft
+OpSource HLSL 680
+OpName %in_var_COLOR "in.var.COLOR"
+OpName %main "main"
+OpName %param_var_color "param.var.color"
+OpDecorate %in_var_COLOR Location 0
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+%void = OpTypeVoid
+%19 = OpTypeFunction %void
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%in_var_COLOR = OpVariable %_ptr_Input_v4float Input
+%main = OpFunction %void None %19
+%20 = OpLabel
+%45 = OpVariable %_ptr_Function_v4float Function
+%param_var_color = OpVariable %_ptr_Function_v4float Function
+%25 = OpLoad %v4float %in_var_COLOR
+OpStore %param_var_color %25
+; CHECK: OpExtInst %v4float %1 InterpolateAtCentroid %in_var_COLOR
+%52 = OpExtInst %v4float %1 InterpolateAtCentroid %param_var_color
+%49 = OpLoad %v4float %param_var_color
+OpStore %45 %49
+; CHECK: OpExtInst %v4float %1 InterpolateAtCentroid %in_var_COLOR
+%54 = OpExtInst %v4float %1 InterpolateAtCentroid %45
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER |
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, false);
+}
+
+TEST_F(CopyPropArrayPassTest, PropagateScalar) {
+ const std::string before = R"(OpCapability InterpolationFunction
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in_var_SV_InstanceID
+OpExecutionMode %main OriginUpperLeft
+OpSource HLSL 680
+OpName %in_var_SV_InstanceID "in.var.SV_InstanceID"
+OpName %main "main"
+OpDecorate %in_var_SV_InstanceID Location 0
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_ptr_Input_float = OpTypePointer Input %float
+%void = OpTypeVoid
+%19 = OpTypeFunction %void
+%_ptr_Function_float = OpTypePointer Function %float
+%in_var_SV_InstanceID = OpVariable %_ptr_Input_float Input
+%main = OpFunction %void None %19
+%20 = OpLabel
+%45 = OpVariable %_ptr_Function_float Function
+%25 = OpLoad %v4float %in_var_SV_InstanceID
+OpStore %45 %25
+; CHECK: OpExtInst %v4float %1 InterpolateAtCentroid %in_var_SV_InstanceID
+%52 = OpExtInst %v4float %1 InterpolateAtCentroid %45
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER |
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, false);
+}
+
+TEST_F(CopyPropArrayPassTest, StoreToAccessChain) {
+ const std::string before = R"(OpCapability InterpolationFunction
+OpCapability MeshShadingEXT
+OpExtension "SPV_EXT_mesh_shader"
+OpMemoryModel Logical GLSL450
+OpEntryPoint MeshEXT %1 "main" %2 %3
+OpExecutionMode %1 LocalSize 128 1 1
+OpExecutionMode %1 OutputTrianglesEXT
+OpExecutionMode %1 OutputVertices 64
+OpExecutionMode %1 OutputPrimitivesEXT 126
+OpDecorate %3 Flat
+OpDecorate %3 Location 2
+%uint = OpTypeInt 32 0
+%uint_4 = OpConstant %uint 4
+%uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+%_struct_8 = OpTypeStruct %_arr_uint_uint_32
+%_ptr_TaskPayloadWorkgroupEXT__struct_8 = OpTypePointer TaskPayloadWorkgroupEXT %_struct_8
+%uint_64 = OpConstant %uint 64
+%_arr_uint_uint_64 = OpTypeArray %uint %uint_64
+%_ptr_Output__arr_uint_uint_64 = OpTypePointer Output %_arr_uint_uint_64
+%void = OpTypeVoid
+%14 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__arr_uint_uint_32 = OpTypePointer Function %_arr_uint_uint_32
+%_ptr_Output_uint = OpTypePointer Output %uint
+%2 = OpVariable %_ptr_TaskPayloadWorkgroupEXT__struct_8 TaskPayloadWorkgroupEXT
+%3 = OpVariable %_ptr_Output__arr_uint_uint_64 Output
+%1 = OpFunction %void None %14
+%18 = OpLabel
+%19 = OpVariable %_ptr_Function__arr_uint_uint_32 Function
+%20 = OpLoad %_struct_8 %2
+%21 = OpCompositeExtract %_arr_uint_uint_32 %20 0
+; CHECK: %28 = OpAccessChain %_ptr_TaskPayloadWorkgroupEXT__arr_uint_uint_32 %2 %uint_0
+OpStore %19 %21
+; CHECK: %22 = OpAccessChain %_ptr_TaskPayloadWorkgroupEXT_uint %28 %uint_4
+%22 = OpAccessChain %_ptr_Function_uint %19 %uint_4
+%23 = OpLoad %uint %22
+%24 = OpAccessChain %_ptr_Output_uint %3 %uint_4
+OpStore %24 %23
+OpReturn
+OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, true);
+}
+
+TEST_F(CopyPropArrayPassTest, PropCopyLogical) {
+ const std::string before = R"(
+; CHECK: [[v4array_ptr:%\w+]] = OpTypePointer Uniform %14
+; CHECK: [[v4_ptr:%\w+]] = OpTypePointer Uniform %7
+; CHECK: [[ac:%\w+]] = OpAccessChain [[v4array_ptr]] %19 %21 %33
+; CHECK: %47 = OpAccessChain [[v4_ptr]] [[ac]] %37
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %4 "main" %19 %30 %32
+ OpSource GLSL 430
+ OpName %4 "main"
+ OpDecorate %14 ArrayStride 16
+ OpDecorate %15 ArrayStride 16
+ OpMemberDecorate %16 0 Offset 0
+ OpMemberDecorate %16 1 Offset 32
+ OpDecorate %17 Block
+ OpMemberDecorate %17 0 Offset 0
+ OpDecorate %19 Binding 0
+ OpDecorate %19 DescriptorSet 0
+ OpDecorate %28 Block
+ OpMemberDecorate %28 0 BuiltIn Position
+ OpMemberDecorate %28 1 BuiltIn PointSize
+ OpMemberDecorate %28 2 BuiltIn ClipDistance
+ OpDecorate %32 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypeInt 32 0
+ %9 = OpConstant %8 2
+%10 = OpTypeArray %7 %9
+%11 = OpTypeStruct %10 %10
+%14 = OpTypeArray %7 %9
+%15 = OpTypeArray %7 %9
+%16 = OpTypeStruct %14 %15
+%17 = OpTypeStruct %16
+%18 = OpTypePointer Uniform %17
+%19 = OpVariable %18 Uniform
+%20 = OpTypeInt 32 1
+%21 = OpConstant %20 0
+%22 = OpTypePointer Uniform %16
+%26 = OpConstant %8 1
+%27 = OpTypeArray %6 %26
+%28 = OpTypeStruct %7 %6 %27
+%29 = OpTypePointer Output %28
+%30 = OpVariable %29 Output
+%31 = OpTypePointer Input %7
+%32 = OpVariable %31 Input
+%33 = OpConstant %8 0
+%34 = OpTypePointer Input %6
+%38 = OpTypePointer Function %7
+%41 = OpTypePointer Output %7
+%43 = OpTypePointer Function %10
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+%44 = OpVariable %43 Function
+%23 = OpAccessChain %22 %19 %21
+%24 = OpLoad %16 %23
+%25 = OpCopyLogical %11 %24
+%46 = OpCompositeExtract %10 %25 0
+ OpStore %44 %46
+%35 = OpAccessChain %34 %32 %33
+%36 = OpLoad %6 %35
+%37 = OpConvertFToS %20 %36
+%47 = OpAccessChain %38 %44 %37
+%40 = OpLoad %7 %47
+%42 = OpAccessChain %41 %30 %21
+ OpStore %42 %40
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_UNIVERSAL_1_6);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, true);
+}
+
+// Ensure that the use of the global variable in a debug instruction does not
+// stop copy propagation. We expect the image operand to OpImageTexelPointer to
+// be replaced.
+TEST_F(CopyPropArrayPassTest, DebugInstNotStore) {
+ const std::string before = R"(
+ OpCapability Shader
+ OpCapability SampledBuffer
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_EXT_descriptor_indexing"
+ %1 = OpExtInstImport "GLSL.std.450"
+ %2 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %3 "maincomp"
+ OpExecutionMode %3 LocalSize 16 16 1
+ %4 = OpString ""
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_6 = OpConstant %uint 6
+ %uint_8 = OpConstant %uint 8
+ %uint_2 = OpConstant %uint 2
+ %uint_7 = OpConstant %uint 7
+ %uint_3 = OpConstant %uint 3
+ %uint_32 = OpConstant %uint 32
+ %uint_16 = OpConstant %uint 16
+ %uint_4 = OpConstant %uint 4
+ %16 = OpTypeImage %uint Buffer 2 0 0 2 R32ui
+%_ptr_UniformConstant_16 = OpTypePointer UniformConstant %16
+ %void = OpTypeVoid
+ %uint_5 = OpConstant %uint 5
+ %uint_70 = OpConstant %uint 70
+ %uint_71 = OpConstant %uint 71
+ %uint_72 = OpConstant %uint 72
+ %uint_17 = OpConstant %uint 17
+ %uint_9 = OpConstant %uint 9
+ %uint_25 = OpConstant %uint 25
+ %uint_14 = OpConstant %uint 14
+ %uint_24 = OpConstant %uint 24
+ %uint_13 = OpConstant %uint 13
+ %29 = OpTypeFunction %void
+%_ptr_Function_16 = OpTypePointer Function %16
+%_ptr_Image_uint = OpTypePointer Image %uint
+; CHECK: [[GV:%\w+]] = OpVariable {{%\w+}} UniformConstant
+ %32 = OpVariable %_ptr_UniformConstant_16 UniformConstant
+ %33 = OpExtInst %void %2 DebugInfoNone
+ %34 = OpExtInst %void %2 DebugExpression
+ %35 = OpExtInst %void %2 DebugTypeBasic %4 %uint_32 %uint_3 %uint_0
+ %36 = OpExtInst %void %2 DebugTypeVector %35 %uint_3
+ %37 = OpExtInst %void %2 DebugSource %4 %4
+ %38 = OpExtInst %void %2 DebugCompilationUnit %uint_1 %uint_4 %37 %uint_5
+ %39 = OpExtInst %void %2 DebugTypeTemplateParameter %4 %36 %33 %37 %uint_0 %uint_0
+ %40 = OpExtInst %void %2 DebugTypeBasic %4 %uint_32 %uint_6 %uint_0
+ %41 = OpExtInst %void %2 DebugSource %4 %4
+ %42 = OpExtInst %void %2 DebugCompilationUnit %uint_1 %uint_4 %41 %uint_5
+ %43 = OpExtInst %void %2 DebugTypeComposite %4 %uint_0 %37 %uint_0 %uint_0 %38 %4 %33 %uint_3
+ %44 = OpExtInst %void %2 DebugTypeTemplateParameter %4 %40 %33 %37 %uint_0 %uint_0
+ %45 = OpExtInst %void %2 DebugTypeTemplate %43 %44
+ %46 = OpExtInst %void %2 DebugTypeFunction %uint_3 %void %40
+ %47 = OpExtInst %void %2 DebugFunction %4 %46 %37 %uint_70 %uint_1 %38 %4 %uint_3 %uint_71
+ %48 = OpExtInst %void %2 DebugLexicalBlock %37 %uint_71 %uint_1 %47
+ %49 = OpExtInst %void %2 DebugLocalVariable %4 %45 %37 %uint_72 %uint_17 %48 %uint_4
+ %50 = OpExtInst %void %2 DebugTypeFunction %uint_3 %void
+ %51 = OpExtInst %void %2 DebugSource %4 %4
+ %52 = OpExtInst %void %2 DebugCompilationUnit %uint_1 %uint_4 %51 %uint_5
+ %53 = OpExtInst %void %2 DebugFunction %4 %50 %51 %uint_24 %uint_1 %52 %4 %uint_3 %uint_25
+ %54 = OpExtInst %void %2 DebugGlobalVariable %4 %45 %37 %uint_17 %uint_16 %38 %4 %32 %uint_8
+ %55 = OpExtInst %void %2 DebugTypeMember %4 %40 %37 %uint_14 %uint_7 %uint_0 %uint_32 %uint_3
+ %56 = OpExtInst %void %2 DebugTypeComposite %4 %uint_1 %37 %uint_13 %uint_9 %38 %4 %uint_32 %uint_3 %55
+ %57 = OpExtInst %void %2 DebugEntryPoint %53 %42 %4 %4
+ %3 = OpFunction %void None %29
+ %58 = OpLabel
+ %59 = OpVariable %_ptr_Function_16 Function
+ %60 = OpLoad %16 %32
+ OpStore %59 %60
+ %61 = OpExtInst %void %2 DebugDeclare %49 %59 %34
+ %62 = OpExtInst %void %2 DebugLine %37 %uint_0 %uint_0 %uint_2 %uint_2
+; CHECK: OpImageTexelPointer %_ptr_Image_uint [[GV]] %uint_0 %uint_0
+ %63 = OpImageTexelPointer %_ptr_Image_uint %59 %uint_0 %uint_0
+ %64 = OpAtomicIAdd %uint %63 %uint_1 %uint_0 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, false);
+}
+
+TEST_F(CopyPropArrayPassTest, DebugInstNotDominatingStore) {
+ // Move the debug value to after the new access chain instruction.
+ const std::string before = R"(
+ OpCapability Shader
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %2 "main" %3
+ OpExecutionMode %2 LocalSize 1 1 1
+ OpExecutionMode %2 OutputTrianglesEXT
+ OpExecutionMode %2 OutputVertices 64
+ OpExecutionMode %2 OutputPrimitivesEXT 124
+ %4 = OpString ""
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+ %_struct_10 = OpTypeStruct %_arr_uint_uint_32
+%_ptr_TaskPayloadWorkgroupEXT__struct_10 = OpTypePointer TaskPayloadWorkgroupEXT %_struct_10
+ %uint_124 = OpConstant %uint 124
+ %uint_64 = OpConstant %uint 64
+ %void = OpTypeVoid
+ %uint_6 = OpConstant %uint 6
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_4 = OpConstant %uint 4
+ %uint_5 = OpConstant %uint 5
+ %uint_1024 = OpConstant %uint 1024
+ %uint_7 = OpConstant %uint 7
+ %uint_8 = OpConstant %uint 8
+ %uint_3 = OpConstant %uint 3
+ %uint_96 = OpConstant %uint 96
+ %uint_11 = OpConstant %uint 11
+ %uint_12 = OpConstant %uint 12
+ %uint_10 = OpConstant %uint 10
+ %uint_16 = OpConstant %uint 16
+ %uint_21 = OpConstant %uint 21
+ %uint_17 = OpConstant %uint 17
+ %uint_26 = OpConstant %uint 26
+ %32 = OpTypeFunction %void
+%_ptr_Function__arr_uint_uint_32 = OpTypePointer Function %_arr_uint_uint_32
+ %3 = OpVariable %_ptr_TaskPayloadWorkgroupEXT__struct_10 TaskPayloadWorkgroupEXT
+ %34 = OpExtInst %void %1 DebugOperation %uint_0
+ %35 = OpExtInst %void %1 DebugTypeBasic %4 %uint_32 %uint_6 %uint_0
+ %36 = OpExtInst %void %1 DebugSource %4 %4
+ %37 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %36 %uint_5
+ %38 = OpExtInst %void %1 DebugTypeArray %35 %uint_32
+ %39 = OpExtInst %void %1 DebugTypeMember %4 %38 %36 %uint_7 %uint_8 %uint_0 %uint_1024 %uint_3
+ %40 = OpExtInst %void %1 DebugTypeComposite %4 %uint_1 %36 %uint_6 %uint_8 %37 %4 %uint_1024 %uint_3 %39
+ %41 = OpExtInst %void %1 DebugTypeVector %35 %uint_3
+ %42 = OpExtInst %void %1 DebugTypeArray %41 %uint_124
+ %43 = OpExtInst %void %1 DebugTypeBasic %4 %uint_32 %uint_3 %uint_0
+ %44 = OpExtInst %void %1 DebugTypeVector %43 %uint_3
+ %45 = OpExtInst %void %1 DebugTypeMember %4 %44 %36 %uint_11 %uint_12 %uint_0 %uint_96 %uint_3
+ %46 = OpExtInst %void %1 DebugTypeComposite %4 %uint_1 %36 %uint_10 %uint_8 %37 %4 %uint_96 %uint_3 %45
+ %47 = OpExtInst %void %1 DebugTypeArray %46 %uint_64
+ %48 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void %40 %35 %42 %47
+ %49 = OpExtInst %void %1 DebugFunction %4 %48 %36 %uint_16 %uint_1 %37 %4 %uint_3 %uint_21
+ %50 = OpExtInst %void %1 DebugLocalVariable %4 %40 %36 %uint_17 %uint_26 %49 %uint_4 %uint_1
+ %51 = OpExtInst %void %1 DebugExpression %34
+; CHECK: OpFunction
+ %2 = OpFunction %void None %32
+ %52 = OpLabel
+ %53 = OpVariable %_ptr_Function__arr_uint_uint_32 Function
+; CHECK: [[new_ptr:%\w+]] = OpAccessChain %_ptr_TaskPayloadWorkgroupEXT__arr_uint_uint_32
+; CHECK: OpExtInst %void %1 DebugValue {{%\w+}} [[new_ptr]]
+ %54 = OpExtInst %void %1 DebugValue %50 %53 %51 %int_0
+ %55 = OpLoad %_struct_10 %3
+ %56 = OpCompositeExtract %_arr_uint_uint_32 %55 0
+ OpStore %53 %56
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, false);
+}
+
+TEST_F(CopyPropArrayPassTest, DebugInstNotDominatingStoreInDifferentBB) {
+ // Move the debug value to after the new access chain instruction.
+ const std::string before = R"(
+ OpCapability Shader
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %2 "main" %3
+ OpExecutionMode %2 LocalSize 1 1 1
+ OpExecutionMode %2 OutputTrianglesEXT
+ OpExecutionMode %2 OutputVertices 64
+ OpExecutionMode %2 OutputPrimitivesEXT 124
+ %4 = OpString ""
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+ %_struct_10 = OpTypeStruct %_arr_uint_uint_32
+%_ptr_TaskPayloadWorkgroupEXT__struct_10 = OpTypePointer TaskPayloadWorkgroupEXT %_struct_10
+ %uint_124 = OpConstant %uint 124
+ %uint_64 = OpConstant %uint 64
+ %void = OpTypeVoid
+ %uint_6 = OpConstant %uint 6
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_4 = OpConstant %uint 4
+ %uint_5 = OpConstant %uint 5
+ %uint_1024 = OpConstant %uint 1024
+ %uint_7 = OpConstant %uint 7
+ %uint_8 = OpConstant %uint 8
+ %uint_3 = OpConstant %uint 3
+ %uint_96 = OpConstant %uint 96
+ %uint_11 = OpConstant %uint 11
+ %uint_12 = OpConstant %uint 12
+ %uint_10 = OpConstant %uint 10
+ %uint_16 = OpConstant %uint 16
+ %uint_21 = OpConstant %uint 21
+ %uint_17 = OpConstant %uint 17
+ %uint_26 = OpConstant %uint 26
+ %32 = OpTypeFunction %void
+%_ptr_Function__arr_uint_uint_32 = OpTypePointer Function %_arr_uint_uint_32
+ %3 = OpVariable %_ptr_TaskPayloadWorkgroupEXT__struct_10 TaskPayloadWorkgroupEXT
+ %34 = OpExtInst %void %1 DebugOperation %uint_0
+ %35 = OpExtInst %void %1 DebugTypeBasic %4 %uint_32 %uint_6 %uint_0
+ %36 = OpExtInst %void %1 DebugSource %4 %4
+ %37 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %36 %uint_5
+ %38 = OpExtInst %void %1 DebugTypeArray %35 %uint_32
+ %39 = OpExtInst %void %1 DebugTypeMember %4 %38 %36 %uint_7 %uint_8 %uint_0 %uint_1024 %uint_3
+ %40 = OpExtInst %void %1 DebugTypeComposite %4 %uint_1 %36 %uint_6 %uint_8 %37 %4 %uint_1024 %uint_3 %39
+ %41 = OpExtInst %void %1 DebugTypeVector %35 %uint_3
+ %42 = OpExtInst %void %1 DebugTypeArray %41 %uint_124
+ %43 = OpExtInst %void %1 DebugTypeBasic %4 %uint_32 %uint_3 %uint_0
+ %44 = OpExtInst %void %1 DebugTypeVector %43 %uint_3
+ %45 = OpExtInst %void %1 DebugTypeMember %4 %44 %36 %uint_11 %uint_12 %uint_0 %uint_96 %uint_3
+ %46 = OpExtInst %void %1 DebugTypeComposite %4 %uint_1 %36 %uint_10 %uint_8 %37 %4 %uint_96 %uint_3 %45
+ %47 = OpExtInst %void %1 DebugTypeArray %46 %uint_64
+ %48 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void %40 %35 %42 %47
+ %49 = OpExtInst %void %1 DebugFunction %4 %48 %36 %uint_16 %uint_1 %37 %4 %uint_3 %uint_21
+ %50 = OpExtInst %void %1 DebugLocalVariable %4 %40 %36 %uint_17 %uint_26 %49 %uint_4 %uint_1
+ %51 = OpExtInst %void %1 DebugExpression %34
+; CHECK: OpFunction
+ %2 = OpFunction %void None %32
+ %52 = OpLabel
+ %53 = OpVariable %_ptr_Function__arr_uint_uint_32 Function
+; CHECK: [[new_ptr:%\w+]] = OpAccessChain %_ptr_TaskPayloadWorkgroupEXT__arr_uint_uint_32
+; CHECK: OpExtInst %void %1 DebugValue {{%\w+}} [[new_ptr]]
+ %54 = OpExtInst %void %1 DebugValue %50 %53 %51 %int_0
+ %55 = OpLoad %_struct_10 %3
+ %56 = OpCompositeExtract %_arr_uint_uint_32 %55 0
+ OpBranch %57
+ %57 = OpLabel
+ OpStore %53 %56
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ SinglePassRunAndMatch<CopyPropagateArrays>(before, false);
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/debug_info_manager_test.cpp b/third_party/SPIRV-Tools/test/opt/debug_info_manager_test.cpp
index 3df26a9..0283370 100644
--- a/third_party/SPIRV-Tools/test/opt/debug_info_manager_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/debug_info_manager_test.cpp
@@ -767,8 +767,6 @@
%101 = OpExtInst %void %1 DebugScope %22
OpLine %5 13 7
OpStore %100 %31
- OpNoLine
- %102 = OpExtInst %void %1 DebugNoScope
%36 = OpExtInst %void %1 DebugDeclare %25 %100 %13
OpReturn
OpFunctionEnd
@@ -799,6 +797,84 @@
7);
}
+TEST(DebugInfoManager, ConvertGlobalToLocal) {
+ const std::string text = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %2 "PSMain" %3
+ OpExecutionMode %2 OriginUpperLeft
+ %4 = OpString "C:\\local\\Temp\\2528091a-6811-4e62-9ed5-02f1547c2016.hlsl"
+ %5 = OpString "float"
+ %6 = OpString "Pi"
+ %float = OpTypeFloat 32
+%float_3_1415 = OpConstant %float 3.1415
+ %uint = OpTypeInt 32 0
+ %uint_32 = OpConstant %uint 32
+%_ptr_Private_float = OpTypePointer Private %float
+%_ptr_Function_float = OpTypePointer Function %float
+ %void = OpTypeVoid
+ %uint_3 = OpConstant %uint 3
+ %uint_0 = OpConstant %uint 0
+ %uint_4 = OpConstant %uint 4
+ %uint_1 = OpConstant %uint 1
+ %uint_5 = OpConstant %uint 5
+ %uint_8 = OpConstant %uint 8
+ %uint_6 = OpConstant %uint 6
+ %uint_20 = OpConstant %uint 20
+ %25 = OpTypeFunction %void
+ %uint_11 = OpConstant %uint 11
+ %3 = OpVariable %_ptr_Private_float Private
+ %8 = OpExtInst %void %1 DebugTypeBasic %5 %uint_32 %uint_3 %uint_0
+ %12 = OpExtInst %void %1 DebugSource %4
+ %13 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %12 %uint_5
+ %17 = OpExtInst %void %1 DebugGlobalVariable %6 %8 %12 %uint_6 %uint_20 %13 %6 %3 %uint_8
+ %2 = OpFunction %void None %25
+ %27 = OpLabel
+ %29 = OpVariable %_ptr_Function_float Function
+ OpStore %3 %float_3_1415
+ %28 = OpExtInst %void %1 DebugLine %12 %uint_11 %uint_11 %uint_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ std::unique_ptr<IRContext> context =
+ BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ auto* def_use_mgr = context->get_def_use_mgr();
+ auto* dbg_var = def_use_mgr->GetDef(17);
+ EXPECT_EQ(dbg_var->GetCommonDebugOpcode(),
+ OpenCLDebugInfo100DebugGlobalVariable);
+ EXPECT_EQ(dbg_var->NumInOperands(), 11);
+
+ std::vector<Operand> originalOperands;
+ for (uint32_t i = 0; i < dbg_var->NumInOperands(); ++i) {
+ originalOperands.emplace_back(dbg_var->GetInOperand((i)));
+ }
+
+ auto* local_var = def_use_mgr->GetDef(29);
+ auto* dbg_info_mgr = context->get_debug_info_mgr();
+ dbg_info_mgr->ConvertDebugGlobalToLocalVariable(dbg_var, local_var);
+
+ EXPECT_EQ(dbg_var->NumInOperands(), 9);
+
+ // This checks that the first two inoperands are correct.
+ EXPECT_EQ(dbg_var->GetCommonDebugOpcode(),
+ OpenCLDebugInfo100DebugLocalVariable);
+
+ // Then next 6 operands should be the same as the original instruction.
+ EXPECT_EQ(dbg_var->GetInOperand(2), originalOperands[2]);
+ EXPECT_EQ(dbg_var->GetInOperand(3), originalOperands[3]);
+ EXPECT_EQ(dbg_var->GetInOperand(4), originalOperands[4]);
+ EXPECT_EQ(dbg_var->GetInOperand(5), originalOperands[5]);
+ EXPECT_EQ(dbg_var->GetInOperand(6), originalOperands[6]);
+ EXPECT_EQ(dbg_var->GetInOperand(7), originalOperands[7]);
+
+ // The flags operand should have shifted because operand 8 and 9 in the global
+ // instruction are not relevant.
+ EXPECT_EQ(dbg_var->GetInOperand(8), originalOperands[10]);
+}
+
} // namespace
} // namespace analysis
} // namespace opt
diff --git a/third_party/SPIRV-Tools/test/opt/desc_sroa_test.cpp b/third_party/SPIRV-Tools/test/opt/desc_sroa_test.cpp
index 5c166d8..f86fa3a 100644
--- a/third_party/SPIRV-Tools/test/opt/desc_sroa_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/desc_sroa_test.cpp
@@ -198,7 +198,8 @@
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, ExpandArrayOfSamplers) {
@@ -249,7 +250,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, ExpandArrayOfSSBOs) {
@@ -308,7 +310,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, NameNewVariables) {
@@ -370,7 +373,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, DontExpandCBuffers) {
@@ -430,7 +434,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, DontExpandStructuredBuffers) {
@@ -497,7 +502,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, StructureArrayNames) {
@@ -511,7 +517,39 @@
)";
const std::string text = checks + GetStructureArrayTestSpirv();
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
+}
+
+TEST_F(DescriptorScalarReplacementTest,
+ FlattensArraysOfStructsButNoResourceArrays) {
+ // Check that only the composite array is flattenned, but internal resource
+ // arrays are left as-is.
+ const std::string checks = R"(
+; CHECK: OpName %globalS_0__0__t "globalS[0][0].t"
+; CHECK: OpName %globalS_0__0__s "globalS[0][0].s"
+; CHECK: OpName %globalS_1__1__t "globalS[1][1].t"
+; CHECK: OpName %globalS_1__1__s "globalS[1][1].s"
+; CHECK-NOT: OpName %globalS_1__1__t_0_
+; CHECK-NOT: OpName %globalS_1__1__s_0_
+ )";
+
+ const std::string text = checks + GetStructureArrayTestSpirv();
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/false);
+}
+
+TEST_F(DescriptorScalarReplacementTest, FlattenNothingIfAskedTo) {
+ // Not useful, but checks what happens if both are set to false.
+ // In such case, nothing happens.
+ const std::string checks = R"(
+; CHECK: OpName %globalS
+; CHECK-NOT: OpName %globalS_
+ )";
+
+ const std::string text = checks + GetStructureArrayTestSpirv();
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/false, /* flatten_arrays=*/false);
}
TEST_F(DescriptorScalarReplacementTest, StructureArrayBindings) {
@@ -525,7 +563,8 @@
)";
const std::string text = checks + GetStructureArrayTestSpirv();
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, StructureArrayReplacements) {
@@ -540,7 +579,8 @@
)";
const std::string text = checks + GetStructureArrayTestSpirv();
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, ResourceStructAsFunctionParam) {
@@ -724,7 +764,9 @@
; CHECK: OpFAdd %v4float [[sample_3]] [[sample_4]]
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(checks + shader, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ checks + shader, true, /* flatten_composites=*/true,
+ /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, BindingForResourceArrayOfStructs) {
@@ -765,7 +807,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(shader, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ shader, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, MemberDecorationForResourceStruct) {
@@ -828,7 +871,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(shader, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ shader, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, DecorateStringForReflect) {
@@ -915,7 +959,8 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(shader, true);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ shader, true, /* flatten_composites=*/true, /* flatten_arrays=*/true);
}
TEST_F(DescriptorScalarReplacementTest, ExpandArrayInOpEntryPoint) {
@@ -983,7 +1028,161 @@
OpFunctionEnd
)";
- SinglePassRunAndMatch<DescriptorScalarReplacement>(text, false);
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, false, /* flatten_composites=*/true, /* flatten_arrays=*/true);
+}
+
+TEST_F(DescriptorScalarReplacementTest,
+ ExpandArrayWhenCompositeExpensionIsOff) {
+ const std::string text = R"(; SPIR-V
+; Version: 1.6
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+
+; CHECK: OpEntryPoint GLCompute %main "main" %output_0_ %output_1_
+
+ OpEntryPoint GLCompute %main "main" %output
+ OpExecutionMode %main LocalSize 1 1 1
+ OpSource HLSL 670
+ OpName %type_RWByteAddressBuffer "type.RWByteAddressBuffer"
+ OpName %output "output"
+ OpName %main "main"
+ OpName %src_main "src.main"
+ OpName %bb_entry "bb.entry"
+
+; CHECK: OpDecorate %output_1_ DescriptorSet 0
+; CHECK: OpDecorate %output_1_ Binding 1
+; CHECK: OpDecorate %output_0_ DescriptorSet 0
+; CHECK: OpDecorate %output_0_ Binding 0
+
+ OpDecorate %output DescriptorSet 0
+ OpDecorate %output Binding 0
+
+ OpDecorate %_runtimearr_uint ArrayStride 4
+ OpMemberDecorate %type_RWByteAddressBuffer 0 Offset 0
+ OpDecorate %type_RWByteAddressBuffer Block
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %uint_2 = OpConstant %uint 2
+ %uint_32 = OpConstant %uint 32
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%type_RWByteAddressBuffer = OpTypeStruct %_runtimearr_uint
+%_arr_type_RWByteAddressBuffer_uint_2 = OpTypeArray %type_RWByteAddressBuffer %uint_2
+%_ptr_StorageBuffer__arr_type_RWByteAddressBuffer_uint_2 = OpTypePointer StorageBuffer %_arr_type_RWByteAddressBuffer_uint_2
+ %void = OpTypeVoid
+ %23 = OpTypeFunction %void
+%_ptr_StorageBuffer_type_RWByteAddressBuffer = OpTypePointer StorageBuffer %type_RWByteAddressBuffer
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+
+; CHECK: %output_1_ = OpVariable %_ptr_StorageBuffer_type_RWByteAddressBuffer StorageBuffer
+; CHECK: %output_0_ = OpVariable %_ptr_StorageBuffer_type_RWByteAddressBuffer StorageBuffer
+
+ %output = OpVariable %_ptr_StorageBuffer__arr_type_RWByteAddressBuffer_uint_2 StorageBuffer
+
+ %main = OpFunction %void None %23
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %src_main
+ OpReturn
+ OpFunctionEnd
+ %src_main = OpFunction %void None %23
+ %bb_entry = OpLabel
+ %28 = OpAccessChain %_ptr_StorageBuffer_type_RWByteAddressBuffer %output %int_1
+ %29 = OpShiftRightLogical %uint %uint_0 %uint_2
+ %30 = OpAccessChain %_ptr_StorageBuffer_uint %28 %uint_0 %29
+ OpStore %30 %uint_32
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, false, /* flatten_composites=*/false, /* flatten_arrays=*/true);
+}
+
+TEST_F(DescriptorScalarReplacementTest, ExpandStructButNotArray) {
+ const std::string text = R"(; SPIR-V
+; Version: 1.6
+; Generator: Khronos SPIR-V Tools Assembler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %out_var_SV_Target
+ OpExecutionMode %main OriginUpperLeft
+ OpSource HLSL 660
+ OpName %type_2d_image "type.2d.image"
+ OpName %Textures "Textures"
+ OpName %type_sampler "type.sampler"
+ OpName %out_var_SV_Target "out.var.SV_Target"
+ OpName %main "main"
+ OpName %type_sampled_image "type.sampled.image"
+ OpName %TheStruct "TheStruct"
+ OpMemberName %StructOfResources 0 "Texture"
+ OpMemberName %StructOfResources 1 "Sampler"
+; CHECK: OpName %TheStruct_Sampler "TheStruct.Sampler"
+; CHECK: OpName %TheStruct_Texture "TheStruct.Texture"
+ OpDecorate %out_var_SV_Target Location 0
+ OpDecorate %Textures DescriptorSet 0
+ OpDecorate %Textures Binding 0
+ OpDecorate %TheStruct DescriptorSet 0
+ OpDecorate %TheStruct Binding 10
+; CHECK: OpDecorate %TheStruct_Sampler DescriptorSet 0
+; CHECK: OpDecorate %TheStruct_Sampler Binding 11
+; CHECK: OpDecorate %TheStruct_Texture DescriptorSet 0
+; CHECK: OpDecorate %TheStruct_Texture Binding 10
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float = OpTypeFloat 32
+ %float_0 = OpConstant %float 0
+ %v2float = OpTypeVector %float 2
+ %13 = OpConstantComposite %v2float %float_0 %float_0
+ %uint = OpTypeInt 32 0
+ %uint_10 = OpConstant %uint 10
+ %type_2d_image = OpTypeImage %float 2D 2 0 0 1 Unknown
+ %_arr_type_2d_image_uint_10 = OpTypeArray %type_2d_image %uint_10
+%_ptr_UniformConstant__arr_type_2d_image_uint_10 = OpTypePointer UniformConstant %_arr_type_2d_image_uint_10
+ %type_sampler = OpTypeSampler
+ %StructOfResources = OpTypeStruct %type_2d_image %type_sampler
+%_ptr_UniformConstant__struct_18 = OpTypePointer UniformConstant %StructOfResources
+ %v4float = OpTypeVector %float 4
+ %_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %23 = OpTypeFunction %void
+%_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
+ %_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
+ %type_sampled_image = OpTypeSampledImage %type_2d_image
+ %Textures = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_10 UniformConstant
+ %out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+ %TheStruct = OpVariable %_ptr_UniformConstant__struct_18 UniformConstant
+ %main = OpFunction %void None %23
+ %26 = OpLabel
+ %27 = OpAccessChain %_ptr_UniformConstant_type_2d_image %Textures %int_0
+ %28 = OpLoad %type_2d_image %27
+ %29 = OpAccessChain %_ptr_UniformConstant_type_sampler %TheStruct %int_1
+ %31 = OpLoad %type_sampler %29
+; CHECK: %31 = OpLoad %type_sampler %TheStruct_Sampler
+ %32 = OpSampledImage %type_sampled_image %28 %31
+ %33 = OpImageSampleImplicitLod %v4float %32 %13 None
+ %34 = OpAccessChain %_ptr_UniformConstant_type_2d_image %TheStruct %int_0
+ %35 = OpLoad %type_2d_image %34
+; CHECK: %35 = OpLoad %type_2d_image %TheStruct_Texture
+ %36 = OpAccessChain %_ptr_UniformConstant_type_sampler %TheStruct %int_1
+ %37 = OpLoad %type_sampler %36
+; CHECK: %37 = OpLoad %type_sampler %TheStruct_Sampler
+ %38 = OpSampledImage %type_sampled_image %35 %37
+ %39 = OpImageSampleImplicitLod %v4float %38 %13 None
+ %40 = OpFAdd %v4float %33 %39
+ OpStore %out_var_SV_Target %40
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ SinglePassRunAndMatch<DescriptorScalarReplacement>(
+ text, false, /* flatten_composites=*/true, /* flatten_arrays=*/false);
}
} // namespace
diff --git a/third_party/SPIRV-Tools/test/opt/eliminate_dead_member_test.cpp b/third_party/SPIRV-Tools/test/opt/eliminate_dead_member_test.cpp
index bb0ec03..8640865 100644
--- a/third_party/SPIRV-Tools/test/opt/eliminate_dead_member_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/eliminate_dead_member_test.cpp
@@ -958,7 +958,7 @@
; CHECK: OpMemberDecorate %type__Globals 1 Offset 16
; CHECK: %type__Globals = OpTypeStruct %float %float
; CHECK: [[ac:%\w+]] = OpAccessChain %_ptr_Uniform_type__Globals %_Globals %uint_0
-; CHECK: OpPtrAccessChain %_ptr_Uniform_float [[ac]] %uint_1 %uint_0
+; CHECK: OpPtrAccessChain %_ptr_Uniform_float [[ac]] %uint_0 %uint_0
; CHECK: OpPtrAccessChain %_ptr_Uniform_float [[ac]] %uint_0 %uint_1
OpCapability Shader
OpCapability VariablePointersStorageBuffer
@@ -995,7 +995,7 @@
%main = OpFunction %void None %14
%16 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_type__Globals %_Globals %uint_0
- %18 = OpPtrAccessChain %_ptr_Uniform_float %17 %uint_1 %uint_0
+ %18 = OpPtrAccessChain %_ptr_Uniform_float %17 %uint_0 %uint_0
%19 = OpPtrAccessChain %_ptr_Uniform_float %17 %uint_0 %uint_2
OpReturn
OpFunctionEnd
diff --git a/third_party/SPIRV-Tools/test/opt/fix_storage_class_test.cpp b/third_party/SPIRV-Tools/test/opt/fix_storage_class_test.cpp
index 684e006..01a75e0 100644
--- a/third_party/SPIRV-Tools/test/opt/fix_storage_class_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/fix_storage_class_test.cpp
@@ -916,6 +916,123 @@
SinglePassRunAndMatch<FixStorageClass>(text, false);
}
+TEST_F(FixStorageClassTest, CorrectlyProcessAccessChainOnCoopMatrix) {
+ const std::string text = R"(OpCapability CooperativeMatrixKHR
+OpCapability Shader
+OpExtension "SPV_KHR_cooperative_matrix"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %1 "main"
+OpExecutionMode %1 LocalSize 64 1 1
+OpSource HLSL 600
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_3 = OpConstant %uint 3
+%uint_16 = OpConstant %uint 16
+%uint_4 = OpConstant %uint 4
+%9 = OpTypeCooperativeMatrixKHR %int %uint_3 %uint_16 %uint_4 %uint_0
+%void = OpTypeVoid
+%11 = OpTypeFunction %void
+%_struct_12 = OpTypeStruct %9
+%_ptr_Function__struct_12 = OpTypePointer Function %_struct_12
+%_ptr_Function_9 = OpTypePointer Function %9
+%_ptr_Function_int = OpTypePointer Function %int
+%_ptr_Function__ptr_Function_int = OpTypePointer Function %_ptr_Function_int
+%1 = OpFunction %void None %11
+%17 = OpLabel
+%18 = OpVariable %_ptr_Function__ptr_Function_int Function
+%19 = OpVariable %_ptr_Function__struct_12 Function
+%20 = OpAccessChain %_ptr_Function_9 %19 %int_0
+%21 = OpAccessChain %_ptr_Function_int %20 %uint_4
+OpStore %18 %21
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndCheck<FixStorageClass>(text, text, false, false);
+}
+
+// Tests that the pass is not confused when there are multiple definitions
+// of a pointer type to the same type with the same storage class.
+TEST_F(FixStorageClassTest, DuplicatePointerType) {
+ const std::string text = R"(OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %1 "main"
+OpExecutionMode %1 LocalSize 64 1 1
+OpSource HLSL 600
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_3 = OpConstant %uint 3
+%_arr_uint_uint_3 = OpTypeArray %uint %uint_3
+%void = OpTypeVoid
+%7 = OpTypeFunction %void
+%_struct_8 = OpTypeStruct %_arr_uint_uint_3
+%_ptr_Function__struct_8 = OpTypePointer Function %_struct_8
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__arr_uint_uint_3 = OpTypePointer Function %_arr_uint_uint_3
+%_ptr_Function_uint_0 = OpTypePointer Function %uint
+%_ptr_Function__ptr_Function_uint_0 = OpTypePointer Function %_ptr_Function_uint_0
+%1 = OpFunction %void None %7
+%14 = OpLabel
+%15 = OpVariable %_ptr_Function__ptr_Function_uint_0 Function
+%16 = OpVariable %_ptr_Function__struct_8 Function
+%17 = OpAccessChain %_ptr_Function__arr_uint_uint_3 %16 %uint_0
+%18 = OpAccessChain %_ptr_Function_uint_0 %17 %uint_0
+OpStore %15 %18
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndCheck<FixStorageClass>(text, text, false);
+}
+
+// This example is generated by DXC when certain inline spiir-v is used.
+// The intention is that the function scope variable will eventually be
+// optimized away, removing the type mismatch. We want to make sure the
+// OpCopyObject is rewritten, and that the pass does not fail.
+TEST_F(FixStorageClassTest, DoNotFailWithMismatchedPointerTypes) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %1 "main" %38
+ OpExecutionMode %1 LocalSize 64 1 1
+ OpSource HLSL 600
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %uint_64 = OpConstant %uint 64
+%_arr_float_uint_64 = OpTypeArray %float %uint_64
+%_ptr_Workgroup__arr_float_uint_64 = OpTypePointer Workgroup %_arr_float_uint_64
+ %void = OpTypeVoid
+ %80 = OpTypeFunction %void
+%_ptr_Workgroup_float = OpTypePointer Workgroup %float
+%_ptr_Function__ptr_Workgroup_float = OpTypePointer Function %_ptr_Workgroup_float
+%_ptr_Workgroup_float_0 = OpTypePointer Workgroup %float
+ %38 = OpVariable %_ptr_Workgroup__arr_float_uint_64 Workgroup
+ %1 = OpFunction %void None %80
+ %98 = OpLabel
+; CHECK: [[var:%\d+]] = OpVariable %_ptr_Function__ptr_Workgroup_float Function
+ %113 = OpVariable %_ptr_Function__ptr_Workgroup_float Function
+; CHECK: [[ac:%\d+]] = OpAccessChain %_ptr_Workgroup_float_0 {{%\d+}} %int_0
+ %136 = OpAccessChain %_ptr_Workgroup_float_0 %38 %int_0
+; Verify that the type for the OpCopyObject has changed to match [[ac]].
+; CHECK: [[copy:%\d+]] = OpCopyObject %_ptr_Workgroup_float_0 [[ac]]
+ %137 = OpCopyObject %_ptr_Workgroup_float %136
+; This has a type mismatch, but this is because we do not have a way to copy
+; a pointer from one type to another, so FixStorageClass cannot do anything
+; about it. We want fix storage class to leave it as is, and the validator
+; will report an error if the store is not remove by a later optimization.
+; CHECK: OpStore [[var]] [[copy]]
+ OpStore %113 %137
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<FixStorageClass>(text, false);
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/fold_test.cpp b/third_party/SPIRV-Tools/test/opt/fold_test.cpp
index a4e0447..299ad75 100644
--- a/third_party/SPIRV-Tools/test/opt/fold_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/fold_test.cpp
@@ -208,6 +208,9 @@
#define VEC4_0_ID 106
#define DVEC4_0_ID 106
#define HALF_0_ID 108
+#define UINT_0_ID 109
+#define INT_NULL_ID 110
+#define UINT_NULL_ID 111
const std::string& Header() {
static const std::string header = R"(OpCapability Shader
OpCapability Float16
@@ -215,6 +218,8 @@
OpCapability Int8
OpCapability Int16
OpCapability Int64
+OpCapability CooperativeMatrixKHR
+OpExtension "SPV_KHR_cooperative_matrix"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
@@ -282,6 +287,7 @@
%ubyte_1 = OpConstant %ubyte 1
%byte_n1 = OpConstant %byte -1
%100 = OpConstant %int 0 ; Need a def with an numerical id to define id maps.
+%110 = OpConstantNull %int ; Need a def with an numerical id to define id maps.
%103 = OpConstant %int 7 ; Need a def with an numerical id to define id maps.
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
@@ -312,6 +318,8 @@
%long_max = OpConstant %long 9223372036854775807
%ulong_7 = OpConstant %ulong 7
%ulong_4611686018427387904 = OpConstant %ulong 4611686018427387904
+%109 = OpConstant %uint 0 ; Need a def with an numerical id to define id maps.
+%111 = OpConstantNull %uint ; Need a def with an numerical id to define id maps.
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
@@ -434,6 +442,12 @@
%ushort_0xBC00 = OpConstant %ushort 0xBC00
%short_0xBC00 = OpConstant %short 0xBC00
%int_arr_2_undef = OpUndef %int_arr_2
+%int_coop_matrix = OpTypeCooperativeMatrixKHR %int %uint_3 %uint_3 %uint_32 %uint_0
+%undef_int_coop_matrix = OpUndef %int_coop_matrix
+%uint_coop_matrix = OpTypeCooperativeMatrixKHR %uint %uint_3 %uint_3 %uint_32 %uint_0
+%undef_uint_coop_matrix = OpUndef %uint_coop_matrix
+%float_coop_matrix = OpTypeCooperativeMatrixKHR %float %uint_3 %uint_3 %uint_32 %uint_0
+%undef_float_coop_matrix = OpUndef %float_coop_matrix
)";
return header;
@@ -924,7 +938,7 @@
"%2 = OpBitcast %ushort %short_0xBC00\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 2, 0xFFFFBC00),
+ 2, 0xBC00),
// Test case 53: Bit-cast half 1 to ushort
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
@@ -940,7 +954,7 @@
"%2 = OpBitcast %short %ushort_0xBC00\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 2, 0xBC00),
+ 2, 0xFFFFBC00),
// Test case 55: Bit-cast short 0xBC00 to short
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
@@ -996,7 +1010,7 @@
"%2 = OpBitcast %ubyte %byte_n1\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 2, 0xFFFFFFFF),
+ 2, 0xFF),
// Test case 62: Negate 2.
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
@@ -4148,6 +4162,62 @@
"%2 = OpSLessThan %bool %long_0 %long_2\n" +
"OpReturn\n" +
"OpFunctionEnd",
+ 2, 0),
+ // Test case 41: Don't fold OpSNegate for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpSNegate %int_coop_matrix %undef_int_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 42: Don't fold OpIAdd for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpIAdd %int_coop_matrix %undef_int_coop_matrix %undef_int_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 43: Don't fold OpISub for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpISub %int_coop_matrix %undef_int_coop_matrix %undef_int_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 44: Don't fold OpIMul for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpIMul %int_coop_matrix %undef_int_coop_matrix %undef_int_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 45: Don't fold OpSDiv for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpSDiv %int_coop_matrix %undef_int_coop_matrix %undef_int_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 46: Don't fold OpUDiv for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpUDiv %uint_coop_matrix %undef_uint_coop_matrix %undef_uint_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 47: Don't fold OpMatrixTimesScalar for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpMatrixTimesScalar %uint_coop_matrix %undef_uint_coop_matrix %uint_3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
2, 0)
));
@@ -4539,7 +4609,18 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 3),
- // Test case 9: Fold n * 0.0
+ // Test case 9: Don't fold n % 1.0
+ // If `n` is not a whole number, the answer is not 0.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_float Function\n" +
+ "%3 = OpLoad %float %n\n" +
+ "%2 = OpFMod %float %3 %float_1\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 10: Fold n * 0.0
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4549,7 +4630,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, FLOAT_0_ID),
- // Test case 10: Fold 0.0 * n
+ // Test case 11: Fold 0.0 * n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4559,7 +4640,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, FLOAT_0_ID),
- // Test case 11: Fold 0.0 / n
+ // Test case 12: Fold 0.0 / n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4569,7 +4650,17 @@
"OpReturn\n" +
"OpFunctionEnd",
2, FLOAT_0_ID),
- // Test case 12: Don't fold mix(a, b, 2.0)
+ // Test case 13: Fold 0.0 % n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_float Function\n" +
+ "%3 = OpLoad %float %n\n" +
+ "%2 = OpFMod %float %104 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, FLOAT_0_ID),
+ // Test case 14: Don't fold mix(a, b, 2.0)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4581,7 +4672,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 13: Fold mix(a, b, 0.0)
+ // Test case 15: Fold mix(a, b, 0.0)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4593,7 +4684,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 3),
- // Test case 14: Fold mix(a, b, 1.0)
+ // Test case 16: Fold mix(a, b, 1.0)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4605,7 +4696,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 4),
- // Test case 15: Fold vector fadd with null
+ // Test case 17: Fold vector fadd with null
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4615,7 +4706,7 @@
"OpReturn\n" +
"OpFunctionEnd",
3, 2),
- // Test case 16: Fold vector fadd with null
+ // Test case 18: Fold vector fadd with null
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4625,7 +4716,7 @@
"OpReturn\n" +
"OpFunctionEnd",
3, 2),
- // Test case 17: Fold vector fsub with null
+ // Test case 19: Fold vector fsub with null
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4635,7 +4726,7 @@
"OpReturn\n" +
"OpFunctionEnd",
3, 2),
- // Test case 18: Fold 0.0(half) * n
+ // Test case 20: Fold 0.0(half) * n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4645,7 +4736,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, HALF_0_ID),
- // Test case 19: Don't fold 1.0(half) * n
+ // Test case 21: Don't fold 1.0(half) * n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4655,7 +4746,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 20: Don't fold 1.0 * 1.0 (half)
+ // Test case 22: Don't fold 1.0 * 1.0 (half)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4663,7 +4754,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 21: Don't fold (0.0, 1.0) * (0.0, 1.0) (half)
+ // Test case 23: Don't fold (0.0, 1.0) * (0.0, 1.0) (half)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4671,7 +4762,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 22: Don't fold (0.0, 1.0) dotp (0.0, 1.0) (half)
+ // Test case 24: Don't fold (0.0, 1.0) dotp (0.0, 1.0) (half)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4679,7 +4770,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 23: Don't fold 1.0(half) / 2.0(half)
+ // Test case 25: Don't fold 1.0(half) / 2.0(half)
// We do not have to code to emulate 16-bit float operations. Just make sure we do not crash.
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
@@ -4689,6 +4780,54 @@
"%2 = OpFDiv %half %half_1 %half_2\n" +
"OpReturn\n" +
"OpFunctionEnd",
+ 2, 0),
+ // Test case 26: Don't fold OpFNegate for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpFNegate %float_coop_matrix %undef_float_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 27: Don't fold OpIAdd for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpFAdd %float_coop_matrix %undef_float_coop_matrix %undef_float_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 28: Don't fold OpISub for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpFSub %float_coop_matrix %undef_float_coop_matrix %undef_float_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 29: Don't fold OpIMul for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpFMul %float_coop_matrix %undef_float_coop_matrix %undef_float_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 30: Don't fold OpSDiv for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpFDiv %float_coop_matrix %undef_float_coop_matrix %undef_float_coop_matrix\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 0),
+ // Test case 31: Don't fold OpMatrixTimesScalar for cooperative matrices.
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%2 = OpMatrixTimesScalar %float_coop_matrix %undef_float_coop_matrix %float_3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
2, 0)
));
@@ -4908,7 +5047,27 @@
"OpReturn\n" +
"OpFunctionEnd",
2, DVEC4_0_ID),
- // Test case 2: Fold a * vec4(1.0, 1.0, 1.0, 1.0)
+ // Test case 2: Fold a + vec4(0.0, 0.0, 0.0, 0.0)
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_v4double Function\n" +
+ "%3 = OpLoad %v4double %n\n" +
+ "%2 = OpFAdd %v4double %3 %106\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 3: Fold a - vec4(0.0, 0.0, 0.0, 0.0)
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_v4double Function\n" +
+ "%3 = OpLoad %v4double %n\n" +
+ "%2 = OpFSub %v4double %3 %106\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 4: Fold a * vec4(1.0, 1.0, 1.0, 1.0)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4942,7 +5101,57 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 2: Fold n + 0
+ // Test case 2: Fold n | 0
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpBitwiseOr %uint %3 %uint_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 3: Fold n ^ 0
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpBitwiseXor %uint %3 %uint_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 4: Fold n >> 0
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpShiftRightLogical %uint %3 %uint_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 5: Fold n >> 0
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpShiftRightArithmetic %uint %3 %uint_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 6: Fold n << 0
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpShiftLeftLogical %uint %3 %uint_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 7: Fold n + 0
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4952,7 +5161,37 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 3),
- // Test case 3: Fold 0 + n
+ // Test case 8: Fold n - 0
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpISub %uint %3 %uint_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 9: Fold 0 | n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpBitwiseOr %uint %uint_0 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 10: Fold 0 ^ n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpBitwiseXor %uint %uint_0 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 11: Fold 0 + n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4962,7 +5201,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 3),
- // Test case 4: Don't fold n + (1,0)
+ // Test case 12: Don't fold n + (1,0)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4972,7 +5211,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 5: Don't fold (1,0) + n
+ // Test case 13: Don't fold (1,0) + n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4982,7 +5221,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 6: Fold n + (0,0)
+ // Test case 14: Fold n + (0,0)
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -4992,7 +5231,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 3),
- // Test case 7: Fold (0,0) + n
+ // Test case 15: Fold (0,0) + n
InstructionFoldingCase<uint32_t>(
Header() + "%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
@@ -5002,7 +5241,117 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 3),
- // Test case 8: Don't fold because of undefined value. Using 4294967295
+ // Test case 16: Fold n | (0,0)
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_v2int Function\n" +
+ "%3 = OpLoad %v2int %n\n" +
+ "%2 = OpBitwiseOr %v2int %3 %v2int_0_0\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 17: Fold (0,0) | n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_v2int Function\n" +
+ "%3 = OpLoad %v2int %n\n" +
+ "%2 = OpBitwiseOr %v2int %v2int_0_0 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, 3),
+ // Test case 18: Fold 0 >> n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpShiftRightLogical %uint %109 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, UINT_0_ID),
+ // Test case 19: Fold 0 >> n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpShiftRightArithmetic %uint %109 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, UINT_0_ID),
+ // Test case 20: Fold 0 << n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpShiftLeftLogical %uint %109 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, UINT_0_ID),
+ // Test case 21: Fold 0 / n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %int %n\n" +
+ "%2 = OpSDiv %int %100 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, INT_0_ID),
+ // Test case 22: Fold 0 / n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpUDiv %uint %109 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, UINT_0_ID),
+ // Test case 23: Fold 0 % n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpSMod %int %int_0 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, INT_0_ID),
+ // Test case 24: Fold 0 % n
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpUMod %uint %109 %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, UINT_0_ID),
+ // Test case 25: Fold n % 1
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %int %n\n" +
+ "%2 = OpSMod %int %3 %int_1\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, INT_NULL_ID),
+ // Test case 26: Fold n % 1
+ InstructionFoldingCase<uint32_t>(
+ Header() + "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%n = OpVariable %_ptr_uint Function\n" +
+ "%3 = OpLoad %uint %n\n" +
+ "%2 = OpUMod %uint %3 %uint_1\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 2, UINT_NULL_ID),
+ // Test case 27: Don't fold because of undefined value. Using 4294967295
// means that entry is undefined. We do not expect it to ever happen, so
// not worth folding.
InstructionFoldingCase<uint32_t>(
@@ -5014,7 +5363,7 @@
"OpReturn\n" +
"OpFunctionEnd",
2, 0),
- // Test case 9: Don't fold because of undefined value. Using 4294967295
+ // Test case 28: Don't fold because of undefined value. Using 4294967295
// means that entry is undefined. We do not expect it to ever happen, so
// not worth folding.
InstructionFoldingCase<uint32_t>(
@@ -5828,7 +6177,195 @@
"%2 = OpFNegate %v2double %v2double_null\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 2, true)
+ 2, true),
+ // Test case 20: fold snegate with OpIMul.
+ // -(x * 2) = x * -2
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" +
+ "; CHECK: [[long_n2:%\\w+]] = OpConstant [[long]] -2\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" +
+ "; CHECK: %4 = OpIMul [[long]] [[ld]] [[long_n2]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_long Function\n" +
+ "%2 = OpLoad %long %var\n" +
+ "%3 = OpIMul %long %2 %long_2\n" +
+ "%4 = OpSNegate %long %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 21: fold snegate with OpIMul.
+ // -(x * 2) = x * -2
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK-DAG: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK-DAG: [[uint:%\\w+]] = OpTypeInt 32 0\n" +
+ "; CHECK: [[uint_n2:%\\w+]] = OpConstant [[uint]] 4294967294\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpIMul [[int]] [[ld]] [[uint_n2]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpIMul %int %2 %uint_2\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 22: fold snegate with OpIMul.
+ // -(-24 * x) = x * 24
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK-DAG: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK: [[int_24:%\\w+]] = OpConstant [[int]] 24\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpIMul [[int]] [[ld]] [[int_24]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpIMul %int %int_n24 %2\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 23: fold snegate with OpIMul with UINT_MAX
+ // -(UINT_MAX * x) = x
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpCopyObject [[int]] [[ld]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpIMul %int %uint_max %2\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 24: fold snegate with OpIMul using -INT_MAX
+ // -(x * 2147483649u) = x * 2147483647u
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK: [[uint:%\\w+]] = OpTypeInt 32 0\n" +
+ "; CHECK: [[uint_2147483647:%\\w+]] = OpConstant [[uint]] 2147483647\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpIMul [[int]] [[ld]] [[uint_2147483647]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpIMul %int %2 %uint_2147483649\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 25: fold snegate with OpSDiv (long).
+ // -(x / 2) = x / -2
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[long:%\\w+]] = OpTypeInt 64 1\n" +
+ "; CHECK: [[long_n2:%\\w+]] = OpConstant [[long]] -2\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[long]]\n" +
+ "; CHECK: %4 = OpSDiv [[long]] [[ld]] [[long_n2]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_long Function\n" +
+ "%2 = OpLoad %long %var\n" +
+ "%3 = OpSDiv %long %2 %long_2\n" +
+ "%4 = OpSNegate %long %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 26: fold snegate with OpSDiv (int).
+ // -(x / 2) = x / -2
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK-DAG: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK-DAG: [[uint:%\\w+]] = OpTypeInt 32 0\n" +
+ "; CHECK: [[uint_n2:%\\w+]] = OpConstant [[uint]] 4294967294\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpSDiv [[int]] [[ld]] [[uint_n2]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpSDiv %int %2 %uint_2\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 27: fold snegate with OpSDiv.
+ // -(-24 / x) = 24 / x
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK-DAG: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK: [[int_24:%\\w+]] = OpConstant [[int]] 24\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpSDiv [[int]] [[int_24]] [[ld]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpSDiv %int %int_n24 %2\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 28: fold snegate with OpSDiv with UINT_MAX
+ // -(UINT_MAX / x) = (1 / x)
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK: [[uint:%\\w+]] = OpTypeInt 32 0\n" +
+ "; CHECK: [[uint_1:%\\w+]] = OpConstant [[uint]] 1\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpSDiv [[int]] [[uint_1]] [[ld]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpSDiv %int %uint_max %2\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 29: fold snegate with OpSDiv using -INT_MAX
+ // -(x / 2147483647u) = x / 2147483647
+ InstructionFoldingCase<bool>(
+ Header() +
+ "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+ "; CHECK: [[uint:%\\w+]] = OpTypeInt 32 0\n" +
+ "; CHECK: [[uint_2147483647:%\\w+]] = OpConstant [[uint]] 2147483647\n" +
+ "; CHECK: [[ld:%\\w+]] = OpLoad [[int]]\n" +
+ "; CHECK: %4 = OpSDiv [[int]] [[ld]] [[uint_2147483647]]\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpSDiv %int %2 %uint_2147483649\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, true),
+ // Test case 30: Don't fold snegate int OpUDiv. The operands are interpreted
+ // as unsigned, so negating an operand is not the same a negating the
+ // result.
+ InstructionFoldingCase<bool>(
+ Header() +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%var = OpVariable %_ptr_int Function\n" +
+ "%2 = OpLoad %int %var\n" +
+ "%3 = OpUDiv %int %2 %uint_1\n" +
+ "%4 = OpSNegate %int %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, false)
));
INSTANTIATE_TEST_SUITE_P(ReciprocalFDivTest, MatchingInstructionFoldingTest,
@@ -7827,7 +8364,21 @@
"%5 = OpCompositeInsert %int_arr_2 %int_1 %4 1\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 5, true)
+ 5, true),
+ // Test case 19: Don't fold for isomorphic structs
+ InstructionFoldingCase<bool>(
+ Header() +
+ "%structA = OpTypeStruct %ulong\n" +
+ "%structB = OpTypeStruct %ulong\n" +
+ "%structC = OpTypeStruct %structB\n" +
+ "%struct_a_undef = OpUndef %structA\n" +
+ "%main = OpFunction %void None %void_func\n" +
+ "%main_lab = OpLabel\n" +
+ "%3 = OpCompositeExtract %ulong %struct_a_undef 0\n" +
+ "%4 = OpCompositeConstruct %structB %3\n" +
+ "OpReturn\n" +
+ "OpFunctionEnd",
+ 4, false)
));
INSTANTIATE_TEST_SUITE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
@@ -7933,21 +8484,15 @@
3, true)
));
+// Issue #5658: The Adreno compiler does not handle 16-bit FMA instructions well.
+// We want to avoid this by not generating FMA. We decided to never generate
+// FMAs because, from a SPIR-V perspective, it is neutral. The ICD can generate
+// the FMA if it wants. The simplest code is no code.
INSTANTIATE_TEST_SUITE_P(FmaGenerationMatchingTest, MatchingInstructionFoldingTest,
::testing::Values(
- // Test case 0: (x * y) + a = Fma(x, y, a)
+ // Test case 0: Don't fold (x * y) + a
InstructionFoldingCase<bool>(
Header() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
"%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
"%x = OpVariable %_ptr_float Function\n" +
@@ -7961,20 +8506,10 @@
"OpStore %a %3\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, true),
- // Test case 1: a + (x * y) = Fma(x, y, a)
+ 3, false),
+ // Test case 1: Don't fold a + (x * y)
InstructionFoldingCase<bool>(
Header() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
"%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
"%x = OpVariable %_ptr_float Function\n" +
@@ -7988,20 +8523,10 @@
"OpStore %a %3\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, true),
- // Test case 2: (x * y) + a = Fma(x, y, a) with vectors
+ 3, false),
+ // Test case 2: Don't fold (x * y) + a with vectors
InstructionFoldingCase<bool>(
Header() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
"%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
"%x = OpVariable %_ptr_v4float Function\n" +
@@ -8015,20 +8540,10 @@
"OpStore %a %3\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, true),
- // Test case 3: a + (x * y) = Fma(x, y, a) with vectors
+ 3,false),
+ // Test case 3: Don't fold a + (x * y) with vectors
InstructionFoldingCase<bool>(
Header() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
"%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
"%x = OpVariable %_ptr_float Function\n" +
@@ -8042,46 +8557,8 @@
"OpStore %a %3\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, true),
- // Test 4: that the OpExtInstImport instruction is generated if it is missing.
- InstructionFoldingCase<bool>(
- std::string() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
- "OpCapability Shader\n" +
- "OpMemoryModel Logical GLSL450\n" +
- "OpEntryPoint Fragment %main \"main\"\n" +
- "OpExecutionMode %main OriginUpperLeft\n" +
- "OpSource GLSL 140\n" +
- "OpName %main \"main\"\n" +
- "%void = OpTypeVoid\n" +
- "%void_func = OpTypeFunction %void\n" +
- "%bool = OpTypeBool\n" +
- "%float = OpTypeFloat 32\n" +
- "%_ptr_float = OpTypePointer Function %float\n" +
- "%main = OpFunction %void None %void_func\n" +
- "%main_lab = OpLabel\n" +
- "%x = OpVariable %_ptr_float Function\n" +
- "%y = OpVariable %_ptr_float Function\n" +
- "%a = OpVariable %_ptr_float Function\n" +
- "%lx = OpLoad %float %x\n" +
- "%ly = OpLoad %float %y\n" +
- "%mul = OpFMul %float %lx %ly\n" +
- "%la = OpLoad %float %a\n" +
- "%3 = OpFAdd %float %mul %la\n" +
- "OpStore %a %3\n" +
- "OpReturn\n" +
- "OpFunctionEnd",
- 3, true),
- // Test 5: Don't fold if the multiple is marked no contract.
+ 3, false),
+ // Test 4: Don't fold if the multiple is marked no contract.
InstructionFoldingCase<bool>(
std::string() +
"OpCapability Shader\n" +
@@ -8110,7 +8587,7 @@
"OpReturn\n" +
"OpFunctionEnd",
3, false),
- // Test 6: Don't fold if the add is marked no contract.
+ // Test 5: Don't fold if the add is marked no contract.
InstructionFoldingCase<bool>(
std::string() +
"OpCapability Shader\n" +
@@ -8139,20 +8616,9 @@
"OpReturn\n" +
"OpFunctionEnd",
3, false),
- // Test case 7: (x * y) - a = Fma(x, y, -a)
+ // Test case 6: Don't fold (x * y) - a
InstructionFoldingCase<bool>(
Header() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[na:%\\w+]] = OpFNegate {{%\\w+}} [[la]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[na]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
"%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
"%x = OpVariable %_ptr_float Function\n" +
@@ -8166,21 +8632,10 @@
"OpStore %a %3\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, true),
- // Test case 8: a - (x * y) = Fma(-x, y, a)
+ 3, false),
+ // Test case 7: Don't fold a - (x * y)
InstructionFoldingCase<bool>(
Header() +
- "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
- "; CHECK: OpFunction\n" +
- "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
- "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
- "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
- "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
- "; CHECK: [[nx:%\\w+]] = OpFNegate {{%\\w+}} [[lx]]\n" +
- "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[nx]] [[ly]] [[la]]\n" +
- "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
"%main = OpFunction %void None %void_func\n" +
"%main_lab = OpLabel\n" +
"%x = OpVariable %_ptr_float Function\n" +
@@ -8194,7 +8649,7 @@
"OpStore %a %3\n" +
"OpReturn\n" +
"OpFunctionEnd",
- 3, true)
+ 3, false)
));
using MatchingInstructionWithNoResultFoldingTest =
diff --git a/third_party/SPIRV-Tools/test/opt/inline_test.cpp b/third_party/SPIRV-Tools/test/opt/inline_test.cpp
index bf79181..272caeb 100644
--- a/third_party/SPIRV-Tools/test/opt/inline_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/inline_test.cpp
@@ -3749,13 +3749,13 @@
%color = OpFunctionParameter %_ptr_Function_v4float
%bb_entry = OpLabel
%140 = OpExtInst %void %1 DebugFunctionDefinition %22 %src_main
- %141 = OpExtInst %void %1 DebugLine %5 %uint_1 %uint_1 %uint_1 %uint_1
+ %141 = OpExtInst %void %1 DebugLine %15 %uint_1 %uint_1 %uint_1 %uint_1
%34 = OpExtInst %void %1 DebugScope %22
%36 = OpExtInst %void %1 DebugDeclare %25 %color %13
%38 = OpExtInst %void %1 DebugScope %26
- %142 = OpExtInst %void %1 DebugLine %5 %uint_2 %uint_2 %uint_10 %uint_10
+ %142 = OpExtInst %void %1 DebugLine %15 %uint_2 %uint_2 %uint_10 %uint_10
%39 = OpLoad %v4float %color
- %143 = OpExtInst %void %1 DebugLine %5 %uint_2 %uint_2 %uint_3 %uint_3
+ %143 = OpExtInst %void %1 DebugLine %15 %uint_2 %uint_2 %uint_3 %uint_3
OpReturnValue %39
OpFunctionEnd
)";
@@ -4433,10 +4433,6 @@
OpMemoryModel PhysicalStorageBuffer64 GLSL450
OpEntryPoint GLCompute %1 "main"
OpExecutionMode %1 LocalSize 8 8 1
- OpDecorate %_ptr_PhysicalStorageBuffer__struct_5 ArrayStride 8
- OpMemberDecorate %_struct_3 0 Offset 0
- OpMemberDecorate %_struct_3 1 Offset 8
- OpDecorate %_ptr_PhysicalStorageBuffer_int ArrayStride 4
OpMemberDecorate %_struct_5 0 Offset 0
OpMemberDecorate %_struct_5 1 Offset 4
OpDecorate %6 Aliased
@@ -4471,6 +4467,86 @@
SinglePassRunAndMatch<InlineExhaustivePass>(text, true);
}
+TEST_F(InlineTest, DebugDeclareWithAccessChain) {
+ const std::string text = R"(
+; CHECK: [[EmptyStruct:%[\w]+]] = OpTypeStruct %float
+; CHECK-DAG: [[Struct:%[\w]+]] = OpTypeStruct [[EmptyStruct]]
+; CHECK-DAG: [[PtrType:%[\w]+]] = OpTypePointer Function [[Struct]]
+; CHECK-DAG: [[EmptyPtrType:%[\w]+]] = OpTypePointer Function [[EmptyStruct]]
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "computeMain"
+ OpExecutionMode %2 LocalSize 1 1 1
+ %3 = OpString "s.hlsl"
+ %4 = OpString "float"
+ %5 = OpString "source"
+ %6 = OpString "a"
+ %7 = OpString "SomeStruct"
+ %8 = OpString "SomeStruct.getA"
+ %9 = OpString ""
+ %10 = OpString "this"
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %uint_32 = OpConstant %uint 32
+ %float = OpTypeFloat 32
+ %void = OpTypeVoid
+ %uint_3 = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %uint_4 = OpConstant %uint 4
+ %uint_5 = OpConstant %uint 5
+ %uint_11 = OpConstant %uint 11
+ %uint_8 = OpConstant %uint 8
+ %uint_288 = OpConstant %uint 288
+ %25 = OpTypeFunction %void
+ %_struct_26 = OpTypeStruct %float
+ %_struct_27 = OpTypeStruct %_struct_26
+%_ptr_Function__struct_27 = OpTypePointer Function %_struct_27
+%_ptr_Function__struct_26 = OpTypePointer Function %_struct_26
+%_ptr_Function_float = OpTypePointer Function %float
+ %30 = OpTypeFunction %float %_ptr_Function__struct_26 %_ptr_Function_float
+ %31 = OpUndef %float
+ %32 = OpExtInst %void %1 DebugTypeBasic %4 %uint_32 %uint_3 %uint_0
+ %33 = OpExtInst %void %1 DebugSource %3 %5
+ %34 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %33 %uint_5
+ %35 = OpExtInst %void %1 DebugTypeMember %6 %32 %33 %uint_3 %uint_11 %uint_0 %uint_32 %uint_3
+ %36 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeComposite %7 %uint_1 %33 %uint_1 %uint_8 %34 %7 %uint_32 %uint_3 %35 %37
+ %38 = OpExtInst %void %1 DebugTypeFunction %uint_3 %32 %36
+ %37 = OpExtInst %void %1 DebugFunction %8 %38 %33 %uint_4 %uint_5 %36 %9 %uint_3 %uint_4
+ %39 = OpExtInst %void %1 DebugLocalVariable %10 %36 %33 %uint_4 %uint_5 %37 %uint_288 %uint_1
+ %52 = OpExtInst %void %1 DebugLocalVariable %10 %32 %33 %uint_4 %uint_5 %37 %uint_288 %uint_1
+ %40 = OpExtInst %void %1 DebugExpression
+; CHECK: OpFunction %void None
+; CHECK: [[Var:%[\w]+]] = OpVariable [[PtrType]] Function
+; CHECK: OpExtInst %void {{%[\w+]+}} DebugDeclare {{%[\w+]+}} [[Var]] {{%[\w+]+}} %int_0
+; CHECK: OpExtInst %void {{%[\w+]+}} DebugDeclare {{%[\w+]+}} [[Var]] {{%[\w+]+}} %int_0 %int_0
+ %2 = OpFunction %void None %25
+ %41 = OpLabel
+ %42 = OpVariable %_ptr_Function__struct_27 Function
+ %43 = OpAccessChain %_ptr_Function__struct_26 %42 %int_0
+ %49 = OpAccessChain %_ptr_Function_float %43 %int_0
+ %44 = OpFunctionCall %float %45 %43 %49
+ OpReturn
+ OpFunctionEnd
+; CHECK: OpFunction %float None
+ %45 = OpFunction %float None %30
+ %46 = OpFunctionParameter %_ptr_Function__struct_26
+ %50 = OpFunctionParameter %_ptr_Function_float
+ %47 = OpLabel
+ %48 = OpExtInst %void %1 DebugDeclare %39 %46 %40
+ %51 = OpExtInst %void %1 DebugDeclare %52 %50 %40
+ OpReturnValue %31
+ OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_VULKAN_1_2);
+ SinglePassRunAndMatch<InlineExhaustivePass>(text, true);
+}
+
// TODO(greg-lunarg): Add tests to verify handling of these cases:
//
// Empty modules
diff --git a/third_party/SPIRV-Tools/test/opt/inst_bindless_check_test.cpp b/third_party/SPIRV-Tools/test/opt/inst_bindless_check_test.cpp
deleted file mode 100644
index 08da367..0000000
--- a/third_party/SPIRV-Tools/test/opt/inst_bindless_check_test.cpp
+++ /dev/null
@@ -1,5312 +0,0 @@
-// Copyright (c) 2017-2022 Valve Corporation
-// Copyright (c) 2017-2022 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Bindless Check Instrumentation Tests.
-
-#include <string>
-#include <vector>
-
-#include "test/opt/pass_fixture.h"
-#include "test/opt/pass_utils.h"
-
-namespace spvtools {
-namespace opt {
-namespace {
-
-using InstBindlessTest = PassTest<::testing::Test>;
-
-static const std::string kFuncName = "inst_bindless_check_desc";
-
-static const std::string kImportDeco = R"(
-;CHECK: OpDecorate %)" + kFuncName + R"( LinkageAttributes ")" +
- kFuncName + R"(" Import
-)";
-
-static const std::string kImportStub = R"(
-;CHECK: %)" + kFuncName + R"( = OpFunction %bool None {{%\w+}}
-;CHECK: OpFunctionEnd
-)";
-
-TEST_F(InstBindlessTest, Simple) {
- // Texture2D g_tColor[128];
- //
- // layout(push_constant) cbuffer PerViewConstantBuffer_t
- // {
- // uint g_nDataIdx;
- // };
- //
- // SamplerState g_sAniso;
- //
- // struct PS_INPUT
- // {
- // float2 vTextureCoords : TEXCOORD2;
- // };
- //
- // struct PS_OUTPUT
- // {
- // float4 vColor : SV_Target0;
- // };
- //
- // PS_OUTPUT MainPs(PS_INPUT i)
- // {
- // PS_OUTPUT ps_output;
- // ps_output.vColor =
- // g_tColor[ g_nDataIdx ].Sample(g_sAniso, i.vTextureCoords.xy);
- // return ps_output;
- // }
-
- const std::string entry = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-)";
-
- // clang-format off
- const std::string names_annots = R"(
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 3
-OpDecorate %g_tColor Binding 0
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %g_sAniso DescriptorSet 0
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0)"
-+ kImportDeco +
-R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-)";
-
- const std::string consts_types_vars = R"(
-%void = OpTypeVoid
-%10 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%16 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_16_uint_128 = OpTypeArray %16 %uint_128
-%_ptr_UniformConstant__arr_16_uint_128 = OpTypePointer UniformConstant %_arr_16_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_16_uint_128 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_16 = OpTypePointer UniformConstant %16
-%24 = OpTypeSampler
-%_ptr_UniformConstant_24 = OpTypePointer UniformConstant %24
-%g_sAniso = OpVariable %_ptr_UniformConstant_24 UniformConstant
-%26 = OpTypeSampledImage %16
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %10
-%29 = OpLabel
-%30 = OpLoad %v2float %i_vTextureCoords
-%31 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%32 = OpLoad %uint %31
-%33 = OpAccessChain %_ptr_UniformConstant_16 %g_tColor %32
-%34 = OpLoad %16 %33
-%35 = OpLoad %24 %g_sAniso
-%36 = OpSampledImage %26 %34 %35
-%37 = OpImageSampleImplicitLod %v4float %36 %30
-OpStore %_entryPointOutput_vColor %37
-;CHECK-NOT: %37 = OpImageSampleImplicitLod %v4float %36 %30
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %37
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_57 {{%\w+}} %uint_3 %uint_0 %32 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %16 %33
-;CHECK: {{%\w+}} = OpSampledImage %26 {{%\w+}} %35
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %30
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(
- entry + names_annots + consts_types_vars + kImportStub + main_func, true,
- 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentMultipleInstructions) {
- // Texture2D g_tColor[128];
- //
- // layout(push_constant) cbuffer PerViewConstantBuffer_t
- // {
- // uint g_nDataIdx;
- // uint g_nDataIdx2;
- // };
- //
- // SamplerState g_sAniso;
- //
- // struct PS_INPUT
- // {
- // float2 vTextureCoords : TEXCOORD2;
- // };
- //
- // struct PS_OUTPUT
- // {
- // float4 vColor : SV_Target0;
- // };
- //
- // PS_OUTPUT MainPs(PS_INPUT i)
- // {
- // PS_OUTPUT ps_output;
- //
- // float t = g_tColor[g_nDataIdx ].Sample(g_sAniso, i.vTextureCoords.xy);
- // float t2 = g_tColor[g_nDataIdx2].Sample(g_sAniso, i.vTextureCoords.xy);
- // ps_output.vColor = t + t2;
- // return ps_output;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 3
-OpDecorate %g_tColor Binding 4
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpMemberDecorate %PerViewConstantBuffer_t 1 Offset 4
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %g_sAniso DescriptorSet 3
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%10 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%int_1 = OpConstant %int 1
-%17 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_17_uint_128 = OpTypeArray %17 %uint_128
-%_ptr_UniformConstant__arr_17_uint_128 = OpTypePointer UniformConstant %_arr_17_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_17_uint_128 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_17 = OpTypePointer UniformConstant %17
-%25 = OpTypeSampler
-%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
-%g_sAniso = OpVariable %_ptr_UniformConstant_25 UniformConstant
-%27 = OpTypeSampledImage %17
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %10
-%30 = OpLabel
-%31 = OpLoad %v2float %i_vTextureCoords
-%32 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%33 = OpLoad %uint %32
-%34 = OpAccessChain %_ptr_UniformConstant_17 %g_tColor %33
-%35 = OpLoad %17 %34
-%36 = OpLoad %25 %g_sAniso
-%37 = OpSampledImage %27 %35 %36
-%38 = OpImageSampleImplicitLod %v4float %37 %31
-;CHECK-NOT: %38 = OpImageSampleImplicitLod %v4float %37 %31
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_60 {{%\w+}} %uint_3 %uint_4 %33 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %17 %34
-;CHECK: {{%\w+}} = OpSampledImage %27 {{%\w+}} %36
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %31
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-%39 = OpAccessChain %_ptr_PushConstant_uint %_ %int_1
-%40 = OpLoad %uint %39
-%41 = OpAccessChain %_ptr_UniformConstant_17 %g_tColor %40
-%42 = OpLoad %17 %41
-%43 = OpSampledImage %27 %42 %36
-%44 = OpImageSampleImplicitLod %v4float %43 %31
-%45 = OpFAdd %v4float %38 %44
-;CHECK-NOT: %44 = OpImageSampleImplicitLod %v4float %43 %31
-;CHECK-NOT: %45 = OpFAdd %v4float %38 %44
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_66 {{%\w+}} %uint_3 %uint_4 %40 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %17 %41
-;CHECK: {{%\w+}} = OpSampledImage %27 {{%\w+}} %36
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %31
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: %45 = OpFAdd %v4float {{%\w+}} {{%\w+}}
-OpStore %_entryPointOutput_vColor %45
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentOpImage) {
- // This test verifies that the pass will correctly instrument shader
- // using OpImage. This test was created by editing the SPIR-V
- // from the Simple test.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability StorageImageReadWithoutFormat
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 3
-OpDecorate %g_tColor Binding 9
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%v2int = OpTypeVector %int 2
-%int_0 = OpConstant %int 0
-%20 = OpTypeImage %float 2D 0 0 0 0 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%39 = OpTypeSampledImage %20
-%_arr_39_uint_128 = OpTypeArray %39 %uint_128
-%_ptr_UniformConstant__arr_39_uint_128 = OpTypePointer UniformConstant %_arr_39_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_39_uint_128 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_39 = OpTypePointer UniformConstant %39
-%_ptr_Input_v2int = OpTypePointer Input %v2int
-%i_vTextureCoords = OpVariable %_ptr_Input_v2int Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%53 = OpLoad %v2int %i_vTextureCoords
-%63 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%64 = OpLoad %uint %63
-%65 = OpAccessChain %_ptr_UniformConstant_39 %g_tColor %64
-%66 = OpLoad %39 %65
-%75 = OpImage %20 %66
-%71 = OpImageRead %v4float %75 %53
-OpStore %_entryPointOutput_vColor %71
-;CHECK-NOT: %71 = OpImageRead %v4float %75 %53
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %71
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_3 %uint_9 %64 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %39 %65
-;CHECK: {{%\w+}} = OpImage %20 {{%\w+}}
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %53
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentSampledImage) {
- // This test verifies that the pass will correctly instrument shader
- // using sampled image. This test was created by editing the SPIR-V
- // from the Simple test.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 4
-OpDecorate %g_tColor Binding 11
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%20 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%39 = OpTypeSampledImage %20
-%_arr_39_uint_128 = OpTypeArray %39 %uint_128
-%_ptr_UniformConstant__arr_39_uint_128 = OpTypePointer UniformConstant %_arr_39_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_39_uint_128 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_39 = OpTypePointer UniformConstant %39
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%53 = OpLoad %v2float %i_vTextureCoords
-%63 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%64 = OpLoad %uint %63
-%65 = OpAccessChain %_ptr_UniformConstant_39 %g_tColor %64
-%66 = OpLoad %39 %65
-%71 = OpImageSampleImplicitLod %v4float %66 %53
-OpStore %_entryPointOutput_vColor %71
-;CHECK-NOT: %71 = OpImageSampleImplicitLod %v4float %66 %53
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %71
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_50 {{%\w+}} %uint_4 %uint_11 %64 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %39 %65
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %53
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentImageWrite) {
- // This test verifies that the pass will correctly instrument shader
- // doing bindless image write. This test was created by editing the SPIR-V
- // from the Simple test.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability StorageImageWriteWithoutFormat
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 30
-OpDecorate %g_tColor Binding 2
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%v2int = OpTypeVector %int 2
-%int_0 = OpConstant %int 0
-%20 = OpTypeImage %float 2D 0 0 0 0 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%80 = OpConstantNull %v4float
-%_arr_20_uint_128 = OpTypeArray %20 %uint_128
-%_ptr_UniformConstant__arr_20_uint_128 = OpTypePointer UniformConstant %_arr_20_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_20_uint_128 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_20 = OpTypePointer UniformConstant %20
-%_ptr_Input_v2int = OpTypePointer Input %v2int
-%i_vTextureCoords = OpVariable %_ptr_Input_v2int Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%53 = OpLoad %v2int %i_vTextureCoords
-%63 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%64 = OpLoad %uint %63
-%65 = OpAccessChain %_ptr_UniformConstant_20 %g_tColor %64
-%66 = OpLoad %20 %65
-OpImageWrite %66 %53 %80
-OpStore %_entryPointOutput_vColor %80
-;CHECK-NOT: OpImageWrite %66 %53 %80
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %80
-;CHECK: %32 = OpLoad %16 %31
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_30 %uint_2 %30 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %16 %31
-;CHECK: OpImageWrite {{%\w+}} %28 %19
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %_entryPointOutput_vColor %19
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentVertexSimple) {
- // This test verifies that the pass will correctly instrument shader
- // doing bindless image write. This test was created by editing the SPIR-V
- // from the Simple test.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability Sampled1D
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Vertex %main "main" %_ %coords2D
-OpSource GLSL 450
-OpName %main "main"
-OpName %lod "lod"
-OpName %coords1D "coords1D"
-OpName %gl_PerVertex "gl_PerVertex"
-OpMemberName %gl_PerVertex 0 "gl_Position"
-OpMemberName %gl_PerVertex 1 "gl_PointSize"
-OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
-OpMemberName %gl_PerVertex 3 "gl_CullDistance"
-OpName %_ ""
-OpName %texSampler1D "texSampler1D"
-OpName %foo "foo"
-OpMemberName %foo 0 "g_idx"
-OpName %__0 ""
-OpName %coords2D "coords2D"
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_VertexIndex BuiltIn VertexIndex
-;CHECK: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
-OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
-OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
-OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
-OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
-OpDecorate %gl_PerVertex Block
-OpDecorate %texSampler1D DescriptorSet 2
-OpDecorate %texSampler1D Binding 13
-OpMemberDecorate %foo 0 Offset 0
-OpDecorate %foo Block
-OpDecorate %__0 DescriptorSet 7
-OpDecorate %__0 Binding 5
-OpDecorate %coords2D Location 0
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Function_float = OpTypePointer Function %float
-%float_3 = OpConstant %float 3
-%float_1_78900003 = OpConstant %float 1.78900003
-%v4float = OpTypeVector %float 4
-%uint = OpTypeInt 32 0
-%uint_1 = OpConstant %uint 1
-%_arr_float_uint_1 = OpTypeArray %float %uint_1
-%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
-%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
-%_ = OpVariable %_ptr_Output_gl_PerVertex Output
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%21 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%22 = OpTypeSampledImage %21
-%uint_128 = OpConstant %uint 128
-%_arr_22_uint_128 = OpTypeArray %22 %uint_128
-%_ptr_UniformConstant__arr_22_uint_128 = OpTypePointer UniformConstant %_arr_22_uint_128
-%texSampler1D = OpVariable %_ptr_UniformConstant__arr_22_uint_128 UniformConstant
-%foo = OpTypeStruct %int
-%_ptr_Uniform_foo = OpTypePointer Uniform %foo
-%__0 = OpVariable %_ptr_Uniform_foo Uniform
-%_ptr_Uniform_int = OpTypePointer Uniform %int
-%_ptr_UniformConstant_22 = OpTypePointer UniformConstant %22
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%v2float = OpTypeVector %float 2
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%coords2D = OpVariable %_ptr_Input_v2float Input
-;CHECK: %_ptr_Input_uint = OpTypePointer Input %uint
-;CHECK: %gl_VertexIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: %gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%lod = OpVariable %_ptr_Function_float Function
-%coords1D = OpVariable %_ptr_Function_float Function
-OpStore %lod %float_3
-OpStore %coords1D %float_1_78900003
-%31 = OpAccessChain %_ptr_Uniform_int %__0 %int_0
-%32 = OpLoad %int %31
-%34 = OpAccessChain %_ptr_UniformConstant_22 %texSampler1D %32
-%35 = OpLoad %22 %34
-%36 = OpLoad %float %coords1D
-%37 = OpLoad %float %lod
-%38 = OpImageSampleExplicitLod %v4float %35 %36 Lod %37
-%40 = OpAccessChain %_ptr_Output_v4float %_ %int_0
-OpStore %40 %38
-;CHECK-NOT: %38 = OpImageSampleExplicitLod %v4float %35 %36 Lod %37
-;CHECK-NOT: %40 = OpAccessChain %_ptr_Output_v4float %_ %int_0
-;CHECK-NOT: OpStore %40 %38
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_70 {{%\w+}} %uint_7 %uint_5 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %int {{%\w+}}
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %int {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_UniformConstant_25 %texSampler1D {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %float %coords1D
-;CHECK: {{%\w+}} = OpLoad %float %lod
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_75 {{%\w+}} %uint_2 %uint_13 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %25 %38
-;CHECK: {{%\w+}} = OpImageSampleExplicitLod %v4float {{%\w+}} %40 Lod %41
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: %43 = OpAccessChain %_ptr_Output_v4float %_ %int_0
-;CHECK: OpStore %43 {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentTeseSimple) {
- // This test verifies that the pass will correctly instrument tessellation
- // evaluation shader doing bindless buffer load.
- //
- // clang-format off
- //
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(std140, set = 9, binding = 1) uniform ufoo { uint index; } uniform_index_buffer;
- //
- // layout(set = 9, binding = 2) buffer bfoo { vec4 val; } adds[11];
- //
- // layout(triangles, equal_spacing, cw) in;
- //
- // void main() {
- // gl_Position = adds[uniform_index_buffer.index].val;
- // }
- //
-
- const std::string defs = R"(
-OpCapability Tessellation
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint TessellationEvaluation %main "main" %_
-;CHECK: OpEntryPoint TessellationEvaluation %main "main" %_ %gl_PrimitiveID %gl_TessCoord
-OpExecutionMode %main Triangles
-OpExecutionMode %main SpacingEqual
-OpExecutionMode %main VertexOrderCw
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %gl_PerVertex "gl_PerVertex"
-OpMemberName %gl_PerVertex 0 "gl_Position"
-OpMemberName %gl_PerVertex 1 "gl_PointSize"
-OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
-OpMemberName %gl_PerVertex 3 "gl_CullDistance"
-OpName %_ ""
-OpName %bfoo "bfoo"
-OpMemberName %bfoo 0 "val"
-OpName %adds "adds"
-OpName %ufoo "ufoo"
-OpMemberName %ufoo 0 "index"
-OpName %uniform_index_buffer "uniform_index_buffer"
-OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
-OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
-OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
-OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
-OpDecorate %gl_PerVertex Block
-OpMemberDecorate %bfoo 0 Offset 0
-OpDecorate %bfoo Block
-OpDecorate %adds DescriptorSet 9
-OpDecorate %adds Binding 1
-OpMemberDecorate %ufoo 0 Offset 0
-OpDecorate %ufoo Block
-OpDecorate %uniform_index_buffer DescriptorSet 9
-OpDecorate %uniform_index_buffer Binding 2
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_PrimitiveID BuiltIn PrimitiveId
-;CHECK: OpDecorate %gl_TessCoord BuiltIn TessCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v4float = OpTypeVector %float 4
-%uint = OpTypeInt 32 0
-%uint_1 = OpConstant %uint 1
-%_arr_float_uint_1 = OpTypeArray %float %uint_1
-%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
-%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
-%_ = OpVariable %_ptr_Output_gl_PerVertex Output
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%bfoo = OpTypeStruct %v4float
-%uint_11 = OpConstant %uint 11
-%_arr_bfoo_uint_11 = OpTypeArray %bfoo %uint_11
-%_ptr_StorageBuffer__arr_bfoo_uint_11 = OpTypePointer StorageBuffer %_arr_bfoo_uint_11
-%adds = OpVariable %_ptr_StorageBuffer__arr_bfoo_uint_11 StorageBuffer
-%ufoo = OpTypeStruct %uint
-%_ptr_Uniform_ufoo = OpTypePointer Uniform %ufoo
-%uniform_index_buffer = OpVariable %_ptr_Uniform_ufoo Uniform
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-;CHECK: %_ptr_Input_uint = OpTypePointer Input %uint
-;CHECK: %gl_PrimitiveID = OpVariable %_ptr_Input_uint Input
-;CHECK: %v3float = OpTypeVector %float 3
-;CHECK: %_ptr_Input_v3float = OpTypePointer Input %v3float
-;CHECK: %gl_TessCoord = OpVariable %_ptr_Input_v3float Input
-;CHECK: %v3uint = OpTypeVector %uint 3
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func =
- R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%25 = OpAccessChain %_ptr_Uniform_uint %uniform_index_buffer %int_0
-%26 = OpLoad %uint %25
-%28 = OpAccessChain %_ptr_StorageBuffer_v4float %adds %26 %int_0
-%29 = OpLoad %v4float %28
-;CHECK-NOT: %29 = OpLoad %v4float %28
-;CHECK: {{%\w+}} = OpLoad %uint %gl_PrimitiveID
-;CHECK: {{%\w+}} = OpLoad %v3float %gl_TessCoord
-;CHECK: {{%\w+}} = OpBitcast %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_2 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_62 {{%\w+}} %uint_9 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %27
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %uint {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-%31 = OpAccessChain %_ptr_Output_v4float %_ %int_0
-OpStore %31 %29
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %uint %gl_PrimitiveID
-;CHECK: {{%\w+}} = OpLoad %v3float %gl_TessCoord
-;CHECK: {{%\w+}} = OpBitcast %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_2 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_64 {{%\w+}} %uint_9 %uint_1 {{%\w+}} {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v4float %29
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: %31 = OpAccessChain %_ptr_Output_v4float %_ %int_0
-;CHECK: OpStore %31 [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentTesc) {
- // This test verifies that the pass will correctly instrument tessellation
- // control shader
- //
- // clang-format off
- //
- // #version 450
- // layout(vertices = 3) out;
- // layout(set = 0, binding = 0) uniform texture1D _77;
- // layout(set = 0, binding = 1) uniform sampler _78;
-
- // layout(location = 1) flat in int _3[];
- // layout(location = 0) out vec4 _5[3];
-
- // void main()
- // {
- // float param;
- // if (_3[gl_InvocationID] == 0)
- // {
- // param = 0.0234375;
- // }
- // else
- // {
- // param = 1.0156199932098388671875;
- // }
- // _5[gl_InvocationID] = textureLod(sampler1D(_77, _78), param, 0.0);
- // vec4 _203;
- // if (gl_InvocationID == 0)
- // {
- // _203 = gl_in[0].gl_Position;
- // }
- // else
- // {
- // _203 = gl_in[2].gl_Position;
- // }
- // gl_out[gl_InvocationID].gl_Position = _203;
- // gl_TessLevelInner[0] = 2.7999999523162841796875;
- // gl_TessLevelInner[1] = 2.7999999523162841796875;
- // gl_TessLevelOuter[0] = 2.7999999523162841796875;
- // gl_TessLevelOuter[1] = 2.7999999523162841796875;
- // gl_TessLevelOuter[2] = 2.7999999523162841796875;
- // gl_TessLevelOuter[3] = 2.7999999523162841796875;
- // }
- //
- // clang-format on
- //
- //
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Tessellation
-OpCapability Sampled1D
-;CHECK: OpCapability Linkage
-;CHECK: OpExtension "SPV_KHR_storage_buffer_storage_class"
-;CHECK: OpExtension "SPV_KHR_physical_storage_buffer"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-;CHECK: OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint TessellationControl %main "main" %_3 %gl_InvocationID %_5 %gl_in %gl_out %gl_TessLevelInner %gl_TessLevelOuter
-;CHECK: OpEntryPoint TessellationControl %main "main" %_3 %gl_InvocationID %_5 %gl_in %gl_out %gl_TessLevelInner %gl_TessLevelOuter %gl_PrimitiveID
-OpExecutionMode %main OutputVertices 3
-OpSource GLSL 450
-OpName %main "main"
-OpName %_3 "_3"
-OpName %gl_InvocationID "gl_InvocationID"
-OpName %param "param"
-OpName %_5 "_5"
-OpName %_77 "_77"
-OpName %_78 "_78"
-OpName %_203 "_203"
-OpName %gl_PerVertex "gl_PerVertex"
-OpMemberName %gl_PerVertex 0 "gl_Position"
-OpMemberName %gl_PerVertex 1 "gl_PointSize"
-OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
-OpMemberName %gl_PerVertex 3 "gl_CullDistance"
-OpName %gl_in "gl_in"
-OpName %gl_PerVertex_0 "gl_PerVertex"
-OpMemberName %gl_PerVertex_0 0 "gl_Position"
-OpMemberName %gl_PerVertex_0 1 "gl_PointSize"
-OpMemberName %gl_PerVertex_0 2 "gl_ClipDistance"
-OpMemberName %gl_PerVertex_0 3 "gl_CullDistance"
-OpName %gl_out "gl_out"
-OpName %gl_TessLevelInner "gl_TessLevelInner"
-OpName %gl_TessLevelOuter "gl_TessLevelOuter"
-OpDecorate %_3 Flat
-OpDecorate %_3 Location 1
-OpDecorate %gl_InvocationID BuiltIn InvocationId
-OpDecorate %_5 Location 0
-OpDecorate %_77 DescriptorSet 0
-OpDecorate %_77 Binding 0
-OpDecorate %_78 DescriptorSet 0
-OpDecorate %_78 Binding 1
-OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
-OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
-OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
-OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
-OpDecorate %gl_PerVertex Block
-OpMemberDecorate %gl_PerVertex_0 0 BuiltIn Position
-OpMemberDecorate %gl_PerVertex_0 1 BuiltIn PointSize
-OpMemberDecorate %gl_PerVertex_0 2 BuiltIn ClipDistance
-OpMemberDecorate %gl_PerVertex_0 3 BuiltIn CullDistance
-OpDecorate %gl_PerVertex_0 Block
-OpDecorate %gl_TessLevelInner Patch
-OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
-OpDecorate %gl_TessLevelOuter Patch
-OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%int = OpTypeInt 32 1
-%uint = OpTypeInt 32 0
-%uint_32 = OpConstant %uint 32
-%_arr_int_uint_32 = OpTypeArray %int %uint_32
-%_ptr_Input__arr_int_uint_32 = OpTypePointer Input %_arr_int_uint_32
-%_3 = OpVariable %_ptr_Input__arr_int_uint_32 Input
-%_ptr_Input_int = OpTypePointer Input %int
-%gl_InvocationID = OpVariable %_ptr_Input_int Input
-%int_0 = OpConstant %int 0
-%bool = OpTypeBool
-%float = OpTypeFloat 32
-%_ptr_Function_float = OpTypePointer Function %float
-%float_0_0234375 = OpConstant %float 0.0234375
-%float_1_01561999 = OpConstant %float 1.01561999
-%v4float = OpTypeVector %float 4
-%uint_3 = OpConstant %uint 3
-%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3
-%_ptr_Output__arr_v4float_uint_3 = OpTypePointer Output %_arr_v4float_uint_3
-%_5 = OpVariable %_ptr_Output__arr_v4float_uint_3 Output
-%34 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_34 = OpTypePointer UniformConstant %34
-%_77 = OpVariable %_ptr_UniformConstant_34 UniformConstant
-%38 = OpTypeSampler
-%_ptr_UniformConstant_38 = OpTypePointer UniformConstant %38
-%_78 = OpVariable %_ptr_UniformConstant_38 UniformConstant
-%42 = OpTypeSampledImage %34
-%float_0 = OpConstant %float 0
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_ptr_Function_v4float = OpTypePointer Function %v4float
-%uint_1 = OpConstant %uint 1
-%_arr_float_uint_1 = OpTypeArray %float %uint_1
-%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
-%_arr_gl_PerVertex_uint_32 = OpTypeArray %gl_PerVertex %uint_32
-%_ptr_Input__arr_gl_PerVertex_uint_32 = OpTypePointer Input %_arr_gl_PerVertex_uint_32
-%gl_in = OpVariable %_ptr_Input__arr_gl_PerVertex_uint_32 Input
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%int_2 = OpConstant %int 2
-%gl_PerVertex_0 = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
-%_arr_gl_PerVertex_0_uint_3 = OpTypeArray %gl_PerVertex_0 %uint_3
-%_ptr_Output__arr_gl_PerVertex_0_uint_3 = OpTypePointer Output %_arr_gl_PerVertex_0_uint_3
-%gl_out = OpVariable %_ptr_Output__arr_gl_PerVertex_0_uint_3 Output
-%uint_2 = OpConstant %uint 2
-%_arr_float_uint_2 = OpTypeArray %float %uint_2
-%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
-%gl_TessLevelInner = OpVariable %_ptr_Output__arr_float_uint_2 Output
-%float_2_79999995 = OpConstant %float 2.79999995
-%_ptr_Output_float = OpTypePointer Output %float
-%int_1 = OpConstant %int 1
-%uint_4 = OpConstant %uint 4
-%_arr_float_uint_4 = OpTypeArray %float %uint_4
-%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
-%gl_TessLevelOuter = OpVariable %_ptr_Output__arr_float_uint_4 Output
-%int_3 = OpConstant %int 3
-)";
-
- const std::string main_func =
- R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%param = OpVariable %_ptr_Function_float Function
-%_203 = OpVariable %_ptr_Function_v4float Function
-%14 = OpLoad %int %gl_InvocationID
-%15 = OpAccessChain %_ptr_Input_int %_3 %14
-%16 = OpLoad %int %15
-%19 = OpIEqual %bool %16 %int_0
-OpSelectionMerge %21 None
-OpBranchConditional %19 %20 %26
-%20 = OpLabel
-;CHECK-NOT: %15 = OpAccessChain %_ptr_Input_int %_3 %14
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %int %gl_InvocationID
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_Input_int %_3 {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %int {{%\w+}}
-;CHECK: {{%\w+}} = OpIEqual %bool {{%\w+}} %int_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpStore %param %float_0_0234375
-OpBranch %21
-%26 = OpLabel
-OpStore %param %float_1_01561999
-OpBranch %21
-%21 = OpLabel
-%33 = OpLoad %int %gl_InvocationID
-%37 = OpLoad %34 %_77
-%41 = OpLoad %38 %_78
-%43 = OpSampledImage %42 %37 %41
-%44 = OpLoad %float %param
-;CHECK: {{%\w+}} = OpLoad %int %gl_InvocationID
-;CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %uint %gl_PrimitiveID
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_1 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %inst_bindless_check_desc %uint_23 %uint_129 {{%\w+}} %uint_0 %uint_0 %uint_0 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-%46 = OpImageSampleExplicitLod %v4float %43 %44 Lod %float_0
-%48 = OpAccessChain %_ptr_Output_v4float %_5 %33
-OpStore %48 %46
-;CHECK-NOT: %48 = OpAccessChain %_ptr_Output_v4float %_5 %33
-;CHECK-NOT: OpStore %48 %46
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: [[access_chain:%\w+]] = OpAccessChain %_ptr_Output_v4float %_5 {{%\w+}}
-;CHECK: OpStore [[access_chain]] [[phi_result]]
-%49 = OpLoad %int %gl_InvocationID
-%50 = OpIEqual %bool %49 %int_0
-OpSelectionMerge %52 None
-OpBranchConditional %50 %51 %64
-%51 = OpLabel
-%62 = OpAccessChain %_ptr_Input_v4float %gl_in %int_0 %int_0
-%63 = OpLoad %v4float %62
-OpStore %_203 %63
-OpBranch %52
-%64 = OpLabel
-%66 = OpAccessChain %_ptr_Input_v4float %gl_in %int_2 %int_0
-%67 = OpLoad %v4float %66
-OpStore %_203 %67
-OpBranch %52
-%52 = OpLabel
-%72 = OpLoad %int %gl_InvocationID
-%73 = OpLoad %v4float %_203
-%74 = OpAccessChain %_ptr_Output_v4float %gl_out %72 %int_0
-OpStore %74 %73
-%81 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %int_0
-OpStore %81 %float_2_79999995
-%83 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %int_1
-OpStore %83 %float_2_79999995
-%88 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %int_0
-OpStore %88 %float_2_79999995
-%89 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %int_1
-OpStore %89 %float_2_79999995
-%90 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %int_2
-OpStore %90 %float_2_79999995
-%92 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %int_3
-OpStore %92 %float_2_79999995
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, MultipleDebugFunctions) {
- // Same source as Simple, but compiled -g and not optimized, especially not
- // inlined. The OpSource has had the source extracted for the sake of brevity.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%2 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-%1 = OpString "foo5.frag"
-OpSource HLSL 500 %1
-OpName %MainPs "MainPs"
-OpName %PS_INPUT "PS_INPUT"
-OpMemberName %PS_INPUT 0 "vTextureCoords"
-OpName %PS_OUTPUT "PS_OUTPUT"
-OpMemberName %PS_OUTPUT 0 "vColor"
-OpName %_MainPs_struct_PS_INPUT_vf21_ "@MainPs(struct-PS_INPUT-vf21;"
-OpName %i "i"
-OpName %ps_output "ps_output"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %g_sAniso "g_sAniso"
-OpName %i_0 "i"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpName %param "param"
-OpDecorate %g_tColor DescriptorSet 1
-OpDecorate %g_tColor Binding 2
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %g_sAniso DescriptorSet 1
-OpDecorate %g_sAniso Binding 3
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%4 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%PS_INPUT = OpTypeStruct %v2float
-%_ptr_Function_PS_INPUT = OpTypePointer Function %PS_INPUT
-%v4float = OpTypeVector %float 4
-%PS_OUTPUT = OpTypeStruct %v4float
-%13 = OpTypeFunction %PS_OUTPUT %_ptr_Function_PS_INPUT
-%_ptr_Function_PS_OUTPUT = OpTypePointer Function %PS_OUTPUT
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%21 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_21_uint_128 = OpTypeArray %21 %uint_128
-%_ptr_UniformConstant__arr_21_uint_128 = OpTypePointer UniformConstant %_arr_21_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_21_uint_128 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_21 = OpTypePointer UniformConstant %21
-%36 = OpTypeSampler
-%_ptr_UniformConstant_36 = OpTypePointer UniformConstant %36
-%g_sAniso = OpVariable %_ptr_UniformConstant_36 UniformConstant
-%40 = OpTypeSampledImage %21
-%_ptr_Function_v2float = OpTypePointer Function %v2float
-%_ptr_Function_v4float = OpTypePointer Function %v4float
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string func1 = R"(
-%MainPs = OpFunction %void None %4
-%6 = OpLabel
-%i_0 = OpVariable %_ptr_Function_PS_INPUT Function
-%param = OpVariable %_ptr_Function_PS_INPUT Function
-OpLine %1 21 0
-%54 = OpLoad %v2float %i_vTextureCoords
-%55 = OpAccessChain %_ptr_Function_v2float %i_0 %int_0
-OpStore %55 %54
-%59 = OpLoad %PS_INPUT %i_0
-OpStore %param %59
-%60 = OpFunctionCall %PS_OUTPUT %_MainPs_struct_PS_INPUT_vf21_ %param
-%61 = OpCompositeExtract %v4float %60 0
-OpStore %_entryPointOutput_vColor %61
-OpReturn
-OpFunctionEnd
-)";
-
- const std::string func2 = R"(
-%_MainPs_struct_PS_INPUT_vf21_ = OpFunction %PS_OUTPUT None %13
-%i = OpFunctionParameter %_ptr_Function_PS_INPUT
-%16 = OpLabel
-%ps_output = OpVariable %_ptr_Function_PS_OUTPUT Function
-OpLine %1 24 0
-%31 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%32 = OpLoad %uint %31
-%34 = OpAccessChain %_ptr_UniformConstant_21 %g_tColor %32
-%35 = OpLoad %21 %34
-%39 = OpLoad %36 %g_sAniso
-%41 = OpSampledImage %40 %35 %39
-%43 = OpAccessChain %_ptr_Function_v2float %i %int_0
-%44 = OpLoad %v2float %43
-%45 = OpImageSampleImplicitLod %v4float %41 %44
-;CHECK-NOT: %45 = OpImageSampleImplicitLod %v4float %41 %44
-;CHECK: {{%\w+}} = OpLoad %v2float {{%\w+}}
-;CHECK: OpNoLine
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_128 {{%\w+}} %uint_1 %uint_2 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %27 {{%\w+}}
-;CHECK: {{%\w+}} = OpSampledImage %37 {{%\w+}} {{%\w+}}
-;CHECK: OpLine %5 24 0
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} {{%\w+}}
-;CHECK: OpNoLine
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-%47 = OpAccessChain %_ptr_Function_v4float %ps_output %int_0
-OpStore %47 %45
-;CHECK-NOT: OpStore %47 %45
-;CHECK: [[store_loc:%\w+]] = OpAccessChain %_ptr_Function_v4float %ps_output %int_0
-;CHECK: OpStore [[store_loc]] [[phi_result]]
-OpLine %1 25 0
-%48 = OpLoad %PS_OUTPUT %ps_output
-OpReturnValue %48
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(
- defs + kImportStub + func1 + func2, true, 23u);
-}
-
-TEST_F(InstBindlessTest, RuntimeArray) {
- // This test verifies that the pass will correctly instrument shader
- // with runtime descriptor array. This test was created by editing the
- // SPIR-V from the Simple test.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability RuntimeDescriptorArray
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 1
-OpDecorate %g_tColor Binding 2
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %g_sAniso DescriptorSet 1
-OpDecorate %g_sAniso Binding 3
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%20 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_1 = OpConstant %uint 1
-%_rarr_20 = OpTypeRuntimeArray %20
-%_ptr_UniformConstant__arr_20 = OpTypePointer UniformConstant %_rarr_20
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_20 UniformConstant
-%PerViewConstantBuffer_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%_ptr_UniformConstant_20 = OpTypePointer UniformConstant %20
-%35 = OpTypeSampler
-%_ptr_UniformConstant_35 = OpTypePointer UniformConstant %35
-%g_sAniso = OpVariable %_ptr_UniformConstant_35 UniformConstant
-%39 = OpTypeSampledImage %20
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%53 = OpLoad %v2float %i_vTextureCoords
-%63 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%64 = OpLoad %uint %63
-%65 = OpAccessChain %_ptr_UniformConstant_20 %g_tColor %64
-%66 = OpLoad %20 %65
-%67 = OpLoad %35 %g_sAniso
-%68 = OpSampledImage %39 %66 %67
-%71 = OpImageSampleImplicitLod %v4float %68 %53
-OpStore %_entryPointOutput_vColor %71
-;CHECK-NOT: %71 = OpImageSampleImplicitLod %v4float %68 %53
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %71
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[check_result:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_60 {{%\w+}} %uint_1 %uint_2 %32 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %16 %33
-;CHECK: {{%\w+}} = OpSampledImage %26 {{%\w+}} %35
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %30
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result_1:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor [[phi_result_1]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstrumentInitCheckOnScalarDescriptor) {
- // This test verifies that the pass will correctly instrument vanilla
- // texture sample on a scalar descriptor with an initialization check if the
- // input_init_enable argument is set to true. This can happen when the
- // descriptor indexing extension is enabled in the API but the SPIR-V
- // does not have the extension enabled because it does not contain a
- // runtime array. This is the same shader as NoInstrumentNonBindless.
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 1
-OpDecorate %g_tColor Binding 2
-OpDecorate %g_sAniso DescriptorSet 1
-OpDecorate %g_sAniso Binding 2
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%8 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%12 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12
-%g_tColor = OpVariable %_ptr_UniformConstant_12 UniformConstant
-%14 = OpTypeSampler
-%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
-%g_sAniso = OpVariable %_ptr_UniformConstant_14 UniformConstant
-%16 = OpTypeSampledImage %12
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%MainPs = OpFunction %void None %8
-%19 = OpLabel
-%20 = OpLoad %v2float %i_vTextureCoords
-%21 = OpLoad %12 %g_tColor
-%22 = OpLoad %14 %g_sAniso
-%23 = OpSampledImage %16 %21 %22
-%24 = OpImageSampleImplicitLod %v4float %23 %20
-OpStore %_entryPointOutput_vColor %24
-;CHECK-NOT: %24 = OpImageSampleImplicitLod %v4float %23 %20
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %24
-;CHECK: [[check_result:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_40 {{%\w+}} %uint_1 %uint_2 %uint_0 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[check_result]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %12 %g_tColor
-;CHECK: {{%\w+}} = OpSampledImage %16 {{%\w+}} %22
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, SPV14AddToEntryPoint) {
- const std::string text = R"(
-OpCapability Shader
-OpExtension "SPV_EXT_descriptor_indexing"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %foo "foo" %gid %image_var %sampler_var
-;CHECK: OpEntryPoint Fragment {{%\w+}} "foo" {{%\w+}} {{%\w+}} {{%\w+}} %gl_FragCoord
-OpExecutionMode %foo OriginUpperLeft
-OpDecorate %image_var DescriptorSet 4
-OpDecorate %image_var Binding 1
-OpDecorate %sampler_var DescriptorSet 4
-OpDecorate %sampler_var Binding 2
-OpDecorate %gid DescriptorSet 0
-OpDecorate %gid Binding 2
-OpDecorate %struct Block
-OpMemberDecorate %struct 0 Offset 0
-%void = OpTypeVoid
-%int = OpTypeInt 32 0
-%int_0 = OpConstant %int 0
-%v3int = OpTypeVector %int 3
-%float = OpTypeFloat 32
-%v3float = OpTypeVector %float 3
-%v4float = OpTypeVector %float 4
-%struct = OpTypeStruct %v3int
-%ptr_ssbo_struct = OpTypePointer StorageBuffer %struct
-%ptr_ssbo_v3int = OpTypePointer StorageBuffer %v3int
-%gid = OpVariable %ptr_ssbo_struct StorageBuffer
-%image = OpTypeImage %float 3D 0 0 0 1 Unknown
-%ptr_uc_image = OpTypePointer UniformConstant %image
-%sampler = OpTypeSampler
-%ptr_uc_sampler = OpTypePointer UniformConstant %sampler
-%image_var = OpVariable %ptr_uc_image UniformConstant
-%sampler_var = OpVariable %ptr_uc_sampler UniformConstant
-%sampled = OpTypeSampledImage %image
-%void_fn = OpTypeFunction %void
-%foo = OpFunction %void None %void_fn
-%entry = OpLabel
-%ld_image = OpLoad %image %image_var
-%ld_sampler = OpLoad %sampler %sampler_var
-%gep = OpAccessChain %ptr_ssbo_v3int %gid %int_0
-%ld_gid = OpLoad %v3int %gep
-%convert = OpConvertUToF %v3float %ld_gid
-%sampled_image = OpSampledImage %sampled %ld_image %ld_sampler
-%sample = OpImageSampleImplicitLod %v4float %sampled_image %convert
-OpReturn
-OpFunctionEnd
-)";
-
- SetTargetEnv(SPV_ENV_VULKAN_1_1_SPIRV_1_4);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, SPV14AddToEntryPoints) {
- const std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %foo "foo" %gid %image_var %sampler_var
-;CHECK: OpEntryPoint Fragment {{%\w+}} "foo" {{%\w+}} {{%\w+}} {{%\w+}} %gl_FragCoord
-OpEntryPoint Fragment %foo "bar" %gid %image_var %sampler_var
-;CHECK: OpEntryPoint Fragment {{%\w+}} "bar" {{%\w+}} {{%\w+}} {{%\w+}} %gl_FragCoord
-OpExecutionMode %foo OriginUpperLeft
-OpDecorate %image_var DescriptorSet 3
-OpDecorate %image_var Binding 2
-OpDecorate %sampler_var DescriptorSet 3
-OpDecorate %sampler_var Binding 3
-OpDecorate %gid DescriptorSet 3
-OpDecorate %gid Binding 4
-OpDecorate %struct Block
-OpMemberDecorate %struct 0 Offset 0
-%void = OpTypeVoid
-%int = OpTypeInt 32 0
-%int_0 = OpConstant %int 0
-%v3int = OpTypeVector %int 3
-%float = OpTypeFloat 32
-%v3float = OpTypeVector %float 3
-%v4float = OpTypeVector %float 4
-%struct = OpTypeStruct %v3int
-%ptr_ssbo_struct = OpTypePointer StorageBuffer %struct
-%ptr_ssbo_v3int = OpTypePointer StorageBuffer %v3int
-%gid = OpVariable %ptr_ssbo_struct StorageBuffer
-%image = OpTypeImage %float 3D 0 0 0 1 Unknown
-%ptr_uc_image = OpTypePointer UniformConstant %image
-%sampler = OpTypeSampler
-%ptr_uc_sampler = OpTypePointer UniformConstant %sampler
-%image_var = OpVariable %ptr_uc_image UniformConstant
-%sampler_var = OpVariable %ptr_uc_sampler UniformConstant
-%sampled = OpTypeSampledImage %image
-%void_fn = OpTypeFunction %void
-%foo = OpFunction %void None %void_fn
-%entry = OpLabel
-%ld_image = OpLoad %image %image_var
-%ld_sampler = OpLoad %sampler %sampler_var
-%gep = OpAccessChain %ptr_ssbo_v3int %gid %int_0
-%ld_gid = OpLoad %v3int %gep
-%convert = OpConvertUToF %v3float %ld_gid
-%sampled_image = OpSampledImage %sampled %ld_image %ld_sampler
-%sample = OpImageSampleImplicitLod %v4float %sampled_image %convert
-OpReturn
-OpFunctionEnd
-)";
-
- SetTargetEnv(SPV_ENV_VULKAN_1_1_SPIRV_1_4);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedUBOArray) {
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(location=0) in nonuniformEXT flat int nu_ii;
- // layout(location=0) out float b;
- //
- // layout(set = 6, binding=3) uniform uname { float a; } uniformBuffer[];
- //
- // void main()
- // {
- // b = uniformBuffer[nu_ii].a;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability ShaderNonUniform
-OpCapability RuntimeDescriptorArray
-OpCapability UniformBufferArrayNonUniformIndexing
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %b %nu_ii
-;CHECK: OpEntryPoint Fragment %main "main" %b %nu_ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %b "b"
-OpName %uname "uname"
-OpMemberName %uname 0 "a"
-OpName %uniformBuffer "uniformBuffer"
-OpName %nu_ii "nu_ii"
-OpDecorate %b Location 0
-OpMemberDecorate %uname 0 Offset 0
-OpDecorate %uname Block
-OpDecorate %uniformBuffer DescriptorSet 6
-OpDecorate %uniformBuffer Binding 3
-OpDecorate %nu_ii Flat
-OpDecorate %nu_ii Location 0
-OpDecorate %nu_ii NonUniform
-OpDecorate %16 NonUniform
-OpDecorate %20 NonUniform
-;CHECK: OpDecorate {{%\w+}} NonUniform
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-;CHECK: OpDecorate {{%\w+}} NonUniform
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%b = OpVariable %_ptr_Output_float Output
-%uname = OpTypeStruct %float
-%_runtimearr_uname = OpTypeRuntimeArray %uname
-%_ptr_Uniform__runtimearr_uname = OpTypePointer Uniform %_runtimearr_uname
-%uniformBuffer = OpVariable %_ptr_Uniform__runtimearr_uname Uniform
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%nu_ii = OpVariable %_ptr_Input_int Input
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %v4float = OpTypeVector %float 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%16 = OpLoad %int %nu_ii
-%19 = OpAccessChain %_ptr_Uniform_float %uniformBuffer %16 %int_0
-%20 = OpLoad %float %19
-OpStore %b %20
-;CHECK-NOT: %20 = OpLoad %float %19
-;CHECK-NOT: OpStore %b %20
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint %7
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_46 {{%\w+}} %uint_6 %uint_3 {{%\w+}} {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %float %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %b [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedSSBOArrayDeprecated) {
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(location=0) in nonuniformEXT flat int nu_ii;
- // layout(location=0) out float b;
- //
- // layout(set = 7, binding=3) buffer bname { float b; } storageBuffer[];
- //
- // void main()
- // {
- // b = storageBuffer[nu_ii].b;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability ShaderNonUniform
-OpCapability RuntimeDescriptorArray
-OpCapability StorageBufferArrayNonUniformIndexing
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %b %nu_ii
-;CHECK: OpEntryPoint Fragment %main "main" %b %nu_ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %b "b"
-OpName %bname "bname"
-OpMemberName %bname 0 "a"
-OpName %storageBuffer "storageBuffer"
-OpName %nu_ii "nu_ii"
-OpDecorate %b Location 0
-OpMemberDecorate %bname 0 Offset 0
-OpDecorate %bname Block
-OpDecorate %storageBuffer DescriptorSet 7
-OpDecorate %storageBuffer Binding 3
-OpDecorate %nu_ii Flat
-OpDecorate %nu_ii Location 0
-OpDecorate %nu_ii NonUniform
-OpDecorate %16 NonUniform
-OpDecorate %20 NonUniform
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%b = OpVariable %_ptr_Output_float Output
-%bname = OpTypeStruct %float
-%_runtimearr_bname = OpTypeRuntimeArray %bname
-%_ptr_StorageBuffer__runtimearr_bname = OpTypePointer StorageBuffer %_runtimearr_bname
-%storageBuffer = OpVariable %_ptr_StorageBuffer__runtimearr_bname StorageBuffer
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%nu_ii = OpVariable %_ptr_Input_int Input
-%int_0 = OpConstant %int 0
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
-;CHECK: %uint = OpTypeInt 32 0
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %v4float = OpTypeVector %float 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%16 = OpLoad %int %nu_ii
-%19 = OpAccessChain %_ptr_StorageBuffer_float %storageBuffer %16 %int_0
-%20 = OpLoad %float %19
-OpStore %b %20
-;CHECK-NOT: %20 = OpLoad %float %19
-;CHECK-NOT: OpStore %b %20
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint %7
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_46 {{%\w+}} %uint_7 %uint_3 {{%\w+}} {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %float %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %b [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedSSBOArray) {
- // Same as Deprecated but declaring as StorageBuffer Block
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability ShaderNonUniform
-OpCapability RuntimeDescriptorArray
-OpCapability StorageBufferArrayNonUniformIndexing
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %b %nu_ii
-;CHECK: OpEntryPoint Fragment %main "main" %b %nu_ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %b "b"
-OpName %bname "bname"
-OpMemberName %bname 0 "a"
-OpName %storageBuffer "storageBuffer"
-OpName %nu_ii "nu_ii"
-OpDecorate %b Location 0
-OpMemberDecorate %bname 0 Offset 0
-OpDecorate %bname Block
-OpDecorate %storageBuffer DescriptorSet 0
-OpDecorate %storageBuffer Binding 3
-OpDecorate %nu_ii Flat
-OpDecorate %nu_ii Location 0
-OpDecorate %nu_ii NonUniform
-OpDecorate %16 NonUniform
-OpDecorate %20 NonUniform
-;CHECK: OpDecorate {{%\w+}} NonUniform
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-;CHECK: OpDecorate {{%\w+}} NonUniform
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%b = OpVariable %_ptr_Output_float Output
-%bname = OpTypeStruct %float
-%_runtimearr_bname = OpTypeRuntimeArray %bname
-%_ptr_StorageBuffer__runtimearr_bname = OpTypePointer StorageBuffer %_runtimearr_bname
-%storageBuffer = OpVariable %_ptr_StorageBuffer__runtimearr_bname StorageBuffer
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%nu_ii = OpVariable %_ptr_Input_int Input
-%int_0 = OpConstant %int 0
-%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %v4float = OpTypeVector %float 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%16 = OpLoad %int %nu_ii
-%19 = OpAccessChain %_ptr_StorageBuffer_float %storageBuffer %16 %int_0
-%20 = OpLoad %float %19
-OpStore %b %20
-;CHECK-NOT: %20 = OpLoad %float %19
-;CHECK-NOT: OpStore %b %20
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint %7
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_46 {{%\w+}} %uint_0 %uint_3 {{%\w+}} {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %float %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %b {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstInitLoadUBOScalar) {
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(location=0) out float b;
- // layout(set=7, binding=3) uniform uname { float a; } uniformBuffer;
- //
- // void main()
- // {
- // b = uniformBuffer.a;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %b
-;CHECK: OpEntryPoint Fragment %main "main" %b %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %b "b"
-OpName %uname "uname"
-OpMemberName %uname 0 "a"
-OpName %uniformBuffer "uniformBuffer"
-OpDecorate %b Location 0
-OpMemberDecorate %uname 0 Offset 0
-OpDecorate %uname Block
-OpDecorate %uniformBuffer DescriptorSet 7
-OpDecorate %uniformBuffer Binding 3
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%b = OpVariable %_ptr_Output_float Output
-%uname = OpTypeStruct %float
-%_ptr_Uniform_uname = OpTypePointer Uniform %uname
-%uniformBuffer = OpVariable %_ptr_Uniform_uname Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: %int = OpTypeInt 32 1
-;CHECK: %_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: %uint = OpTypeInt 32 0
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %v4float = OpTypeVector %float 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%15 = OpAccessChain %_ptr_Uniform_float %uniformBuffer %int_0
-%16 = OpLoad %float %15
-OpStore %b %16
-;CHECK-NOT: %16 = OpLoad %float %15
-;CHECK-NOT: OpStore %b %16
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[check_result:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_33 {{%\w+}} %uint_7 %uint_3 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[check_result]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %float %15
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %b [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstBoundsInitStoreUnsizedSSBOArray) {
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(location=0) in nonuniformEXT flat int nu_ii;
- // layout(location=1) in float b;
- //
- // layout(set=5, binding=4) buffer bname { float b; } storageBuffer[];
- //
- // void main()
- // {
- // storageBuffer[nu_ii].b = b;
- // }
-
- // clang-format off
- const std::string defs = R"(OpCapability Shader
-OpCapability ShaderNonUniform
-OpCapability RuntimeDescriptorArray
-OpCapability StorageBufferArrayNonUniformIndexing
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %nu_ii %b
-;CHECK: OpEntryPoint Fragment %main "main" %nu_ii %b %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %bname "bname"
-OpMemberName %bname 0 "b"
-OpName %storageBuffer "storageBuffer"
-OpName %nu_ii "nu_ii"
-OpName %b "b"
-OpMemberDecorate %bname 0 Offset 0
-OpDecorate %bname BufferBlock
-OpDecorate %storageBuffer DescriptorSet 5
-OpDecorate %storageBuffer Binding 4
-OpDecorate %nu_ii Flat
-OpDecorate %nu_ii Location 0
-OpDecorate %nu_ii NonUniform
-OpDecorate %14 NonUniform
-OpDecorate %b Location 1
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%bname = OpTypeStruct %float
-%_runtimearr_bname = OpTypeRuntimeArray %bname
-%_ptr_Uniform__runtimearr_bname = OpTypePointer Uniform %_runtimearr_bname
-%storageBuffer = OpVariable %_ptr_Uniform__runtimearr_bname Uniform
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%nu_ii = OpVariable %_ptr_Input_int Input
-%int_0 = OpConstant %int 0
-%_ptr_Input_float = OpTypePointer Input %float
-%b = OpVariable %_ptr_Input_float Input
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%14 = OpLoad %int %nu_ii
-%18 = OpLoad %float %b
-%20 = OpAccessChain %_ptr_Uniform_float %storageBuffer %14 %int_0
-OpStore %20 %18
-;CHECK-NOT: OpStore %20 %18
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint %7
-;CHECK: [[check_result:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_46 {{%\w+}} %uint_5 %uint_4 {{%\w+}} {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[check_result]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %20 %19
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstBoundsInitLoadSizedUBOArray) {
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(location=0) in nonuniformEXT flat int nu_ii;
- // layout(location=0) out float b;
- //
- // layout(set=1, binding=3) uniform uname { float a; } uniformBuffer[128];
- //
- // void main()
- // {
- // b = uniformBuffer[nu_ii].a;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability ShaderNonUniform
-OpCapability UniformBufferArrayNonUniformIndexing
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %b %nu_ii
-;CHECK: OpEntryPoint Fragment %main "main" %b %nu_ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %b "b"
-OpName %uname "uname"
-OpMemberName %uname 0 "a"
-OpName %uniformBuffer "uniformBuffer"
-OpName %nu_ii "nu_ii"
-OpDecorate %b Location 0
-OpMemberDecorate %uname 0 Offset 0
-OpDecorate %uname Block
-OpDecorate %uniformBuffer DescriptorSet 1
-OpDecorate %uniformBuffer Binding 3
-OpDecorate %nu_ii Flat
-OpDecorate %nu_ii Location 0
-OpDecorate %nu_ii NonUniform
-OpDecorate %18 NonUniform
-OpDecorate %22 NonUniform
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-;CHECK: OpDecorate [[load_result:%\w+]] NonUniform
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%b = OpVariable %_ptr_Output_float Output
-%uname = OpTypeStruct %float
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_uname_uint_128 = OpTypeArray %uname %uint_128
-%_ptr_Uniform__arr_uname_uint_128 = OpTypePointer Uniform %_arr_uname_uint_128
-%uniformBuffer = OpVariable %_ptr_Uniform__arr_uname_uint_128 Uniform
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%nu_ii = OpVariable %_ptr_Input_int Input
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%18 = OpLoad %int %nu_ii
-%21 = OpAccessChain %_ptr_Uniform_float %uniformBuffer %18 %int_0
-%22 = OpLoad %float %21
-OpStore %b %22
-;CHECK-NOT: %22 = OpLoad %float %21
-;CHECK-NOT: OpStore %b %22
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint %7
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_47 {{%\w+}} %uint_1 %uint_3 {{%\w+}} {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %float %22
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %b {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsComputeShaderInitLoadVariableSizedSampledImagesArray) {
- // #version 450
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout (local_size_x = 1, local_size_y = 1) in;
- //
- // layout(set = 2, binding = 0, std140) buffer Input {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 2, binding = 1, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability Shader
-OpCapability RuntimeDescriptorArray
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint GLCompute %main "main"
-;CHECK: OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
-OpExecutionMode %main LocalSize 1 1 1
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %Input "Input"
-OpMemberName %Input 0 "index"
-OpMemberName %Input 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %Input 0 Offset 0
-OpMemberDecorate %Input 1 Offset 4
-OpDecorate %Input BufferBlock
-OpDecorate %sbo DescriptorSet 2
-OpDecorate %sbo Binding 0
-OpDecorate %images DescriptorSet 2
-OpDecorate %images Binding 1
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%Input = OpTypeStruct %uint %float
-%_ptr_Uniform_Input = OpTypePointer Uniform %Input
-%sbo = OpVariable %_ptr_Uniform_Input Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: %v3uint = OpTypeVector %uint 3
-;CHECK: %_ptr_Input_v3uint = OpTypePointer Input %v3uint
-;CHECK: %gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint %gl_GlobalInvocationID
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_48 {{%\w+}} %uint_2 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %uint {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_UniformConstant_13 %images {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %13 {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %v3uint %gl_GlobalInvocationID
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_51 {{%\w+}} %uint_2 %uint_1 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 {{%\w+}}
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK: {{%\w+}} = OpLoad %v3uint %gl_GlobalInvocationID
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_54 {{%\w+}} %uint_2 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %31 {{%\w+}}
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsRayGenerationInitLoadVariableSizedSampledImagesArray) {
- // #version 460
- // #extension GL_EXT_nonuniform_qualifier : require
- // #extension GL_NV_ray_tracing : require
- //
- // layout(set = 3, binding = 1, std140) buffer StorageBuffer {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 3, binding = 5, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability RuntimeDescriptorArray
-OpCapability RayTracingNV
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpExtension "SPV_NV_ray_tracing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint RayGenerationNV %main "main"
-;CHECK: OpEntryPoint RayGenerationNV %main "main" [[launch_id:%\w+]]
-OpSource GLSL 460
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpSourceExtension "GL_NV_ray_tracing"
-OpName %main "main"
-OpName %StorageBuffer "StorageBuffer"
-OpMemberName %StorageBuffer 0 "index"
-OpMemberName %StorageBuffer 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %StorageBuffer 0 Offset 0
-OpMemberDecorate %StorageBuffer 1 Offset 4
-OpDecorate %StorageBuffer BufferBlock
-OpDecorate %sbo DescriptorSet 3
-OpDecorate %sbo Binding 1
-OpDecorate %images DescriptorSet 3
-OpDecorate %images Binding 5
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate [[launch_id]] BuiltIn LaunchIdNV
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%StorageBuffer = OpTypeStruct %uint %float
-%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer
-%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5313 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} %uint_3 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %uint {{%\w+}} {{%\w+}} [[null_uint]] {{%\w+}}
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_UniformConstant_13 %images {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %13 {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5313 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_3 %uint_5 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 {{%\w+}}
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5313 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_55 {{%\w+}} %uint_3 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore {{%\w+}} {{%\w+}}
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsIntersectionInitLoadVariableSizedSampledImagesArray) {
- // #version 460
- // #extension GL_EXT_nonuniform_qualifier : require
- // #extension GL_NV_ray_tracing : require
- //
- // layout(set = 5, binding = 1, std140) buffer StorageBuffer {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 5, binding = 3, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability RuntimeDescriptorArray
-OpCapability RayTracingNV
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpExtension "SPV_NV_ray_tracing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint IntersectionNV %main "main"
-;CHECK: OpEntryPoint IntersectionNV %main "main" [[launch_id:%\w+]]
-OpSource GLSL 460
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpSourceExtension "GL_NV_ray_tracing"
-OpName %main "main"
-OpName %StorageBuffer "StorageBuffer"
-OpMemberName %StorageBuffer 0 "index"
-OpMemberName %StorageBuffer 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %StorageBuffer 0 Offset 0
-OpMemberDecorate %StorageBuffer 1 Offset 4
-OpDecorate %StorageBuffer BufferBlock
-OpDecorate %sbo DescriptorSet 5
-OpDecorate %sbo Binding 1
-OpDecorate %images DescriptorSet 5
-OpDecorate %images Binding 3
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate [[launch_id]] BuiltIn LaunchIdNV
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%StorageBuffer = OpTypeStruct %uint %float
-%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer
-%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: [[launch_id]] = OpVariable %_ptr_Input_v3uint Input
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5314 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} %uint_5 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %uint {{%\w+}} {{%\w+}} [[null_uint]] {{%\w+}}
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_UniformConstant_13 %images {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %13 {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5314 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_5 %uint_3 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 {{%\w+}}
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: {{%\w+}} = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5314 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_55 {{%\w+}} %uint_5 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %31 {{%\w+}}
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsAnyHitInitLoadVariableSizedSampledImagesArray) {
- // #version 460
- // #extension GL_EXT_nonuniform_qualifier : require
- // #extension GL_NV_ray_tracing : require
- //
- // layout(set = 2, binding = 1, std140) buffer StorageBuffer {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 2, binding = 3, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability RuntimeDescriptorArray
-OpCapability RayTracingNV
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpExtension "SPV_NV_ray_tracing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint AnyHitNV %main "main"
-;CHECK: OpEntryPoint AnyHitNV %main "main" [[launch_id:%\w+]]
-OpSource GLSL 460
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpSourceExtension "GL_NV_ray_tracing"
-OpName %main "main"
-OpName %StorageBuffer "StorageBuffer"
-OpMemberName %StorageBuffer 0 "index"
-OpMemberName %StorageBuffer 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %StorageBuffer 0 Offset 0
-OpMemberDecorate %StorageBuffer 1 Offset 4
-OpDecorate %StorageBuffer BufferBlock
-OpDecorate %sbo DescriptorSet 2
-OpDecorate %sbo Binding 1
-OpDecorate %images DescriptorSet 2
-OpDecorate %images Binding 3
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate [[launch_id]] BuiltIn LaunchIdNV
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%StorageBuffer = OpTypeStruct %uint %float
-%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer
-%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: [[launch_id]] = OpVariable %_ptr_Input_v3uint Input
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: %20 = OpLoad %uint %19
-;CHECK-NOT: %22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-;CHECK-NOT: %23 = OpLoad %13 %22
-;CHECK-NOT: %27 = OpImageRead %v4float %23 %25
-;CHECK-NOT: %29 = OpCompositeExtract %float %27 0
-;CHECK-NOT: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5315 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} %uint_2 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %uint {{%\w+}} {{%\w+}} [[null_uint]] {{%\w+}}
-;CHECK: %27 = OpAccessChain %_ptr_UniformConstant_13 %images [[phi_result]]
-;CHECK: %28 = OpLoad %13 %27
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5315 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_2 %uint_3 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 %27
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: %30 = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5315 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_55 {{%\w+}} %uint_2 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %31 %30
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsClosestHitInitLoadVariableSizedSampledImagesArray) {
- // #version 460
- // #extension GL_EXT_nonuniform_qualifier : require
- // #extension GL_NV_ray_tracing : require
- //
- // layout(set = 1, binding = 2, std140) buffer StorageBuffer {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 1, binding = 3, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability RuntimeDescriptorArray
-OpCapability RayTracingNV
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpExtension "SPV_NV_ray_tracing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint ClosestHitNV %main "main"
-;CHECK: OpEntryPoint ClosestHitNV %main "main" [[launch_id:%\w+]]
-OpSource GLSL 460
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpSourceExtension "GL_NV_ray_tracing"
-OpName %main "main"
-OpName %StorageBuffer "StorageBuffer"
-OpMemberName %StorageBuffer 0 "index"
-OpMemberName %StorageBuffer 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %StorageBuffer 0 Offset 0
-OpMemberDecorate %StorageBuffer 1 Offset 4
-OpDecorate %StorageBuffer BufferBlock
-OpDecorate %sbo DescriptorSet 1
-OpDecorate %sbo Binding 2
-OpDecorate %images DescriptorSet 1
-OpDecorate %images Binding 3
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate [[launch_id]] BuiltIn LaunchIdNV
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%StorageBuffer = OpTypeStruct %uint %float
-%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer
-%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: [[launch_id]] = OpVariable %_ptr_Input_v3uint Input
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: %20 = OpLoad %uint %19
-;CHECK-NOT: %22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-;CHECK-NOT: %23 = OpLoad %13 %22
-;CHECK-NOT: %27 = OpImageRead %v4float %23 %25
-;CHECK-NOT: %29 = OpCompositeExtract %float %27 0
-;CHECK-NOT: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5316 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} %uint_1 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %uint {{%\w+}} {{%\w+}} [[null_uint]] {{%\w+}}
-;CHECK: %27 = OpAccessChain %_ptr_UniformConstant_13 %images [[phi_result]]
-;CHECK: %28 = OpLoad %13 %27
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5316 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_1 %uint_3 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 %27
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: %30 = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5316 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_55 {{%\w+}} %uint_1 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %31 %30
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsMissInitLoadVariableSizedSampledImagesArray) {
- // #version 460
- // #extension GL_EXT_nonuniform_qualifier : require
- // #extension GL_NV_ray_tracing : require
- //
- // layout(set = 1, binding = 2, std140) buffer StorageBuffer {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 1, binding = 3, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability RuntimeDescriptorArray
-OpCapability RayTracingNV
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpExtension "SPV_NV_ray_tracing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint MissNV %main "main"
-;CHECK: OpEntryPoint MissNV %main "main" [[launch_id:%\w+]]
-OpSource GLSL 460
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpSourceExtension "GL_NV_ray_tracing"
-OpName %main "main"
-OpName %StorageBuffer "StorageBuffer"
-OpMemberName %StorageBuffer 0 "index"
-OpMemberName %StorageBuffer 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %StorageBuffer 0 Offset 0
-OpMemberDecorate %StorageBuffer 1 Offset 4
-OpDecorate %StorageBuffer BufferBlock
-OpDecorate %sbo DescriptorSet 1
-OpDecorate %sbo Binding 2
-OpDecorate %images DescriptorSet 1
-OpDecorate %images Binding 3
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate [[launch_id]] BuiltIn LaunchIdNV
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%StorageBuffer = OpTypeStruct %uint %float
-%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer
-%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: [[launch_id]] = OpVariable %_ptr_Input_v3uint Input
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: %20 = OpLoad %uint %19
-;CHECK-NOT: %22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-;CHECK-NOT: %27 = OpImageRead %v4float %23 %25
-;CHECK-NOT: %29 = OpCompositeExtract %float %27 0
-;CHECK-NOT OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5317 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} %uint_1 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %uint {{%\w+}} {{%\w+}} [[null_uint]] {{%\w+}}
-;CHECK: %27 = OpAccessChain %_ptr_UniformConstant_13 %images [[phi_result]]
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5317 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_1 %uint_3 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 %27
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: %30 = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5317 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_55 {{%\w+}} %uint_1 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %31 %30
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest,
- InstBoundsCallableInitLoadVariableSizedSampledImagesArray) {
- // #version 460
- // #extension GL_EXT_nonuniform_qualifier : require
- // #extension GL_NV_ray_tracing : require
- //
- // layout(set = 1, binding = 2, std140) buffer StorageBuffer {
- // uint index;
- // float red;
- // } sbo;
- //
- // layout(set = 1, binding = 3, rgba32f) readonly uniform image2D images[];
- //
- // void main()
- // {
- // sbo.red = imageLoad(images[sbo.index], ivec2(0, 0)).r;
- // }
-
- // clang-format off
- const std::string defs = R"(
-OpCapability RuntimeDescriptorArray
-OpCapability RayTracingNV
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-OpExtension "SPV_NV_ray_tracing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint CallableNV %main "main"
-;CHECK: OpEntryPoint CallableNV %main "main" [[launch_id:%\w+]]
-OpSource GLSL 460
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpSourceExtension "GL_NV_ray_tracing"
-OpName %main "main"
-OpName %StorageBuffer "StorageBuffer"
-OpMemberName %StorageBuffer 0 "index"
-OpMemberName %StorageBuffer 1 "red"
-OpName %sbo "sbo"
-OpName %images "images"
-OpMemberDecorate %StorageBuffer 0 Offset 0
-OpMemberDecorate %StorageBuffer 1 Offset 4
-OpDecorate %StorageBuffer BufferBlock
-OpDecorate %sbo DescriptorSet 1
-OpDecorate %sbo Binding 2
-OpDecorate %images DescriptorSet 1
-OpDecorate %images Binding 3
-OpDecorate %images NonWritable
-)" + kImportDeco + R"(
-;CHECK: OpDecorate [[launch_id]] BuiltIn LaunchIdNV
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%uint = OpTypeInt 32 0
-%float = OpTypeFloat 32
-%StorageBuffer = OpTypeStruct %uint %float
-%_ptr_Uniform_StorageBuffer = OpTypePointer Uniform %StorageBuffer
-%sbo = OpVariable %_ptr_Uniform_StorageBuffer Uniform
-%int = OpTypeInt 32 1
-%int_1 = OpConstant %int 1
-%13 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_runtimearr_13 = OpTypeRuntimeArray %13
-%_ptr_UniformConstant__runtimearr_13 = OpTypePointer UniformConstant %_runtimearr_13
-%images = OpVariable %_ptr_UniformConstant__runtimearr_13 UniformConstant
-%int_0 = OpConstant %int 0
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%v2int = OpTypeVector %int 2
-%25 = OpConstantComposite %v2int %int_0 %int_0
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-;CHECK: [[null_uint:%\w+]] = OpConstantNull %uint
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%19 = OpAccessChain %_ptr_Uniform_uint %sbo %int_0
-%20 = OpLoad %uint %19
-%22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-%23 = OpLoad %13 %22
-%27 = OpImageRead %v4float %23 %25
-%29 = OpCompositeExtract %float %27 0
-;CHECK-NOT: %20 = OpLoad %uint %19
-;CHECK-NOT: %22 = OpAccessChain %_ptr_UniformConstant_13 %images %20
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5318 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} %uint_1 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %uint {{%\w+}} {{%\w+}} [[null_uint]] {{%\w+}}
-;CHECK: %27 = OpAccessChain %_ptr_UniformConstant_13 %images {{%\w+}}
-;CHECK-NOT: %23 = OpLoad %13 %22
-;CHECK-NOT: %27 = OpImageRead %v4float %23 %25
-;CHECK-NOT: %29 = OpCompositeExtract %float %27 0
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5318 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_1 %uint_3 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 %27
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: %30 = OpCompositeExtract %float {{%\w+}} 0
-;CHECK: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-%31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-OpStore %31 %29
-;CHECK-NOT: %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
-;CHECK-NOT: OpStore %31 %29
-;CHECK: {{%\w+}} = OpLoad %v3uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5318 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_55 {{%\w+}} %uint_1 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %31 %30
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, InstBoundsInitSameBlockOpReplication) {
- // Test that same block ops like OpSampledImage are replicated properly
- // where needed.
- //
- // clang-format off
- //
- // #version 450 core
- // #extension GL_EXT_nonuniform_qualifier : enable
- //
- // layout(location = 0) in vec2 inTexcoord;
- // layout(location = 0) out vec4 outColor;
- //
- // layout(set = 1, binding = 0) uniform Uniforms {
- // vec2 var0;
- // } uniforms;
- //
- // layout(set = 1, binding = 1) uniform sampler uniformSampler;
- // layout(set = 1, binding = 2) uniform texture2D uniformTex;
- // layout(set = 1, binding = 3) uniform texture2D uniformTexArr[8];
- //
- // void main() {
- // int index = 0;
- // float x = texture(sampler2D(uniformTexArr[nonuniformEXT(index)], uniformSampler), inTexcoord.xy).x;
- // float y = texture(sampler2D(uniformTex, uniformSampler), inTexcoord.xy * uniforms.var0.xy).x;
- // outColor = vec4(x, y, 0.0, 0.0);
- // }
- //
-
- const std::string defs = R"(
-OpCapability Shader
-OpCapability ShaderNonUniformEXT
-OpCapability SampledImageArrayNonUniformIndexingEXT
-;CHECK: OpCapability Linkage
-OpExtension "SPV_EXT_descriptor_indexing"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %inTexcoord %outColor
-;CHECK: OpEntryPoint Fragment %main "main" %inTexcoord %outColor %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_nonuniform_qualifier"
-OpName %main "main"
-OpName %index "index"
-OpName %x "x"
-OpName %uniformTexArr "uniformTexArr"
-OpName %uniformSampler "uniformSampler"
-OpName %inTexcoord "inTexcoord"
-OpName %y "y"
-OpName %uniformTex "uniformTex"
-OpName %Uniforms "Uniforms"
-OpMemberName %Uniforms 0 "var0"
-OpName %uniforms "uniforms"
-OpName %outColor "outColor"
-OpDecorate %uniformTexArr DescriptorSet 1
-OpDecorate %uniformTexArr Binding 3
-OpDecorate %19 NonUniformEXT
-OpDecorate %22 NonUniformEXT
-OpDecorate %uniformSampler DescriptorSet 1
-OpDecorate %uniformSampler Binding 1
-OpDecorate %inTexcoord Location 0
-OpDecorate %uniformTex DescriptorSet 1
-OpDecorate %uniformTex Binding 2
-OpMemberDecorate %Uniforms 0 Offset 0
-OpDecorate %Uniforms Block
-OpDecorate %uniforms DescriptorSet 1
-OpDecorate %uniforms Binding 0
-OpDecorate %outColor Location 0
-;CHECK: OpDecorate {{%\w+}} NonUniform
-;CHECK: OpDecorate {{%\w+}} NonUniform
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-;CHECK: OpDecorate [[desc_state_result:%\w+]] NonUniform
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
-%int_0 = OpConstant %int 0
-%float = OpTypeFloat 32
-%_ptr_Function_float = OpTypePointer Function %float
-%13 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_8 = OpConstant %uint 8
-%_arr_13_uint_8 = OpTypeArray %13 %uint_8
-%_ptr_UniformConstant__arr_13_uint_8 = OpTypePointer UniformConstant %_arr_13_uint_8
-%uniformTexArr = OpVariable %_ptr_UniformConstant__arr_13_uint_8 UniformConstant
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%23 = OpTypeSampler
-%_ptr_UniformConstant_23 = OpTypePointer UniformConstant %23
-%uniformSampler = OpVariable %_ptr_UniformConstant_23 UniformConstant
-%27 = OpTypeSampledImage %13
-%v2float = OpTypeVector %float 2
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%inTexcoord = OpVariable %_ptr_Input_v2float Input
-%v4float = OpTypeVector %float 4
-%uint_0 = OpConstant %uint 0
-%uniformTex = OpVariable %_ptr_UniformConstant_13 UniformConstant
-%Uniforms = OpTypeStruct %v2float
-%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms
-%uniforms = OpVariable %_ptr_Uniform_Uniforms Uniform
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%outColor = OpVariable %_ptr_Output_v4float Output
-%float_0 = OpConstant %float 0
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-;CHECK: [[null_v2float:%\w+]] = OpConstantNull %v2float
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%index = OpVariable %_ptr_Function_int Function
-%x = OpVariable %_ptr_Function_float Function
-%y = OpVariable %_ptr_Function_float Function
-OpStore %index %int_0
-%19 = OpLoad %int %index
-%21 = OpAccessChain %_ptr_UniformConstant_13 %uniformTexArr %19
-%22 = OpLoad %13 %21
-%26 = OpLoad %23 %uniformSampler
-%28 = OpSampledImage %27 %22 %26
-%32 = OpLoad %v2float %inTexcoord
-%34 = OpImageSampleImplicitLod %v4float %28 %32
-%36 = OpCompositeExtract %float %34 0
-;CHECK-NOT: %34 = OpImageSampleImplicitLod %v4float %28 %32
-;CHECK-NOT: %36 = OpCompositeExtract %float %34 0
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpBitcast %uint %19
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_80 {{%\w+}} %uint_1 %uint_3 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 %21
-;CHECK: {{%\w+}} = OpSampledImage %27 {{%\w+}} %26
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %32
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-OpStore %x %36
-%39 = OpLoad %13 %uniformTex
-%40 = OpLoad %23 %uniformSampler
-%41 = OpSampledImage %27 %39 %40
-%42 = OpLoad %v2float %inTexcoord
-%47 = OpAccessChain %_ptr_Uniform_v2float %uniforms %int_0
-%48 = OpLoad %v2float %47
-%49 = OpFMul %v2float %42 %48
-;CHECK-NOT: %48 = OpLoad %v2float %47
-;CHECK-NOT: %49 = OpFMul %v2float %42 %48
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_88 {{%\w+}} %uint_1 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v2float %47
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v2float {{%\w+}} {{%\w+}} [[null_v2float]] {{%\w+}}
-;CHECK: %49 = OpFMul %v2float %42 [[phi_result]]
-%50 = OpImageSampleImplicitLod %v4float %41 %49
-%51 = OpCompositeExtract %float %50 0
-OpStore %y %51
-;CHECK-NOT: %50 = OpImageSampleImplicitLod %v4float %41 %49
-;CHECK-NOT: %51 = OpCompositeExtract %float %50 0
-;CHECK: {{%\w+}} = OpSampledImage %27 %39 %40
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_90 {{%\w+}} %uint_1 %uint_2 %uint_0 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %13 %uniformTex
-;CHECK: {{%\w+}} = OpSampledImage %27 {{%\w+}} %40
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %49
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: %51 = OpCompositeExtract %float {{%\w+}} 0
-OpStore %y %51
-%54 = OpLoad %float %x
-%55 = OpLoad %float %y
-%57 = OpCompositeConstruct %v4float %54 %55 %float_0 %float_0
-OpStore %outColor %57
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(defs + kImportStub + main_func,
- true, 23u);
-}
-
-TEST_F(InstBindlessTest, MultipleUniformNonAggregateRefsNoDescInit) {
- // Check that uniform refs do not go out-of-bounds. All checks use same input
- // buffer read function call result at top of function for uniform buffer
- // length. Because descriptor indexing is not being checked, we can avoid one
- // buffer load.
- //
- // Texture2D g_tColor;
- // SamplerState g_sAniso;
- //
- // layout(push_constant) cbuffer PerViewPushConst_t { bool g_B; };
- //
- // cbuffer PerViewConstantBuffer_t {
- // float2 g_TexOff0;
- // float2 g_TexOff1;
- // };
- //
- // struct PS_INPUT {
- // float2 vTextureCoords : TEXCOORD2;
- // };
- //
- // struct PS_OUTPUT {
- // float4 vColor : SV_Target0;
- // };
- //
- // PS_OUTPUT MainPs(PS_INPUT i) {
- // PS_OUTPUT ps_output;
- // float2 off;
- // float2 vtc;
- // if (g_B)
- // off = g_TexOff0;
- // else
- // off = g_TexOff1;
- // vtc = i.vTextureCoords.xy + off;
- // ps_output.vColor = g_tColor.Sample(g_sAniso, vtc);
- // return ps_output;
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %PerViewPushConst_t "PerViewPushConst_t"
-OpMemberName %PerViewPushConst_t 0 "g_B"
-OpName %_ ""
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_TexOff0"
-OpMemberName %PerViewConstantBuffer_t 1 "g_TexOff1"
-OpName %__0 ""
-OpName %g_tColor "g_tColor"
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpMemberDecorate %PerViewPushConst_t 0 Offset 0
-OpDecorate %PerViewPushConst_t Block
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpMemberDecorate %PerViewConstantBuffer_t 1 Offset 8
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %__0 DescriptorSet 0
-OpDecorate %__0 Binding 1
-OpDecorate %g_tColor DescriptorSet 0
-OpDecorate %g_tColor Binding 0
-OpDecorate %g_sAniso DescriptorSet 0
-OpDecorate %g_sAniso Binding 2
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%uint = OpTypeInt 32 0
-%PerViewPushConst_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewPushConst_t = OpTypePointer PushConstant %PerViewPushConst_t
-%_ = OpVariable %_ptr_PushConstant_PerViewPushConst_t PushConstant
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%bool = OpTypeBool
-%uint_0 = OpConstant %uint 0
-%PerViewConstantBuffer_t = OpTypeStruct %v2float %v2float
-%_ptr_Uniform_PerViewConstantBuffer_t = OpTypePointer Uniform %PerViewConstantBuffer_t
-%__0 = OpVariable %_ptr_Uniform_PerViewConstantBuffer_t Uniform
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%int_1 = OpConstant %int 1
-%49 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_49 = OpTypePointer UniformConstant %49
-%g_tColor = OpVariable %_ptr_UniformConstant_49 UniformConstant
-%53 = OpTypeSampler
-%_ptr_UniformConstant_53 = OpTypePointer UniformConstant %53
-%g_sAniso = OpVariable %_ptr_UniformConstant_53 UniformConstant
-%57 = OpTypeSampledImage %49
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v2float:%\w+]] = OpConstantNull %v2float
- )" + kImportStub + R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%69 = OpLoad %v2float %i_vTextureCoords
-%82 = OpAccessChain %_ptr_PushConstant_uint %_ %int_0
-%83 = OpLoad %uint %82
-%84 = OpINotEqual %bool %83 %uint_0
-OpSelectionMerge %91 None
-OpBranchConditional %84 %85 %88
-%85 = OpLabel
-%86 = OpAccessChain %_ptr_Uniform_v2float %__0 %int_0
-%87 = OpLoad %v2float %86
-;CHECK-NOT: %87 = OpLoad %v2float %86
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 %uint_7
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[desc_state_result:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_72 {{%\w+}} %uint_0 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[desc_state_result]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v2float %86
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
- ;CHECK: {{%\w+}} = OpPhi %v2float {{%\w+}} {{%\w+}} [[null_v2float]] {{%\w+}}
-OpBranch %91
-%88 = OpLabel
-%89 = OpAccessChain %_ptr_Uniform_v2float %__0 %int_1
-%90 = OpLoad %v2float %89
-;CHECK-NOT: %90 = OpLoad %v2float %89
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_8 %uint_7
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_76 {{%\w+}} %uint_0 %uint_1 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v2float %89
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v2float {{%\w+}} {{%\w+}} [[null_v2float]] {{%\w+}}
-OpBranch %91
-%91 = OpLabel
-%115 = OpPhi %v2float %87 %85 %90 %88
-;CHECK-NOT: %115 = OpPhi %v2float %87 %85 %90 %88
-;CHECK: %115 = OpPhi %v2float {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-%95 = OpFAdd %v2float %69 %115
-%96 = OpLoad %49 %g_tColor
-%97 = OpLoad %53 %g_sAniso
-%98 = OpSampledImage %57 %96 %97
-%100 = OpImageSampleImplicitLod %v4float %98 %95
-OpStore %_entryPointOutput_vColor %100
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, UniformArrayRefNoDescInit) {
- // Check that uniform array ref does not go out-of-bounds.
- //
- // Texture2D g_tColor;
- // SamplerState g_sAniso;
- //
- // layout(push_constant) cbuffer PerViewPushConst_t { uint g_c; };
- //
- // struct PerBatchEnvMapConstantBuffer_t {
- // float4x3 g_matEnvMapWorldToLocal;
- // float4 g_vEnvironmentMapBoxMins;
- // float2 g_TexOff;
- // };
- //
- // cbuffer _BindlessFastEnvMapCB_PS_t {
- // PerBatchEnvMapConstantBuffer_t g_envMapConstants[128];
- // };
- //
- // struct PS_INPUT {
- // float2 vTextureCoords : TEXCOORD2;
- // };
- //
- // struct PS_OUTPUT {
- // float4 vColor : SV_Target0;
- // };
- //
- // PS_OUTPUT MainPs(PS_INPUT i) {
- // PS_OUTPUT ps_output;
- // float2 off;
- // float2 vtc;
- // off = g_envMapConstants[g_c].g_TexOff;
- // vtc = i.vTextureCoords.xy + off;
- // ps_output.vColor = g_tColor.Sample(g_sAniso, vtc);
- // return ps_output;
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %PerBatchEnvMapConstantBuffer_t "PerBatchEnvMapConstantBuffer_t"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 0 "g_matEnvMapWorldToLocal"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 1 "g_vEnvironmentMapBoxMins"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 2 "g_TexOff"
-OpName %_BindlessFastEnvMapCB_PS_t "_BindlessFastEnvMapCB_PS_t"
-OpMemberName %_BindlessFastEnvMapCB_PS_t 0 "g_envMapConstants"
-OpName %_ ""
-OpName %PerViewPushConst_t "PerViewPushConst_t"
-OpMemberName %PerViewPushConst_t 0 "g_c"
-OpName %__0 ""
-OpName %g_tColor "g_tColor"
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 RowMajor
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 Offset 0
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 MatrixStride 16
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 1 Offset 48
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 2 Offset 64
-OpDecorate %_arr_PerBatchEnvMapConstantBuffer_t_uint_128 ArrayStride 80
-OpMemberDecorate %_BindlessFastEnvMapCB_PS_t 0 Offset 0
-OpDecorate %_BindlessFastEnvMapCB_PS_t Block
-OpDecorate %_ DescriptorSet 0
-OpDecorate %_ Binding 2
-OpMemberDecorate %PerViewPushConst_t 0 Offset 0
-OpDecorate %PerViewPushConst_t Block
-OpDecorate %g_tColor DescriptorSet 0
-OpDecorate %g_tColor Binding 0
-OpDecorate %g_sAniso DescriptorSet 0
-OpDecorate %g_sAniso Binding 1
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%v3float = OpTypeVector %float 3
-%mat4v3float = OpTypeMatrix %v3float 4
-%PerBatchEnvMapConstantBuffer_t = OpTypeStruct %mat4v3float %v4float %v2float
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_PerBatchEnvMapConstantBuffer_t_uint_128 = OpTypeArray %PerBatchEnvMapConstantBuffer_t %uint_128
-%_BindlessFastEnvMapCB_PS_t = OpTypeStruct %_arr_PerBatchEnvMapConstantBuffer_t_uint_128
-%_ptr_Uniform__BindlessFastEnvMapCB_PS_t = OpTypePointer Uniform %_BindlessFastEnvMapCB_PS_t
-%_ = OpVariable %_ptr_Uniform__BindlessFastEnvMapCB_PS_t Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%PerViewPushConst_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewPushConst_t = OpTypePointer PushConstant %PerViewPushConst_t
-%__0 = OpVariable %_ptr_PushConstant_PerViewPushConst_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%int_2 = OpConstant %int 2
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%46 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_46 = OpTypePointer UniformConstant %46
-%g_tColor = OpVariable %_ptr_UniformConstant_46 UniformConstant
-%50 = OpTypeSampler
-%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50
-%g_sAniso = OpVariable %_ptr_UniformConstant_50 UniformConstant
-%54 = OpTypeSampledImage %46
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v2float:%\w+]] = OpConstantNull %v2float
-)" + kImportStub + R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%66 = OpLoad %v2float %i_vTextureCoords
-%79 = OpAccessChain %_ptr_PushConstant_uint %__0 %int_0
-%80 = OpLoad %uint %79
-%81 = OpAccessChain %_ptr_Uniform_v2float %_ %int_0 %80 %int_2
-%82 = OpLoad %v2float %81
-;CHECK-NOT: %82 = OpLoad %v2float %81
-;CHECK: {{%\w+}} = OpIMul %uint %uint_80 %80
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_64
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_7
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_79 {{%\w+}} %uint_0 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v2float %81
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v2float {{%\w+}} {{%\w+}} [[null_v2float]] {{%\w+}}
-%86 = OpFAdd %v2float %66 %82
-;CHECK-NOT: %86 = OpFAdd %v2float %66 %82
-;CHECK: %86 = OpFAdd %v2float %66 {{%\w+}}
-%87 = OpLoad %46 %g_tColor
-%88 = OpLoad %50 %g_sAniso
-%89 = OpSampledImage %54 %87 %88
-%91 = OpImageSampleImplicitLod %v4float %89 %86
-OpStore %_entryPointOutput_vColor %91
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, UniformArrayRefWithDescInit) {
- // The buffer-oob and desc-init checks should use the same debug
- // output buffer write function.
- //
- // Same source as UniformArrayRefNoDescInit
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %PerBatchEnvMapConstantBuffer_t "PerBatchEnvMapConstantBuffer_t"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 0 "g_matEnvMapWorldToLocal"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 1 "g_vEnvironmentMapBoxMins"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 2 "g_TexOff"
-OpName %_BindlessFastEnvMapCB_PS_t "_BindlessFastEnvMapCB_PS_t"
-OpMemberName %_BindlessFastEnvMapCB_PS_t 0 "g_envMapConstants"
-OpName %_ ""
-OpName %PerViewPushConst_t "PerViewPushConst_t"
-OpMemberName %PerViewPushConst_t 0 "g_c"
-OpName %__0 ""
-OpName %g_tColor "g_tColor"
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 RowMajor
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 Offset 0
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 MatrixStride 16
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 1 Offset 48
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 2 Offset 64
-OpDecorate %_arr_PerBatchEnvMapConstantBuffer_t_uint_128 ArrayStride 80
-OpMemberDecorate %_BindlessFastEnvMapCB_PS_t 0 Offset 0
-OpDecorate %_BindlessFastEnvMapCB_PS_t Block
-OpDecorate %_ DescriptorSet 0
-OpDecorate %_ Binding 2
-OpMemberDecorate %PerViewPushConst_t 0 Offset 0
-OpDecorate %PerViewPushConst_t Block
-OpDecorate %g_tColor DescriptorSet 0
-OpDecorate %g_tColor Binding 0
-OpDecorate %g_sAniso DescriptorSet 0
-OpDecorate %g_sAniso Binding 1
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%v3float = OpTypeVector %float 3
-%mat4v3float = OpTypeMatrix %v3float 4
-%PerBatchEnvMapConstantBuffer_t = OpTypeStruct %mat4v3float %v4float %v2float
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_PerBatchEnvMapConstantBuffer_t_uint_128 = OpTypeArray %PerBatchEnvMapConstantBuffer_t %uint_128
-%_BindlessFastEnvMapCB_PS_t = OpTypeStruct %_arr_PerBatchEnvMapConstantBuffer_t_uint_128
-%_ptr_Uniform__BindlessFastEnvMapCB_PS_t = OpTypePointer Uniform %_BindlessFastEnvMapCB_PS_t
-%_ = OpVariable %_ptr_Uniform__BindlessFastEnvMapCB_PS_t Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%PerViewPushConst_t = OpTypeStruct %uint
-%_ptr_PushConstant_PerViewPushConst_t = OpTypePointer PushConstant %PerViewPushConst_t
-%__0 = OpVariable %_ptr_PushConstant_PerViewPushConst_t PushConstant
-%_ptr_PushConstant_uint = OpTypePointer PushConstant %uint
-%int_2 = OpConstant %int 2
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%46 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_46 = OpTypePointer UniformConstant %46
-%g_tColor = OpVariable %_ptr_UniformConstant_46 UniformConstant
-%50 = OpTypeSampler
-%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50
-%g_sAniso = OpVariable %_ptr_UniformConstant_50 UniformConstant
-%54 = OpTypeSampledImage %46
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %v4uint = OpTypeVector %uint 4
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v2float:%\w+]] = OpConstantNull %v2float
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)" + kImportStub + R"(
-%MainPs = OpFunction %void None %3
-%5 = OpLabel
-%66 = OpLoad %v2float %i_vTextureCoords
-%79 = OpAccessChain %_ptr_PushConstant_uint %__0 %int_0
-%80 = OpLoad %uint %79
-%81 = OpAccessChain %_ptr_Uniform_v2float %_ %int_0 %80 %int_2
-%82 = OpLoad %v2float %81
-%86 = OpFAdd %v2float %66 %82
-;CHECK-NOT: %82 = OpLoad %v2float %81
-;CHECK-NOT: %86 = OpFAdd %v2float %66 %82
-;CHECK: {{%\w+}} = OpIMul %uint %uint_80 %80
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_64
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_7
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_79 {{%\w+}} %uint_0 %uint_2 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v2float %81
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v2float {{%\w+}} {{%\w+}} [[null_v2float]] {{%\w+}}
-;CHECK: %86 = OpFAdd %v2float %66 {{%\w+}}
-%87 = OpLoad %46 %g_tColor
-%88 = OpLoad %50 %g_sAniso
-%89 = OpSampledImage %54 %87 %88
-%91 = OpImageSampleImplicitLod %v4float %89 %86
-OpStore %_entryPointOutput_vColor %91
-;CHECK-NOT: %91 = OpImageSampleImplicitLod %v4float %89 %86
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %91
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_84 {{%\w+}} %uint_0 %uint_0 %uint_0 %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %46 %g_tColor
-;CHECK: {{%\w+}} = OpSampledImage %54 {{%\w+}} %88
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %86
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor {{%\w+}}
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, Descriptor16BitIdxRef) {
- // Check that descriptor indexed with 16bit index is inbounds and
- // initialized
- //
- // Use Simple source with min16uint g_nDataIdx
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability Int16
-OpCapability StoragePushConstant16
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %g_tColor %_ %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %g_tColor %_ %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %g_tColor "g_tColor"
-OpName %PerViewConstantBuffer_t "PerViewConstantBuffer_t"
-OpMemberName %PerViewConstantBuffer_t 0 "g_nDataIdx"
-OpName %_ ""
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpDecorate %g_tColor DescriptorSet 1
-OpDecorate %g_tColor Binding 2
-OpMemberDecorate %PerViewConstantBuffer_t 0 Offset 0
-OpDecorate %PerViewConstantBuffer_t Block
-OpDecorate %g_sAniso DescriptorSet 1
-OpDecorate %g_sAniso Binding 2
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%10 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%16 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_16_uint_128 = OpTypeArray %16 %uint_128
-%_ptr_UniformConstant__arr_16_uint_128 = OpTypePointer UniformConstant %_arr_16_uint_128
-%g_tColor = OpVariable %_ptr_UniformConstant__arr_16_uint_128 UniformConstant
-%ushort = OpTypeInt 16 0
-%PerViewConstantBuffer_t = OpTypeStruct %ushort
-%_ptr_PushConstant_PerViewConstantBuffer_t = OpTypePointer PushConstant %PerViewConstantBuffer_t
-%_ = OpVariable %_ptr_PushConstant_PerViewConstantBuffer_t PushConstant
-%_ptr_PushConstant_ushort = OpTypePointer PushConstant %ushort
-%_ptr_UniformConstant_16 = OpTypePointer UniformConstant %16
-%25 = OpTypeSampler
-%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %25
-%g_sAniso = OpVariable %_ptr_UniformConstant_25 UniformConstant
-%27 = OpTypeSampledImage %16
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)" + kImportStub + R"(
-%MainPs = OpFunction %void None %10
-%30 = OpLabel
-;CHECK: OpBranch %39
-;CHECK: %39 = OpLabel
-%31 = OpLoad %v2float %i_vTextureCoords
-%32 = OpAccessChain %_ptr_PushConstant_ushort %_ %int_0
-%33 = OpLoad %ushort %32
-%34 = OpAccessChain %_ptr_UniformConstant_16 %g_tColor %33
-%35 = OpLoad %16 %34
-%36 = OpLoad %25 %g_sAniso
-%37 = OpSampledImage %27 %35 %36
-%38 = OpImageSampleImplicitLod %v4float %37 %31
-OpStore %_entryPointOutput_vColor %38
-;CHECK-NOT: %38 = OpImageSampleImplicitLod %v4float %37 %31
-;CHECK-NOT: OpStore %_entryPointOutput_vColor %38
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpUConvert %uint %33
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_61 {{%\w+}} %uint_1 %uint_2 {{%\w+}} %uint_0
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %16 %34
-;CHECK: {{%\w+}} = OpSampledImage %27 {{%\w+}} %36
-;CHECK: {{%\w+}} = OpImageSampleImplicitLod %v4float {{%\w+}} %31
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %_entryPointOutput_vColor [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, UniformArray16bitIdxRef) {
- // Check that uniform array ref with 16bit index does not go out-of-bounds.
- //
- // Texture2D g_tColor;
- // SamplerState g_sAniso;
- //
- // layout(push_constant) cbuffer PerViewPushConst_t { min16uint g_c; };
- //
- // struct PerBatchEnvMapConstantBuffer_t {
- // float4x3 g_matEnvMapWorldToLocal;
- // float4 g_vEnvironmentMapBoxMins;
- // float2 g_TexOff;
- // };
- //
- // cbuffer _BindlessFastEnvMapCB_PS_t {
- // PerBatchEnvMapConstantBuffer_t g_envMapConstants[128];
- // };
- //
- // struct PS_INPUT {
- // float2 vTextureCoords : TEXCOORD2;
- // };
- //
- // struct PS_OUTPUT {
- // float4 vColor : SV_Target0;
- // };
- //
- // PS_OUTPUT MainPs(PS_INPUT i) {
- // PS_OUTPUT ps_output;
- // float2 off;
- // float2 vtc;
- // off = g_envMapConstants[g_c].g_TexOff;
- // vtc = i.vTextureCoords.xy + off;
- // ps_output.vColor = g_tColor.Sample(g_sAniso, vtc);
- // return ps_output;
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability Int16
-OpCapability StoragePushConstant16
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor
-;CHECK: OpEntryPoint Fragment %MainPs "MainPs" %_ %__0 %g_tColor %g_sAniso %i_vTextureCoords %_entryPointOutput_vColor %gl_FragCoord
-OpExecutionMode %MainPs OriginUpperLeft
-OpSource HLSL 500
-OpName %MainPs "MainPs"
-OpName %PerBatchEnvMapConstantBuffer_t "PerBatchEnvMapConstantBuffer_t"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 0 "g_matEnvMapWorldToLocal"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 1 "g_vEnvironmentMapBoxMins"
-OpMemberName %PerBatchEnvMapConstantBuffer_t 2 "g_TexOff"
-OpName %_BindlessFastEnvMapCB_PS_t "_BindlessFastEnvMapCB_PS_t"
-OpMemberName %_BindlessFastEnvMapCB_PS_t 0 "g_envMapConstants"
-OpName %_ ""
-OpName %PerViewPushConst_t "PerViewPushConst_t"
-OpMemberName %PerViewPushConst_t 0 "g_c"
-OpName %__0 ""
-OpName %g_tColor "g_tColor"
-OpName %g_sAniso "g_sAniso"
-OpName %i_vTextureCoords "i.vTextureCoords"
-OpName %_entryPointOutput_vColor "@entryPointOutput.vColor"
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 RowMajor
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 Offset 0
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 0 MatrixStride 16
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 1 Offset 48
-OpMemberDecorate %PerBatchEnvMapConstantBuffer_t 2 Offset 64
-OpDecorate %_arr_PerBatchEnvMapConstantBuffer_t_uint_128 ArrayStride 80
-OpMemberDecorate %_BindlessFastEnvMapCB_PS_t 0 Offset 0
-OpDecorate %_BindlessFastEnvMapCB_PS_t Block
-OpDecorate %_ DescriptorSet 0
-OpDecorate %_ Binding 0
-OpMemberDecorate %PerViewPushConst_t 0 Offset 0
-OpDecorate %PerViewPushConst_t Block
-OpDecorate %g_tColor DescriptorSet 0
-OpDecorate %g_tColor Binding 0
-OpDecorate %g_sAniso DescriptorSet 0
-OpDecorate %g_sAniso Binding 0
-OpDecorate %i_vTextureCoords Location 0
-OpDecorate %_entryPointOutput_vColor Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%14 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%v3float = OpTypeVector %float 3
-%mat4v3float = OpTypeMatrix %v3float 4
-%PerBatchEnvMapConstantBuffer_t = OpTypeStruct %mat4v3float %v4float %v2float
-%uint = OpTypeInt 32 0
-%uint_128 = OpConstant %uint 128
-%_arr_PerBatchEnvMapConstantBuffer_t_uint_128 = OpTypeArray %PerBatchEnvMapConstantBuffer_t %uint_128
-%_BindlessFastEnvMapCB_PS_t = OpTypeStruct %_arr_PerBatchEnvMapConstantBuffer_t_uint_128
-%_ptr_Uniform__BindlessFastEnvMapCB_PS_t = OpTypePointer Uniform %_BindlessFastEnvMapCB_PS_t
-%_ = OpVariable %_ptr_Uniform__BindlessFastEnvMapCB_PS_t Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%ushort = OpTypeInt 16 0
-%PerViewPushConst_t = OpTypeStruct %ushort
-%_ptr_PushConstant_PerViewPushConst_t = OpTypePointer PushConstant %PerViewPushConst_t
-%__0 = OpVariable %_ptr_PushConstant_PerViewPushConst_t PushConstant
-%_ptr_PushConstant_ushort = OpTypePointer PushConstant %ushort
-%int_2 = OpConstant %int 2
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%30 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_30 = OpTypePointer UniformConstant %30
-%g_tColor = OpVariable %_ptr_UniformConstant_30 UniformConstant
-%32 = OpTypeSampler
-%_ptr_UniformConstant_32 = OpTypePointer UniformConstant %32
-%g_sAniso = OpVariable %_ptr_UniformConstant_32 UniformConstant
-%34 = OpTypeSampledImage %30
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%i_vTextureCoords = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_entryPointOutput_vColor = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v2float:%\w+]] = OpConstantNull %v2float
-)" + kImportStub + R"(
-%MainPs = OpFunction %void None %14
-%37 = OpLabel
-%38 = OpLoad %v2float %i_vTextureCoords
-%39 = OpAccessChain %_ptr_PushConstant_ushort %__0 %int_0
-%40 = OpLoad %ushort %39
-%41 = OpAccessChain %_ptr_Uniform_v2float %_ %int_0 %40 %int_2
-%42 = OpLoad %v2float %41
-%43 = OpFAdd %v2float %38 %42
-;CHECK-NOT: %42 = OpLoad %v2float %41
-;CHECK-NOT: %43 = OpFAdd %v2float %38 %42
-;CHECK: {{%\w+}} = OpUConvert %uint %40
-;CHECK: {{%\w+}} = OpIMul %uint %uint_80 {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_64
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_7
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_82 {{%\w+}} %uint_0 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v2float %41
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %v2float {{%\w+}} {{%\w+}} [[null_v2float]] {{%\w+}}
-;CHECK: %43 = OpFAdd %v2float %38 {{%\w+}}
-%44 = OpLoad %30 %g_tColor
-%45 = OpLoad %32 %g_sAniso
-%46 = OpSampledImage %34 %44 %45
-%47 = OpImageSampleImplicitLod %v4float %46 %43
-OpStore %_entryPointOutput_vColor %47
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, UniformMatrixRefRowMajor) {
- // The buffer-oob row major matrix check
- //
- // #version 450
- // #extension GL_EXT_scalar_block_layout : enable
- //
- // layout(location = 0) in highp vec4 a_position;
- // layout(location = 0) out mediump float v_vtxResult;
- //
- // layout(set = 0, binding = 0, std430, row_major) uniform Block
- // {
- // lowp mat4x2 var;
- // };
- //
- // void main (void)
- // {
- // v_vtxResult = var[2][1];
- // }
-
- // clang-format off
- std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Vertex %main "main" %v_vtxResult %_ %a_position
-;CHECK: OpEntryPoint Vertex %main "main" %v_vtxResult %_ %a_position %gl_VertexIndex %gl_InstanceIndex
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_scalar_block_layout"
-OpName %main "main"
-OpName %v_vtxResult "v_vtxResult"
-OpName %Block "Block"
-OpMemberName %Block 0 "var"
-OpName %_ ""
-OpName %a_position "a_position"
-OpDecorate %v_vtxResult RelaxedPrecision
-OpDecorate %v_vtxResult Location 0
-OpMemberDecorate %Block 0 RowMajor
-OpMemberDecorate %Block 0 RelaxedPrecision
-OpMemberDecorate %Block 0 Offset 0
-OpMemberDecorate %Block 0 MatrixStride 16
-OpDecorate %Block Block
-OpDecorate %_ DescriptorSet 0
-OpDecorate %_ Binding 0
-OpDecorate %21 RelaxedPrecision
-;CHECK-NOT: OpDecorate %21 RelaxedPrecision
-;CHECK: OpDecorate %v_vtxResult RelaxedPrecision
-;CHECK: OpDecorate [[phi_result:%\w+]] RelaxedPrecision
-OpDecorate %a_position Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_VertexIndex BuiltIn VertexIndex
-;CHECK: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
-;CHECK: OpDecorate [[load_result:%\w+]] RelaxedPrecision
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%v_vtxResult = OpVariable %_ptr_Output_float Output
-%v2float = OpTypeVector %float 2
-%mat4v2float = OpTypeMatrix %v2float 4
-%Block = OpTypeStruct %mat4v2float
-%_ptr_Uniform_Block = OpTypePointer Uniform %Block
-%_ = OpVariable %_ptr_Uniform_Block Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%int_2 = OpConstant %int 2
-%uint = OpTypeInt 32 0
-%uint_1 = OpConstant %uint 1
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-%v4float = OpTypeVector %float 4
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%a_position = OpVariable %_ptr_Input_v4float Input
-;CHECK: %_ptr_Input_uint = OpTypePointer Input %uint
-;CHECK: %gl_VertexIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: %gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-%20 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2 %uint_1
-%21 = OpLoad %float %20
-;CHECK-NOT: %21 = OpLoad %float %20
-;CHECK: {{%\w+}} = OpIMul %uint %uint_4 %int_2
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIMul %uint %uint_16 %uint_1
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_3
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[desc_state:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_46 {{%\w+}} %uint_0 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[desc_state]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[load_result]] = OpLoad %float %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result]] = OpPhi %float [[load_result]] {{%\w+}} [[null_float]] {{%\w+}}
-OpStore %v_vtxResult %21
-;CHECK-NOT: OpStore %v_vtxResult %21$
-;CHECK: OpStore %v_vtxResult [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, UniformMatrixRefColumnMajor) {
- // The buffer-oob column major matrix check
- //
- // #version 450
- // #extension GL_EXT_scalar_block_layout : enable
- //
- // layout(location = 0) in highp vec4 a_position;
- // layout(location = 0) out mediump float v_vtxResult;
- //
- // layout(set = 0, binding = 0, std430, column_major) uniform Block
- // {
- // lowp mat4x2 var;
- // };
- //
- // void main (void)
- // {
- // v_vtxResult = var[2][1];
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Vertex %main "main" %v_vtxResult %_ %a_position
-;CHECK: OpEntryPoint Vertex %main "main" %v_vtxResult %_ %a_position %gl_VertexIndex %gl_InstanceIndex
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_scalar_block_layout"
-OpName %main "main"
-OpName %v_vtxResult "v_vtxResult"
-OpName %Block "Block"
-OpMemberName %Block 0 "var"
-OpName %_ ""
-OpName %a_position "a_position"
-OpDecorate %v_vtxResult RelaxedPrecision
-OpDecorate %v_vtxResult Location 0
-OpMemberDecorate %Block 0 ColMajor
-OpMemberDecorate %Block 0 RelaxedPrecision
-OpMemberDecorate %Block 0 Offset 0
-OpMemberDecorate %Block 0 MatrixStride 8
-OpDecorate %Block Block
-OpDecorate %_ DescriptorSet 0
-OpDecorate %_ Binding 0
-OpDecorate %21 RelaxedPrecision
-;CHECK-NOT: OpDecorate %21 RelaxedPrecision
-;CHECK: OpDecorate %v_vtxResult RelaxedPrecision
-;CHECK: OpDecorate [[phi_result:%\w+]] RelaxedPrecision
-OpDecorate %a_position Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_VertexIndex BuiltIn VertexIndex
-;CHECK: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
-;CHECK: OpDecorate [[load_result:%\w+]] RelaxedPrecision
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%_ptr_Output_float = OpTypePointer Output %float
-%v_vtxResult = OpVariable %_ptr_Output_float Output
-%v2float = OpTypeVector %float 2
-%mat4v2float = OpTypeMatrix %v2float 4
-%Block = OpTypeStruct %mat4v2float
-%_ptr_Uniform_Block = OpTypePointer Uniform %Block
-%_ = OpVariable %_ptr_Uniform_Block Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%int_2 = OpConstant %int 2
-%uint = OpTypeInt 32 0
-%uint_1 = OpConstant %uint 1
-%_ptr_Uniform_float = OpTypePointer Uniform %float
-%v4float = OpTypeVector %float 4
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%a_position = OpVariable %_ptr_Input_v4float Input
-;CHECK: %_ptr_Input_uint = OpTypePointer Input %uint
-;CHECK: %gl_VertexIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: %gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: [[null_float:%\w+]] = OpConstantNull %float
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%20 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2 %uint_1
-%21 = OpLoad %float %20
-;CHECK-NOT: %21 = OpLoad %float %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpIMul %uint %uint_8 %int_2
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIMul %uint %uint_4 %uint_1
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_3
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[desc_state:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_46 {{%\w+}} %uint_0 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[desc_state]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK:[[load_result]] = OpLoad %float %20
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result]] = OpPhi %float [[load_result]] {{%\w+}} [[null_float]] {{%\w+}}
-OpStore %v_vtxResult %21
-;CHECK-NOT: OpStore %v_vtxResult %21$
-;CHECK: OpStore %v_vtxResult [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- ValidatorOptions()->uniform_buffer_standard_layout = true;
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, UniformMatrixVecRefRowMajor) {
- // The buffer-oob row major matrix vector ref check
- //
- // #version 450
- // #extension GL_EXT_scalar_block_layout : enable
- //
- // layout(location = 0) in highp vec4 a_position;
- // layout(location = 0) out highp vec2 v_vtxResult;
- //
- // layout(set = 3, binding = 7, std430, row_major) uniform Block
- // {
- // lowp mat2 var[3][4];
- // };
- //
- // void main (void)
- // {
- // v_vtxResult = var[2][3][1];
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Vertex %main "main" %v_vtxResult %_ %a_position
-;CHECK: OpEntryPoint Vertex %main "main" %v_vtxResult %_ %a_position %gl_VertexIndex %gl_InstanceIndex
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_scalar_block_layout"
-OpName %main "main"
-OpName %v_vtxResult "v_vtxResult"
-OpName %Block "Block"
-OpMemberName %Block 0 "var"
-OpName %_ ""
-OpName %a_position "a_position"
-OpDecorate %v_vtxResult Location 0
-OpDecorate %_arr_mat2v2float_uint_4 ArrayStride 32
-OpDecorate %_arr__arr_mat2v2float_uint_4_uint_3 ArrayStride 128
-OpMemberDecorate %Block 0 RowMajor
-OpMemberDecorate %Block 0 RelaxedPrecision
-OpMemberDecorate %Block 0 Offset 0
-OpMemberDecorate %Block 0 MatrixStride 16
-OpDecorate %Block Block
-OpDecorate %_ DescriptorSet 3
-OpDecorate %_ Binding 7
-OpDecorate %26 RelaxedPrecision
-;CHECK-NOT: OpDecorate %26 RelaxedPrecision
-;CHECK: OpDecorate [[phi_result:%\w+]] RelaxedPrecision
-OpDecorate %a_position Location 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_VertexIndex BuiltIn VertexIndex
-;CHECK: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
-;CHECK: OpDecorate [[load_result:%\w+]] RelaxedPrecision
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%_ptr_Output_v2float = OpTypePointer Output %v2float
-%v_vtxResult = OpVariable %_ptr_Output_v2float Output
-%mat2v2float = OpTypeMatrix %v2float 2
-%uint = OpTypeInt 32 0
-%uint_4 = OpConstant %uint 4
-%_arr_mat2v2float_uint_4 = OpTypeArray %mat2v2float %uint_4
-%uint_3 = OpConstant %uint 3
-%_arr__arr_mat2v2float_uint_4_uint_3 = OpTypeArray %_arr_mat2v2float_uint_4 %uint_3
-%Block = OpTypeStruct %_arr__arr_mat2v2float_uint_4_uint_3
-%_ptr_Uniform_Block = OpTypePointer Uniform %Block
-%_ = OpVariable %_ptr_Uniform_Block Uniform
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%int_2 = OpConstant %int 2
-%int_3 = OpConstant %int 3
-%int_1 = OpConstant %int 1
-%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
-%v4float = OpTypeVector %float 4
-%_ptr_Input_v4float = OpTypePointer Input %v4float
-%a_position = OpVariable %_ptr_Input_v4float Input
-;CHECK: %_ptr_Input_uint = OpTypePointer Input %uint
-;CHECK: %gl_VertexIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: %gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
-;CHECK: [[null_v2float:%\w+]] = OpConstantNull %v2float
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%25 = OpAccessChain %_ptr_Uniform_v2float %_ %int_0 %int_2 %int_3 %int_1
-;CHECK: {{%\w+}} = OpIMul %uint %uint_128 %int_2
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIMul %uint %uint_32 %int_3
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpIMul %uint %uint_4 %int_1
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_19
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[desc_state:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_52 {{%\w+}} %uint_3 %uint_7 %uint_0 {{%\w+}}
-%26 = OpLoad %v2float %25
-OpStore %v_vtxResult %26
-;CHECK-NOT: %26 = OpLoad %v2float %25
-;CHECK-NOT: OpStore %v_vtxResult %26
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[desc_state]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[load_result]] = OpLoad %v2float %25
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result]] = OpPhi %v2float [[load_result]] {{%\w+}} [[null_v2float]] {{%\w+}}
-;CHECK: OpStore %v_vtxResult [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, ImageBufferOOBRead) {
- // Texel buffer (imagebuffer) oob check for ImageRead
- //
- // #version 450
- // layout(set=3, binding=7, r32f) uniform readonly imageBuffer s;
- // layout(location=11) out vec4 x;
- // layout(location=13) in flat int ii;
- //
- // void main(){
- // x = imageLoad(s, ii);
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability ImageBuffer
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %x %s %ii
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpName %main "main"
-OpName %x "x"
-OpName %s "s"
-OpName %ii "ii"
-OpDecorate %x Location 11
-OpDecorate %s DescriptorSet 3
-OpDecorate %s Binding 7
-OpDecorate %s NonWritable
-OpDecorate %ii Flat
-OpDecorate %ii Location 13
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%x = OpVariable %_ptr_Output_v4float Output
-%10 = OpTypeImage %float Buffer 0 0 0 2 R32f
-%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
-%s = OpVariable %_ptr_UniformConstant_10 UniformConstant
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%ii = OpVariable %_ptr_Input_int Input
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-%main = OpFunction %void None %3
-%5 = OpLabel
-;CHECK: OpBranch %19
-;CHECK: %19 = OpLabel
-%13 = OpLoad %10 %s
-%17 = OpLoad %int %ii
-%18 = OpImageRead %v4float %13 %17
-OpStore %x %18
-;CHECK-NOT: %18 = OpImageRead %v4float %13 %17
-;CHECK-NOT: OpStore %x %18
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_34 {{%\w+}} %uint_3 %uint_7 %uint_0 %22
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %10 %s
-;CHECK: {{%\w+}} = OpImageRead %v4float {{%\w+}} %17
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %x [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, ImageBufferOOBWrite) {
- // Texel buffer (imagebuffer) oob check for ImageWrite
- //
- // #version 450
- // layout(set=3, binding=7, r32f) uniform readonly imageBuffer s;
- // layout(location=11) out vec4 x;
- // layout(location=13) in flat int ii;
- //
- // void main(){
- // imageStore(s, ii, x);
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability ImageBuffer
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %s %ii %x
-;CHECK: OpEntryPoint Fragment %main "main" %s %ii %x %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpName %main "main"
-OpName %s "s"
-OpName %ii "ii"
-OpName %x "x"
-OpDecorate %s DescriptorSet 3
-OpDecorate %s Binding 7
-OpDecorate %s NonReadable
-OpDecorate %ii Flat
-OpDecorate %ii Location 13
-OpDecorate %x Location 11
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%7 = OpTypeImage %float Buffer 0 0 0 2 R32f
-%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
-%s = OpVariable %_ptr_UniformConstant_7 UniformConstant
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%ii = OpVariable %_ptr_Input_int Input
-%v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%x = OpVariable %_ptr_Output_v4float Output
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: %19 = OpLabel
-%10 = OpLoad %7 %s
-%14 = OpLoad %int %ii
-%18 = OpLoad %v4float %x
-OpImageWrite %10 %14 %18
-;CHECK-NOT: OpImageWrite %10 %14 %18
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_35 {{%\w+}} %uint_3 %uint_7 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %7 %s
-;CHECK: OpImageWrite {{%\w+}} %14 %18
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, TextureBufferOOBFetch) {
- // Texel buffer (texturebuffer) oob check for ImageFetch
- //
- // #version 450
- // layout(set=3, binding=7) uniform textureBuffer s;
- // layout(location=11) out vec4 x;
- // layout(location=13) in flat int ii;
- //
- // void main(){
- // x = texelFetch(s, ii);
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability SampledBuffer
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %x %s %ii
-;CHECK: OpEntryPoint Fragment %main "main" %x %s %ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpName %main "main"
-OpName %x "x"
-OpName %s "s"
-OpName %ii "ii"
-OpDecorate %x Location 11
-OpDecorate %s DescriptorSet 3
-OpDecorate %s Binding 7
-OpDecorate %ii Flat
-OpDecorate %ii Location 13
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%x = OpVariable %_ptr_Output_v4float Output
-%10 = OpTypeImage %float Buffer 0 0 0 1 Unknown
-%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
-%s = OpVariable %_ptr_UniformConstant_10 UniformConstant
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%ii = OpVariable %_ptr_Input_int Input
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-%main = OpFunction %void None %3
-%5 = OpLabel
-;CHECK: OpBranch %19
-;CHECK: %19 = OpLabel
-%13 = OpLoad %10 %s
-%17 = OpLoad %int %ii
-%18 = OpImageFetch %v4float %13 %17
-OpStore %x %18
-;CHECK-NOT: %18 = OpImageFetch %v4float %13 %17
-;CHECK-NOT: OpStore %x %18
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_33 {{%\w+}} %uint_3 %uint_7 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %10 %s
-;CHECK: {{%\w+}} = OpImageFetch %v4float {{%\w+}} %17
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %x [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, SamplerBufferOOBFetch) {
- // Texel buffer (samplerbuffer) oob check for ImageFetch
- //
- // #version 450
- // layout(set=3, binding=7) uniform samplerBuffer s;
- // layout(location=11) out vec4 x;
- // layout(location=13) in flat int ii;
- //
- // void main(){
- // x = texelFetch(s, ii);
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability SampledBuffer
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %x %s %ii
-;CHECK: OpEntryPoint Fragment %main "main" %x %s %ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpName %main "main"
-OpName %x "x"
-OpName %s "s"
-OpName %ii "ii"
-OpDecorate %x Location 11
-OpDecorate %s DescriptorSet 3
-OpDecorate %s Binding 7
-OpDecorate %ii Flat
-OpDecorate %ii Location 13
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%x = OpVariable %_ptr_Output_v4float Output
-%10 = OpTypeImage %float Buffer 0 0 0 1 Unknown
-%11 = OpTypeSampledImage %10
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
-%s = OpVariable %_ptr_UniformConstant_11 UniformConstant
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%ii = OpVariable %_ptr_Input_int Input
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-;CHECK: OpBranch %21
-;CHECK: %21 = OpLabel
-%14 = OpLoad %11 %s
-%18 = OpLoad %int %ii
-%19 = OpImage %10 %14
-%20 = OpImageFetch %v4float %19 %18
-OpStore %x %20
-;CHECK-NOT: %20 = OpImageFetch %v4float %19 %18
-;CHECK-NOT: OpStore %x %20
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_35 {{%\w+}} %uint_3 %uint_7 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %11 %s
-;CHECK: {{%\w+}} = OpImage %10 {{%\w+}}
-;CHECK: {{%\w+}} = OpImageFetch %v4float {{%\w+}} {{%\w+}}
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %x [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, SamplerBufferConstructorOOBFetch) {
- // Texel buffer (samplerbuffer constructor) oob check for ImageFetch
- //
- // #version 450
- // layout(set=3, binding=7) uniform textureBuffer tBuf;
- // layout(set=3, binding=8) uniform sampler s;
- // layout(location=11) out vec4 x;
- // layout(location=13) in flat int ii;
- //
- // void main(){
- // x = texelFetch(samplerBuffer(tBuf, s), ii);
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability SampledBuffer
-;CHECK: OpCapability Linkage
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %main "main" %x %tBuf %s %ii
-;CHECK: OpEntryPoint Fragment %main "main" %x %tBuf %s %ii %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpName %main "main"
-OpName %x "x"
-OpName %tBuf "tBuf"
-OpName %s "s"
-OpName %ii "ii"
-OpDecorate %x Location 11
-OpDecorate %tBuf DescriptorSet 3
-OpDecorate %tBuf Binding 7
-OpDecorate %s DescriptorSet 3
-OpDecorate %s Binding 8
-OpDecorate %ii Flat
-OpDecorate %ii Location 13
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%x = OpVariable %_ptr_Output_v4float Output
-%10 = OpTypeImage %float Buffer 0 0 0 1 Unknown
-%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
-%tBuf = OpVariable %_ptr_UniformConstant_10 UniformConstant
-%14 = OpTypeSampler
-%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14
-%s = OpVariable %_ptr_UniformConstant_14 UniformConstant
-%18 = OpTypeSampledImage %10
-%int = OpTypeInt 32 1
-%_ptr_Input_int = OpTypePointer Input %int
-%ii = OpVariable %_ptr_Input_int Input
-;CHECK: %_ptr_Input_v4float = OpTypePointer Input %v4float
-;CHECK: %gl_FragCoord = OpVariable %_ptr_Input_v4float Input
-;CHECK: [[null_v4float:%\w+]] = OpConstantNull %v4float
-%main = OpFunction %void None %3
-%5 = OpLabel
-%13 = OpLoad %10 %tBuf
-%17 = OpLoad %14 %s
-%19 = OpSampledImage %18 %13 %17
-%23 = OpLoad %int %ii
-%24 = OpImage %10 %19
-%25 = OpImageFetch %v4float %24 %23
-OpStore %x %25
-;CHECK-NOT: %25 = OpImageFetch %v4float %24 %23
-;CHECK-NOT: OpStore %x %25
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_43 {{%\w+}} %uint_3 %uint_7 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %10 %tBuf
-;CHECK: {{%\w+}} = OpSampledImage %18 {{%\w+}} %17
-;CHECK: {{%\w+}} = OpImage %10 {{%\w+}}
-;CHECK: {{%\w+}} = OpImageFetch %v4float {{%\w+}} %23
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v4float {{%\w+}} {{%\w+}} [[null_v4float]] {{%\w+}}
-;CHECK: OpStore %x [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, DeviceBufferAddressOOB) {
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
- // layout(buffer_reference, buffer_reference_align = 16) buffer bufStruct;
- // layout(set = 0, binding = 0) uniform ufoo {
- // bufStruct data;
- // int nWrites;
- // } u_info;
- // layout(buffer_reference, std140) buffer bufStruct {
- // int a[4];
- // };
- // void main() {
- // for (int i=0; i < u_info.nWrites; ++i) {
- // u_info.data.a[i] = 0xdeadca71;
- // }
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability PhysicalStorageBufferAddresses
-;CHECK: OpCapability Linkage
-;CHECK: OpCapability Int64
-OpExtension "SPV_KHR_physical_storage_buffer"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Vertex %main "main" %u_info
-;CHECK: OpEntryPoint Vertex %main "main" %u_info %gl_VertexIndex %gl_InstanceIndex
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_buffer_reference"
-OpName %main "main"
-OpName %i "i"
-OpName %ufoo "ufoo"
-OpMemberName %ufoo 0 "data"
-OpMemberName %ufoo 1 "nWrites"
-OpName %bufStruct "bufStruct"
-OpMemberName %bufStruct 0 "a"
-OpName %u_info "u_info"
-OpMemberDecorate %ufoo 0 Offset 0
-OpMemberDecorate %ufoo 1 Offset 8
-OpDecorate %ufoo Block
-OpDecorate %_arr_int_uint_4 ArrayStride 16
-OpMemberDecorate %bufStruct 0 Offset 0
-OpDecorate %bufStruct Block
-OpDecorate %u_info DescriptorSet 0
-OpDecorate %u_info Binding 0
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
-%int_0 = OpConstant %int 0
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_bufStruct PhysicalStorageBuffer
-%ufoo = OpTypeStruct %_ptr_PhysicalStorageBuffer_bufStruct %int
-%uint = OpTypeInt 32 0
-%uint_4 = OpConstant %uint 4
-%_arr_int_uint_4 = OpTypeArray %int %uint_4
-%bufStruct = OpTypeStruct %_arr_int_uint_4
-%_ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer PhysicalStorageBuffer %bufStruct
-%_ptr_Uniform_ufoo = OpTypePointer Uniform %ufoo
-%u_info = OpVariable %_ptr_Uniform_ufoo Uniform
-%int_1 = OpConstant %int 1
-%_ptr_Uniform_int = OpTypePointer Uniform %int
-%bool = OpTypeBool
-%_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBuffer_bufStruct
-%int_n559035791 = OpConstant %int -559035791
-%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%i = OpVariable %_ptr_Function_int Function
-OpStore %i %int_0
-OpBranch %10
-%10 = OpLabel
-OpLoopMerge %12 %13 None
-OpBranch %14
-%14 = OpLabel
-%15 = OpLoad %int %i
-%26 = OpAccessChain %_ptr_Uniform_int %u_info %int_1
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_8 %uint_3
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_56 {{%\w+}} %uint_0 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[load_result:%\w+]] = OpLoad %int %26
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %int [[load_result]] {{%\w+}} {{%\w+}} {{%\w+}}
-%27 = OpLoad %int %26
-%29 = OpSLessThan %bool %15 %27
-;CHECK-NOT: %27 = OpLoad %int %26
-;CHECK-NOT: %29 = OpSLessThan %bool %15 %27
-;CHECK: %29 = OpSLessThan %bool %15 [[phi_result]]
-OpBranchConditional %29 %11 %12
-%11 = OpLabel
-%31 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct %u_info %int_0
-%32 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %31
-;CHECK-NOT: %32 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %31
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 %uint_7
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_61 {{%\w+}} %uint_0 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[load_result_2:%\w+]] = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %31
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpConvertUToPtr %_ptr_PhysicalStorageBuffer_bufStruct {{%\w+}}
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result_2:%\w+]] = OpPhi %_ptr_PhysicalStorageBuffer_bufStruct [[load_result_2]] {{%\w+}} {{%\w+}} {{%\w+}}
-%33 = OpLoad %int %i
-%36 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %32 %int_0 %33
-;CHECK-NOT: %36 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %32 %int_0 %33
-;CHECK: %36 = OpAccessChain %_ptr_PhysicalStorageBuffer_int [[phi_result_2]] %int_0 %33
-OpStore %36 %int_n559035791 Aligned 16
-OpBranch %13
-%13 = OpLabel
-%37 = OpLoad %int %i
-%38 = OpIAdd %int %37 %int_1
-OpStore %i %38
-OpBranch %10
-%12 = OpLabel
-OpReturn
-OpFunctionEnd)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-TEST_F(InstBindlessTest, VertexIndexOOB) {
- // #version 450
- // layout(std140, binding = 0) uniform foo { uint tex_index[1]; }
- // uniform_index_buffer; layout(location = 0) out flat uint index; vec2
- // vertices[3]; void main() {
- // vertices[0] = vec2(-1.0, -1.0);
- // vertices[1] = vec2( 1.0, -1.0);
- // vertices[2] = vec2( 0.0, 1.0);
- // gl_Position = vec4(vertices[gl_VertexIndex % 3], 0.0, 1.0);
- // index = uniform_index_buffer.tex_index[0];
- // }
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Vertex %main "main" %vertices %_ %gl_VertexIndex %index %uniform_index_buffer
-OpSource GLSL 450
-OpName %main "main"
-OpName %vertices "vertices"
-OpName %gl_PerVertex "gl_PerVertex"
-OpMemberName %gl_PerVertex 0 "gl_Position"
-OpMemberName %gl_PerVertex 1 "gl_PointSize"
-OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
-OpMemberName %gl_PerVertex 3 "gl_CullDistance"
-OpName %_ ""
-OpName %gl_VertexIndex "gl_VertexIndex"
-OpName %index "index"
-OpName %foo "foo"
-OpMemberName %foo 0 "tex_index"
-OpName %uniform_index_buffer "uniform_index_buffer"
-OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
-OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
-OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
-OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
-OpDecorate %gl_PerVertex Block
-OpDecorate %gl_VertexIndex BuiltIn VertexIndex
-OpDecorate %index Flat
-OpDecorate %index Location 0
-OpDecorate %_arr_uint_uint_1 ArrayStride 16
-OpMemberDecorate %foo 0 Offset 0
-OpDecorate %foo Block
-OpDecorate %uniform_index_buffer DescriptorSet 0
-OpDecorate %uniform_index_buffer Binding 0
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%uint = OpTypeInt 32 0
-%uint_3 = OpConstant %uint 3
-%_arr_v2float_uint_3 = OpTypeArray %v2float %uint_3
-%_ptr_Private__arr_v2float_uint_3 = OpTypePointer Private %_arr_v2float_uint_3
-%vertices = OpVariable %_ptr_Private__arr_v2float_uint_3 Private
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%float_n1 = OpConstant %float -1
-%16 = OpConstantComposite %v2float %float_n1 %float_n1
-%_ptr_Private_v2float = OpTypePointer Private %v2float
-%int_1 = OpConstant %int 1
-%float_1 = OpConstant %float 1
-%21 = OpConstantComposite %v2float %float_1 %float_n1
-%int_2 = OpConstant %int 2
-%float_0 = OpConstant %float 0
-%25 = OpConstantComposite %v2float %float_0 %float_1
-%v4float = OpTypeVector %float 4
-%uint_1 = OpConstant %uint 1
-%_arr_float_uint_1 = OpTypeArray %float %uint_1
-%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
-%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
-%_ = OpVariable %_ptr_Output_gl_PerVertex Output
-%_ptr_Input_int = OpTypePointer Input %int
-%gl_VertexIndex = OpVariable %_ptr_Input_int Input
-%int_3 = OpConstant %int 3
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%_ptr_Output_uint = OpTypePointer Output %uint
-%index = OpVariable %_ptr_Output_uint Output
-%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
-%foo = OpTypeStruct %_arr_uint_uint_1
-%_ptr_Uniform_foo = OpTypePointer Uniform %foo
-%uniform_index_buffer = OpVariable %_ptr_Uniform_foo Uniform
-%_ptr_Uniform_uint = OpTypePointer Uniform %uint
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%18 = OpAccessChain %_ptr_Private_v2float %vertices %int_0
-OpStore %18 %16
-%22 = OpAccessChain %_ptr_Private_v2float %vertices %int_1
-OpStore %22 %21
-%26 = OpAccessChain %_ptr_Private_v2float %vertices %int_2
-OpStore %26 %25
-%35 = OpLoad %int %gl_VertexIndex
-%37 = OpSMod %int %35 %int_3
-%38 = OpAccessChain %_ptr_Private_v2float %vertices %37
-%39 = OpLoad %v2float %38
-%40 = OpCompositeExtract %float %39 0
-%41 = OpCompositeExtract %float %39 1
-%42 = OpCompositeConstruct %v4float %40 %41 %float_0 %float_1
-%44 = OpAccessChain %_ptr_Output_v4float %_ %int_0
-OpStore %44 %42
-%52 = OpAccessChain %_ptr_Uniform_uint %uniform_index_buffer %int_0 %int_0
-%53 = OpLoad %uint %52
-;CHECK-NOT: %53 = OpLoad %uint %52
-;CHECK: {{%\w+}} = OpIMul %uint %uint_16 %int_0
-;CHECK: {{%\w+}} = OpIAdd %uint %uint_0 {{%\w+}}
-;CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_3
-;CHECK: {{%\w+}} = OpLoad %int %gl_VertexIndex
-;CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_87 {{%\w+}} %uint_0 %uint_0 %uint_0 {{%\w+}}
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %uint %52
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %uint {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %index [[phi_result]]
-OpStore %index %53
-;CHECK-NOT: OpStore %index %53
-OpReturn
-;CHECK: OpReturn
-OpFunctionEnd)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBindlessCheckPass>(text, true, 23u);
-}
-
-// TODO(greg-lunarg): Add tests to verify handling of these cases:
-//
-// Compute shader
-// Geometry shader
-// Tessellation control shader
-// Tessellation eval shader
-// OpImage
-// SampledImage variable
-
-} // namespace
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/inst_buff_addr_check_test.cpp b/third_party/SPIRV-Tools/test/opt/inst_buff_addr_check_test.cpp
deleted file mode 100644
index 72d3438..0000000
--- a/third_party/SPIRV-Tools/test/opt/inst_buff_addr_check_test.cpp
+++ /dev/null
@@ -1,772 +0,0 @@
-// Copyright (c) 2019-2022 Valve Corporation
-// Copyright (c) 2019-2022 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Bindless Check Instrumentation Tests.
-// Tests ending with V2 use version 2 record format.
-
-#include <string>
-#include <vector>
-
-#include "test/opt/pass_fixture.h"
-#include "test/opt/pass_utils.h"
-
-namespace spvtools {
-namespace opt {
-namespace {
-
-static const std::string kFuncName = "inst_buff_addr_search_and_test";
-static const std::string kImportDeco = R"(
-;CHECK: OpDecorate %)" + kFuncName + R"( LinkageAttributes ")" +
- kFuncName + R"(" Import
-)";
-static const std::string kImportStub = R"(
-;CHECK: %)" + kFuncName + R"( = OpFunction %bool None {{%\w+}}
-;CHECK: OpFunctionEnd
-)";
-// clang-format on
-
-using InstBuffAddrTest = PassTest<::testing::Test>;
-
-TEST_F(InstBuffAddrTest, InstPhysicalStorageBufferStore) {
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
- //
- // layout(buffer_reference, buffer_reference_align = 16) buffer bufStruct;
- //
- // layout(set = 0, binding = 0) uniform ufoo {
- // bufStruct data;
- // uint offset;
- // } u_info;
- //
- // layout(buffer_reference, std140) buffer bufStruct {
- // layout(offset = 0) int a[2];
- // layout(offset = 32) int b;
- // };
- //
- // void main() {
- // u_info.data.b = 0xca7;
- // }
-
- const std::string defs = R"(
-OpCapability Shader
-OpCapability PhysicalStorageBufferAddresses
-;CHECK: OpCapability Int64
-OpExtension "SPV_EXT_physical_storage_buffer"
-;CHECK: OpExtension "SPV_KHR_storage_buffer_storage_class"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint GLCompute %main "main"
-;CHECK: OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
-OpExecutionMode %main LocalSize 1 1 1
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_buffer_reference"
-OpName %main "main"
-OpName %ufoo "ufoo"
-OpMemberName %ufoo 0 "data"
-OpMemberName %ufoo 1 "offset"
-OpName %bufStruct "bufStruct"
-OpMemberName %bufStruct 0 "a"
-OpMemberName %bufStruct 1 "b"
-OpName %u_info "u_info"
-)";
-
- // clang-format off
- const std::string decorates = R"(
-OpMemberDecorate %ufoo 0 Offset 0
-OpMemberDecorate %ufoo 1 Offset 8
-OpDecorate %ufoo Block
-OpDecorate %_arr_int_uint_2 ArrayStride 16
-OpMemberDecorate %bufStruct 0 Offset 0
-OpMemberDecorate %bufStruct 1 Offset 32
-OpDecorate %bufStruct Block
-OpDecorate %u_info DescriptorSet 0
-OpDecorate %u_info Binding 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
-)";
-
- const std::string globals = R"(
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_bufStruct PhysicalStorageBuffer
-%uint = OpTypeInt 32 0
-%ufoo = OpTypeStruct %_ptr_PhysicalStorageBuffer_bufStruct %uint
-%int = OpTypeInt 32 1
-%uint_2 = OpConstant %uint 2
-%_arr_int_uint_2 = OpTypeArray %int %uint_2
-%bufStruct = OpTypeStruct %_arr_int_uint_2 %int
-%_ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer PhysicalStorageBuffer %bufStruct
-%_ptr_Uniform_ufoo = OpTypePointer Uniform %ufoo
-%u_info = OpVariable %_ptr_Uniform_ufoo Uniform
-%int_0 = OpConstant %int 0
-%_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBuffer_bufStruct
-%int_1 = OpConstant %int 1
-%int_3239 = OpConstant %int 3239
-%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int
-;CHECK: %ulong = OpTypeInt 64 0
-;CHECK: %bool = OpTypeBool
-;CHECK: %v3uint = OpTypeVector %uint 3
-;CHECK: %_ptr_Input_v3uint = OpTypePointer Input %v3uint
-;CHECK: %gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
-)";
-// clang-format off
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%17 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct %u_info %int_0
-%18 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %17
-%22 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %18 %int_1
-;CHECK-NOT: %17 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct %u_info %int_0
-;CHECK-NOT: %18 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %17
-;CHECK-NOT: %22 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %18 %int_1
-;CHECK: %20 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct %u_info %int_0
-;CHECK: %21 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %20
-;CHECK: %22 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %21 %int_1
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %22
-;CHECK: {{%\w+}} = OpLoad %v3uint %gl_GlobalInvocationID
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_49 {{%\w+}} {{%\w+}} %uint_4
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpStore %22 %int_3239 Aligned 16
-;CHECK: OpStore %22 %int_3239 Aligned 16
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
-
- // SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBuffAddrCheckPass>(
- defs + decorates + globals + kImportStub + main_func, true, 23u);
-}
-
-TEST_F(InstBuffAddrTest, InstPhysicalStorageBufferLoadAndStore) {
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
-
- // // forward reference
- // layout(buffer_reference) buffer blockType;
-
- // layout(buffer_reference, std430, buffer_reference_align = 16) buffer
- // blockType {
- // int x;
- // blockType next;
- // };
-
- // layout(std430) buffer rootBlock {
- // blockType root;
- // } r;
-
- // void main()
- // {
- // blockType b = r.root;
- // b = b.next;
- // b.x = 531;
- // }
-
- const std::string defs = R"(
-OpCapability Shader
-OpCapability PhysicalStorageBufferAddresses
-;CHECK: OpCapability Int64
-OpExtension "SPV_EXT_physical_storage_buffer"
-OpExtension "SPV_KHR_storage_buffer_storage_class"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint GLCompute %main "main"
-OpExecutionMode %main LocalSize 1 1 1
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_buffer_reference"
-OpName %main "main"
-;CHECK: OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
-OpName %blockType "blockType"
-OpMemberName %blockType 0 "x"
-OpMemberName %blockType 1 "next"
-OpName %rootBlock "rootBlock"
-OpMemberName %rootBlock 0 "root"
-OpName %r "r"
-)";
-
-// clang-format off
- const std::string decorates = R"(
-OpMemberDecorate %blockType 0 Offset 0
-OpMemberDecorate %blockType 1 Offset 8
-OpDecorate %blockType Block
-OpMemberDecorate %rootBlock 0 Offset 0
-OpDecorate %rootBlock Block
-OpDecorate %r DescriptorSet 0
-OpDecorate %r Binding 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
-)";
-
- const std::string globals = R"(
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_blockType PhysicalStorageBuffer
-%int = OpTypeInt 32 1
-%blockType = OpTypeStruct %int %_ptr_PhysicalStorageBuffer_blockType
-%_ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %blockType
-%rootBlock = OpTypeStruct %_ptr_PhysicalStorageBuffer_blockType
-%_ptr_StorageBuffer_rootBlock = OpTypePointer StorageBuffer %rootBlock
-%r = OpVariable %_ptr_StorageBuffer_rootBlock StorageBuffer
-%int_0 = OpConstant %int 0
-%_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBuffer_blockType
-%int_1 = OpConstant %int 1
-%_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %_ptr_PhysicalStorageBuffer_blockType
-%int_531 = OpConstant %int 531
-%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%16 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType %r %int_0
-%17 = OpLoad %_ptr_PhysicalStorageBuffer_blockType %16
-%21 = OpAccessChain %_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType %17 %int_1
-%22 = OpLoad %_ptr_PhysicalStorageBuffer_blockType %21 Aligned 8
-%26 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %22 %int_0
-OpStore %26 %int_531 Aligned 16
-;CHECK-NOT: %22 = OpLoad %_ptr_PhysicalStorageBuffer_blockType %21 Aligned 8
-;CHECK-NOT: %26 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %22 %int_0
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %21
-;CHECK: {{%\w+}} = OpLoad %v3uint %gl_GlobalInvocationID
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_45 {{%\w+}} {{%\w+}} %uint_8
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %_ptr_PhysicalStorageBuffer_blockType %21 Aligned 8
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpConvertUToPtr %_ptr_PhysicalStorageBuffer_blockType %52
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpPhi %_ptr_PhysicalStorageBuffer_blockType {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: %26 = OpAccessChain %_ptr_PhysicalStorageBuffer_int {{%\w+}} %int_0
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %26
-;CHECK: {{%\w+}} = OpLoad %v3uint %gl_GlobalInvocationID
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 2
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_5 {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_47 {{%\w+}} {{%\w+}} %uint_4
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %26 %int_531 Aligned 16
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBuffAddrCheckPass>(
- defs + decorates + globals + kImportStub + main_func, true, 23u);
-}
-
-TEST_F(InstBuffAddrTest, StructLoad) {
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
- // #extension GL_ARB_gpu_shader_int64 : enable
- // struct Test {
- // float a;
- // };
- //
- // layout(buffer_reference, std430, buffer_reference_align = 16) buffer
- // TestBuffer { Test test; };
- //
- // Test GetTest(uint64_t ptr) {
- // return TestBuffer(ptr).test;
- // }
- //
- // void main() {
- // GetTest(0xe0000000);
- // }
-
- const std::string defs =
- R"(
-OpCapability Shader
-OpCapability Int64
-OpCapability PhysicalStorageBufferAddresses
-;CHECK: OpExtension "SPV_KHR_storage_buffer_storage_class"
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Fragment %main "main"
-;CHECK: OpEntryPoint Fragment %main "main" %gl_FragCoord
-OpExecutionMode %main OriginUpperLeft
-OpSource GLSL 450
-OpSourceExtension "GL_ARB_gpu_shader_int64"
-OpSourceExtension "GL_EXT_buffer_reference"
-OpName %main "main"
-OpName %Test "Test"
-OpMemberName %Test 0 "a"
-OpName %Test_0 "Test"
-OpMemberName %Test_0 0 "a"
-OpName %TestBuffer "TestBuffer"
-OpMemberName %TestBuffer 0 "test"
-)";
-
- // clang-format off
- const std::string decorates = R"(
-OpMemberDecorate %Test_0 0 Offset 0
-OpMemberDecorate %TestBuffer 0 Offset 0
-OpDecorate %TestBuffer Block
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_FragCoord BuiltIn FragCoord
-)";
-
- const std::string globals = R"(
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%ulong = OpTypeInt 64 0
-%float = OpTypeFloat 32
-%Test = OpTypeStruct %float
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_TestBuffer PhysicalStorageBuffer
-%Test_0 = OpTypeStruct %float
-%TestBuffer = OpTypeStruct %Test_0
-%_ptr_PhysicalStorageBuffer_TestBuffer = OpTypePointer PhysicalStorageBuffer %TestBuffer
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%_ptr_PhysicalStorageBuffer_Test_0 = OpTypePointer PhysicalStorageBuffer %Test_0
-%ulong_18446744073172680704 = OpConstant %ulong 18446744073172680704
-;CHECK: {{%\w+}} = OpConstantNull %Test_0
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%37 = OpConvertUToPtr %_ptr_PhysicalStorageBuffer_TestBuffer %ulong_18446744073172680704
-%38 = OpAccessChain %_ptr_PhysicalStorageBuffer_Test_0 %37 %int_0
-%39 = OpLoad %Test_0 %38 Aligned 16
-;CHECK-NOT: %39 = OpLoad %Test_0 %38 Aligned 16
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %38
-;CHECK: {{%\w+}} = OpLoad %v4float %gl_FragCoord
-;CHECK: {{%\w+}} = OpBitcast %v4uint {{%\w+}}
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 0
-;CHECK: {{%\w+}} = OpCompositeExtract %uint {{%\w+}} 1
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_4 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_38 {{%\w+}} {{%\w+}} %uint_4
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %Test_0 %38 Aligned 16
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %Test_0 {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-%40 = OpCopyLogical %Test %39
-;CHECK-NOT: %40 = OpCopyLogical %Test %39
-;CHECK: %40 = OpCopyLogical %Test [[phi_result]]
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBuffAddrCheckPass>(
- defs + decorates + globals + kImportStub + main_func, true);
-}
-
-TEST_F(InstBuffAddrTest, PaddedStructLoad) {
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
- // #extension GL_ARB_gpu_shader_int64 : enable
- // struct Test {
- // uvec3 pad_1; // Offset 0 Size 12
- // double pad_2; // Offset 16 Size 8 (alignment requirement)
- // float a; // Offset 24 Size 4
- // }; // Total Size 28
- //
- // layout(buffer_reference, std430, buffer_reference_align = 16) buffer
- // TestBuffer { Test test; };
- //
- // Test GetTest(uint64_t ptr) {
- // return TestBuffer(ptr).test;
- // }
- //
- // void main() {
- // GetTest(0xe0000000);
- // }
-
- const std::string defs =
- R"(
-OpCapability Shader
-OpCapability Float64
-OpCapability Int64
-OpCapability PhysicalStorageBufferAddresses
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Vertex %main "main"
-OpSource GLSL 450
-OpSourceExtension "GL_ARB_gpu_shader_int64"
-OpSourceExtension "GL_EXT_buffer_reference"
-OpName %main "main"
-OpName %Test "Test"
-OpMemberName %Test 0 "pad_1"
-OpMemberName %Test 1 "pad_2"
-OpMemberName %Test 2 "a"
-OpName %GetTest_u641_ "GetTest(u641;"
-OpName %ptr "ptr"
-OpName %Test_0 "Test"
-OpMemberName %Test_0 0 "pad_1"
-OpMemberName %Test_0 1 "pad_2"
-OpMemberName %Test_0 2 "a"
-OpName %TestBuffer "TestBuffer"
-OpMemberName %TestBuffer 0 "test"
-OpName %param "param"
-)";
-
- // clang-format off
- const std::string decorates = R"(
-OpDecorate %TestBuffer Block
-OpMemberDecorate %Test_0 0 Offset 0
-OpMemberDecorate %Test_0 1 Offset 16
-OpMemberDecorate %Test_0 2 Offset 24
-OpMemberDecorate %TestBuffer 0 Offset 0
-)" + kImportDeco + R"(
-;CHECK: OpDecorate %gl_VertexIndex BuiltIn VertexIndex
-;CHECK: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
-)";
-
- const std::string globals = R"(
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%ulong = OpTypeInt 64 0
-%_ptr_Function_ulong = OpTypePointer Function %ulong
-%uint = OpTypeInt 32 0
-%v3uint = OpTypeVector %uint 3
-%double = OpTypeFloat 64
-%float = OpTypeFloat 32
-%Test = OpTypeStruct %v3uint %double %float
-%13 = OpTypeFunction %Test %_ptr_Function_ulong
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_TestBuffer PhysicalStorageBuffer
-%Test_0 = OpTypeStruct %v3uint %double %float
-%TestBuffer = OpTypeStruct %Test_0
-%_ptr_PhysicalStorageBuffer_TestBuffer = OpTypePointer PhysicalStorageBuffer %TestBuffer
-%int = OpTypeInt 32 1
-%int_0 = OpConstant %int 0
-%_ptr_PhysicalStorageBuffer_Test_0 = OpTypePointer PhysicalStorageBuffer %Test_0
-%_ptr_Function_Test = OpTypePointer Function %Test
-%ulong_18446744073172680704 = OpConstant %ulong 18446744073172680704
-;CHECK: {{%\w+}} = OpConstantNull %Test_0
-)";
-
- const std::string main_func = R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%param = OpVariable %_ptr_Function_ulong Function
-OpStore %param %ulong_18446744073172680704
-%35 = OpFunctionCall %Test %GetTest_u641_ %param
-OpReturn
-OpFunctionEnd
-%GetTest_u641_ = OpFunction %Test None %13
-%ptr = OpFunctionParameter %_ptr_Function_ulong
-%16 = OpLabel
-%28 = OpVariable %_ptr_Function_Test Function
-%17 = OpLoad %ulong %ptr
-%21 = OpConvertUToPtr %_ptr_PhysicalStorageBuffer_TestBuffer %17
-%25 = OpAccessChain %_ptr_PhysicalStorageBuffer_Test_0 %21 %int_0
-%26 = OpLoad %Test_0 %25 Aligned 16
-%29 = OpCopyLogical %Test %26
-;CHECK-NOT: %30 = OpLoad %Test %28
-;CHECK-NOT: %26 = OpLoad %Test_0 %25 Aligned 16
-;CHECK-NOT: %29 = OpCopyLogical %Test %26
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %25
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_63 {{%\w+}} {{%\w+}} %uint_28
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %Test_0 %25 Aligned 16
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %Test_0 {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: %29 = OpCopyLogical %Test [[phi_result]]
-OpStore %28 %29
-%30 = OpLoad %Test %28
-OpReturnValue %30
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBuffAddrCheckPass>(
- defs + decorates + globals + kImportStub + main_func, true);
-}
-
-TEST_F(InstBuffAddrTest, DeviceBufferAddressOOB) {
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
- // layout(buffer_reference, buffer_reference_align = 16) buffer bufStruct;
- // layout(set = 0, binding = 0) uniform ufoo {
- // bufStruct data;
- // int nWrites;
- // } u_info;
- // layout(buffer_reference, std140) buffer bufStruct {
- // int a[4];
- // };
- // void main() {
- // for (int i=0; i < u_info.nWrites; ++i) {
- // u_info.data.a[i] = 0xdeadca71;
- // }
- // }
-
- // clang-format off
- const std::string text = R"(
-OpCapability Shader
-OpCapability PhysicalStorageBufferAddresses
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Vertex %main "main" %u_info
-;CHECK: OpEntryPoint Vertex %main "main" %u_info %gl_VertexIndex %gl_InstanceIndex
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_buffer_reference"
-OpName %main "main"
-OpName %i "i"
-OpName %ufoo "ufoo"
-OpMemberName %ufoo 0 "data"
-OpMemberName %ufoo 1 "nWrites"
-OpName %bufStruct "bufStruct"
-OpMemberName %bufStruct 0 "a"
-OpName %u_info "u_info"
-OpMemberDecorate %ufoo 0 Offset 0
-OpMemberDecorate %ufoo 1 Offset 8
-OpDecorate %ufoo Block
-OpDecorate %_arr_int_uint_4 ArrayStride 16
-OpMemberDecorate %bufStruct 0 Offset 0
-OpDecorate %bufStruct Block
-OpDecorate %u_info DescriptorSet 0
-OpDecorate %u_info Binding 0
-)" + kImportDeco + R"(
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
-%int_0 = OpConstant %int 0
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_bufStruct PhysicalStorageBuffer
-%ufoo = OpTypeStruct %_ptr_PhysicalStorageBuffer_bufStruct %int
-%uint = OpTypeInt 32 0
-%uint_4 = OpConstant %uint 4
-%_arr_int_uint_4 = OpTypeArray %int %uint_4
-%bufStruct = OpTypeStruct %_arr_int_uint_4
-%_ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer PhysicalStorageBuffer %bufStruct
-%_ptr_Uniform_ufoo = OpTypePointer Uniform %ufoo
-%u_info = OpVariable %_ptr_Uniform_ufoo Uniform
-%int_1 = OpConstant %int 1
-%_ptr_Uniform_int = OpTypePointer Uniform %int
-%bool = OpTypeBool
-%_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBuffer_bufStruct
-%int_n559035791 = OpConstant %int -559035791
-%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int
-)" + kImportStub + R"(
-%main = OpFunction %void None %3
-%5 = OpLabel
-%i = OpVariable %_ptr_Function_int Function
-OpStore %i %int_0
-OpBranch %10
-%10 = OpLabel
-OpLoopMerge %12 %13 None
-OpBranch %14
-%14 = OpLabel
-%15 = OpLoad %int %i
-%26 = OpAccessChain %_ptr_Uniform_int %u_info %int_1
-%27 = OpLoad %int %26
-%29 = OpSLessThan %bool %15 %27
-OpBranchConditional %29 %11 %12
-%11 = OpLabel
-%31 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct %u_info %int_0
-%32 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %31
-%33 = OpLoad %int %i
-%36 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %32 %int_0 %33
-OpStore %36 %int_n559035791 Aligned 16
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %36
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: {{%\w+}} = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_63 {{%\w+}} {{%\w+}} %uint_4
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpStore %36 %int_n559035791 Aligned 16
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-OpBranch %13
-%13 = OpLabel
-%37 = OpLoad %int %i
-%38 = OpIAdd %int %37 %int_1
-OpStore %i %38
-OpBranch %10
-%12 = OpLabel
-OpReturn
-OpFunctionEnd)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstBuffAddrCheckPass>(text, true, 23);
-}
-
-TEST_F(InstBuffAddrTest, UVec3ScalarAddressOOB) {
- // clang-format off
- // #version 450
- // #extension GL_EXT_buffer_reference : enable
- // #extension GL_EXT_scalar_block_layout : enable
- // layout(buffer_reference, std430, scalar) readonly buffer IndexBuffer
- // {
- // uvec3 indices[];
- // };
- // layout(set = 0, binding = 0) uniform ufoo {
- // IndexBuffer data;
- // int nReads;
- // } u_info;
- // void main() {
- // uvec3 readvec;
- // for (int i=0; i < u_info.nReads; ++i) {
- // readvec = u_info.data.indices[i];
- // }
- // }
- const std::string text = R"(
-OpCapability Shader
-OpCapability PhysicalStorageBufferAddresses
-%1 = OpExtInstImport "GLSL.std.450"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Vertex %main "main" %u_info
-OpSource GLSL 450
-OpSourceExtension "GL_EXT_buffer_reference"
-OpSourceExtension "GL_EXT_scalar_block_layout"
-OpName %main "main"
-OpName %i "i"
-OpName %ufoo "ufoo"
-OpMemberName %ufoo 0 "data"
-OpMemberName %ufoo 1 "nReads"
-OpName %IndexBuffer "IndexBuffer"
-OpMemberName %IndexBuffer 0 "indices"
-OpName %u_info "u_info"
-OpName %readvec "readvec"
-OpMemberDecorate %ufoo 0 Offset 0
-OpMemberDecorate %ufoo 1 Offset 8
-OpDecorate %ufoo Block
-OpDecorate %_runtimearr_v3uint ArrayStride 12
-OpMemberDecorate %IndexBuffer 0 NonWritable
-OpMemberDecorate %IndexBuffer 0 Offset 0
-OpDecorate %IndexBuffer Block
-OpDecorate %u_info DescriptorSet 0
-OpDecorate %u_info Binding 0
-)" + kImportDeco + R"(
-%void = OpTypeVoid
-%3 = OpTypeFunction %void
-%int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
-%int_0 = OpConstant %int 0
-OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_IndexBuffer PhysicalStorageBuffer
-%ufoo = OpTypeStruct %_ptr_PhysicalStorageBuffer_IndexBuffer %int
-%uint = OpTypeInt 32 0
-%v3uint = OpTypeVector %uint 3
-%_runtimearr_v3uint = OpTypeRuntimeArray %v3uint
-%IndexBuffer = OpTypeStruct %_runtimearr_v3uint
-%_ptr_PhysicalStorageBuffer_IndexBuffer = OpTypePointer PhysicalStorageBuffer %IndexBuffer
-%_ptr_Uniform_ufoo = OpTypePointer Uniform %ufoo
-%u_info = OpVariable %_ptr_Uniform_ufoo Uniform
-%int_1 = OpConstant %int 1
-%_ptr_Uniform_int = OpTypePointer Uniform %int
-%bool = OpTypeBool
-)" + kImportStub + R"(
-%_ptr_Function_v3uint = OpTypePointer Function %v3uint
-%_ptr_Uniform__ptr_PhysicalStorageBuffer_IndexBuffer = OpTypePointer Uniform %_ptr_PhysicalStorageBuffer_IndexBuffer
-%_ptr_PhysicalStorageBuffer_v3uint = OpTypePointer PhysicalStorageBuffer %v3uint
-%main = OpFunction %void None %3
-%5 = OpLabel
-%i = OpVariable %_ptr_Function_int Function
-%readvec = OpVariable %_ptr_Function_v3uint Function
-OpStore %i %int_0
-OpBranch %10
-%10 = OpLabel
-OpLoopMerge %12 %13 None
-OpBranch %14
-%14 = OpLabel
-%15 = OpLoad %int %i
-%26 = OpAccessChain %_ptr_Uniform_int %u_info %int_1
-%27 = OpLoad %int %26
-%29 = OpSLessThan %bool %15 %27
-OpBranchConditional %29 %11 %12
-%11 = OpLabel
-%33 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_IndexBuffer %u_info %int_0
-%34 = OpLoad %_ptr_PhysicalStorageBuffer_IndexBuffer %33
-%35 = OpLoad %int %i
-%37 = OpAccessChain %_ptr_PhysicalStorageBuffer_v3uint %34 %int_0 %35
-%38 = OpLoad %v3uint %37 Aligned 4
-OpStore %readvec %38
-;CHECK-NOT: %38 = OpLoad %v3uint %37 Aligned 4
-;CHECK-NOT: OpStore %readvec %38
-;CHECK: {{%\w+}} = OpConvertPtrToU %ulong %37
-;CHECK: {{%\w+}} = OpLoad %uint %gl_VertexIndex
-;CHECK: {{%\w+}} = OpLoad %uint %gl_InstanceIndex
-;CHECK: {{%\w+}} = OpCompositeConstruct %v4uint %uint_0 {{%\w+}} {{%\w+}} %uint_0
-;CHECK: [[test_result:%\w+]] = OpFunctionCall %bool %)" + kFuncName + R"( %uint_23 %uint_67 {{%\w+}} {{%\w+}} %uint_12
-;CHECK: OpSelectionMerge {{%\w+}} None
-;CHECK: OpBranchConditional [[test_result]] {{%\w+}} {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: {{%\w+}} = OpLoad %v3uint %37 Aligned 4
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: OpBranch {{%\w+}}
-;CHECK: {{%\w+}} = OpLabel
-;CHECK: [[phi_result:%\w+]] = OpPhi %v3uint {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-;CHECK: OpStore %readvec [[phi_result]]
-OpBranch %13
-%13 = OpLabel
-%39 = OpLoad %int %i
-%40 = OpIAdd %int %39 %int_1
-OpStore %i %40
-OpBranch %10
-%12 = OpLabel
-OpReturn
-OpFunctionEnd
-)";
- // clang-format on
-
- SetTargetEnv(SPV_ENV_UNIVERSAL_1_4);
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- ValidatorOptions()->scalar_block_layout = true;
- SinglePassRunAndMatch<InstBuffAddrCheckPass>(text, true, 23);
-}
-
-} // namespace
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/inst_debug_printf_test.cpp b/third_party/SPIRV-Tools/test/opt/inst_debug_printf_test.cpp
deleted file mode 100644
index 24c0bc6..0000000
--- a/third_party/SPIRV-Tools/test/opt/inst_debug_printf_test.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-// Copyright (c) 2020-2022 Valve Corporation
-// Copyright (c) 2020-2022 LunarG Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Debug Printf Instrumentation Tests.
-
-#include <string>
-#include <vector>
-
-#include "test/opt/pass_fixture.h"
-#include "test/opt/pass_utils.h"
-
-namespace spvtools {
-namespace opt {
-namespace {
-
-static const std::string kOutputDecorations = R"(
-; CHECK: OpDecorate [[output_buffer_type:%inst_printf_OutputBuffer]] Block
-; CHECK: OpMemberDecorate [[output_buffer_type]] 0 Offset 0
-; CHECK: OpMemberDecorate [[output_buffer_type]] 1 Offset 4
-; CHECK: OpMemberDecorate [[output_buffer_type]] 2 Offset 8
-; CHECK: OpDecorate [[output_buffer_var:%\w+]] DescriptorSet 7
-; CHECK: OpDecorate [[output_buffer_var]] Binding 3
-)";
-
-static const std::string kOutputGlobals = R"(
-; CHECK: [[output_buffer_type]] = OpTypeStruct %uint %uint %_runtimearr_uint
-; CHECK: [[output_ptr_type:%\w+]] = OpTypePointer StorageBuffer [[output_buffer_type]]
-; CHECK: [[output_buffer_var]] = OpVariable [[output_ptr_type]] StorageBuffer
-)";
-
-using InstDebugPrintfTest = PassTest<::testing::Test>;
-
-TEST_F(InstDebugPrintfTest, V4Float32) {
- // SamplerState g_sDefault;
- // Texture2D g_tColor;
- //
- // struct PS_INPUT
- // {
- // float2 vBaseTexCoord : TEXCOORD0;
- // };
- //
- // struct PS_OUTPUT
- // {
- // float4 vDiffuse : SV_Target0;
- // };
- //
- // PS_OUTPUT MainPs(PS_INPUT i)
- // {
- // PS_OUTPUT o;
- //
- // o.vDiffuse.rgba = g_tColor.Sample(g_sDefault, (i.vBaseTexCoord.xy).xy);
- // debugPrintfEXT("diffuse: %v4f", o.vDiffuse.rgba);
- // return o;
- // }
-
- const std::string defs =
- R"(OpCapability Shader
-OpExtension "SPV_KHR_non_semantic_info"
-%1 = OpExtInstImport "NonSemantic.DebugPrintf"
-; CHECK-NOT: OpExtension "SPV_KHR_non_semantic_info"
-; CHECK-NOT: %1 = OpExtInstImport "NonSemantic.DebugPrintf"
-; CHECK: OpExtension "SPV_KHR_storage_buffer_storage_class"
-OpMemoryModel Logical GLSL450
-OpEntryPoint Fragment %2 "MainPs" %3 %4
-; CHECK: OpEntryPoint Fragment %2 "MainPs" %3 %4
-OpExecutionMode %2 OriginUpperLeft
-%5 = OpString "Color is %vn"
-)";
-
- // clang-format off
- const std::string decorates =
- R"(OpDecorate %6 DescriptorSet 0
-OpDecorate %6 Binding 1
-OpDecorate %7 DescriptorSet 0
-OpDecorate %7 Binding 0
-OpDecorate %3 Location 0
-OpDecorate %4 Location 0
-)" + kOutputDecorations;
-
- const std::string globals =
- R"(%void = OpTypeVoid
-%9 = OpTypeFunction %void
-%float = OpTypeFloat 32
-%v2float = OpTypeVector %float 2
-%v4float = OpTypeVector %float 4
-%13 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13
-%6 = OpVariable %_ptr_UniformConstant_13 UniformConstant
-%15 = OpTypeSampler
-%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
-%7 = OpVariable %_ptr_UniformConstant_15 UniformConstant
-%17 = OpTypeSampledImage %13
-%_ptr_Input_v2float = OpTypePointer Input %v2float
-%3 = OpVariable %_ptr_Input_v2float Input
-%_ptr_Output_v4float = OpTypePointer Output %v4float
-%4 = OpVariable %_ptr_Output_v4float Output
-; CHECK: %uint = OpTypeInt 32 0
-; CHECK: [[func_type:%\w+]] = OpTypeFunction %void %uint %uint %uint %uint %uint %uint %uint
-; CHECK: %_runtimearr_uint = OpTypeRuntimeArray %uint
-)" + kOutputGlobals + R"(
-; CHECK: %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
-; CHECK: %bool = OpTypeBool
-)";
- // clang-format on
-
- const std::string main =
- R"(%2 = OpFunction %void None %9
-%20 = OpLabel
-%21 = OpLoad %v2float %3
-%22 = OpLoad %13 %6
-%23 = OpLoad %15 %7
-%24 = OpSampledImage %17 %22 %23
-%25 = OpImageSampleImplicitLod %v4float %24 %21
-%26 = OpExtInst %void %1 1 %5 %25
-; CHECK-NOT: %26 = OpExtInst %void %1 1 %5 %25
-; CHECK: {{%\w+}} = OpCompositeExtract %float %25 0
-; CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-; CHECK: {{%\w+}} = OpCompositeExtract %float %25 1
-; CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-; CHECK: {{%\w+}} = OpCompositeExtract %float %25 2
-; CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-; CHECK: {{%\w+}} = OpCompositeExtract %float %25 3
-; CHECK: {{%\w+}} = OpBitcast %uint {{%\w+}}
-; CHECK: {{%\w+}} = OpFunctionCall %void %inst_printf_stream_write_5 %uint_23 %uint_36 %uint_5 {{%\w+}} {{%\w+}} {{%\w+}} {{%\w+}}
-; CHECK: OpBranch {{%\w+}}
-; CHECK: {{%\w+}} = OpLabel
-OpStore %4 %25
-OpReturn
-OpFunctionEnd
-)";
-
- const std::string output_func = R"(
-; CHECK: %inst_printf_stream_write_5 = OpFunction %void None {{%\w+}}
-; CHECK: [[sw_shader_id:%\w+]] = OpFunctionParameter %uint
-; CHECK: [[sw_inst_idx:%\w+]] = OpFunctionParameter %uint
-; CHECK: [[sw_param_1:%\w+]] = OpFunctionParameter %uint
-; CHECK: [[sw_param_2:%\w+]] = OpFunctionParameter %uint
-; CHECK: [[sw_param_3:%\w+]] = OpFunctionParameter %uint
-; CHECK: [[sw_param_4:%\w+]] = OpFunctionParameter %uint
-; CHECK: [[sw_param_5:%\w+]] = OpFunctionParameter %uint
-; CHECK: {{%\w+}} = OpLabel
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_1
-; CHECK: {{%\w+}} = OpAtomicIAdd %uint {{%\w+}} %uint_4 %uint_0 %uint_8
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_8
-; CHECK: {{%\w+}} = OpArrayLength %uint [[output_buffer_var]] 2
-; CHECK: {{%\w+}} = OpULessThanEqual %bool {{%\w+}} {{%\w+}}
-; CHECK: OpSelectionMerge {{%\w+}} None
-; CHECK: OpBranchConditional {{%\w+}} {{%\w+}} {{%\w+}}
-; CHECK: {{%\w+}} = OpLabel
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_0
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} %uint_8
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_1
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_shader_id]]
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_2
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_inst_idx]]
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_3
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_param_1]]
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_4
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_param_2]]
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_5
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_param_3]]
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_6
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_param_4]]
-; CHECK: {{%\w+}} = OpIAdd %uint {{%\w+}} %uint_7
-; CHECK: {{%\w+}} = OpAccessChain %_ptr_StorageBuffer_uint [[output_buffer_var]] %uint_2 {{%\w+}}
-; CHECK: OpStore {{%\w+}} [[sw_param_5]]
-; CHECK: OpBranch {{%\w+}}
-; CHECK: {{%\w+}} = OpLabel
-; CHECK: OpReturn
-; CHECK: OpFunctionEnd
-)";
-
- SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
- SinglePassRunAndMatch<InstDebugPrintfPass>(
- defs + decorates + globals + main + output_func, true);
-}
-
-// TODO(greg-lunarg): Add tests to verify handling of these cases:
-//
-// Compute shader
-// Geometry shader
-// Tessellation control shader
-// Tessellation eval shader
-// Vertex shader
-
-} // namespace
-} // namespace opt
-} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/ir_builder.cpp b/third_party/SPIRV-Tools/test/opt/ir_builder.cpp
index f0cfc18..15d31d9 100644
--- a/third_party/SPIRV-Tools/test/opt/ir_builder.cpp
+++ b/third_party/SPIRV-Tools/test/opt/ir_builder.cpp
@@ -256,6 +256,38 @@
Match(text, context.get());
}
+TEST_F(IRBuilderTest, AddVariable) {
+ // Use Private beacuse its' enun is 7 which is higher
+ // than the ID limit.
+ const std::string text = R"(
+; CHECK: [[uint:%\w+]] = OpTypeInt 32 0
+; CHECK: [[ptr:%\w+]] = OpTypePointer Private [[uint]]
+; CHECK: [[var:%\w+]] = OpVariable [[ptr]] Private
+; CHECK: OpTypeFloat
+OpCapability Kernel
+OpCapability VectorComputeINTEL
+OpCapability Linkage
+OpExtension "SPV_INTEL_vector_compute"
+OpMemoryModel Logical OpenCL
+%1 = OpTypeInt 32 0
+%2 = OpTypePointer Private %1
+%3 = OpTypeFloat 32
+)";
+
+ std::unique_ptr<IRContext> context =
+ BuildModule(SPV_ENV_UNIVERSAL_1_2, nullptr, text);
+ EXPECT_NE(nullptr, context) << text;
+
+ auto* float_ty = context->get_def_use_mgr()->GetDef(3);
+ InstructionBuilder builder(context.get(), float_ty);
+ auto* var = builder.AddVariable(2u, uint32_t(spv::StorageClass::Private));
+ EXPECT_NE(nullptr, var);
+
+ context->get_def_use_mgr()->AnalyzeInstDefUse(var); // should not assert
+
+ Match(text, context.get());
+}
+
TEST_F(IRBuilderTest, AddCompositeConstruct) {
const std::string text = R"(
; CHECK: [[uint:%\w+]] = OpTypeInt
diff --git a/third_party/SPIRV-Tools/test/opt/ir_context_test.cpp b/third_party/SPIRV-Tools/test/opt/ir_context_test.cpp
index 621fe8c..d499506 100644
--- a/third_party/SPIRV-Tools/test/opt/ir_context_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/ir_context_test.cpp
@@ -871,6 +871,7 @@
opt::Function* fun =
context->cfg()->block(5)->GetParent(); // Computes the CFG analysis
opt::DominatorAnalysis* dom = nullptr;
+ // NOLINTNEXTLINE
dom = context->GetDominatorAnalysis(fun); // Computes the dominator analysis,
// which depends on the CFG
// analysis
@@ -1154,10 +1155,7 @@
using TargetEnvCompareTest = ::testing::TestWithParam<TargetEnvCompareTestData>;
-TEST_P(TargetEnvCompareTest, Case) {
- // If new environments are added, then we must update the list of tests.
- ASSERT_EQ(SPV_ENV_VULKAN_1_3 + 1, SPV_ENV_MAX);
-
+TEST_P(TargetEnvCompareTest, IsTargetEnvAtLeast) {
const auto& tc = GetParam();
std::unique_ptr<Module> module(new Module());
@@ -1421,6 +1419,8 @@
1);
}
+// If new environments are added, then we must update the list of tests.
+static_assert(SPV_ENV_VULKAN_1_4 + 1 == SPV_ENV_MAX);
INSTANTIATE_TEST_SUITE_P(
TestCase, TargetEnvCompareTest,
::testing::Values(
@@ -1463,6 +1463,7 @@
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_1},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_UNIVERSAL_1_3},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_0},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_1},
@@ -1472,6 +1473,7 @@
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_UNIVERSAL_1_5},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_1},
TargetEnvCompareTestData{SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_2},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_0},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_1},
@@ -1479,7 +1481,16 @@
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_3},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_4},
TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_5},
- TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_6}));
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_UNIVERSAL_1_6},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_2},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_0},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_1},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_2},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_3},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_4},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_5},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_6},
+ TargetEnvCompareTestData{SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_3}));
} // namespace
} // namespace opt
diff --git a/third_party/SPIRV-Tools/test/opt/local_single_store_elim_test.cpp b/third_party/SPIRV-Tools/test/opt/local_single_store_elim_test.cpp
index ffe352e..8fd5c9d 100644
--- a/third_party/SPIRV-Tools/test/opt/local_single_store_elim_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/local_single_store_elim_test.cpp
@@ -24,6 +24,56 @@
using LocalSingleStoreElimTest = PassTest<::testing::Test>;
+TEST_F(LocalSingleStoreElimTest, DoSomethingWithExtensions) {
+ const std::string capabilities_and_extensions =
+ R"(OpCapability Shader
+OpExtension "SPV_EXT_fragment_shader_interlock"
+OpExtension "SPV_NV_compute_shader_derivatives"
+OpExtension "SPV_KHR_ray_query"
+OpExtension "SPV_NV_shader_subgroup_partitioned"
+OpExtension "SPV_KHR_ray_tracing"
+OpExtension "SPV_EXT_descriptor_indexing"
+)";
+
+ const std::string before = capabilities_and_extensions +
+ R"(%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %2 "main"
+OpExecutionMode %2 OriginUpperLeft
+OpSource GLSL 140
+%void = OpTypeVoid
+%4 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+%float_0 = OpConstant %float 0
+%2 = OpFunction %void None %4
+%8 = OpLabel
+%9 = OpVariable %_ptr_Function_float Function
+OpStore %9 %float_0
+%10 = OpLoad %float %9
+OpReturn
+OpFunctionEnd
+)";
+ const std::string after = capabilities_and_extensions +
+ R"(%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %2 "main"
+OpExecutionMode %2 OriginUpperLeft
+OpSource GLSL 140
+%void = OpTypeVoid
+%4 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+%float_0 = OpConstant %float 0
+%2 = OpFunction %void None %4
+%8 = OpLabel
+%9 = OpVariable %_ptr_Function_float Function
+OpStore %9 %float_0
+OpReturn
+OpFunctionEnd
+)";
+ SinglePassRunAndCheck<LocalSingleStoreElimPass>(before, after, true, true);
+}
TEST_F(LocalSingleStoreElimTest, PositiveAndNegative) {
// Single store to v is optimized. Multiple store to
// f is not optimized.
diff --git a/third_party/SPIRV-Tools/test/opt/local_ssa_elim_test.cpp b/third_party/SPIRV-Tools/test/opt/local_ssa_elim_test.cpp
index 45006ca..810d985 100644
--- a/third_party/SPIRV-Tools/test/opt/local_ssa_elim_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/local_ssa_elim_test.cpp
@@ -2978,7 +2978,9 @@
; CHECK: OpExtInst %void [[ext]] DebugScope [[dbg_main]]
; CHECK: OpStore %f %float_0
+; CHECK-NEXT: OpExtInst %void [[ext]] DebugScope [[dbg_bb]]
; CHECK-NEXT: OpExtInst %void [[ext]] DebugValue [[dbg_x]] %float_0
+; CHECK-NEXT: OpExtInst %void [[ext]] DebugScope [[dbg_main]]
; CHECK-NEXT: OpExtInst %void [[ext]] DebugValue [[dbg_f]] %float_0
; CHECK-NEXT: OpStore %i %int_0
; CHECK-NEXT: OpExtInst %void [[ext]] DebugValue [[dbg_i]] %int_0
@@ -5434,6 +5436,7 @@
%1614 = OpLabel
;CHECK: %1614 = OpLabel
;CHECK-NEXT: [[phi:%\w+]] = OpPhi
+;CHECK-NEXT: {{%\w+}} = OpExtInst %void {{%\w+}} DebugScope %179
;CHECK-NEXT: {{%\w+}} = OpExtInst %void {{%\w+}} DebugValue %233
%2335 = OpExtInst %void %2 DebugScope %179
%1795 = OpExtInst %void %2 DebugLine %64 %uint_149 %uint_149 %uint_16 %uint_16
@@ -5456,6 +5459,50 @@
SinglePassRunAndMatch<SSARewritePass>(text, true);
}
+TEST_F(LocalSSAElimTest, StoreWithLoadedPtr) {
+ const std::string text =
+ R"(OpCapability Shader
+OpCapability VariablePointersStorageBuffer
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %2 "pointer_branch_buffer" %3
+OpExecutionMode %2 LocalSize 8 8 1
+OpDecorate %3 DescriptorSet 0
+OpDecorate %3 Binding 0
+%bool = OpTypeBool
+%uint = OpTypeInt 32 0
+%uint_2 = OpConstant %uint 2
+%void = OpTypeVoid
+%8 = OpTypeFunction %void
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%_ptr_Function__ptr_StorageBuffer_uint = OpTypePointer Function %_ptr_StorageBuffer_uint
+%3 = OpVariable %_ptr_StorageBuffer_uint StorageBuffer
+%11 = OpUndef %bool
+%2 = OpFunction %void None %8
+%12 = OpLabel
+%13 = OpVariable %_ptr_Function__ptr_StorageBuffer_uint Function
+OpSelectionMerge %14 None
+OpBranchConditional %11 %15 %16
+%15 = OpLabel
+OpBranch %14
+%16 = OpLabel
+OpStore %13 %3
+OpBranch %14
+%14 = OpLabel
+; CHECK: [[phi:%\w+]] = OpPhi %_ptr_StorageBuffer_uint
+; CHECK-NEXT: [[ld:%\w+]] = OpLoad %uint %20
+; CHECK-NEXT: OpIAdd %uint [[ld]] %uint_2
+%17 = OpLoad %_ptr_StorageBuffer_uint %13
+%18 = OpLoad %uint %17
+%19 = OpIAdd %uint %18 %uint_2
+OpReturn
+OpFunctionEnd
+)";
+
+ SetTargetEnv(SPV_ENV_UNIVERSAL_1_6);
+ SinglePassRunAndMatch<SSARewritePass>(text, true);
+}
+
// TODO(greg-lunarg): Add tests to verify handling of these cases:
//
// No optimization in the presence of
diff --git a/third_party/SPIRV-Tools/test/opt/loop_optimizations/unroll_simple.cpp b/third_party/SPIRV-Tools/test/opt/loop_optimizations/unroll_simple.cpp
index 6468adf..6214902 100644
--- a/third_party/SPIRV-Tools/test/opt/loop_optimizations/unroll_simple.cpp
+++ b/third_party/SPIRV-Tools/test/opt/loop_optimizations/unroll_simple.cpp
@@ -510,36 +510,36 @@
%24 = OpLabel
%35 = OpPhi %8 %10 %23 %34 %26
%s1 = OpExtInst %6 %ext DebugScope %dbg_main
-%d10 = OpExtInst %6 %ext DebugLine %file_name %uint_1 %uint_1 %uint_0 %uint_0
+%d10 = OpExtInst %6 %ext DebugLine %src %uint_1 %uint_1 %uint_0 %uint_0
%value0 = OpExtInst %6 %ext DebugValue %dbg_f %35 %null_expr
OpLoopMerge %25 %26 Unroll
OpBranch %27
%27 = OpLabel
%s2 = OpExtInst %6 %ext DebugScope %dbg_main
-%d1 = OpExtInst %6 %ext DebugLine %file_name %uint_1 %uint_1 %uint_1 %uint_1
+%d1 = OpExtInst %6 %ext DebugLine %src %uint_1 %uint_1 %uint_1 %uint_1
%29 = OpSLessThan %12 %35 %11
-%d2 = OpExtInst %6 %ext DebugLine %file_name %uint_2 %uint_2 %uint_0 %uint_0
+%d2 = OpExtInst %6 %ext DebugLine %src %uint_2 %uint_2 %uint_0 %uint_0
OpBranchConditional %29 %30 %25
%30 = OpLabel
%s3 = OpExtInst %6 %ext DebugScope %bb
%decl0 = OpExtInst %6 %ext DebugDeclare %dbg_f %5 %null_expr
%decl1 = OpExtInst %6 %ext DebugValue %dbg_i %5 %deref_expr
-%d3 = OpExtInst %6 %ext DebugLine %file_name %uint_3 %uint_3 %uint_0 %uint_0
+%d3 = OpExtInst %6 %ext DebugLine %src %uint_3 %uint_3 %uint_0 %uint_0
%32 = OpAccessChain %19 %5 %35
-%d4 = OpExtInst %6 %ext DebugLine %file_name %uint_4 %uint_4 %uint_0 %uint_0
+%d4 = OpExtInst %6 %ext DebugLine %src %uint_4 %uint_4 %uint_0 %uint_0
OpStore %32 %18
-%d5 = OpExtInst %6 %ext DebugLine %file_name %uint_5 %uint_5 %uint_0 %uint_0
+%d5 = OpExtInst %6 %ext DebugLine %src %uint_5 %uint_5 %uint_0 %uint_0
OpBranch %26
%26 = OpLabel
%s4 = OpExtInst %6 %ext DebugScope %dbg_main
-%d6 = OpExtInst %6 %ext DebugLine %file_name %uint_6 %uint_6 %uint_0 %uint_0
+%d6 = OpExtInst %6 %ext DebugLine %src %uint_6 %uint_6 %uint_0 %uint_0
%34 = OpIAdd %8 %35 %20
%value1 = OpExtInst %6 %ext DebugValue %dbg_f %34 %null_expr
-%d7 = OpExtInst %6 %ext DebugLine %file_name %uint_7 %uint_7 %uint_0 %uint_0
+%d7 = OpExtInst %6 %ext DebugLine %src %uint_7 %uint_7 %uint_0 %uint_0
OpBranch %24
%25 = OpLabel
%s5 = OpExtInst %6 %ext DebugScope %dbg_main
-%d8 = OpExtInst %6 %ext DebugLine %file_name %uint_8 %uint_8 %uint_0 %uint_0
+%d8 = OpExtInst %6 %ext DebugLine %src %uint_8 %uint_8 %uint_0 %uint_0
OpReturn
OpFunctionEnd)";
@@ -3788,6 +3788,48 @@
SinglePassRunAndMatch<PartialUnrollerTestPass<2>>(text, true);
}
+TEST_F(PassClassTest, UnrollWithDecorationOnPhi) {
+ // With LocalMultiStoreElimPass
+ const std::string text = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 16 16 1
+; CHECK-NOT: OpDecorate {{%\w+}} RelaxedPrecision
+ OpDecorate %4 RelaxedPrecision
+ %float = OpTypeFloat 32
+%float_0_000122070312 = OpConstant %float 0.000122070312
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %bool = OpTypeBool
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %2 = OpFunction %void None %12
+ %13 = OpLabel
+ OpBranch %14
+ %14 = OpLabel
+ %4 = OpPhi %float %float_0_000122070312 %13 %3 %15
+ %16 = OpPhi %int %int_0 %13 %17 %15
+ %18 = OpSLessThan %bool %16 %int_1
+ OpLoopMerge %19 %15 Unroll
+ OpBranchConditional %18 %15 %19
+ %15 = OpLabel
+; CHECK: [[v:%\w+]] = OpExtInst %float
+ %3 = OpExtInst %float %1 NMax %float_0_000122070312 %float_0_000122070312
+ %17 = OpIAdd %int %16 %int_1
+ OpBranch %14
+ %19 = OpLabel
+; CHECK: OpCopyObject %float [[v]]
+ %20 = OpCopyObject %float %4
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ SinglePassRunAndMatch<LoopUnroller>(text, true);
+}
+
TEST_F(PassClassTest, DontUnrollInfiteLoop) {
// This is an infinite loop that because the step is 0. We want to make sure
// the unroller does not try to unroll it.
diff --git a/third_party/SPIRV-Tools/test/opt/opextinst_forward_ref_fixup_pass_test.cpp b/third_party/SPIRV-Tools/test/opt/opextinst_forward_ref_fixup_pass_test.cpp
new file mode 100644
index 0000000..b9ac5d2
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/opt/opextinst_forward_ref_fixup_pass_test.cpp
@@ -0,0 +1,338 @@
+// Copyright (c) 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "spirv-tools/optimizer.hpp"
+#include "test/opt/pass_fixture.h"
+#include "test/opt/pass_utils.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+using OpExtInstForwardRefFixupPassTest = PassTest<::testing::Test>;
+
+TEST_F(OpExtInstForwardRefFixupPassTest, NoChangeWithougExtendedInstructions) {
+ const std::string kTest = R"(
+; CHECK-NOT: SomeOpcode
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result =
+ SinglePassRunAndMatch<OpExtInstWithForwardReferenceFixupPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(OpExtInstForwardRefFixupPassTest, NoForwardRef_NoChange) {
+ const std::string kTest = R"(OpCapability Shader
+OpExtension "SPV_KHR_non_semantic_info"
+%1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%3 = OpString "/usr/local/google/home/nathangauer/projects/DirectXShaderCompiler/repro.hlsl"
+%4 = OpString "// RUN: %dxc -T cs_6_0 %s -E main -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source | FileCheck %s
+
+[numthreads(1, 1, 1)]
+void main() {
+}
+"
+%5 = OpString "main"
+%6 = OpString ""
+%7 = OpString "3f3d3740"
+%8 = OpString " -E main -T cs_6_0 -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source -Qembed_debug"
+OpName %main "main"
+%void = OpTypeVoid
+%uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+%uint_4 = OpConstant %uint 4
+%uint_5 = OpConstant %uint 5
+%15 = OpTypeFunction %void
+%16 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void
+%17 = OpExtInst %void %1 DebugSource %3 %4
+%18 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %17 %uint_5
+%19 = OpExtInst %void %1 DebugFunction %5 %16 %17 %uint_4 %uint_1 %18 %6 %uint_3 %uint_4
+%20 = OpExtInst %void %1 DebugEntryPoint %19 %18 %7 %8
+%main = OpFunction %void None %15
+%21 = OpLabel
+%22 = OpExtInst %void %1 DebugFunctionDefinition %19 %main
+%23 = OpExtInst %void %1 DebugLine %17 %uint_5 %uint_5 %uint_1 %uint_1
+OpReturn
+OpFunctionEnd
+)";
+ SinglePassRunAndCheck<OpExtInstWithForwardReferenceFixupPass>(
+ kTest, kTest, /* skip_nop= */ false);
+}
+
+TEST_F(OpExtInstForwardRefFixupPassTest,
+ NoForwardRef_ReplaceOpExtInstWithForwardWithOpExtInst) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_KHR_relaxed_extended_instruction"
+; CHECK-NOT: OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %3 = OpString "/usr/local/google/home/nathangauer/projects/DirectXShaderCompiler/repro.hlsl"
+ %4 = OpString "// RUN: %dxc -T cs_6_0 %s -E main -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source | FileCheck %s
+
+[numthreads(1, 1, 1)]
+void main() {
+}
+"
+ %5 = OpString "main"
+ %6 = OpString ""
+ %7 = OpString "3f3d3740"
+ %8 = OpString " -E main -T cs_6_0 -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source -Qembed_debug"
+ OpName %main "main"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %uint_4 = OpConstant %uint 4
+ %uint_5 = OpConstant %uint 5
+ %20 = OpTypeFunction %void
+ %10 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction %uint_3 %void
+ %12 = OpExtInstWithForwardRefsKHR %void %1 DebugSource %3 %4
+ %13 = OpExtInstWithForwardRefsKHR %void %1 DebugCompilationUnit %uint_1 %uint_4 %12 %uint_5
+ %17 = OpExtInstWithForwardRefsKHR %void %1 DebugFunction %5 %10 %12 %uint_4 %uint_1 %13 %6 %uint_3 %uint_4
+ %18 = OpExtInstWithForwardRefsKHR %void %1 DebugEntryPoint %17 %13 %7 %8
+; CHECK-NOT: {{.*}} = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction %uint_3 %void
+; CHECK-NOT: {{.*}} = OpExtInstWithForwardRefsKHR %void %1 DebugSource {{.*}} {{.*}}
+; CHECK-NOT: {{.*}} = OpExtInstWithForwardRefsKHR %void %1 DebugCompilationUnit %uint_1 %uint_4 {{.*}} %uint_5
+; CHECK-NOT: {{.*}} = OpExtInstWithForwardRefsKHR %void %1 DebugFunction {{.*}} {{.*}} {{.*}} %uint_4 %uint_1 {{.*}} {{.*}} %uint_3 %uint_4
+; CHECK-NOT: {{.*}} = OpExtInstWithForwardRefsKHR %void %1 DebugEntryPoint {{.*}} {{.*}} {{.*}} {{.*}}
+; CHECK: {{.*}} = OpExtInst %void %1 DebugTypeFunction %uint_3 %void
+; CHECK: {{.*}} = OpExtInst %void %1 DebugSource {{.*}} {{.*}}
+; CHECK: {{.*}} = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 {{.*}} %uint_5
+; CHECK: {{.*}} = OpExtInst %void %1 DebugFunction {{.*}} {{.*}} {{.*}} %uint_4 %uint_1 {{.*}} {{.*}} %uint_3 %uint_4
+; CHECK: {{.*}} = OpExtInst %void %1 DebugEntryPoint {{.*}} {{.*}} {{.*}} {{.*}}
+ %main = OpFunction %void None %20
+ %21 = OpLabel
+ %22 = OpExtInst %void %1 DebugFunctionDefinition %17 %main
+ %23 = OpExtInst %void %1 DebugLine %12 %uint_5 %uint_5 %uint_1 %uint_1
+; CHECK: {{.*}} = OpExtInst %void %1 DebugFunctionDefinition {{.*}} %main
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLine {{.*}} %uint_5 %uint_5 %uint_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<OpExtInstWithForwardReferenceFixupPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(OpExtInstForwardRefFixupPassTest, ForwardRefs_NoChange) {
+ const std::string kTest = R"(OpCapability Shader
+OpExtension "SPV_KHR_non_semantic_info"
+OpExtension "SPV_KHR_relaxed_extended_instruction"
+%1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%3 = OpString "/usr/local/google/home/nathangauer/projects/DirectXShaderCompiler/repro.hlsl"
+%4 = OpString "// RUN: %dxc -T cs_6_0 %s -E main -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source | FileCheck %s
+
+class A {
+ void foo() {
+ }
+};
+
+[numthreads(1, 1, 1)]
+void main() {
+ A a;
+ a.foo();
+}
+"
+%5 = OpString "A"
+%6 = OpString "A.foo"
+%7 = OpString ""
+%8 = OpString "this"
+%9 = OpString "main"
+%10 = OpString "a"
+%11 = OpString "d59ae9c2"
+%12 = OpString " -E main -T cs_6_0 -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source -Vd -Qembed_debug"
+OpName %main "main"
+OpName %A "A"
+%void = OpTypeVoid
+%uint = OpTypeInt 32 0
+%uint_1 = OpConstant %uint 1
+%uint_4 = OpConstant %uint 4
+%uint_5 = OpConstant %uint 5
+%uint_0 = OpConstant %uint 0
+%uint_3 = OpConstant %uint 3
+%uint_7 = OpConstant %uint 7
+%uint_288 = OpConstant %uint 288
+%uint_9 = OpConstant %uint 9
+%uint_13 = OpConstant %uint 13
+%uint_10 = OpConstant %uint 10
+%26 = OpTypeFunction %void
+%uint_12 = OpConstant %uint 12
+%A = OpTypeStruct
+%_ptr_Function_A = OpTypePointer Function %A
+%uint_11 = OpConstant %uint 11
+%30 = OpExtInst %void %1 DebugExpression
+%31 = OpExtInst %void %1 DebugSource %3 %4
+%32 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %31 %uint_5
+%33 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeComposite %5 %uint_0 %31 %uint_3 %uint_7 %32 %5 %uint_0 %uint_3 %34
+%35 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void %33
+%34 = OpExtInst %void %1 DebugFunction %6 %35 %31 %uint_4 %uint_3 %33 %7 %uint_3 %uint_4
+%36 = OpExtInst %void %1 DebugLocalVariable %8 %33 %31 %uint_4 %uint_3 %34 %uint_288 %uint_1
+%37 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void
+%38 = OpExtInst %void %1 DebugFunction %9 %37 %31 %uint_9 %uint_1 %32 %7 %uint_3 %uint_9
+%39 = OpExtInst %void %1 DebugLexicalBlock %31 %uint_9 %uint_13 %38
+%40 = OpExtInst %void %1 DebugLocalVariable %10 %33 %31 %uint_10 %uint_5 %39 %uint_4
+%41 = OpExtInst %void %1 DebugEntryPoint %38 %32 %11 %12
+%42 = OpExtInst %void %1 DebugInlinedAt %uint_11 %39
+%main = OpFunction %void None %26
+%43 = OpLabel
+%44 = OpVariable %_ptr_Function_A Function
+%45 = OpExtInst %void %1 DebugFunctionDefinition %38 %main
+%57 = OpExtInst %void %1 DebugScope %39
+%47 = OpExtInst %void %1 DebugLine %31 %uint_10 %uint_10 %uint_3 %uint_5
+%48 = OpExtInst %void %1 DebugDeclare %40 %44 %30
+%58 = OpExtInst %void %1 DebugScope %34 %42
+%50 = OpExtInst %void %1 DebugLine %31 %uint_4 %uint_5 %uint_3 %uint_3
+%51 = OpExtInst %void %1 DebugDeclare %36 %44 %30
+%59 = OpExtInst %void %1 DebugNoScope
+%53 = OpExtInst %void %1 DebugLine %31 %uint_12 %uint_12 %uint_1 %uint_1
+OpReturn
+OpFunctionEnd
+)";
+ SinglePassRunAndCheck<OpExtInstWithForwardReferenceFixupPass>(
+ kTest, kTest, /* skip_nop= */ false);
+}
+
+TEST_F(OpExtInstForwardRefFixupPassTest,
+ ForwardRefs_ReplaceOpExtInstWithOpExtInstWithForwardRefs) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+; CHECK: OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %3 = OpString "/usr/local/google/home/nathangauer/projects/DirectXShaderCompiler/repro.hlsl"
+ %4 = OpString "// RUN: %dxc -T cs_6_0 %s -E main -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source | FileCheck %s
+
+class A {
+ void foo() {
+ }
+};
+
+[numthreads(1, 1, 1)]
+void main() {
+ A a;
+ a.foo();
+}
+"
+ %5 = OpString "A"
+ %6 = OpString "A.foo"
+ %7 = OpString ""
+ %8 = OpString "this"
+ %9 = OpString "main"
+ %10 = OpString "a"
+ %11 = OpString "d59ae9c2"
+ %12 = OpString " -E main -T cs_6_0 -spirv -fspv-target-env=vulkan1.1 -fspv-debug=vulkan-with-source -Vd -Qembed_debug"
+ OpName %main "main"
+ OpName %A "A"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %uint_4 = OpConstant %uint 4
+ %uint_5 = OpConstant %uint 5
+ %uint_0 = OpConstant %uint 0
+ %uint_3 = OpConstant %uint 3
+ %uint_7 = OpConstant %uint 7
+ %uint_288 = OpConstant %uint 288
+ %uint_9 = OpConstant %uint 9
+ %uint_13 = OpConstant %uint 13
+ %uint_10 = OpConstant %uint 10
+ %40 = OpTypeFunction %void
+ %uint_12 = OpConstant %uint 12
+ %A = OpTypeStruct
+ %_ptr_Function_A = OpTypePointer Function %A
+ %uint_11 = OpConstant %uint 11
+ %15 = OpExtInst %void %1 DebugExpression
+ %16 = OpExtInst %void %1 DebugSource %3 %4
+ %17 = OpExtInst %void %1 DebugCompilationUnit %uint_1 %uint_4 %16 %uint_5
+ %21 = OpExtInst %void %1 DebugTypeComposite %5 %uint_0 %16 %uint_3 %uint_7 %17 %5 %uint_0 %uint_3 %25
+ %26 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void %21
+ %25 = OpExtInst %void %1 DebugFunction %6 %26 %16 %uint_4 %uint_3 %21 %7 %uint_3 %uint_4
+ %27 = OpExtInst %void %1 DebugLocalVariable %8 %21 %16 %uint_4 %uint_3 %25 %uint_288 %uint_1
+ %29 = OpExtInst %void %1 DebugTypeFunction %uint_3 %void
+ %30 = OpExtInst %void %1 DebugFunction %9 %29 %16 %uint_9 %uint_1 %17 %7 %uint_3 %uint_9
+ %32 = OpExtInst %void %1 DebugLexicalBlock %16 %uint_9 %uint_13 %30
+ %34 = OpExtInst %void %1 DebugLocalVariable %10 %21 %16 %uint_10 %uint_5 %32 %uint_4
+ %36 = OpExtInst %void %1 DebugEntryPoint %30 %17 %11 %12
+ %37 = OpExtInst %void %1 DebugInlinedAt %uint_11 %32
+; CHECK: {{.*}} = OpExtInst %void %1 DebugExpression
+; CHECK: {{.*}} = OpExtInst %void %1 DebugSource
+; CHECK: {{.*}} = OpExtInst %void %1 DebugCompilationUnit
+; CHECK: {{.*}} = OpExtInstWithForwardRefsKHR %void {{.*}} DebugTypeComposite
+; CHECK-NOT: {{.*}} = OpExtInst %void {{.*}} DebugTypeComposite
+; CHECK: {{.*}} = OpExtInst %void %1 DebugTypeFunction
+; CHECK: {{.*}} = OpExtInst %void %1 DebugFunction
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLocalVariable
+; CHECK: {{.*}} = OpExtInst %void %1 DebugTypeFunction
+; CHECK: {{.*}} = OpExtInst %void %1 DebugFunction
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLexicalBlock
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLocalVariable
+; CHECK: {{.*}} = OpExtInst %void %1 DebugEntryPoint
+; CHECK: {{.*}} = OpExtInst %void %1 DebugInlinedAt
+ %main = OpFunction %void None %40
+ %43 = OpLabel
+ %44 = OpVariable %_ptr_Function_A Function
+ %45 = OpExtInst %void %1 DebugFunctionDefinition %30 %main
+ %51 = OpExtInst %void %1 DebugScope %32
+ %46 = OpExtInst %void %1 DebugLine %16 %uint_10 %uint_10 %uint_3 %uint_5
+ %47 = OpExtInst %void %1 DebugDeclare %34 %44 %15
+ %52 = OpExtInst %void %1 DebugScope %25 %37
+ %48 = OpExtInst %void %1 DebugLine %16 %uint_4 %uint_5 %uint_3 %uint_3
+ %49 = OpExtInst %void %1 DebugDeclare %27 %44 %15
+ %53 = OpExtInst %void %1 DebugNoScope
+ %50 = OpExtInst %void %1 DebugLine %16 %uint_12 %uint_12 %uint_1 %uint_1
+; CHECK: {{.*}} = OpExtInst %void %1 DebugFunctionDefinition
+; CHECK: {{.*}} = OpExtInst %void %1 DebugScope
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLine
+; CHECK: {{.*}} = OpExtInst %void %1 DebugDeclare
+; CHECK: {{.*}} = OpExtInst %void %1 DebugScope
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLine
+; CHECK: {{.*}} = OpExtInst %void %1 DebugDeclare
+; CHECK: {{.*}} = OpExtInst %void %1 DebugNoScope
+; CHECK: {{.*}} = OpExtInst %void %1 DebugLine
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<OpExtInstWithForwardReferenceFixupPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+} // namespace
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/optimizer_test.cpp b/third_party/SPIRV-Tools/test/opt/optimizer_test.cpp
index 0171c09..76457dd 100644
--- a/third_party/SPIRV-Tools/test/opt/optimizer_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/optimizer_test.cpp
@@ -12,12 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include "spirv-tools/optimizer.hpp"
+
+#include <sstream>
#include <string>
#include <vector>
#include "gmock/gmock.h"
#include "spirv-tools/libspirv.hpp"
-#include "spirv-tools/optimizer.hpp"
#include "test/opt/pass_fixture.h"
namespace spvtools {
@@ -388,6 +390,213 @@
<< "Was expecting the result id of DebugScope to have been changed.";
}
+TEST(Optimizer, CheckDefaultPerformancePassesLargeStructScalarization) {
+ std::string start = R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Vertex %4 "main" %46 %48
+OpSource GLSL 430
+OpName %4 "main"
+OpDecorate %44 Block
+OpMemberDecorate %44 0 BuiltIn Position
+OpMemberDecorate %44 1 BuiltIn PointSize
+OpMemberDecorate %44 2 BuiltIn ClipDistance
+OpDecorate %48 Location 0
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeFloat 32
+%7 = OpTypeVector %6 4
+%8 = OpTypePointer Function %7
+%9 = OpTypeStruct %7)";
+
+ // add 200 float members to the struct
+ for (int i = 0; i < 200; i++) {
+ start += " %6";
+ }
+
+ start += R"(
+%10 = OpTypeFunction %9 %8
+%14 = OpTypeFunction %6 %9
+%18 = OpTypePointer Function %9
+%20 = OpTypeInt 32 1
+%21 = OpConstant %20 0
+%24 = OpConstant %20 1
+%25 = OpTypeInt 32 0
+%26 = OpConstant %25 1
+%27 = OpTypePointer Function %6
+%43 = OpTypeArray %6 %26
+%44 = OpTypeStruct %7 %6 %43
+%45 = OpTypePointer Output %44
+%46 = OpVariable %45 Output
+%47 = OpTypePointer Input %7
+%48 = OpVariable %47 Input
+%54 = OpTypePointer Output %7
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%49 = OpVariable %8 Function
+%50 = OpLoad %7 %48
+OpStore %49 %50
+%51 = OpFunctionCall %9 %12 %49
+%52 = OpFunctionCall %6 %16 %51
+%53 = OpCompositeConstruct %7 %52 %52 %52 %52
+%55 = OpAccessChain %54 %46 %21
+OpStore %55 %53
+OpReturn
+OpFunctionEnd
+%12 = OpFunction %9 None %10
+%11 = OpFunctionParameter %8
+%13 = OpLabel
+%19 = OpVariable %18 Function
+%22 = OpLoad %7 %11
+%23 = OpAccessChain %8 %19 %21
+OpStore %23 %22
+%28 = OpAccessChain %27 %11 %26
+%29 = OpLoad %6 %28
+%30 = OpConvertFToS %20 %29
+%31 = OpAccessChain %27 %19 %21 %30
+%32 = OpLoad %6 %31
+%33 = OpAccessChain %27 %19 %24
+OpStore %33 %32
+%34 = OpLoad %9 %19
+OpReturnValue %34
+OpFunctionEnd
+%16 = OpFunction %6 None %14
+%15 = OpFunctionParameter %9
+%17 = OpLabel
+%37 = OpCompositeExtract %6 %15 1
+%38 = OpConvertFToS %20 %37
+%39 = OpCompositeExtract %7 %15 0
+%40 = OpVectorExtractDynamic %6 %39 %38
+OpReturnValue %40
+OpFunctionEnd)";
+
+ std::vector<uint32_t> binary;
+ SpirvTools tools(SPV_ENV_VULKAN_1_3);
+ tools.Assemble(start, &binary,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+
+ std::string test_disassembly;
+ std::string default_disassembly;
+
+ {
+ Optimizer opt(SPV_ENV_VULKAN_1_3);
+ opt.RegisterPerformancePasses();
+
+ std::vector<uint32_t> optimized;
+ ASSERT_TRUE(opt.Run(binary.data(), binary.size(), &optimized))
+ << start << "\n";
+
+ tools.Disassemble(optimized.data(), optimized.size(), &default_disassembly,
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+
+ {
+ // default passes should not benefit from additional scalar replacement
+ Optimizer opt(SPV_ENV_VULKAN_1_3);
+ opt.RegisterPerformancePasses()
+ .RegisterPass(CreateScalarReplacementPass(201))
+ .RegisterPass(CreateAggressiveDCEPass());
+
+ std::vector<uint32_t> optimized;
+ ASSERT_TRUE(opt.Run(binary.data(), binary.size(), &optimized))
+ << start << "\n";
+
+ tools.Disassemble(optimized.data(), optimized.size(), &test_disassembly,
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+
+ EXPECT_EQ(test_disassembly, default_disassembly);
+}
+
+TEST(Optimizer, KeepDebugBuildIdentifierAfterDCE) {
+ // Test that DebugBuildIdentifier is not removed after DCE.
+ const std::string before = R"(
+OpCapability Shader
+OpExtension "SPV_KHR_non_semantic_info"
+%1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 8 8 1
+%4 = OpString "8937d8f571cf7b58d86d9d66196024f5d04e3186"
+%7 = OpString ""
+%9 = OpString ""
+OpSource Slang 1
+%19 = OpString ""
+%24 = OpString ""
+%25 = OpString ""
+OpName %main "main"
+%void = OpTypeVoid
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_11 = OpConstant %uint 11
+%uint_5 = OpConstant %uint 5
+%uint_100 = OpConstant %uint 100
+%15 = OpTypeFunction %void
+%uint_6 = OpConstant %uint 6
+%uint_7 = OpConstant %uint 7
+%uint_1 = OpConstant %uint 1
+%uint_2 = OpConstant %uint 2
+%3 = OpExtInst %void %1 DebugBuildIdentifier %4 %uint_0
+%8 = OpExtInst %void %1 DebugSource %9 %7
+%13 = OpExtInst %void %1 DebugCompilationUnit %uint_100 %uint_5 %8 %uint_11
+%17 = OpExtInst %void %1 DebugTypeFunction %uint_0 %void
+%18 = OpExtInst %void %1 DebugFunction %19 %17 %8 %uint_5 %uint_6 %13 %19 %uint_0 %uint_5
+%23 = OpExtInst %void %1 DebugEntryPoint %18 %13 %24 %25
+%main = OpFunction %void None %15
+%16 = OpLabel
+%21 = OpExtInst %void %1 DebugFunctionDefinition %18 %main
+%32 = OpExtInst %void %1 DebugScope %18
+%26 = OpExtInst %void %1 DebugLine %8 %uint_7 %uint_7 %uint_1 %uint_2
+OpReturn
+%33 = OpExtInst %void %1 DebugNoScope
+OpFunctionEnd
+ )";
+
+ std::vector<uint32_t> binary;
+ SpirvTools tools(SPV_ENV_VULKAN_1_3);
+ tools.Assemble(before, &binary,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+
+ Optimizer opt(SPV_ENV_VULKAN_1_3);
+ opt.RegisterPerformancePasses().RegisterPass(CreateAggressiveDCEPass());
+
+ std::vector<uint32_t> optimized;
+ ASSERT_TRUE(opt.Run(binary.data(), binary.size(), &optimized))
+ << before << "\n";
+
+ std::string after;
+ tools.Disassemble(optimized.data(), optimized.size(), &after,
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+
+ // Test that the DebugBuildIdentifier is not removed after DCE.
+ size_t dbi_pos = after.find("DebugBuildIdentifier");
+ EXPECT_NE(dbi_pos, std::string::npos)
+ << "Was expecting the DebugBuildIdentifier to have been kept.";
+ std::string string_id;
+ std::string flags_id;
+ if (dbi_pos != std::string::npos) {
+ std::stringstream ss(after.substr(dbi_pos));
+ std::string temp;
+ char percent;
+ ss >> temp; // Consume "DebugBuildIdentifier"
+ ss >> percent >> string_id;
+ ss >> percent >> flags_id;
+ }
+
+ EXPECT_FALSE(string_id.empty())
+ << "Could not find string id for DebugBuildIdentifier.";
+ EXPECT_FALSE(flags_id.empty())
+ << "Could not find flags id for DebugBuildIdentifier.";
+
+ bool found =
+ (after.find("%" + string_id + " = OpString") != std::string::npos);
+ EXPECT_TRUE(found)
+ << "Was expecting the DebugBuildIdentifier string to have been kept.";
+ found = (after.find("%" + flags_id + " = OpConstant") != std::string::npos);
+ EXPECT_TRUE(found)
+ << "Was expecting the DebugBuildIdentifier constant to have been kept.";
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/pass_fixture.h b/third_party/SPIRV-Tools/test/opt/pass_fixture.h
index e520821..d67d364 100644
--- a/third_party/SPIRV-Tools/test/opt/pass_fixture.h
+++ b/third_party/SPIRV-Tools/test/opt/pass_fixture.h
@@ -35,6 +35,26 @@
namespace spvtools {
namespace opt {
+inline std::ostream& operator<<(std::ostream& os,
+ const effcee::Result::Status ers) {
+ switch (ers) {
+ case effcee::Result::Status::Ok:
+ return os << "effcee::Result::Status::Ok";
+ case effcee::Result::Status::Fail:
+ return os << "effcee::Result::Status::Fail";
+ case effcee::Result::Status::BadOption:
+ return os << "effcee::Result::Status::BadOption";
+ case effcee::Result::Status::NoRules:
+ return os << "effcee::Result::Status::NoRules";
+ case effcee::Result::Status::BadRule:
+ return os << "effcee::Result::Status::BadRule";
+ default:
+ break;
+ }
+ return os << "(invalid effcee::Result::Status " << static_cast<unsigned>(ers)
+ << ")";
+}
+
// Template class for testing passes. It contains some handy utility methods for
// running passes and checking results.
//
@@ -102,23 +122,24 @@
auto status = Pass::Status::SuccessWithoutChange;
std::tie(optimized_bin, status) = SinglePassRunToBinary<PassT>(
assembly, skip_nop, std::forward<Args>(args)...);
- if (do_validation) {
- spv_context spvContext = spvContextCreate(env_);
- spv_diagnostic diagnostic = nullptr;
- spv_const_binary_t binary = {optimized_bin.data(), optimized_bin.size()};
- spv_result_t error = spvValidateWithOptions(
- spvContext, ValidatorOptions(), &binary, &diagnostic);
- EXPECT_EQ(error, 0);
- if (error != 0) spvDiagnosticPrint(diagnostic);
- spvDiagnosticDestroy(diagnostic);
- spvContextDestroy(spvContext);
- }
std::string optimized_asm;
SpirvTools tools(env_);
EXPECT_TRUE(
tools.Disassemble(optimized_bin, &optimized_asm, disassemble_options_))
<< "Disassembling failed for shader:\n"
<< assembly << std::endl;
+ if (do_validation) {
+ spv_context spvContext = spvContextCreate(env_);
+ spv_diagnostic diagnostic = nullptr;
+ spv_const_binary_t binary = {optimized_bin.data(), optimized_bin.size()};
+ spv_result_t error = spvValidateWithOptions(
+ spvContext, ValidatorOptions(), &binary, &diagnostic);
+ EXPECT_EQ(error, 0) << "validation failed for optimized asm:\n"
+ << optimized_asm;
+ if (error != 0) spvDiagnosticPrint(diagnostic);
+ spvDiagnosticDestroy(diagnostic);
+ spvContextDestroy(spvContext);
+ }
return std::make_tuple(optimized_asm, status);
}
@@ -257,6 +278,23 @@
}
}
+ // Returns the disassembly of the current module. This is useful for
+ // debugging.
+ std::unique_ptr<opt::IRContext> AssembleModule(const std::string& text) {
+ return spvtools::BuildModule(env_, consumer_, text, assemble_options_);
+ }
+
+ // Returns the disassembly of the current module. This is useful for
+ // debugging.
+ std::string Disassemble(opt::Module* m) {
+ std::vector<uint32_t> binary;
+ m->ToBinary(&binary, /* skip_nop = */ false);
+ std::string disassembly;
+ SpirvTools tools(env_);
+ tools.Disassemble(binary, &disassembly, disassemble_options_);
+ return disassembly;
+ }
+
void SetAssembleOptions(uint32_t assemble_options) {
assemble_options_ = assemble_options;
}
diff --git a/third_party/SPIRV-Tools/test/opt/pass_merge_return_test.cpp b/third_party/SPIRV-Tools/test/opt/pass_merge_return_test.cpp
index 494f2e9..c005d74 100644
--- a/third_party/SPIRV-Tools/test/opt/pass_merge_return_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/pass_merge_return_test.cpp
@@ -2598,6 +2598,70 @@
EXPECT_EQ(Pass::Status::Failure, std::get<1>(result));
}
+TEST_F(MergeReturnPassTest, DebugFunctionDefinitionStillInEntryBlock) {
+ // Make sure that the DebugFunctionDefinition instruction is still in the
+ // entry block
+ const std::string text =
+ R"(
+; CHECK: OpFunction
+; CHECK: OpLabel
+; CHECK: DebugFunctionDefinition
+; CHECK: OpSelectionMerge
+; CHECK: OpCompositeExtract
+; CHECK: OpUGreaterThan
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %2 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main" %entryPointParam_main %gl_GlobalInvocationID
+ %1 = OpString "test"
+ OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
+ OpDecorate %entryPointParam_main Location 0
+ %void = OpTypeVoid
+ %4 = OpExtInst %void %2 DebugSource %1
+ %uint = OpTypeInt 32 0
+ %uint_100 = OpConstant %uint 100
+ %uint_5 = OpConstant %uint 5
+ %uint_11 = OpConstant %uint 11
+ %10 = OpExtInst %void %2 DebugCompilationUnit %uint_100 %uint_5 %4 %uint_11
+ %12 = OpTypeFunction %void
+ %uint_0 = OpConstant %uint 0
+ %14 = OpExtInst %void %2 DebugTypeFunction %uint_0 %void
+ %uint_2 = OpConstant %uint 2
+ %16 = OpExtInst %void %2 DebugFunction %1 %14 %4 %uint_2 %uint_5 %10 %1 %uint_0 %uint_2
+ %v3uint = OpTypeVector %uint 3
+ %_ptr_Input_v3uint = OpTypePointer Input %v3uint
+ %bool = OpTypeBool
+ %uint_3 = OpConstant %uint 3
+ %int = OpTypeInt 32 1
+ %_ptr_Output_int = OpTypePointer Output %int
+ %int_1 = OpConstant %int 1
+ %int_0 = OpConstant %int 0
+ %gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input ; BuiltIn GlobalInvocationId
+ %entryPointParam_main = OpVariable %_ptr_Output_int Output ; Location 0
+
+ ; Function main
+ %main = OpFunction %void None %12
+ %13 = OpLabel
+ %20 = OpExtInst %void %2 DebugScope %16
+ %29 = OpLoad %v3uint %gl_GlobalInvocationID
+ %37 = OpCompositeExtract %uint %29 0
+ %39 = OpUGreaterThan %bool %37 %uint_3
+ %19 = OpExtInst %void %2 DebugFunctionDefinition %16 %main
+ OpSelectionMerge %21 None
+ OpBranchConditional %39 %23 %21
+ %21 = OpLabel
+ OpStore %entryPointParam_main %int_1
+ OpReturn
+ %23 = OpLabel
+ OpStore %entryPointParam_main %int_0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<MergeReturnPass>(text, true);
+}
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/pass_utils.h b/third_party/SPIRV-Tools/test/opt/pass_utils.h
index 8968f8a..ddf3b9f 100644
--- a/third_party/SPIRV-Tools/test/opt/pass_utils.h
+++ b/third_party/SPIRV-Tools/test/opt/pass_utils.h
@@ -17,6 +17,7 @@
#include <algorithm>
#include <functional>
+#include <iostream>
#include <iterator>
#include <string>
#include <vector>
@@ -24,10 +25,25 @@
#include "gtest/gtest.h"
#include "include/spirv-tools/libspirv.h"
#include "include/spirv-tools/libspirv.hpp"
+#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
+inline std::ostream& operator<<(std::ostream& os, const Pass::Status ps) {
+ switch (ps) {
+ case Pass::Status::Failure:
+ return os << "Pass::Status::Failure";
+ case Pass::Status::SuccessWithChange:
+ return os << "Pass::Status::SuccessWithChange";
+ case Pass::Status::SuccessWithoutChange:
+ return os << "Pass::Status::SuccessWithoutChange";
+ default:
+ break;
+ }
+ return os << "(invalid Pass::Status " << static_cast<unsigned>(ps) << ")";
+}
+
struct Message {
spv_message_level_t level;
const char* source_file;
diff --git a/third_party/SPIRV-Tools/test/opt/private_to_local_test.cpp b/third_party/SPIRV-Tools/test/opt/private_to_local_test.cpp
index f7c37c9..6314d49 100644
--- a/third_party/SPIRV-Tools/test/opt/private_to_local_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/private_to_local_test.cpp
@@ -173,6 +173,43 @@
SinglePassRunAndMatch<PrivateToLocalPass>(text, false);
}
+TEST_F(PrivateToLocalTest, IgnorePointerToPrivateVariable) {
+ // Should not change because the pointer to the private variable
+ // has been stored inside a function variable.
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability VariablePointersStorageBuffer
+ OpCapability VariablePointers
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %load_thread_local "load_thread_local" %v
+ OpExecutionMode %load_thread_local LocalSize 8 8 1
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %void = OpTypeVoid
+%function_type__1561_ = OpTypeFunction %void
+%_ptr_Private_uint = OpTypePointer Private %uint
+%_ptr_Function__ptr_Private_uint = OpTypePointer Function %_ptr_Private_uint
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %v = OpVariable %_ptr_Private_uint Private %uint_0
+%load_thread_local = OpFunction %void None %function_type__1561_
+ %37 = OpLabel
+ %31 = OpVariable %_ptr_Function__ptr_Private_uint Function
+ %32 = OpVariable %_ptr_Function_uint Function
+ %33 = OpVariable %_ptr_Function_uint Function
+ OpStore %31 %v
+ %35 = OpLoad %uint %v
+ OpStore %32 %35
+ %36 = OpLoad %uint %v
+ OpStore %33 %36
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto result = SinglePassRunAndDisassemble<PrivateToLocalPass>(
+ text, /* skip_nop = */ true, /* do_validation = */ false);
+ EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
+}
+
TEST_F(PrivateToLocalTest, UsedInTwoFunctions) {
// Should not change because it is used in multiple functions.
const std::string text = R"(
diff --git a/third_party/SPIRV-Tools/test/opt/propagator_test.cpp b/third_party/SPIRV-Tools/test/opt/propagator_test.cpp
index 307a2a1..0a98cfa 100644
--- a/third_party/SPIRV-Tools/test/opt/propagator_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/propagator_test.cpp
@@ -184,7 +184,7 @@
}
} else if (instr->opcode() == spv::Op::OpPhi) {
phi_instr = instr;
- SSAPropagator::PropStatus retval;
+ SSAPropagator::PropStatus retval = SSAPropagator::kNotInteresting;
for (uint32_t i = 2; i < instr->NumOperands(); i += 2) {
uint32_t phi_arg_id = instr->GetSingleWordOperand(i);
auto it = values_.find(phi_arg_id);
diff --git a/third_party/SPIRV-Tools/test/opt/redundancy_elimination_test.cpp b/third_party/SPIRV-Tools/test/opt/redundancy_elimination_test.cpp
index eb78497..7799d45 100644
--- a/third_party/SPIRV-Tools/test/opt/redundancy_elimination_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/redundancy_elimination_test.cpp
@@ -359,6 +359,93 @@
SinglePassRunAndCheck<RedundancyEliminationPass>(text, text, false);
}
+TEST_F(RedundancyEliminationTest, PreserveLoadYieldingImage) {
+ // This is more strict than needed.
+ // This is sufficient to ensure that the load of an image
+ // occurs in the same basic block as its use.
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %load_ty "load_ty"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %load_ty = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%ptr_load_ty = OpTypePointer UniformConstant %load_ty
+ %var = OpVariable %ptr_load_ty UniformConstant
+ %main = OpFunction %void None %6
+ ; CHECK: OpLoad %load_ty
+ ; CHECK: OpLoad %load_ty
+ %15 = OpLabel
+ %16 = OpLoad %load_ty %var
+ %17 = OpLoad %load_ty %var
+ OpReturn
+ OpFunctionEnd
+ )";
+ SinglePassRunAndMatch<RedundancyEliminationPass>(text, false);
+}
+
+TEST_F(RedundancyEliminationTest, PreserveLoadYieldingSampler) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %load_ty "load_ty"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %load_ty = OpTypeSampler
+%ptr_load_ty = OpTypePointer UniformConstant %load_ty
+ %var = OpVariable %ptr_load_ty UniformConstant
+ %main = OpFunction %void None %6
+ ; CHECK: OpLoad %load_ty
+ ; CHECK: OpLoad %load_ty
+ %15 = OpLabel
+ %16 = OpLoad %load_ty %var
+ %17 = OpLoad %load_ty %var
+ OpReturn
+ OpFunctionEnd
+ )";
+ SinglePassRunAndMatch<RedundancyEliminationPass>(text, false);
+}
+
+TEST_F(RedundancyEliminationTest, PreserveLoadYieldingSampledImage) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %load_ty "load_ty"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %i_ty = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+ %load_ty = OpTypeSampledImage %i_ty
+%ptr_load_ty = OpTypePointer UniformConstant %load_ty
+ %var = OpVariable %ptr_load_ty UniformConstant
+ %main = OpFunction %void None %6
+ ; CHECK: OpLoad %load_ty
+ ; CHECK: OpLoad %load_ty
+ %15 = OpLabel
+ %16 = OpLoad %load_ty %var
+ %17 = OpLoad %load_ty %var
+ OpReturn
+ OpFunctionEnd
+ )";
+ SinglePassRunAndMatch<RedundancyEliminationPass>(text, false);
+}
+
} // namespace
} // namespace opt
-} // namespace spvtools
\ No newline at end of file
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/resolve_binding_conflicts_pass_test.cpp b/third_party/SPIRV-Tools/test/opt/resolve_binding_conflicts_pass_test.cpp
new file mode 100644
index 0000000..31378b9
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/opt/resolve_binding_conflicts_pass_test.cpp
@@ -0,0 +1,864 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <iostream>
+#include <ostream>
+
+#include "spirv-tools/optimizer.hpp"
+#include "test/opt/pass_fixture.h"
+#include "test/opt/pass_utils.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+struct ResolveBindingConflictsTest : public PassTest<::testing::Test> {
+ virtual void SetUp() override {
+ SetTargetEnv(SPV_ENV_VULKAN_1_1); // allow storage buffer storage class
+ // without extension.
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+};
+
+using StringList = std::vector<std::string>;
+std::string EntryPointDecls(const StringList& names) {
+ std::ostringstream os;
+ for (auto& name : names) {
+ os << " OpEntryPoint GLCompute %" + name + " \"" + name +
+ "\"\n";
+ }
+ for (auto& name : names) {
+ os << " OpExecutionMode %" + name + " LocalSize 1 1 1\n";
+ }
+ for (auto& name : names) {
+ os << " OpName %" + name + " \"" + name + "\"\n";
+ }
+ return os.str();
+}
+
+std::string Preamble(const StringList& names = {"main"}) {
+ return R"( OpCapability Shader
+ OpMemoryModel Logical GLSL450
+)" + EntryPointDecls(names) +
+ R"( OpName %voidfn "voidfn"
+ OpName %s_ty "s_ty"
+ OpName %i_ty "i_ty"
+ OpName %si_ty "si_ty"
+ OpName %p_s_ty "p_s_ty"
+ OpName %p_i_ty "p_i_ty"
+ OpName %p_si_ty "p_si_ty"
+ OpName %st_ty "st_ty"
+ OpName %pu_st_ty "pu_st_ty"
+ OpName %pb_st_ty "pb_st_ty"
+)";
+}
+
+std::string BasicTypes() {
+ return R"( OpDecorate %st_ty Block
+ OpMemberDecorate %st_ty 0 Offset 0
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %uint_3 = OpConstant %uint 3
+ %void = OpTypeVoid
+ %voidfn = OpTypeFunction %void
+ %s_ty = OpTypeSampler
+ %i_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %si_ty = OpTypeSampledImage %i_ty
+ %p_i_ty = OpTypePointer UniformConstant %i_ty
+ %p_s_ty = OpTypePointer UniformConstant %s_ty
+ %p_si_ty = OpTypePointer UniformConstant %si_ty
+ %st_ty = OpTypeStruct %uint
+ %pu_st_ty = OpTypePointer Uniform %st_ty
+ %pb_st_ty = OpTypePointer StorageBuffer %st_ty
+)";
+}
+std::string NoCheck() { return "; CHECK-NOT: nothing to see"; }
+
+TEST_F(ResolveBindingConflictsTest, NoBindings_NoChange) {
+ const std::string kTest = Preamble() + BasicTypes() +
+ R"( %main = OpFunction %void None %voidfn
+ %100 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest + NoCheck(), /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange);
+ EXPECT_EQ(kTest, disasm);
+}
+
+TEST_F(ResolveBindingConflictsTest, NoConflict_UnusedVars_NoChange) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 0
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 0
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 0
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 0
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 0
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 0
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 0
+
+)" + BasicTypes() + R"(
+
+ ; Unused variables
+
+ %100 = OpVariable %p_i_ty UniformConstant ; image
+ %101 = OpVariable %p_s_ty UniformConstant ; sampler
+ %102 = OpVariable %pu_st_ty Uniform ; UBO
+ %103 = OpVariable %pb_st_ty StorageBuffer ; SSBO
+ %104 = OpVariable %p_si_ty UniformConstant ; combined sampled image
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest, NoConflict_UsedVars_NoChange) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 1
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 2
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 3
+ OpDecorate %110 DescriptorSet 1
+ OpDecorate %110 Binding 0
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 0
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 1
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+ ; CHECK: OpDecorate %110 DescriptorSet 1
+ ; CHECK: OpDecorate %110 Binding 0
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_i_ty UniformConstant ; image
+ %101 = OpVariable %p_s_ty UniformConstant ; sampler
+ %102 = OpVariable %pu_st_ty Uniform ; UBO
+ %103 = OpVariable %pb_st_ty StorageBuffer ; SSBO
+ %110 = OpVariable %p_si_ty UniformConstant ; combined sampled image
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ %11 = OpCopyObject %p_i_ty %100
+ %12 = OpCopyObject %p_s_ty %101
+ %13 = OpCopyObject %pu_st_ty %102
+ %14 = OpCopyObject %pb_st_ty %103
+ %15 = OpCopyObject %p_si_ty %110
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ OneEntryPoint_SamplerFirstConflict_Resolves) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+
+ ; The sampler's binding number is incremented, even when listed first.
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; sampler listed first
+ %101 = OpVariable %p_i_ty UniformConstant
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ %11 = OpCopyObject %p_s_ty %100
+ %12 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ OneEntryPoint_SamplerSecondConflict_Resolves) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+
+ ; The sampler's binding number is incremented, even when listed second.
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 0
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 1
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_i_ty UniformConstant
+ %101 = OpVariable %p_s_ty UniformConstant ; sampler listed second
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ %11 = OpCopyObject %p_i_ty %100
+ %12 = OpCopyObject %p_s_ty %101
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest, OneEntryPoint_Conflict_Ripples) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 2
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 3
+
+ ; The sampler's binding number is incremented, and later
+ ; bindings move out of the way.
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 4
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; sampler comes first
+ %101 = OpVariable %p_i_ty UniformConstant
+ %102 = OpVariable %pu_st_ty Uniform
+ %103 = OpVariable %pb_st_ty StorageBuffer
+ %104 = OpVariable %p_si_ty UniformConstant
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ %11 = OpCopyObject %p_s_ty %100
+ %12 = OpCopyObject %p_i_ty %101
+ %13 = OpCopyObject %pu_st_ty %102
+ %14 = OpCopyObject %pb_st_ty %103
+ %15 = OpCopyObject %p_si_ty %104
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ OneEntryPoint_Conflict_RippleStopsAtFirstHole) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ ; Leave a hole at (0, 2)
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 3
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 4
+
+ ; There was a hole at binding 2. The ripple stops there.
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 4
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; sampler comes first
+ %101 = OpVariable %p_i_ty UniformConstant
+ %102 = OpVariable %pu_st_ty Uniform
+ %103 = OpVariable %pb_st_ty StorageBuffer
+ %104 = OpVariable %p_si_ty UniformConstant
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ %11 = OpCopyObject %p_s_ty %100
+ %12 = OpCopyObject %p_i_ty %101
+ %13 = OpCopyObject %pu_st_ty %102
+ %14 = OpCopyObject %pb_st_ty %103
+ %15 = OpCopyObject %p_si_ty %104
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest, OneEntryPoint_MultiConflict_Resolves) {
+ const std::string kTest = Preamble() +
+ R"(
+ ; Two conflicts: at Bindings 0, and 1
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 1
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 2
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 4
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; sampler first
+ %101 = OpVariable %p_i_ty UniformConstant
+ %102 = OpVariable %p_i_ty UniformConstant
+ %103 = OpVariable %p_s_ty UniformConstant ; sampler second
+ %104 = OpVariable %pu_st_ty Uniform
+
+ %main = OpFunction %void None %voidfn
+ %10 = OpLabel
+ %11 = OpCopyObject %p_s_ty %100
+ %12 = OpCopyObject %p_i_ty %101
+ %13 = OpCopyObject %p_i_ty %102
+ %14 = OpCopyObject %p_s_ty %103
+ %15 = OpCopyObject %pu_st_ty %104
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ OneEntryPoint_MultiConflict_ComplexCallGraph_Resolves) {
+ // Check that uses are seen even when used at various points in a complex call
+ // graph.
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 1
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 2
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 4
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; used in %200
+ %101 = OpVariable %p_i_ty UniformConstant ; used in %300, %400
+ %102 = OpVariable %p_i_ty UniformConstant ; used in %500
+ %103 = OpVariable %p_s_ty UniformConstant ; used in %400 twice
+ %104 = OpVariable %pu_st_ty Uniform ; used in %600
+
+ %200 = OpFunction %void None %voidfn
+ %201 = OpLabel
+ %202 = OpCopyObject %p_s_ty %100
+ OpReturn
+ OpFunctionEnd
+
+ %300 = OpFunction %void None %voidfn
+ %301 = OpLabel
+ %302 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+
+ %400 = OpFunction %void None %voidfn
+ %401 = OpLabel
+ %402 = OpFunctionCall %void %200
+ %403 = OpCopyObject %p_s_ty %103
+ %404 = OpCopyObject %p_i_ty %101
+ %405 = OpCopyObject %p_s_ty %103
+ %406 = OpFunctionCall %void %300
+ OpReturn
+ OpFunctionEnd
+
+ %500 = OpFunction %void None %voidfn
+ %501 = OpLabel
+ %502 = OpFunctionCall %void %400
+ %503 = OpCopyObject %p_i_ty %102
+ %504 = OpFunctionCall %void %300
+ OpReturn
+ OpFunctionEnd
+
+ %600 = OpFunction %void None %voidfn
+ %601 = OpLabel
+ %602 = OpFunctionCall %void %300
+ %603 = OpFunctionCall %void %500
+ %604 = OpCopyObject %pu_st_ty %104
+ OpReturn
+ OpFunctionEnd
+
+ %main = OpFunction %void None %voidfn
+ %1000 = OpLabel
+ %1001 = OpFunctionCall %void %600
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ MultiEntryPoint_DuplicatConflicts_ResolvesOnlyOnce) {
+ // Before:
+ //
+ // Binding: 0 1
+ // Alpha: %100,%101
+ // Beta: %100,%101
+ //
+ // After:
+ //
+ // Binding: 0 1
+ // Alpha: %101 %100
+ // Beta: %101 %100
+ const std::string kTest = Preamble({"alpha", "beta"}) +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant
+ %101 = OpVariable %p_i_ty UniformConstant
+
+ %alpha = OpFunction %void None %voidfn
+ %1000 = OpLabel
+ %1001 = OpCopyObject %p_s_ty %100
+ %1002 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+
+ %beta = OpFunction %void None %voidfn
+ %2000 = OpLabel
+ %2001 = OpCopyObject %p_s_ty %100
+ %2002 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ MultiEntryPoint_IndependentConflicts_Resolves) {
+ // Before:
+ //
+ // Binding: 0 1
+ // Alpha: %100,%101
+ // Beta: %102,%103
+ //
+ // After:
+ //
+ // Binding: 0 1
+ // Alpha: %101 %100
+ // Beta: %102 %103
+ const std::string kTest = Preamble({"alpha", "beta"}) +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 0
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 0
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 0
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 1
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant
+ %101 = OpVariable %p_i_ty UniformConstant
+ %102 = OpVariable %p_i_ty UniformConstant
+ %103 = OpVariable %p_s_ty UniformConstant
+
+ %alpha = OpFunction %void None %voidfn
+ %1000 = OpLabel
+ %1001 = OpCopyObject %p_s_ty %100
+ %1002 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+
+ %beta = OpFunction %void None %voidfn
+ %2000 = OpLabel
+ %2001 = OpCopyObject %p_i_ty %102
+ %2002 = OpCopyObject %p_s_ty %103
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ MultiEntryPoint_SameVarConflictsAcrossMultiEntryPoints_Resolves) {
+ // A sampler variable is bumped, causing potential conflicts in other shaders.
+ //
+ // Before:
+ //
+ // Binding: 0 1 2
+ // Alpha: %100,%101
+ // Beta: %100 %102
+ // Gamma: %100 %103
+ //
+ // After:
+ //
+ // Binding: 0 1 2
+ // Alpha: %101 %100
+ // Beta: %100 %102
+ // Gamma: %100 %103
+ //
+ const std::string kTest = Preamble({"alpha", "beta", "gamma"}) +
+ R"(
+ OpDecorate %100 DescriptorSet 0 ; The sampler
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 2
+
+ ; bumped once
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+
+ ; pushed back from bump of %100
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+
+ ; does not need to be bumped
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 2
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; used in alpha, beta, gamma
+ %101 = OpVariable %p_i_ty UniformConstant ; used in alpha
+ %102 = OpVariable %pu_st_ty Uniform ; used in beta
+ %103 = OpVariable %pb_st_ty StorageBuffer ; used in gamma
+
+ %alpha = OpFunction %void None %voidfn
+ %1000 = OpLabel
+ %1001 = OpCopyObject %p_s_ty %100
+ %1002 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+
+ %beta = OpFunction %void None %voidfn
+ %2000 = OpLabel
+ %2001 = OpCopyObject %p_s_ty %100
+ %2002 = OpCopyObject %pu_st_ty %102
+ OpReturn
+ OpFunctionEnd
+
+ %gamma = OpFunction %void None %voidfn
+ %3000 = OpLabel
+ %3001 = OpCopyObject %p_s_ty %100
+ %3002 = OpCopyObject %pb_st_ty %103
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest, MultiEntryPoint_ConflictCascade_Resolves) {
+ // Before:
+ //
+ // Binding: 0 1 2 3
+ // Alpha: %100,%101
+ // Beta: %100 %102
+ // Gamma: %102 %103
+ // Delta: %103 %104
+ //
+ // After:
+ //
+ // Binding: 0 1 2 3 4
+ // Alpha: %101 %100
+ // Beta: %100 %102
+ // Gamma: %102 %103
+ // Delta: %103 %104
+ //
+ const std::string kTest = Preamble({"alpha", "beta", "gamma", "delta"}) +
+ R"(
+ OpDecorate %100 DescriptorSet 0 ; The sampler
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 2
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 3
+
+ ; %100 is bumped once:
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 1
+
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 0
+
+ ; pushed back from bump of %100
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+
+ ; pushed back from bump of %102
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+
+ ; pushed back from bump of %103
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 4
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_s_ty UniformConstant ; used in alpha, beta
+ %101 = OpVariable %p_i_ty UniformConstant ; used in alpha
+ %102 = OpVariable %pu_st_ty Uniform ; used in beta, gamma
+ %103 = OpVariable %pb_st_ty StorageBuffer ; used in gamma, delta
+ %104 = OpVariable %p_si_ty UniformConstant ; used delta
+
+ %alpha = OpFunction %void None %voidfn
+ %1000 = OpLabel
+ %1001 = OpCopyObject %p_s_ty %100
+ %1002 = OpCopyObject %p_i_ty %101
+ OpReturn
+ OpFunctionEnd
+
+ %beta = OpFunction %void None %voidfn
+ %2000 = OpLabel
+ %2001 = OpCopyObject %p_s_ty %100
+ %2002 = OpCopyObject %pu_st_ty %102
+ OpReturn
+ OpFunctionEnd
+
+ %gamma = OpFunction %void None %voidfn
+ %3000 = OpLabel
+ %3001 = OpCopyObject %pu_st_ty %102
+ %3002 = OpCopyObject %pb_st_ty %103
+ OpReturn
+ OpFunctionEnd
+
+ %delta = OpFunction %void None %voidfn
+ %4000 = OpLabel
+ %4001 = OpCopyObject %pb_st_ty %103
+ %4002 = OpCopyObject %p_si_ty %104
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(ResolveBindingConflictsTest,
+ MultiEntryPoint_ConflictCascade_RevisitEntryPoint) {
+ // Prove that the settling algorithm knows to revisit entry points that
+ // already had all their own conflicts resolved.
+ //
+ // Before:
+ //
+ // Binding: 0 1 2 3 4
+ // Alpha: %100,%101 %103 %104 %105
+ // Beta: %101 %102 %103 %105
+ //
+ // After:
+ //
+ // Binding: 0 1 2 3 4 5
+ // Alpha: %100 %101 %103 %104 %105
+ // Beta: %101 %102 %103 %105
+ const std::string kTest = Preamble({"alpha", "beta"}) +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %101 DescriptorSet 0 ; the sampler
+ OpDecorate %101 Binding 0
+ OpDecorate %102 DescriptorSet 0
+ OpDecorate %102 Binding 1
+ OpDecorate %103 DescriptorSet 0
+ OpDecorate %103 Binding 2
+ OpDecorate %104 DescriptorSet 0
+ OpDecorate %104 Binding 3
+ OpDecorate %105 DescriptorSet 0
+ OpDecorate %105 Binding 4
+
+ ; CHECK: OpDecorate %100 DescriptorSet 0
+ ; CHECK: OpDecorate %100 Binding 0
+ ; CHECK: OpDecorate %101 DescriptorSet 0
+ ; CHECK: OpDecorate %101 Binding 1
+ ; CHECK: OpDecorate %102 DescriptorSet 0
+ ; CHECK: OpDecorate %102 Binding 2
+ ; CHECK: OpDecorate %103 DescriptorSet 0
+ ; CHECK: OpDecorate %103 Binding 3
+ ; CHECK: OpDecorate %104 DescriptorSet 0
+ ; CHECK: OpDecorate %104 Binding 4
+ ; CHECK: OpDecorate %105 DescriptorSet 0
+ ; CHECK: OpDecorate %105 Binding 5
+
+)" + BasicTypes() + R"(
+
+ %100 = OpVariable %p_i_ty UniformConstant
+ %101 = OpVariable %p_s_ty UniformConstant
+ %102 = OpVariable %pu_st_ty Uniform
+ %103 = OpVariable %pb_st_ty StorageBuffer
+ %104 = OpVariable %p_si_ty UniformConstant
+ %105 = OpVariable %p_s_ty UniformConstant
+
+ %alpha = OpFunction %void None %voidfn
+ %1000 = OpLabel
+ %1001 = OpCopyObject %p_i_ty %100
+ %1002 = OpCopyObject %p_s_ty %101
+ %1003 = OpCopyObject %pb_st_ty %103
+ %1004 = OpCopyObject %p_si_ty %104
+ %1005 = OpCopyObject %p_s_ty %105
+ OpReturn
+ OpFunctionEnd
+
+ %beta = OpFunction %void None %voidfn
+ %2000 = OpLabel
+ %2001 = OpCopyObject %p_s_ty %101
+ %2002 = OpCopyObject %pu_st_ty %102
+ %2003 = OpCopyObject %pb_st_ty %103
+ %2004 = OpCopyObject %p_s_ty %105
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<ResolveBindingConflictsPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+} // namespace
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/scalar_replacement_test.cpp b/third_party/SPIRV-Tools/test/opt/scalar_replacement_test.cpp
index 0ba285b..01fa721 100644
--- a/third_party/SPIRV-Tools/test/opt/scalar_replacement_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/scalar_replacement_test.cpp
@@ -27,7 +27,7 @@
TEST_F(ScalarReplacementPassName, Default) {
auto srp = ScalarReplacementPass();
- EXPECT_STREQ(srp.name(), "scalar-replacement=100");
+ EXPECT_STREQ(srp.name(), "scalar-replacement=0");
}
TEST_F(ScalarReplacementPassName, Large) {
diff --git a/third_party/SPIRV-Tools/test/opt/split_combined_image_sampler_pass_test.cpp b/third_party/SPIRV-Tools/test/opt/split_combined_image_sampler_pass_test.cpp
new file mode 100644
index 0000000..d6ad6bb
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/opt/split_combined_image_sampler_pass_test.cpp
@@ -0,0 +1,1933 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <array>
+#include <iostream>
+#include <ostream>
+
+#include "spirv-tools/optimizer.hpp"
+#include "test/opt/pass_fixture.h"
+#include "test/opt/pass_utils.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+struct SplitCombinedImageSamplerPassTest : public PassTest<::testing::Test> {
+ virtual void SetUp() override {
+ SetTargetEnv(SPV_ENV_VULKAN_1_0);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+};
+
+struct TypeCase {
+ const char* glsl_type;
+ const char* image_type_decl;
+};
+std::ostream& operator<<(std::ostream& os, const TypeCase& tc) {
+ os << tc.glsl_type;
+ return os;
+}
+
+struct SplitCombinedImageSamplerPassTypeCaseTest
+ : public PassTest<::testing::TestWithParam<TypeCase>> {
+ virtual void SetUp() override {
+ SetTargetEnv(SPV_ENV_VULKAN_1_0);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+};
+
+std::vector<TypeCase> ImageTypeCases() {
+ return std::vector<TypeCase>{
+ {"sampler2D", "OpTypeImage %float 2D 0 0 0 1 Unknown"},
+ {"sampler2DShadow", "OpTypeImage %float 2D 1 0 0 1 Unknown"},
+ {"sampler2DArray", "OpTypeImage %float 2D 0 1 0 1 Unknown"},
+ {"sampler2DArrayShadow", "OpTypeImage %float 2D 1 1 0 1 Unknown"},
+ {"sampler2DMS", "OpTypeImage %float 2D 0 0 1 1 Unknown"},
+ {"sampler2DMSArray", "OpTypeImage %float 2D 0 1 1 1 Unknown"},
+ {"sampler3D", "OpTypeImage %float 3D 0 0 0 1 Unknown"},
+ {"samplerCube", "OpTypeImage %float Cube 0 0 0 1 Unknown"},
+ {"samplerCubeShadow", "OpTypeImage %float Cube 1 0 0 1 Unknown"},
+ {"samplerCubeArray", "OpTypeImage %float Cube 0 1 0 1 Unknown"},
+ {"samplerCubeArrayShadow", "OpTypeImage %float Cube 1 1 0 1 Unknown"},
+ {"isampler2D", "OpTypeImage %int 2D 0 0 0 1 Unknown"},
+ {"isampler2DShadow", "OpTypeImage %int 2D 1 0 0 1 Unknown"},
+ {"isampler2DArray", "OpTypeImage %int 2D 0 1 0 1 Unknown"},
+ {"isampler2DArrayShadow", "OpTypeImage %int 2D 1 1 0 1 Unknown"},
+ {"isampler2DMS", "OpTypeImage %int 2D 0 0 1 1 Unknown"},
+ {"isampler2DMSArray", "OpTypeImage %int 2D 0 1 1 1 Unknown"},
+ {"isampler3D", "OpTypeImage %int 3D 0 0 0 1 Unknown"},
+ {"isamplerCube", "OpTypeImage %int Cube 0 0 0 1 Unknown"},
+ {"isamplerCubeShadow", "OpTypeImage %int Cube 1 0 0 1 Unknown"},
+ {"isamplerCubeArray", "OpTypeImage %int Cube 0 1 0 1 Unknown"},
+ {"isamplerCubeArrayShadow", "OpTypeImage %int Cube 1 1 0 1 Unknown"},
+ {"usampler2D", "OpTypeImage %uint 2D 0 0 0 1 Unknown"},
+ {"usampler2DShadow", "OpTypeImage %uint 2D 1 0 0 1 Unknown"},
+ {"usampler2DArray", "OpTypeImage %uint 2D 0 1 0 1 Unknown"},
+ {"usampler2DArrayShadow", "OpTypeImage %uint 2D 1 1 0 1 Unknown"},
+ {"usampler2DMS", "OpTypeImage %uint 2D 0 0 1 1 Unknown"},
+ {"usampler2DMSArray", "OpTypeImage %uint 2D 0 1 1 1 Unknown"},
+ {"usampler3D", "OpTypeImage %uint 3D 0 0 0 1 Unknown"},
+ {"usamplerCube", "OpTypeImage %uint Cube 0 0 0 1 Unknown"},
+ {"usamplerCubeShadow", "OpTypeImage %uint Cube 1 0 0 1 Unknown"},
+ {"usamplerCubeArray", "OpTypeImage %uint Cube 0 1 0 1 Unknown"},
+ {"usamplerCubeArrayShadow", "OpTypeImage %uint Cube 1 1 0 1 Unknown"},
+ };
+}
+
+std::string Preamble(const std::string shader_interface = "") {
+ return R"( OpCapability Shader
+ OpCapability RuntimeDescriptorArray
+ OpExtension "SPV_EXT_descriptor_indexing"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main")" +
+ shader_interface + R"(
+ OpExecutionMode %main LocalSize 1 1 1
+ OpName %main "main"
+ OpName %main_0 "main_0"
+ OpName %voidfn "voidfn"
+)";
+}
+
+std::string PreambleFragment(const std::string shader_interface = "") {
+ return R"( OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main")" +
+ shader_interface + R"(
+ OpExecutionMode %main OriginUpperLeft
+ OpName %main "main"
+ OpName %main_0 "main_0"
+ OpName %voidfn "voidfn"
+)";
+}
+
+std::string BasicTypes() {
+ return R"( %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_3 = OpConstant %uint 3
+ %float_0 = OpConstant %float 0
+ %v2float = OpTypeVector %float 2
+ %v3float = OpTypeVector %float 3
+ %v4float = OpTypeVector %float 4
+ %13 = OpConstantNull %v2float
+ %14 = OpConstantNull %v3float
+ %15 = OpConstantNull %v4float
+ %void = OpTypeVoid
+ %voidfn = OpTypeFunction %void
+)";
+}
+std::string Main() {
+ return R"(
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+}
+std::string NoCheck() { return "; CHECK-NOT: nothing to see"; }
+
+TEST_F(SplitCombinedImageSamplerPassTest, SamplerOnly_NoChange) {
+ const std::string kTest = Preamble() +
+ R"( OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+)" + BasicTypes() + R"( %10 = OpTypeSampler
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %100 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %6 = OpLoad %10 %100
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest + NoCheck(), /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange)
+ << "status" << kTest << "\n -> \n"
+ << disasm;
+ EXPECT_EQ(disasm, kTest) << "disasm";
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, ImageOnly_NoChange) {
+ const std::string kTest = Preamble() +
+ R"( OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+)" + BasicTypes() + R"( %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
+ %100 = OpVariable %_ptr_UniformConstant_10 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %6 = OpLoad %10 %100
+ OpReturn
+ OpFunctionEnd
+)";
+
+ SCOPED_TRACE("image only");
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest + NoCheck(), /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange);
+ EXPECT_EQ(disasm, kTest);
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, PtrSampledImageOnly_DeletesPtrType) {
+ const std::string kTest = Preamble() + BasicTypes() + R"(
+ ; CHECK: OpCapability Shader
+ ; CHECK-NOT: OpTypePointer UniformConstant
+ ; CHECK: OpFunction %void
+ %100 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %101 = OpTypeSampledImage %100
+ %102 = OpTypePointer UniformConstant %101
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest + NoCheck(), /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << "status";
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ PtrArraySampledImageOnly_DeletesPtrType) {
+ const std::string kTest = Preamble() + BasicTypes() + R"(
+ ; CHECK: OpCapability Shader
+ ; CHECK-NOT: OpTypePointer UniformConstant
+ ; CHECK: OpFunction %void
+ %100 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %101 = OpTypeSampledImage %100
+ %103 = OpTypeArray %101 %uint_1
+ %104 = OpTypePointer UniformConstant %103
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest + NoCheck(), /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << "status";
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ PtrRtArraySampledImageOnly_DeletesPtrType) {
+ const std::string kTest = Preamble() + BasicTypes() + R"(
+ ; CHECK: OpCapability Shader
+ ; CHECK-NOT: OpTypePointer UniformConstant
+ ; CHECK: OpFunction %void
+ %100 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %101 = OpTypeSampledImage %100
+ %103 = OpTypeRuntimeArray %101
+ %104 = OpTypePointer UniformConstant %103
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest + NoCheck(), /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << "status";
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ Combined_NoSampler_CreatedBeforeSampledImage) {
+ // No OpTypeSampler to begin with.
+ const std::string kTest = Preamble() +
+ R"( OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+
+ ; A sampler type is created and placed at the start of types.
+ ; CHECK: OpDecorate %{{\d+}} Binding 0
+ ; CHECK: OpDecorate %{{\d+}} Binding 0
+ ; CHECK-NOT: TypeSampledImage
+ ; CHECK: TypeSampler
+ ; CHECK: TypeSampledImage
+
+)" + BasicTypes() + R"( %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+
+ %100 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %6 = OpLoad %11 %100
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, Combined_SynthesizeVarNames) {
+ // Also tests binding info is copied to both variables.
+ const std::string kTest = Preamble() +
+ R"(
+ OpName %orig_var "orig_var"
+ OpDecorate %orig_var DescriptorSet 0
+ OpDecorate %orig_var Binding 0
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK: OpCapability
+ ; The original name is deleted
+ ; CHECK-NOT: OpName %orig_var "
+ ; CHECK: OpName %orig_var_image "orig_var_image"
+ ; CHECK: OpName %orig_var_sampler "orig_var_sampler"
+ ; CHECK-NOT: OpName %orig_var "
+
+ ; CHECK: OpDecorate %orig_var_image DescriptorSet 0
+ ; CHECK: OpDecorate %orig_var_sampler DescriptorSet 0
+ ; CHECK: OpDecorate %orig_var_image Binding 0
+ ; CHECK: OpDecorate %orig_var_sampler Binding 0
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+
+ ; CHECK-NOT: %orig_var = OpVariable
+ ; CHECK-DAG: %orig_var_sampler = OpVariable %[[sampler_ptr_ty]] UniformConstant
+ ; CHECK-DAG: %orig_var_image = OpVariable %[[image_ptr_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+)" + BasicTypes() + R"(
+ %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+
+ %orig_var = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %101 = OpLoad %11 %orig_var
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassTypeCaseTest, Combined_RemapLoad) {
+ // Also tests binding info is copied to both variables.
+ const std::string kTest = Preamble() +
+ R"(
+ OpName %combined "combined"
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+
+ ; CHECK: OpName
+ ; CHECK-NOT: OpDecorate %100
+ ; CHECK: OpDecorate %[[image_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[image_var]] Binding 0
+ ; CHECK: OpDecorate %[[sampler_var]] Binding 0
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK-NOT: %100 = OpVariable
+ ; CHECK-DAG: %[[sampler_var]] = OpVariable %[[sampler_ptr_ty]] UniformConstant
+ ; CHECK-DAG: %[[image_var]] = OpVariable %[[image_ptr_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+ ; The load of the combined image+sampler is replaced by a two loads, then
+ ; a combination operation.
+ ; CHECK: %[[im:\d+]] = OpLoad %10 %[[image_var]]
+ ; CHECK: %[[s:\d+]] = OpLoad %[[sampler_ty]] %[[sampler_var]]
+ ; CHECK: %combined = OpSampledImage %11 %[[im]] %[[s]]
+
+)" + BasicTypes() +
+ " %10 = " + GetParam().image_type_decl + R"(
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+
+ %100 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %combined = OpLoad %11 %100
+
+ ; Uses of the combined image sampler are preserved.
+ ; CHECK: OpCopyObject %11 %combined
+
+ %7 = OpCopyObject %11 %combined
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassTypeCaseTest,
+ Combined_RemapLoad_RelaxedPrecisionOnVarCopied) {
+ // All decorations on the variable are copied. In this case, RelaxedPrecision
+ const std::string kTest = Preamble() +
+ R"(
+ OpName %combined "combined"
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %100 RelaxedPrecision
+
+ ; CHECK: OpName
+ ; CHECK-NOT: OpDecorate %100
+ ; CHECK: OpDecorate %[[image_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[image_var]] Binding 0
+ ; CHECK: OpDecorate %[[sampler_var]] Binding 0
+ ; CHECK: OpDecorate %[[image_var:\d+]] RelaxedPrecision
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] RelaxedPrecision
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK-NOT: %100 = OpVariable
+ ; CHECK-NOT: OpVariable _ptr_UniformConstant_11
+ ; CHECK-DAG: %[[sampler_var]] = OpVariable %[[sampler_ptr_ty]] UniformConstant
+ ; CHECK-DAG: %[[image_var]] = OpVariable %[[image_ptr_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+ ; The load of the combined image+sampler is replaced by a two loads, then
+ ; a combination operation.
+ ; CHECK: %[[im:\d+]] = OpLoad %10 %[[image_var]]
+ ; CHECK: %[[s:\d+]] = OpLoad %[[sampler_ty]] %[[sampler_var]]
+ ; CHECK: %combined = OpSampledImage %11 %[[im]] %[[s]]
+
+ %bool = OpTypeBool ; location marker
+)" + BasicTypes() +
+ " %10 = " + GetParam().image_type_decl + R"(
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+
+ %100 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %combined = OpLoad %11 %100
+
+ ; Uses of the combined image sampler are preserved.
+ ; CHECK: OpCopyObject %11 %combined
+
+ %7 = OpCopyObject %11 %combined
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassTypeCaseTest,
+ Combined_RemapLoad_RelaxedPrecisionOnLoadCopied) {
+ // Copy decorations form an OpLoad that is replaced.
+ const std::string kTest = Preamble() +
+ R"(
+ OpName %combined "combined"
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+ OpDecorate %combined RelaxedPrecision
+
+ ; CHECK: OpName
+ ; CHECK-NOT: OpDecorate %100
+ ; CHECK: OpDecorate %[[image_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[image_var]] Binding 0
+ ; CHECK: OpDecorate %[[sampler_var]] Binding 0
+
+ ; This is what we are checking in this test.
+ ; CHECK: OpDecorate %[[im:\d+]] RelaxedPrecision
+ ; CHECK: OpDecorate %[[s:\d+]] RelaxedPrecision
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK-NOT: %100 = OpVariable
+ ; CHECK-NOT: OpVariable _ptr_UniformConstant_11
+ ; CHECK-DAG: %[[sampler_var]] = OpVariable %[[sampler_ptr_ty]] UniformConstant
+ ; CHECK-DAG: %[[image_var]] = OpVariable %[[image_ptr_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+ ; The load of the combined image+sampler is replaced by a two loads, then
+ ; a combination operation. The new loads get the same decorations that the
+ ; original load had.
+ ; CHECK: %[[im]] = OpLoad %10 %[[image_var]]
+ ; CHECK: %[[s]] = OpLoad %[[sampler_ty]] %[[sampler_var]]
+ ; CHECK: %combined = OpSampledImage %11 %[[im]] %[[s]]
+
+ %bool = OpTypeBool ; location marker
+)" + BasicTypes() +
+ " %10 = " + GetParam().image_type_decl + R"(
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+
+ %100 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %combined = OpLoad %11 %100
+
+ ; Uses of the combined image sampler are preserved.
+ ; CHECK: OpCopyObject %11 %combined
+
+ %7 = OpCopyObject %11 %combined
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassTypeCaseTest,
+ Combined_DeletesCopyObjectOfPtr) {
+ // OpCopyObject is deleted, and its uses updated.
+ const std::string kTest = Preamble() +
+ R"(
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+
+ ; CHECK: OpName
+ ; CHECK-NOT: OpDecorate %100
+ ; CHECK: OpDecorate %[[image_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[image_var]] Binding 0
+ ; CHECK: OpDecorate %[[sampler_var]] Binding 0
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK-NOT: %100 = OpVariable
+ ; CHECK-DAG: %[[sampler_var]] = OpVariable %[[sampler_ptr_ty]] UniformConstant
+ ; CHECK-DAG: %[[image_var]] = OpVariable %[[image_ptr_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+
+)" + BasicTypes() +
+ " %10 = " + GetParam().image_type_decl + R"(
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+
+ %100 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %101 = OpCopyObject %_ptr_UniformConstant_11 %100
+ %102 = OpLoad %11 %101
+ %103 = OpCopyObject %_ptr_UniformConstant_11 %101
+ %104 = OpCopyObject %11 %102 ;; this copy survives
+ OpReturn
+ OpFunctionEnd
+
+ ; The OpCopyObject instructions are removed.
+ ; The load of the combined image+sampler is replaced by a two loads, then
+ ; a combination operation. The only OpCopyObject that remains is the copy
+ ; of the copy of the sampled image value.
+ ; CHECK: %[[im:\d+]] = OpLoad %10 %[[image_var]]
+ ; CHECK: %[[s:\d+]] = OpLoad %[[sampler_ty]] %[[sampler_var]]
+ ; CHECK: %[[si:\d+]] = OpSampledImage %11 %[[im]] %[[s]]
+ ; CHECK-NEXT: OpCopyObject %11 %[[si]]
+ ; CHECK-NEXT: OpReturn
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassTypeCaseTest, ArrayCombined_RemapLoad) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpName %combined "combined"
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+
+ ; CHECK: OpName
+ ; CHECK-NOT: OpDecorate %100
+ ; CHECK: OpDecorate %[[image_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[image_var]] Binding 0
+ ; CHECK: OpDecorate %[[sampler_var]] Binding 0
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK: %[[array_image_ty:\w+]] = OpTypeArray %10 %uint_3
+ ; CHECK: %[[ptr_array_image_ty:\w+]] = OpTypePointer UniformConstant %[[array_image_ty]]
+
+ ; CHECK: %[[array_sampler_ty:\w+]] = OpTypeArray %[[sampler_ty]] %uint_3
+ ; CHECK: %[[ptr_array_sampler_ty:\w+]] = OpTypePointer UniformConstant %[[array_sampler_ty]]
+
+ ; CHECK-NOT: %100 = OpVariable
+ ; CHECK-DAG: %[[sampler_var]] = OpVariable %[[ptr_array_sampler_ty]] UniformConstant
+ ; CHECK-DAG: %[[image_var]] = OpVariable %[[ptr_array_image_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+ ; The access chain and load is replaced by two access chains, two loads, then
+ ; a combine operation.
+ ; CHECK: %[[ptr_im:\d+]] = OpAccessChain %[[image_ptr_ty]] %[[image_var]] %uint_1
+ ; CHECK: %[[ptr_s:\d+]] = OpAccessChain %[[sampler_ptr_ty]] %[[sampler_var]] %uint_1
+ ; CHECK: %[[im:\d+]] = OpLoad %10 %[[ptr_im]]
+ ; CHECK: %[[s:\d+]] = OpLoad %[[sampler_ty]] %[[ptr_s]]
+ ; CHECK: %combined = OpSampledImage %11 %[[im]] %[[s]]
+
+)" + BasicTypes() +
+ " %10 = " + GetParam().image_type_decl + R"(
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %12 = OpTypeArray %11 %uint_3
+%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12
+
+ %100 = OpVariable %_ptr_UniformConstant_12 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %ptr = OpAccessChain %_ptr_UniformConstant_11 %100 %uint_1
+ %combined = OpLoad %11 %ptr
+
+ ; Uses of the combined image sampler are preserved.
+ ; CHECK: OpCopyObject %11 %combined
+
+ %7 = OpCopyObject %11 %combined
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassTypeCaseTest, RtArrayCombined_RemapLoad) {
+ const std::string kTest = Preamble() +
+ R"(
+ OpName %combined "combined"
+ OpDecorate %100 DescriptorSet 0
+ OpDecorate %100 Binding 0
+
+ ; CHECK: OpName
+ ; CHECK-NOT: OpDecorate %100
+ ; CHECK: OpDecorate %[[image_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[sampler_var:\d+]] DescriptorSet 0
+ ; CHECK: OpDecorate %[[image_var]] Binding 0
+ ; CHECK: OpDecorate %[[sampler_var]] Binding 0
+
+ ; CHECK: %10 = OpTypeImage %
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+
+ ; CHECK: %[[array_image_ty:\w+]] = OpTypeRuntimeArray %10
+ ; CHECK: %[[ptr_array_image_ty:\w+]] = OpTypePointer UniformConstant %[[array_image_ty]]
+
+ ; CHECK: %[[array_sampler_ty:\w+]] = OpTypeRuntimeArray %[[sampler_ty]]
+ ; CHECK: %[[ptr_array_sampler_ty:\w+]] = OpTypePointer UniformConstant %[[array_sampler_ty]]
+
+ ; CHECK-NOT: %100 = OpVariable
+ ; CHECK-DAG: %[[sampler_var]] = OpVariable %[[ptr_array_sampler_ty]] UniformConstant
+ ; CHECK-DAG: %[[image_var]] = OpVariable %[[ptr_array_image_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+ ; The access chain and load is replaced by two access chains, two loads, then
+ ; a combine operation.
+ ; CHECK: %[[ptr_im:\d+]] = OpAccessChain %[[image_ptr_ty]] %[[image_var]] %uint_1
+ ; CHECK: %[[ptr_s:\d+]] = OpAccessChain %[[sampler_ptr_ty]] %[[sampler_var]] %uint_1
+ ; CHECK: %[[im:\d+]] = OpLoad %10 %[[ptr_im]]
+ ; CHECK: %[[s:\d+]] = OpLoad %[[sampler_ty]] %[[ptr_s]]
+ ; CHECK: %combined = OpSampledImage %11 %[[im]] %[[s]]
+
+)" + BasicTypes() +
+ " %10 = " + GetParam().image_type_decl + R"(
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %12 = OpTypeRuntimeArray %11
+%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12
+
+ %100 = OpVariable %_ptr_UniformConstant_12 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ %ptr = OpAccessChain %_ptr_UniformConstant_11 %100 %uint_1
+ %combined = OpLoad %11 %ptr
+
+ ; Uses of the combined image sampler are preserved.
+ ; CHECK: OpCopyObject %11 %combined
+
+ %7 = OpCopyObject %11 %combined
+ OpReturn
+ OpFunctionEnd
+)";
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+INSTANTIATE_TEST_SUITE_P(AllCombinedTypes,
+ SplitCombinedImageSamplerPassTypeCaseTest,
+ ::testing::ValuesIn(ImageTypeCases()));
+
+// Remap entry point
+
+struct EntryPointRemapCase {
+ const spv_target_env environment = SPV_ENV_VULKAN_1_0;
+ const char* initial_interface = "";
+ const char* expected_interface = nullptr;
+};
+
+std::ostream& operator<<(std::ostream& os, const EntryPointRemapCase& eprc) {
+ os << "(env " << spvLogStringForEnv(eprc.environment) << ", init "
+ << eprc.initial_interface << " -> expect " << eprc.expected_interface
+ << ")";
+ return os;
+}
+
+struct SplitCombinedImageSamplerPassEntryPointRemapTest
+ : public PassTest<::testing::TestWithParam<EntryPointRemapCase>> {
+ virtual void SetUp() override {
+ SetTargetEnv(GetParam().environment);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+};
+
+std::vector<EntryPointRemapCase> EntryPointInterfaceCases() {
+ return std::vector<EntryPointRemapCase>{
+ {SPV_ENV_VULKAN_1_0, " %in_var %out_var", " %in_var %out_var"},
+ {SPV_ENV_VULKAN_1_4, " %combined_var",
+ " %combined_var_image %combined_var_sampler"},
+ {SPV_ENV_VULKAN_1_4, " %combined_var %in_var %out_var",
+ " %combined_var_image %in_var %out_var %combined_var_sampler"},
+ {SPV_ENV_VULKAN_1_4, " %in_var %combined_var %out_var",
+ " %in_var %combined_var_image %out_var %combined_var_sampler"},
+ {SPV_ENV_VULKAN_1_4, " %in_var %out_var %combined_var",
+ " %in_var %out_var %combined_var_image %combined_var_sampler"},
+ };
+}
+
+TEST_P(SplitCombinedImageSamplerPassEntryPointRemapTest,
+ EntryPoint_Combined_UsedInShader) {
+ const std::string kTest = PreambleFragment(GetParam().initial_interface) +
+ R"(
+ OpName %combined "combined"
+ OpName %combined_var "combined_var"
+ OpName %in_var "in_var"
+ OpName %out_var "out_var"
+ OpDecorate %combined_var DescriptorSet 0
+ OpDecorate %combined_var Binding 0
+ OpDecorate %in_var BuiltIn FragCoord
+ OpDecorate %out_var Location 0
+
+; CHECK: OpEntryPoint Fragment %main "main")" +
+ GetParam().expected_interface + R"(
+; These clauses ensure the expected interface is the whole interface.
+; CHECK-NOT: %{{\d+}}
+; CHECK-NOT: %in_var
+; CHECK-NOT: %out_var
+; CHECK-NOT: %combined_var
+; CHECK: OpExecutionMode %main OriginUpperLeft
+
+ ; Check the var names, tracing up through the types.
+ ; CHECK: %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ ; CHECK: %[[image_ptr_ty:\w+]] = OpTypePointer UniformConstant %10
+ ; CHECK: %[[sampler_ty:\d+]] = OpTypeSampler
+ ; CHECK: %[[sampler_ptr_ty:\w+]] = OpTypePointer UniformConstant %[[sampler_ty]]
+ ; The combined image variable is replaced by an image variable and a sampler variable.
+ ; CHECK-DAG: %combined_var_sampler = OpVariable %[[sampler_ptr_ty]] UniformConstant
+ ; CHECK-DAG: %combined_var_image = OpVariable %[[image_ptr_ty]] UniformConstant
+ ; CHECK: = OpFunction
+
+ %bool = OpTypeBool
+)" + BasicTypes() + R"( %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %11 = OpTypeSampledImage %10
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %in_ptr_v4f = OpTypePointer Input %v4float
+ %in_var = OpVariable %in_ptr_v4f Input
+ %out_ptr_v4f = OpTypePointer Output %v4float
+ %out_var = OpVariable %out_ptr_v4f Output
+
+%combined_var = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ ;CHECK: %main_0 = OpLabel
+ ;CHECK: OpLoad
+
+ %main_0 = OpLabel
+ %combined = OpLoad %11 %combined_var
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassEntryPointRemapTest,
+ EntryPoint_Combined_UsedOnlyInEntryPointInstruction) {
+ // If the combined var is in the interface, that is enough to trigger
+ // its replacement. Otherwise the entry point interface is untouched
+ // when the combined var is not otherwise used.
+ const bool combined_var_in_interface =
+ std::string(GetParam().initial_interface).find("%combined_var") !=
+ std::string::npos;
+ if (combined_var_in_interface) {
+ const std::string kTest = PreambleFragment(GetParam().initial_interface) +
+ R"(
+ OpName %combined_var "combined_var"
+ OpName %in_var "in_var"
+ OpName %out_var "out_var"
+ OpDecorate %combined_var DescriptorSet 0
+ OpDecorate %combined_var Binding 0
+ OpDecorate %in_var BuiltIn FragCoord
+ OpDecorate %out_var Location 0
+
+ ; CHECK: OpEntryPoint Fragment %main "main")" +
+ GetParam().expected_interface + R"(
+ ; These clauses ensure the expected interface is the whole interface.
+ ; CHECK-NOT: %{{\d+}}
+ ; CHECK-NOT: %in_var
+ ; CHECK-NOT: %out_var
+ ; CHECK-NOT: %combined_var
+ ; CHECK: OpExecutionMode %main OriginUpperLeft
+
+ %bool = OpTypeBool
+ )" + BasicTypes() + R"( %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %11 = OpTypeSampledImage %10
+ %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %in_ptr_v4f = OpTypePointer Input %v4float
+ %in_var = OpVariable %in_ptr_v4f Input
+ %out_ptr_v4f = OpTypePointer Output %v4float
+ %out_var = OpVariable %out_ptr_v4f Output
+
+ ; %combined_var is not used!
+ %combined_var = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto [disasm, status] =
+ SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+ }
+}
+
+TEST_P(SplitCombinedImageSamplerPassEntryPointRemapTest,
+ EntryPoint_Combined_Unused) {
+ // If the combined var is in the interface, that is enough to trigger
+ // its replacement. Otherwise the entry point interface is untouched
+ // when the combined var is not otherwise used.
+ const bool combined_var_in_interface =
+ std::string(GetParam().initial_interface).find("%combined_var") !=
+ std::string::npos;
+ if (!combined_var_in_interface) {
+ const std::string kTest = PreambleFragment(GetParam().initial_interface) +
+ R"(
+ ; CHECK: OpEntryPoint Fragment %main "main")" +
+ GetParam().initial_interface // Note this is the
+ // intial interface
+ + R"(
+ ; These clauses ensure the expected interface is the whole interface.
+ ; CHECK-NOT: %{{\d+}}
+ ; CHECK-NOT: %in_var
+ ; CHECK-NOT: %out_var
+ ; CHECK-NOT: %combined_var
+ ; CHECK: OpExecutionMode %main OriginUpperLeft
+
+ ; The variable disappears.
+ ; CHECK-NOT: %combined_var =
+ ; CHECK: OpFunctionEnd
+ OpName %combined_var "combined_var"
+ OpName %in_var "in_var"
+ OpName %out_var "out_var"
+ OpDecorate %combined_var DescriptorSet 0
+ OpDecorate %combined_var Binding 0
+ OpDecorate %in_var BuiltIn FragCoord
+ OpDecorate %out_var Location 0
+
+
+ %bool = OpTypeBool
+ )" + BasicTypes() + R"( %10 = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %11 = OpTypeSampledImage %10
+ %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %in_ptr_v4f = OpTypePointer Input %v4float
+ %in_var = OpVariable %in_ptr_v4f Input
+ %out_ptr_v4f = OpTypePointer Output %v4float
+ %out_var = OpVariable %out_ptr_v4f Output
+
+ ; %combined_var is not used!
+ %combined_var = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %main = OpFunction %void None %voidfn
+ %main_0 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ auto [disasm, status] =
+ SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(EntryPointRemap,
+ SplitCombinedImageSamplerPassEntryPointRemapTest,
+ ::testing::ValuesIn(EntryPointInterfaceCases()));
+
+// Remap function types
+
+struct FunctionTypeCase {
+ const char* initial_type_params = "";
+ const char* expected_type_params = "";
+};
+
+std::ostream& operator<<(std::ostream& os, const FunctionTypeCase& ftc) {
+ os << "(init " << ftc.initial_type_params << " -> expect "
+ << ftc.expected_type_params << ")";
+ return os;
+}
+
+struct SplitCombinedImageSamplerPassFunctionTypeTest
+ : public PassTest<::testing::TestWithParam<FunctionTypeCase>> {
+ virtual void SetUp() override {
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+};
+
+std::vector<FunctionTypeCase> FunctionTypeCases() {
+ return std::vector<FunctionTypeCase>{
+ {"", ""},
+ {" %image_ty", " %image_ty"},
+ {" %sampler_ty", " %sampler_ty"},
+ {" %sampled_image_ty", " %image_ty %sampler_ty"},
+ {" %uint %sampled_image_ty %float",
+ " %uint %image_ty %sampler_ty %float"},
+ {" %ptr_sampled_image_ty",
+ " %_ptr_UniformConstant_image_ty %_ptr_UniformConstant_sampler_ty"},
+ {" %uint %ptr_sampled_image_ty %float",
+ " %uint %_ptr_UniformConstant_image_ty %_ptr_UniformConstant_sampler_ty "
+ "%float"},
+ {" %uint %ptr_sampled_image_ty %ptr_sampled_image_ty %float",
+ " %uint %_ptr_UniformConstant_image_ty %_ptr_UniformConstant_sampler_ty "
+ "%_ptr_UniformConstant_image_ty %_ptr_UniformConstant_sampler_ty "
+ "%float"},
+ };
+}
+
+TEST_P(SplitCombinedImageSamplerPassFunctionTypeTest,
+ ReplaceCombinedImageSamplersOnly) {
+ const std::string kTest = Preamble() + +R"(
+ OpName %f_ty "f_ty"
+ OpName %sampler_ty "sampler_ty"
+ OpName %image_ty "image_ty"
+ OpName %sampled_image_ty "sampled_image_ty"
+ OpName %ptr_sampled_image_ty "sampled_image_ty"
+
+ )" + BasicTypes() + R"(
+
+ %sampler_ty = OpTypeSampler
+ %image_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %sampled_image_ty = OpTypeSampledImage %image_ty
+ %ptr_sampled_image_ty = OpTypePointer UniformConstant %sampled_image_ty
+
+ %f_ty = OpTypeFunction %float)" +
+ GetParam().initial_type_params + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %float)" +
+ GetParam().expected_type_params + R"(
+)" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_P(SplitCombinedImageSamplerPassFunctionTypeTest, AvoidDuplicateType) {
+ // SPIR-V does not allow duplicate non-aggregate types. That includes function
+ // types. Test that when replacing function type parameters would cause a
+ // collision, that the original function type is replaced with the new one.
+ const std::string initial_params(GetParam().initial_type_params);
+ const std::string expected_params(GetParam().expected_type_params);
+ const std::string kTest = Preamble() + +R"(
+ OpName %sampler_ty "sampler_ty"
+ OpName %image_ty "image_ty"
+ OpName %sampled_image_ty "sampled_image_ty"
+ OpName %_ptr_UniformConstant_sampler_ty "_ptr_UniformConstant_sampler_ty"
+ OpName %_ptr_UniformConstant_image_ty "_ptr_UniformConstant_image_ty"
+ OpName %ptr_sampled_image_ty "sampled_image_ty"
+ OpName %dest_ty "dest_ty"
+
+ )" + BasicTypes() + R"(
+
+ %sampler_ty = OpTypeSampler
+ %image_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %sampled_image_ty = OpTypeSampledImage %image_ty
+ %ptr_sampled_image_ty = OpTypePointer UniformConstant %sampled_image_ty
+ %_ptr_UniformConstant_image_ty = OpTypePointer UniformConstant %image_ty
+ %_ptr_UniformConstant_sampler_ty = OpTypePointer UniformConstant %sampler_ty
+
+ %100 = OpTypeFunction %float)" +
+ initial_params + R"(
+ %dest_ty = OpTypeFunction %float)" +
+ expected_params + R"(
+
+ ; CHECK: OpTypeSampler
+ ; CHECK-NOT: %100 =
+ ; CHECK: %dest_ty = OpTypeFunction %float)" +
+ expected_params + R"(
+ ; CHECK-NOT: %100 =
+ ; CHECK: %main = OpFunction
+)" + Main();
+ // The original source is invalid if initial and expected params are the same,
+ // because the type is already duplicated.
+ // Only test when they are different.
+ if (initial_params != expected_params) {
+ auto [disasm, status] =
+ SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(FunctionTypeRemap,
+ SplitCombinedImageSamplerPassFunctionTypeTest,
+ ::testing::ValuesIn(FunctionTypeCases()));
+
+// Test array and runtime-array cases for function type replacement.
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionType_ReplaceSampledImageArg) {
+ // The original module has a sampled image type, used only as a function
+ // parameter. We still want to replace it. But no other sampled-image types
+ // exist. This proves that the pass needs a sampled_image_used_as_param_
+ // state variable.
+ const std::string kTest = Preamble() + +R"(
+ OpName %f_ty "f_ty"
+ OpName %sampler_ty "sampler_ty"
+ OpName %image_ty "image_ty"
+ OpName %sampled_image_ty "sampled_image_ty"
+
+ )" + BasicTypes() + R"(
+
+ %sampler_ty = OpTypeSampler
+ %image_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %sampled_image_ty = OpTypeSampledImage %image_ty
+
+ %f_ty = OpTypeFunction %float %sampled_image_ty %float
+ ; CHECK: %f_ty = OpTypeFunction %float %image_ty %sampler_ty %float
+)" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionType_ReplaceArrayArg) {
+ const std::string kTest = Preamble() + +R"(
+ OpName %f_ty "f_ty"
+ OpName %sampler_ty "sampler_ty"
+ OpName %image_ty "image_ty"
+ OpName %sampled_image_ty "sampled_image_ty"
+ OpName %ptr_array_si_ty "ptr_array_si_ty"
+
+ )" + BasicTypes() + R"(
+
+ %sampler_ty = OpTypeSampler
+ %image_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %sampled_image_ty = OpTypeSampledImage %image_ty
+ %array_si_ty = OpTypeArray %sampled_image_ty %uint_3
+ %ptr_array_si_ty = OpTypePointer UniformConstant %array_si_ty
+
+ ; CHECK: %[[array_i_ty:\w+]] = OpTypeArray %image_ty %uint_3
+ ; CHECK: %[[ptr_array_i_ty:\w+]] = OpTypePointer UniformConstant %[[array_i_ty]]
+ ; CHECK: %[[array_s_ty:\w+]] = OpTypeArray %sampler_ty %uint_3
+ ; CHECK: %[[ptr_array_s_ty:\w+]] = OpTypePointer UniformConstant %[[array_s_ty]]
+
+ %f_ty = OpTypeFunction %float %uint %ptr_array_si_ty %float
+ ; CHECK: %f_ty = OpTypeFunction %float %uint %[[ptr_array_i_ty]] %[[ptr_array_s_ty]] %float
+)" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionType_ReplaceRtArrayArg) {
+ const std::string kTest = Preamble() + +R"(
+ OpName %f_ty "f_ty"
+ OpName %sampler_ty "sampler_ty"
+ OpName %image_ty "image_ty"
+ OpName %sampled_image_ty "sampled_image_ty"
+ OpName %ptr_array_si_ty "ptr_array_si_ty"
+
+ )" + BasicTypes() + R"(
+
+ %sampler_ty = OpTypeSampler
+ %image_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %sampled_image_ty = OpTypeSampledImage %image_ty
+ %array_si_ty = OpTypeRuntimeArray %sampled_image_ty
+ %ptr_array_si_ty = OpTypePointer UniformConstant %array_si_ty
+
+ ; CHECK: %[[array_i_ty:\w+]] = OpTypeRuntimeArray %image_ty
+ ; CHECK: %[[ptr_array_i_ty:\w+]] = OpTypePointer UniformConstant %[[array_i_ty]]
+ ; CHECK: %[[array_s_ty:\w+]] = OpTypeRuntimeArray %sampler_ty
+ ; CHECK: %[[ptr_array_s_ty:\w+]] = OpTypePointer UniformConstant %[[array_s_ty]]
+
+ %f_ty = OpTypeFunction %float %uint %ptr_array_si_ty %float
+ ; CHECK: %f_ty = OpTypeFunction %float %uint %[[ptr_array_i_ty]] %[[ptr_array_s_ty]] %float
+)" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+// Remap function bodies
+
+std::string NamedITypes() {
+ return R"(
+ OpName %f "f"
+ OpName %f_ty "f_ty"
+ OpName %i_ty "i_ty"
+ OpName %s_ty "s_ty"
+ OpName %p_i_ty "p_i_ty"
+ OpName %p_s_ty "p_s_ty"
+)";
+}
+
+std::string NamedCombinedTypes() {
+ return R"(
+ OpName %si_ty "si_ty"
+ OpName %p_si_ty "p_si_ty"
+ OpName %array_si_ty "array_si_ty"
+ OpName %rtarray_si_ty "rtarray_si_ty"
+ OpName %p_array_si_ty "p_array_si_ty"
+ OpName %p_rtarray_si_ty "p_rtarray_si_ty"
+)";
+}
+
+std::string NamedCaller() {
+ return R"(
+ OpName %caller_ty "caller_ty"
+ OpName %caller "caller"
+ OpName %caller_entry "caller_entry"
+ OpName %caller_call "caller_call"
+ OpName %caller_arg "caller_arg"
+)";
+}
+
+std::string ITypes() {
+ return R"(
+ %i_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %s_ty = OpTypeSampler
+ %p_i_ty = OpTypePointer UniformConstant %i_ty
+ %p_s_ty = OpTypePointer UniformConstant %s_ty
+)";
+}
+
+std::string CombinedTypes() {
+ return R"(
+ %si_ty = OpTypeSampledImage %i_ty
+ %p_si_ty = OpTypePointer UniformConstant %si_ty
+ %array_si_ty = OpTypeArray %si_ty %uint_3
+ %p_array_si_ty = OpTypePointer UniformConstant %array_si_ty
+ %rtarray_si_ty = OpTypeRuntimeArray %si_ty
+ %p_rtarray_si_ty = OpTypePointer UniformConstant %rtarray_si_ty
+)";
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionBody_ScalarNoChange) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ BasicTypes() + ITypes() + CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %float %i_ty %s_ty %p_i_ty %p_s_ty
+ %f_ty = OpTypeFunction %float %i_ty %s_ty %p_i_ty %p_s_ty
+
+ ; CHECK: %f = OpFunction %float None %f_ty
+ ; CHECK-NEXT: OpFunctionParameter %i_ty
+ ; CHECK-NEXT: OpFunctionParameter %s_ty
+ ; CHECK-NEXT: OpFunctionParameter %p_i_ty
+ ; CHECK-NEXT: OpFunctionParameter %p_s_ty
+ ; CHECK-NEXT: OpLabel
+ %f = OpFunction %float None %f_ty
+ %100 = OpFunctionParameter %i_ty
+ %101 = OpFunctionParameter %s_ty
+ %102 = OpFunctionParameter %p_i_ty
+ %103 = OpFunctionParameter %p_s_ty
+ %110 = OpLabel
+ OpReturnValue %float_0
+ OpFunctionEnd
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionBody_SampledImage_OpImageSample) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ BasicTypes() + ITypes() + CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %v4float %uint %i_ty %s_ty %float
+ %f_ty = OpTypeFunction %v4float %uint %si_ty %float
+
+ ; CHECK: %f = OpFunction %v4float None %f_ty
+ ; CHECK: OpFunctionParameter %uint
+ ; CHECK-NEXT: %[[i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: OpFunctionParameter %float
+ ; CHECK-NEXT: OpLabel
+ ; CHECK-NEXT: %[[si:\w+]] = OpSampledImage %si_ty %[[i]] %[[s]]
+ ; CHECK-NEXT: %200 = OpImageSampleExplicitLod %v4float %[[si]] %13 Lod %float_0
+ ; CHECK-NEXT: OpReturnValue %200
+
+ %f = OpFunction %v4float None %f_ty
+ %100 = OpFunctionParameter %uint
+ %101 = OpFunctionParameter %si_ty ; replace this
+ %110 = OpFunctionParameter %float
+ %120 = OpLabel
+ %200 = OpImageSampleExplicitLod %v4float %101 %13 Lod %float_0
+ OpReturnValue %200
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionBody_SampledImage_OpImage) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ BasicTypes() + ITypes() + CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %uint %i_ty %s_ty %float
+ %f_ty = OpTypeFunction %void %uint %si_ty %float
+
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK: OpFunctionParameter %uint
+ ; CHECK-NEXT: %[[i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: OpFunctionParameter %float
+ ; CHECK-NEXT: OpLabel
+ ; CHECK-NEXT: %[[si:\w+]] = OpSampledImage %si_ty %[[i]] %[[s]]
+ ; CHECK-NEXT: %200 = OpImage %i_ty %[[si]]
+ ; CHECK-NEXT: OpReturn
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %uint
+ %101 = OpFunctionParameter %si_ty ; replace this
+ %110 = OpFunctionParameter %float
+ %120 = OpLabel
+ %200 = OpImage %i_ty %101
+ OpReturn
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionBody_PtrSampledImage) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ BasicTypes() + ITypes() + CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %v4float %uint %p_i_ty %p_s_ty %float
+ %f_ty = OpTypeFunction %v4float %uint %p_si_ty %float
+
+ ; CHECK: %f = OpFunction %v4float None %f_ty
+ ; CHECK-NEXT: OpFunctionParameter %uint
+ ; CHECK-NEXT: %[[pi:\w+]] = OpFunctionParameter %p_i_ty
+ ; CHECK-NEXT: %[[ps:\w+]] = OpFunctionParameter %p_s_ty
+ ; CHECK-NEXT: OpFunctionParameter %float
+ ; CHECK-NEXT: OpLabel
+ ; CHECK-NEXT: %[[i:\w+]] = OpLoad %i_ty %[[pi]]
+ ; CHECK-NEXT: %[[s:\w+]] = OpLoad %s_ty %[[ps]]
+ ; CHECK-NEXT: %[[si:\w+]] = OpSampledImage %si_ty %[[i]] %[[s]]
+ ; CHECK-NEXT: %200 = OpImageSampleExplicitLod %v4float %[[si]] %13 Lod %float_0
+ ; CHECK-NEXT: OpReturnValue %200
+
+ %f = OpFunction %v4float None %f_ty
+ %100 = OpFunctionParameter %uint
+ %101 = OpFunctionParameter %p_si_ty ; replace this
+ %110 = OpFunctionParameter %float
+ %120 = OpLabel
+ %121 = OpLoad %si_ty %101
+ %200 = OpImageSampleExplicitLod %v4float %121 %13 Lod %float_0
+ OpReturnValue %200
+ OpFunctionEnd
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_NoImageOrSampler_NoChange) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCaller() +
+ BasicTypes() + ITypes() + CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %uint %float
+ %f_ty = OpTypeFunction %void %uint %float
+ %caller_ty = OpTypeFunction %float ; make it return non-void otherwise it's just like main
+
+ ; The called function does not change
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: = OpFunctionParameter %uint
+ ; CHECK-NEXT: = OpFunctionParameter %float
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %uint
+ %101 = OpFunctionParameter %float
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; The caller does not change
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_arg = OpCopyObject %uint %uint_0
+ ; CHECK-NEXT: OpFunctionCall %void %f %caller_arg %float_0
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+%caller_entry = OpLabel
+ %caller_arg = OpCopyObject %uint %uint_0
+ %caller_call = OpFunctionCall %void %f %caller_arg %float_0
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ // We still get a success-with-change result because the boilerplate included
+ // combined types, which were removed.
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionCall_Image_NoChange) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCaller() +
+ BasicTypes() + ITypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %i_ty
+ %f_ty = OpTypeFunction %void %i_ty
+ %caller_ty = OpTypeFunction %float %i_ty
+
+ ; The called function does not change
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %i_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; The caller does not change
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %caller_arg = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: OpFunctionCall %void %f %caller_arg
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %i_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionCall_Sampler_NoChange) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCaller() +
+ BasicTypes() + ITypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %s_ty
+ %f_ty = OpTypeFunction %void %s_ty
+ %caller_ty = OpTypeFunction %float %s_ty
+
+ ; The called function does not change
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %s_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; The caller does not change
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %caller_arg = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: OpFunctionCall %void %f %caller_arg
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %s_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionCall_PtrImage_NoChange) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCaller() +
+ BasicTypes() + ITypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %p_i_ty
+ %f_ty = OpTypeFunction %void %p_i_ty
+ %caller_ty = OpTypeFunction %float %p_i_ty
+
+ ; The called function does not change
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: = OpFunctionParameter %p_i_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %p_i_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; The caller does not change
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %caller_arg = OpFunctionParameter %p_i_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: OpFunctionCall %void %f %caller_arg
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %p_i_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionCall_PtrSampler_NoChange) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCaller() +
+ BasicTypes() + ITypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %p_s_ty
+ %f_ty = OpTypeFunction %void %p_s_ty
+ %caller_ty = OpTypeFunction %float %p_s_ty
+
+ ; The called function does not change
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: = OpFunctionParameter %p_s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %p_s_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; The caller does not change
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %caller_arg = OpFunctionParameter %p_s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: OpFunctionCall %void %f %caller_arg
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %p_s_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithoutChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionCall_SampledImage_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %i_ty %s_ty
+ %f_ty = OpTypeFunction %void %si_ty
+ %caller_ty = OpTypeFunction %float %si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i]] %[[caller_s]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %si_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_SampledImageDuplicatedArg_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %i_ty %s_ty %i_ty %s_ty
+ %f_ty = OpTypeFunction %void %si_ty %si_ty
+ %caller_ty = OpTypeFunction %float %si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i_0:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s_0:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %[[callee_i_1:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s_1:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %si_ty
+ %101 = OpFunctionParameter %si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i]] %[[caller_s]] %[[caller_i]] %[[caller_s]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %si_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_SampledImageTwoDistinct_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %i_ty %s_ty %i_ty %s_ty
+ %f_ty = OpTypeFunction %void %si_ty %si_ty
+ %caller_ty = OpTypeFunction %float %si_ty %si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i_0:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s_0:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %[[callee_i_1:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s_1:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %si_ty
+ %101 = OpFunctionParameter %si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i_0:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[caller_s_0:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %[[caller_i_1:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[caller_s_1:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i_0]] %[[caller_s_0]] %[[caller_i_1]] %[[caller_s_1]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %si_ty
+ %201 = OpFunctionParameter %si_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg %201
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_SampledImageAndCopy_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %i_ty %s_ty %i_ty %s_ty
+ %f_ty = OpTypeFunction %void %si_ty %si_ty
+ ; CHECK: %caller_ty = OpTypeFunction %float %i_ty %s_ty
+ %caller_ty = OpTypeFunction %float %si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i_0:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s_0:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %[[callee_i_1:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s_1:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %si_ty
+ %101 = OpFunctionParameter %si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i]] %[[caller_s]] %[[caller_i]] %[[caller_s]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %si_ty
+%caller_entry = OpLabel
+ %copy = OpCopyObject %si_ty %caller_arg
+ %caller_call = OpFunctionCall %void %f %caller_arg %copy
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_SampledImageSurrounded_Split) {
+ // Test indexing by surrounding the sampled image parameter with other
+ // arguments that should not be touched.
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %float %i_ty %s_ty %uint
+ %f_ty = OpTypeFunction %void %float %si_ty %uint
+ ; CHECK: %caller_ty = OpTypeFunction %float %uint %i_ty %s_ty %float
+ %caller_ty = OpTypeFunction %float %uint %si_ty %float
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_f:\w+]] = OpFunctionParameter %float
+ ; CHECK-NEXT: %[[callee_i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[callee_s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %[[callee_u:\w+]] = OpFunctionParameter %uint
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %99 = OpFunctionParameter %float
+ %100 = OpFunctionParameter %si_ty
+ %101 = OpFunctionParameter %uint
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[u_param:\w+]] = OpFunctionParameter %uint
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %i_ty
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %s_ty
+ ; CHECK-NEXT: %[[f_param:\w+]] = OpFunctionParameter %float
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[f_param]] %[[caller_i]] %[[caller_s]] %[[u_param]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %200 = OpFunctionParameter %uint
+ %caller_arg = OpFunctionParameter %si_ty
+ %201 = OpFunctionParameter %float
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %201 %caller_arg %200
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest, FunctionCall_PtrSampledImage_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %f_ty = OpTypeFunction %void %p_i_ty %p_s_ty
+ %f_ty = OpTypeFunction %void %p_si_ty
+ %caller_ty = OpTypeFunction %float %p_si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i:\w+]] = OpFunctionParameter %p_i_ty
+ ; CHECK-NEXT: %[[callee_s:\w+]] = OpFunctionParameter %p_s_ty
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %p_si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %p_i_ty
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %p_s_ty
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i]] %[[caller_s]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %p_si_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_PtrArraySampledImage_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %[[array_i_ty:\w+]] = OpTypeArray %i_ty %uint_3
+ ; CHECK: %[[p_array_i_ty:\w+]] = OpTypePointer UniformConstant %[[array_i_ty]]
+ ; CHECK: %[[array_s_ty:\w+]] = OpTypeArray %s_ty %uint_3
+ ; CHECK: %[[p_array_s_ty:\w+]] = OpTypePointer UniformConstant %[[array_s_ty]]
+
+ ; CHECK: %f_ty = OpTypeFunction %void %[[p_array_i_ty]] %[[p_array_s_ty]]
+ %f_ty = OpTypeFunction %void %p_array_si_ty
+ %caller_ty = OpTypeFunction %float %p_array_si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i:\w+]] = OpFunctionParameter %[[p_array_i_ty]]
+ ; CHECK-NEXT: %[[callee_s:\w+]] = OpFunctionParameter %[[p_array_s_ty]]
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %p_array_si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %[[p_array_i_ty]]
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %[[p_array_s_ty]]
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i]] %[[caller_s]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %p_array_si_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+TEST_F(SplitCombinedImageSamplerPassTest,
+ FunctionCall_PtrRtArraySampledImage_Split) {
+ const std::string kTest = Preamble() + NamedITypes() + NamedCombinedTypes() +
+ NamedCaller() + BasicTypes() + ITypes() +
+ CombinedTypes() + R"(
+
+ ; CHECK: %[[array_i_ty:\w+]] = OpTypeRuntimeArray %i_ty
+ ; CHECK: %[[p_array_i_ty:\w+]] = OpTypePointer UniformConstant %[[array_i_ty]]
+ ; CHECK: %[[array_s_ty:\w+]] = OpTypeRuntimeArray
+ ; CHECK: %[[p_array_s_ty:\w+]] = OpTypePointer UniformConstant %[[array_s_ty]]
+
+ ; CHECK: %f_ty = OpTypeFunction %void %[[p_array_i_ty]] %[[p_array_s_ty]]
+ %f_ty = OpTypeFunction %void %p_rtarray_si_ty
+ %caller_ty = OpTypeFunction %float %p_rtarray_si_ty
+
+ ; Call function arg is split. We've checked these details in other tests.
+ ; CHECK: %f = OpFunction %void None %f_ty
+ ; CHECK-NEXT: %[[callee_i:\w+]] = OpFunctionParameter %[[p_array_i_ty]]
+ ; CHECK-NEXT: %[[callee_s:\w+]] = OpFunctionParameter %[[p_array_s_ty]]
+ ; CHECK-NEXT: = OpLabel
+ ; CHECK-NEXT: OpReturn
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %f = OpFunction %void None %f_ty
+ %100 = OpFunctionParameter %p_rtarray_si_ty
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+
+ ; CHECK: %caller = OpFunction %float None %caller_ty
+ ; CHECK-NEXT: %[[caller_i:\w+]] = OpFunctionParameter %[[p_array_i_ty]]
+ ; CHECK-NEXT: %[[caller_s:\w+]] = OpFunctionParameter %[[p_array_s_ty]]
+ ; CHECK-NEXT: %caller_entry = OpLabel
+ ; CHECK-NEXT: %caller_call = OpFunctionCall %void %f %[[caller_i]] %[[caller_s]]
+ ; CHECK-NEXT: OpReturnValue %float_0
+ ; CHECK-NEXT: OpFunctionEnd
+
+ %caller = OpFunction %float None %caller_ty
+ %caller_arg = OpFunctionParameter %p_rtarray_si_ty
+%caller_entry = OpLabel
+ %caller_call = OpFunctionCall %void %f %caller_arg
+ OpReturnValue %float_0
+ OpFunctionEnd
+
+ )" + Main();
+
+ auto [disasm, status] = SinglePassRunAndMatch<SplitCombinedImageSamplerPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(status, Pass::Status::SuccessWithChange) << disasm;
+}
+
+} // namespace
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/spread_volatile_semantics_test.cpp b/third_party/SPIRV-Tools/test/opt/spread_volatile_semantics_test.cpp
index 4328c39..664c986 100644
--- a/third_party/SPIRV-Tools/test/opt/spread_volatile_semantics_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/spread_volatile_semantics_test.cpp
@@ -306,7 +306,7 @@
OpDecorate %images Binding 1
OpDecorate %images NonWritable
-; CHECK: OpEntryPoint RayGenerationNV {{%\w+}} "RayGeneration" [[var:%\w+]]
+; CHECK: OpEntryPoint RayGenerationKHR {{%\w+}} "RayGeneration" [[var:%\w+]]
; CHECK: OpDecorate [[var]] BuiltIn SubgroupSize
; CHECK: OpDecorate [[var]] Volatile
; CHECK-NOT: OpDecorate {{%\w+}} Volatile
@@ -397,8 +397,8 @@
OpDecorate %images Binding 1
OpDecorate %images NonWritable
-; CHECK: OpEntryPoint RayGenerationNV {{%\w+}} "RayGeneration" [[var:%\w+]]
-; CHECK: OpEntryPoint ClosestHitNV {{%\w+}} "ClosestHit" [[var]]
+; CHECK: OpEntryPoint RayGenerationKHR {{%\w+}} "RayGeneration" [[var:%\w+]]
+; CHECK: OpEntryPoint ClosestHitKHR {{%\w+}} "ClosestHit" [[var]]
; CHECK: OpDecorate [[var]] BuiltIn SubgroupSize
; CHECK: OpDecorate [[var]] Volatile
; CHECK-NOT: OpDecorate {{%\w+}} Volatile
diff --git a/third_party/SPIRV-Tools/test/opt/struct_packing_test.cpp b/third_party/SPIRV-Tools/test/opt/struct_packing_test.cpp
new file mode 100644
index 0000000..1b8e8d1
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/opt/struct_packing_test.cpp
@@ -0,0 +1,242 @@
+// Copyright (c) 2024 Epic Games, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <string>
+
+#include "gmock/gmock.h"
+#include "source/opt/struct_packing_pass.h"
+#include "test/opt/pass_fixture.h"
+#include "test/opt/pass_utils.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+using StructPackingTest = PassTest<::testing::Test>;
+
+TEST_F(StructPackingTest, PackSimpleStructStd140) {
+ // #version 420
+ //
+ // layout(std140, binding = 0) uniform Globals {
+ // layout(offset = 16) vec3 a_xyz;
+ // float a_w;
+ // layout(offset = 128) vec3 b_xyz;
+ // int b_w;
+ // };
+ //
+ // void main() {}
+ const std::string spirv = R"(
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginLowerLeft
+OpSource GLSL 420
+OpName %main "main"
+OpName %Globals "Globals"
+OpMemberName %Globals 0 "a_xyz"
+OpMemberName %Globals 1 "a_w"
+OpMemberName %Globals 2 "b_xyz"
+OpMemberName %Globals 3 "b_w"
+OpName %_ ""
+; CHECK: OpMemberDecorate %Globals 0 Offset 0
+OpMemberDecorate %Globals 0 Offset 16
+; CHECK: OpMemberDecorate %Globals 1 Offset 12
+OpMemberDecorate %Globals 1 Offset 28
+; CHECK: OpMemberDecorate %Globals 2 Offset 16
+OpMemberDecorate %Globals 2 Offset 128
+; CHECK: OpMemberDecorate %Globals 3 Offset 28
+OpMemberDecorate %Globals 3 Offset 140
+OpDecorate %Globals Block
+OpDecorate %_ DescriptorSet 0
+OpDecorate %_ Binding 0
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%v3float = OpTypeVector %float 3
+%int = OpTypeInt 32 1
+%Globals = OpTypeStruct %v3float %float %v3float %int
+%_ptr_Uniform_Globals = OpTypePointer Uniform %Globals
+%_ = OpVariable %_ptr_Uniform_Globals Uniform
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<StructPackingPass>(
+ spirv, true, "Globals", StructPackingPass::PackingRules::Std140);
+}
+
+TEST_F(StructPackingTest, PackSimpleStructWithPaddingStd140) {
+ // #version 420
+ //
+ // layout(std140, binding = 0) uniform Globals {
+ // layout(offset = 16) vec3 a_xyz;
+ // float a_w;
+ // float b_x_padding_yzw;
+ // layout(offset = 128) vec3 c_xyz;
+ // int c_w;
+ // };
+ //
+ // void main() {}
+ const std::string spirv = R"(
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginLowerLeft
+OpSource GLSL 420
+OpName %main "main"
+OpName %Globals "Globals"
+OpMemberName %Globals 0 "a_xyz"
+OpMemberName %Globals 1 "a_w"
+OpMemberName %Globals 2 "b_x_padding_yzw"
+OpMemberName %Globals 3 "c_xyz"
+OpMemberName %Globals 4 "c_w"
+OpName %_ ""
+; CHECK: OpMemberDecorate %Globals 0 Offset 0
+OpMemberDecorate %Globals 0 Offset 16
+; CHECK: OpMemberDecorate %Globals 1 Offset 12
+OpMemberDecorate %Globals 1 Offset 28
+; CHECK: OpMemberDecorate %Globals 2 Offset 16
+OpMemberDecorate %Globals 2 Offset 32
+; CHECK: OpMemberDecorate %Globals 3 Offset 32
+OpMemberDecorate %Globals 3 Offset 128
+; CHECK: OpMemberDecorate %Globals 4 Offset 44
+OpMemberDecorate %Globals 4 Offset 140
+OpDecorate %Globals Block
+OpDecorate %_ DescriptorSet 0
+OpDecorate %_ Binding 0
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%v3float = OpTypeVector %float 3
+%int = OpTypeInt 32 1
+%Globals = OpTypeStruct %v3float %float %float %v3float %int
+%_ptr_Uniform_Globals = OpTypePointer Uniform %Globals
+%_ = OpVariable %_ptr_Uniform_Globals Uniform
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<StructPackingPass>(
+ spirv, true, "Globals", StructPackingPass::PackingRules::Std140);
+}
+
+TEST_F(StructPackingTest, PackSimpleScalarArrayStd140) {
+ // #version 420
+ //
+ // layout(std140, binding = 0) uniform Globals {
+ // layout(offset = 16) float a[2];
+ // layout(offset = 128) float b[2]; // Must become offset 32 with std140
+ // };
+ //
+ // void main() {}
+ const std::string spirv = R"(
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginLowerLeft
+OpSource GLSL 420
+OpName %main "main"
+OpName %Globals "Globals"
+OpMemberName %Globals 0 "a"
+OpMemberName %Globals 1 "b"
+OpName %_ ""
+OpDecorate %_arr_float_uint_2 ArrayStride 16
+OpDecorate %_arr_float_uint_2_0 ArrayStride 16
+; CHECK: OpMemberDecorate %Globals 0 Offset 0
+OpMemberDecorate %Globals 0 Offset 16
+; CHECK: OpMemberDecorate %Globals 1 Offset 32
+OpMemberDecorate %Globals 1 Offset 128
+OpDecorate %Globals Block
+OpDecorate %_ DescriptorSet 0
+OpDecorate %_ Binding 0
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_2 = OpConstant %uint 2
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_arr_float_uint_2_0 = OpTypeArray %float %uint_2
+%Globals = OpTypeStruct %_arr_float_uint_2 %_arr_float_uint_2_0
+%_ptr_Uniform_Globals = OpTypePointer Uniform %Globals
+%_ = OpVariable %_ptr_Uniform_Globals Uniform
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<StructPackingPass>(
+ spirv, true, "Globals", StructPackingPass::PackingRules::Std140);
+}
+
+TEST_F(StructPackingTest, PackSimpleScalarArrayStd430) {
+ // #version 430
+ //
+ // layout(std430, binding = 0) buffer Globals {
+ // layout(offset = 16) float a[2];
+ // layout(offset = 128) float b[2]; // Must become offset 8 with std430
+ // };
+ //
+ // void main() {}
+ const std::string spirv = R"(
+OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginLowerLeft
+OpSource GLSL 430
+OpName %main "main"
+OpName %Globals "Globals"
+OpMemberName %Globals 0 "a"
+OpMemberName %Globals 1 "b"
+OpName %_ ""
+OpDecorate %_arr_float_uint_2 ArrayStride 4
+OpDecorate %_arr_float_uint_2_0 ArrayStride 4
+; CHECK: OpMemberDecorate %Globals 0 Offset 0
+OpMemberDecorate %Globals 0 Offset 16
+; CHECK: OpMemberDecorate %Globals 1 Offset 8
+OpMemberDecorate %Globals 1 Offset 128
+OpDecorate %Globals BufferBlock
+OpDecorate %_ DescriptorSet 0
+OpDecorate %_ Binding 0
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_2 = OpConstant %uint 2
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_arr_float_uint_2_0 = OpTypeArray %float %uint_2
+%Globals = OpTypeStruct %_arr_float_uint_2 %_arr_float_uint_2_0
+%_ptr_Uniform_Globals = OpTypePointer Uniform %Globals
+%_ = OpVariable %_ptr_Uniform_Globals Uniform
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SinglePassRunAndMatch<StructPackingPass>(
+ spirv, true, "Globals", StructPackingPass::PackingRules::Std430);
+}
+
+} // namespace
+} // namespace opt
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/trim_capabilities_pass_test.cpp b/third_party/SPIRV-Tools/test/opt/trim_capabilities_pass_test.cpp
index d74ccdf..eb4bea5 100644
--- a/third_party/SPIRV-Tools/test/opt/trim_capabilities_pass_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/trim_capabilities_pass_test.cpp
@@ -12,6 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#include <gtest/gtest-param-test.h>
+#include <gtest/gtest.h>
+
+#include <tuple>
+
#include "spirv-tools/optimizer.hpp"
#include "test/opt/pass_fixture.h"
#include "test/opt/pass_utils.h"
@@ -63,8 +68,8 @@
OpCapability DotProductInput4x8BitKHR
OpCapability DotProductInput4x8BitPackedKHR
OpCapability DotProductKHR
- OpCapability ComputeDerivativeGroupQuadsNV
- OpCapability ComputeDerivativeGroupLinearNV
+ OpCapability ComputeDerivativeGroupQuadsKHR
+ OpCapability ComputeDerivativeGroupLinearKHR
; CHECK: OpCapability Linkage
; CHECK-NOT: OpCapability StorageUniform16
; CHECK-NOT: OpCapability StorageUniformBufferBlock16
@@ -91,8 +96,8 @@
; CHECK-NOT: OpCapability DotProductInput4x8BitKHR
; CHECK-NOT: OpCapability DotProductInput4x8BitPackedKHR
; CHECK-NOT: OpCapability DotProductKHR
-; CHECK-NOT: OpCapability ComputeDerivativeGroupQuadsNV
-; CHECK-NOT: OpCapability ComputeDerivativeGroupLinearNV
+; CHECK-NOT: OpCapability ComputeDerivativeGroupQuadsKHR
+; CHECK-NOT: OpCapability ComputeDerivativeGroupLinearKHR
; CHECK: OpCapability UniformAndStorageBuffer16BitAccess
; CHECK: OpCapability StorageBuffer16BitAccess
; CHECK: OpCapability ShaderViewportIndexLayerEXT
@@ -1396,6 +1401,244 @@
EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
}
+TEST_F(TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_RemainsSimplePointer_Vulkan1_0) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability Float16
+ OpCapability StorageBuffer16BitAccess
+
+; CHECK: OpCapability StorageBuffer16BitAccess
+; CHECK-NOT: OpExtension "SPV_KHR_16bit_storage"
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpDecorate %struct Block
+ %void = OpTypeVoid
+ %half = OpTypeFloat 16
+ %struct = OpTypeStruct %half
+ %ptr = OpTypePointer StorageBuffer %struct
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ SetTargetEnv(SPV_ENV_VULKAN_1_0);
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_RemainsSimplePointer_Vulkan1_1) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability Float16
+ OpCapability StorageBuffer16BitAccess
+
+; CHECK: OpCapability StorageBuffer16BitAccess
+; CHECK-NOT: OpExtension "SPV_KHR_16bit_storage"
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpDecorate %struct Block
+ %void = OpTypeVoid
+ %half = OpTypeFloat 16
+ %struct = OpTypeStruct %half
+ %ptr = OpTypePointer StorageBuffer %struct
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(
+ TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_RemainsSimplePointerUshortPhysicalStorage_Vulkan1_1) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability StorageBuffer16BitAccess
+ OpCapability PhysicalStorageBufferAddresses
+
+; CHECK: OpCapability StorageBuffer16BitAccess
+; CHECK: OpCapability PhysicalStorageBufferAddresses
+; CHECK-NOT: OpExtension "SPV_KHR_16bit_storage"
+; CHECK-NOT: OpCapability Int16
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpDecorate %struct Block
+ %void = OpTypeVoid
+ %ushort = OpTypeInt 16 0
+ %struct = OpTypeStruct %ushort
+ %ptr = OpTypePointer PhysicalStorageBuffer %struct
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(
+ TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_RemainsSimplePointerUshortStorageBuffer_Vulkan1_1) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability StorageBuffer16BitAccess
+
+; CHECK: OpCapability StorageBuffer16BitAccess
+; CHECK-NOT: OpExtension "SPV_KHR_16bit_storage"
+; CHECK-NOT: OpCapability Int16
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpDecorate %struct Block
+ %void = OpTypeVoid
+ %ushort = OpTypeInt 16 0
+ %struct = OpTypeStruct %ushort
+ %ptr = OpTypePointer StorageBuffer %struct
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(
+ TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_RemainsSimplePointerUshortRecordBuffer_Vulkan1_1) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability RayTracingKHR
+ OpCapability StorageBuffer16BitAccess
+ OpExtension "SPV_KHR_ray_tracing"
+
+; CHECK-NOT: OpCapability Int16
+; CHECK: OpCapability RayTracingKHR
+; CHECK: OpCapability StorageBuffer16BitAccess
+; CHECK: OpExtension "SPV_KHR_ray_tracing"
+; CHECK-NOT: OpExtension "SPV_KHR_16bit_storage"
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpDecorate %struct Block
+ %void = OpTypeVoid
+ %ushort = OpTypeInt 16 0
+ %struct = OpTypeStruct %ushort
+ %ptr = OpTypePointer ShaderRecordBufferKHR %struct
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_TrimRecordBuffer_Vulkan1_1) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability RayTracingKHR
+ OpCapability StorageBuffer16BitAccess
+ OpExtension "SPV_KHR_ray_tracing"
+
+; CHECK-NOT: OpCapability RayTracingKHR
+; CHECK-NOT: OpCapability StorageBuffer16BitAccess
+; CHECK-NOT: OpExtension "SPV_KHR_ray_tracing"
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpDecorate %struct Block
+ %void = OpTypeVoid
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ SetTargetEnv(SPV_ENV_VULKAN_1_1);
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ StorageBuffer16BitAccess_RemovedSimplePointer) {
+ // See https://github.com/KhronosGroup/SPIRV-Tools/issues/5354
+ static_assert(spv::Capability::StorageUniformBufferBlock16 ==
+ spv::Capability::StorageBuffer16BitAccess);
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability Float16
+ OpCapability StorageBuffer16BitAccess
+ OpExtension "SPV_KHR_16bit_storage"
+
+; CHECK-NOT: OpCapability StorageBuffer16BitAccess
+; CHECK-NOT: OpExtension "SPV_KHR_16bit_storage"
+
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ %void = OpTypeVoid
+ %half = OpTypeFloat 16
+ %struct = OpTypeStruct %half
+ %ptr = OpTypePointer Function %struct
+ %1 = OpTypeFunction %void
+ %2 = OpFunction %void None %1
+ %3 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
TEST_F(TrimCapabilitiesPassTest, FragmentShaderInterlock_RemovedIfNotUsed) {
const std::string kTest = R"(
OpCapability Shader
@@ -2136,11 +2379,11 @@
TEST_F(TrimCapabilitiesPassTest,
ComputeDerivativeGroupQuads_ReamainsWithExecMode) {
const std::string kTest = R"(
- OpCapability ComputeDerivativeGroupQuadsNV
- OpCapability ComputeDerivativeGroupLinearNV
-; CHECK-NOT: OpCapability ComputeDerivativeGroupLinearNV
-; CHECK: OpCapability ComputeDerivativeGroupQuadsNV
-; CHECK-NOT: OpCapability ComputeDerivativeGroupLinearNV
+ OpCapability ComputeDerivativeGroupQuadsKHR
+ OpCapability ComputeDerivativeGroupLinearKHR
+; CHECK-NOT: OpCapability ComputeDerivativeGroupLinearKHR
+; CHECK: OpCapability ComputeDerivativeGroupQuadsKHR
+; CHECK-NOT: OpCapability ComputeDerivativeGroupLinearKHR
OpCapability Shader
; CHECK: OpExtension "SPV_NV_compute_shader_derivatives"
OpExtension "SPV_NV_compute_shader_derivatives"
@@ -2162,11 +2405,11 @@
TEST_F(TrimCapabilitiesPassTest,
ComputeDerivativeGroupLinear_ReamainsWithExecMode) {
const std::string kTest = R"(
- OpCapability ComputeDerivativeGroupLinearNV
- OpCapability ComputeDerivativeGroupQuadsNV
-; CHECK-NOT: OpCapability ComputeDerivativeGroupQuadsNV
-; CHECK: OpCapability ComputeDerivativeGroupLinearNV
-; CHECK-NOT: OpCapability ComputeDerivativeGroupQuadsNV
+ OpCapability ComputeDerivativeGroupLinearKHR
+ OpCapability ComputeDerivativeGroupQuadsKHR
+; CHECK-NOT: OpCapability ComputeDerivativeGroupQuadsKHR
+; CHECK: OpCapability ComputeDerivativeGroupLinearKHR
+; CHECK-NOT: OpCapability ComputeDerivativeGroupQuadsKHR
OpCapability Shader
; CHECK: OpExtension "SPV_NV_compute_shader_derivatives"
OpExtension "SPV_NV_compute_shader_derivatives"
@@ -2366,6 +2609,94 @@
EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
}
+TEST_F(TrimCapabilitiesPassTest,
+ StorageImageWriteWithoutFormat_RemainsWhenRequiredWithWrite) {
+ const std::string kTest = R"(
+ OpCapability StorageImageWriteWithoutFormat
+; CHECK: OpCapability StorageImageWriteWithoutFormat
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main" %id %img
+ OpExecutionMode %main LocalSize 8 8 8
+ OpSource HLSL 670
+ OpName %type_image "type.3d.image"
+ OpName %img "img"
+ OpName %main "main"
+ OpDecorate %id BuiltIn GlobalInvocationId
+ OpDecorate %img DescriptorSet 0
+ OpDecorate %img Binding 0
+ %float = OpTypeFloat 32
+ %float_4 = OpConstant %float 4
+ %float_5 = OpConstant %float 5
+ %v2float = OpTypeVector %float 2
+ %9 = OpConstantComposite %v2float %float_4 %float_5
+ %type_image = OpTypeImage %float 3D 2 0 0 2 Unknown
+ %ptr_img = OpTypePointer UniformConstant %type_image
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %ptr_input = OpTypePointer Input %v3uint
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %img = OpVariable %ptr_img UniformConstant
+ %id = OpVariable %ptr_input Input
+ %main = OpFunction %void None %15
+ %16 = OpLabel
+ %17 = OpLoad %v3uint %id
+ %18 = OpLoad %type_image %img
+ OpImageWrite %18 %17 %9 None
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ StorageImageWriteWithoutFormat_RemovedWithWriteOnKnownFormat) {
+ const std::string kTest = R"(
+ OpCapability StorageImageWriteWithoutFormat
+; CHECK-NOT: OpCapability StorageImageWriteWithoutFormat
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main" %id %img
+ OpExecutionMode %main LocalSize 8 8 8
+ OpSource HLSL 670
+ OpName %type_image "type.3d.image"
+ OpName %img "img"
+ OpName %main "main"
+ OpDecorate %id BuiltIn GlobalInvocationId
+ OpDecorate %img DescriptorSet 0
+ OpDecorate %img Binding 0
+ %float = OpTypeFloat 32
+ %float_4 = OpConstant %float 4
+ %float_5 = OpConstant %float 5
+ %v2float = OpTypeVector %float 2
+ %9 = OpConstantComposite %v2float %float_4 %float_5
+ %type_image = OpTypeImage %float 3D 2 0 0 2 Rg32f
+ %ptr_img = OpTypePointer UniformConstant %type_image
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %ptr_input = OpTypePointer Input %v3uint
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %img = OpVariable %ptr_img UniformConstant
+ %id = OpVariable %ptr_input Input
+ %main = OpFunction %void None %15
+ %16 = OpLabel
+ %17 = OpLoad %v3uint %id
+ %18 = OpLoad %type_image %img
+ OpImageWrite %18 %17 %9 None
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
TEST_F(TrimCapabilitiesPassTest, PhysicalStorageBuffer_RemovedWhenUnused) {
const std::string kTest = R"(
OpCapability PhysicalStorageBufferAddresses
@@ -2660,6 +2991,659 @@
EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
}
+TEST_F(TrimCapabilitiesPassTest, GroupNonUniform_RemovedWhenUnused) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniform_RemainsGroupNonUniformWhenInUse) {
+ const std::string kTest = R"(
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK: OpCapability GroupNonUniform
+ OpCapability Shader
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformElect %bool %scope_subgroup
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniformVote_Remains_OpGroupNonUniformAll) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformAll %bool %scope_subgroup %true
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniformVote_Remains_OpGroupNonUniformAny) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformAny %bool %scope_subgroup %true
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniformArithmetic_Remains_OpGroupNonUniformIAdd_Reduce) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformIAdd %uint %scope_subgroup Reduce %uint_1
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniformArithmetic_Remains_OpGroupNonUniformIAdd_InclusiveScan) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformIAdd %uint %scope_subgroup InclusiveScan %uint_1
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniformArithmetic_Remains_OpGroupNonUniformIAdd_ExclusiveScan) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformIAdd %uint %scope_subgroup ExclusiveScan %uint_1
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ GroupNonUniformClustered_Remains_OpGroupNonUniformIAdd_ClusteredReduce) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = OpGroupNonUniformIAdd %uint %scope_subgroup ClusteredReduce %uint_1 %uint_1
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+struct SubgroupTestCase {
+ // The result type of the subgroup instruction.
+ std::string resultType;
+ // The opcode of the subgroup instruction.
+ std::string opcode;
+ // The actual operand of the subgroup instruction.
+ std::string operand;
+};
+
+static const std::vector<SubgroupTestCase> kSubgroupTestCases{
+ // clang-format off
+ { "uint", "OpGroupNonUniformIAdd", "uint_1" },
+ { "float", "OpGroupNonUniformFAdd", "float_1" },
+ { "uint", "OpGroupNonUniformIMul", "uint_1" },
+ { "float", "OpGroupNonUniformFMul", "float_1" },
+ { "int", "OpGroupNonUniformSMin", "int_1" },
+ { "uint", "OpGroupNonUniformUMin", "uint_1" },
+ { "float", "OpGroupNonUniformFMin", "float_1" },
+ { "int", "OpGroupNonUniformSMax", "int_1" },
+ { "uint", "OpGroupNonUniformUMax", "uint_1" },
+ { "float", "OpGroupNonUniformFMax", "float_1" },
+ { "uint", "OpGroupNonUniformBitwiseAnd", "uint_1" },
+ { "uint", "OpGroupNonUniformBitwiseOr", "uint_1" },
+ { "uint", "OpGroupNonUniformBitwiseXor", "uint_1" },
+ { "bool", "OpGroupNonUniformLogicalAnd", "true" },
+ { "bool", "OpGroupNonUniformLogicalOr", "true" },
+ { "bool", "OpGroupNonUniformLogicalXor", "true" } // clang-format on
+};
+
+using TrimCapabilitiesPassTestSubgroupNV_Unsigned = PassTest<
+ ::testing::TestWithParam<std::tuple<SubgroupTestCase, std::string>>>;
+TEST_P(TrimCapabilitiesPassTestSubgroupNV_Unsigned,
+ GroupNonUniformPartitionedNV_Remains) {
+ SubgroupTestCase test_case = std::get<0>(GetParam());
+ const std::string operation = std::get<1>(GetParam());
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %float = OpTypeFloat 32
+ %v4uint = OpTypeVector %uint 4
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %uint4_1111 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = )" + test_case.opcode +
+ " %" + test_case.resultType + " %scope_subgroup " +
+ operation + " %" + test_case.operand +
+ R"( %uint4_1111
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ TrimCapabilitiesPassTestSubgroupNV_Unsigned_I,
+ TrimCapabilitiesPassTestSubgroupNV_Unsigned,
+ ::testing::Combine(::testing::ValuesIn(kSubgroupTestCases),
+ ::testing::Values("PartitionedReduceNV",
+ "PartitionedInclusiveScanNV",
+ "PartitionedExclusiveScanNV")),
+ [](const ::testing::TestParamInfo<
+ TrimCapabilitiesPassTestSubgroupNV_Unsigned::ParamType>& info) {
+ return std::get<0>(info.param).opcode + "_" + std::get<1>(info.param);
+ });
+
+using TrimCapabilitiesPassTestSubgroupArithmetic_Unsigned = PassTest<
+ ::testing::TestWithParam<std::tuple<SubgroupTestCase, std::string>>>;
+TEST_P(TrimCapabilitiesPassTestSubgroupArithmetic_Unsigned,
+ GroupNonUniformPartitionedArithmetic_Remains) {
+ SubgroupTestCase test_case = std::get<0>(GetParam());
+ const std::string operation = std::get<1>(GetParam());
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK-NOT: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %float = OpTypeFloat 32
+ %v4uint = OpTypeVector %uint 4
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %uint4_1111 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = )" + test_case.opcode +
+ " %" + test_case.resultType + " %scope_subgroup " +
+ operation + " %" + test_case.operand + R"( %uint_1
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ TrimCapabilitiesPassTestSubgroupArithmetic_Unsigned_I,
+ TrimCapabilitiesPassTestSubgroupArithmetic_Unsigned,
+ ::testing::Combine(::testing::ValuesIn(kSubgroupTestCases),
+ ::testing::Values("Reduce", "InclusiveScan",
+ "ExclusiveScan")),
+ [](const ::testing::TestParamInfo<
+ TrimCapabilitiesPassTestSubgroupArithmetic_Unsigned::ParamType>& info) {
+ return std::get<0>(info.param).opcode + "_" + std::get<1>(info.param);
+ });
+
+using TrimCapabilitiesPassTestSubgroupClustered_Unsigned = PassTest<
+ ::testing::TestWithParam<std::tuple<SubgroupTestCase, std::string>>>;
+TEST_P(TrimCapabilitiesPassTestSubgroupClustered_Unsigned,
+ GroupNonUniformPartitionedClustered_Remains) {
+ SubgroupTestCase test_case = std::get<0>(GetParam());
+ const std::string operation = std::get<1>(GetParam());
+
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability GroupNonUniformVote
+; CHECK-NOT: OpCapability GroupNonUniformVote
+ OpCapability GroupNonUniformArithmetic
+; CHECK-NOT: OpCapability GroupNonUniformArithmetic
+ OpCapability GroupNonUniformClustered
+; CHECK: OpCapability GroupNonUniformClustered
+ OpCapability GroupNonUniformPartitionedNV
+; CHECK-NOT: OpCapability GroupNonUniformPartitionedNV
+ OpCapability GroupNonUniform
+; CHECK-NOT: OpCapability GroupNonUniform
+ OpExtension "SPV_NV_shader_subgroup_partitioned"
+; CHECK-NOT: OpExtension "SPV_NV_shader_subgroup_partitioned"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 2 4
+ %void = OpTypeVoid
+ %bool = OpTypeBool
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %float = OpTypeFloat 32
+ %v4uint = OpTypeVector %uint 4
+ %scope_subgroup = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %uint4_1111 = OpConstantComposite %v4uint %uint_1 %uint_1 %uint_1 %uint_1
+ %true = OpConstantTrue %bool
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %6 = OpLabel
+ %7 = )" + test_case.opcode +
+ " %" + test_case.resultType + " %scope_subgroup " +
+ operation + " %" + test_case.operand + R"( %uint_1
+ OpReturn
+ OpFunctionEnd;
+ )";
+ const auto result = SinglePassRunAndMatch<TrimCapabilitiesPass>(
+ kTest, /* do_validation= */ true);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest, InterpolationFunction_RemovedIfNotUsed) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability InterpolationFunction
+; CHECK-NOT: OpCapability InterpolationFunction
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %out_var_SV_Target
+ OpExecutionMode %main OriginUpperLeft
+ OpSource HLSL 660
+ OpName %out_var_SV_Target "out.var.SV_Target"
+ OpName %main "main"
+ OpDecorate %out_var_SV_Target Location 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %7 = OpTypeFunction %void
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+ %main = OpFunction %void None %7
+ %8 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest,
+ InterpolationFunction_RemainsWithInterpolateAtCentroid) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability InterpolationFunction
+; CHECK: OpCapability InterpolationFunction
+ %std450 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %out_var_SV_Target %gl_PointCoord
+ OpExecutionMode %main OriginUpperLeft
+ OpSource HLSL 660
+ OpName %out_var_SV_Target "out.var.SV_Target"
+ OpName %main "main"
+ OpDecorate %out_var_SV_Target Location 0
+ OpDecorate %gl_PointCoord BuiltIn PointCoord
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+ %void = OpTypeVoid
+ %7 = OpTypeFunction %void
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+%gl_PointCoord = OpVariable %_ptr_Input_v2float Input
+ %main = OpFunction %void None %7
+ %8 = OpLabel
+ %9 = OpExtInst %v4float %std450 InterpolateAtCentroid %gl_PointCoord
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest, QuadControlKHR_RemoveIfNotUsed) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability QuadControlKHR
+; CHECK-NOT: OpCapability QuadControlKHR
+ OpExtension "SPV_KHR_quad_control"
+; CHECK-NOT: OpExtension "SPV_KHR_quad_control"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %out_var_SV_Target
+ OpExecutionMode %main OriginUpperLeft
+ OpSource HLSL 660
+ OpName %out_var_SV_Target "out.var.SV_Target"
+ OpName %main "main"
+ OpDecorate %out_var_SV_Target Location 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %7 = OpTypeFunction %void
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+ %main = OpFunction %void None %7
+ %8 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest, QuadControlKHR_RemainsWithQuadAny) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability QuadControlKHR
+; CHECK: OpCapability QuadControlKHR
+ OpExtension "SPV_KHR_quad_control"
+; CHECK: OpExtension "SPV_KHR_quad_control"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %out_var_SV_Target
+ OpExecutionMode %main OriginUpperLeft
+ OpSource HLSL 660
+ OpName %out_var_SV_Target "out.var.SV_Target"
+ OpName %main "main"
+ OpDecorate %out_var_SV_Target Location 0
+ %bool = OpTypeBool
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %void = OpTypeVoid
+ %7 = OpTypeFunction %void
+%out_var_SV_Target = OpVariable %_ptr_Output_v4float Output
+ %main = OpFunction %void None %7
+ %8 = OpLabel
+ %true = OpConstantTrue %bool
+ %10 = OpGroupNonUniformQuadAnyKHR %bool %true
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(TrimCapabilitiesPassTest, PhysicalStorageBuffer_RecursiveTypes) {
+ const std::string kTest = R"(
+ OpCapability Shader
+ OpCapability PhysicalStorageBufferAddresses
+; CHECK: OpCapability PhysicalStorageBufferAddresses
+ OpExtension "SPV_KHR_physical_storage_buffer"
+; CHECK: OpExtension "SPV_KHR_physical_storage_buffer"
+ OpMemoryModel PhysicalStorageBuffer64 GLSL450
+ OpEntryPoint Fragment %1 "main"
+ OpExecutionMode %1 OriginUpperLeft
+ OpSource HLSL 600
+ OpMemberDecorate %_struct_2 0 Offset 0
+ OpMemberDecorate %_struct_2 1 Offset 16
+ OpTypeForwardPointer %_ptr_PhysicalStorageBuffer__struct_2 PhysicalStorageBuffer
+ %int = OpTypeInt 32 1
+ %_struct_2 = OpTypeStruct %int %_ptr_PhysicalStorageBuffer__struct_2
+%_ptr_PhysicalStorageBuffer__struct_2 = OpTypePointer PhysicalStorageBuffer %_struct_2
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %1 = OpFunction %void None %6
+ %7 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ const auto result =
+ SinglePassRunAndMatch<TrimCapabilitiesPass>(kTest, /* skip_nop= */ false);
+ EXPECT_EQ(std::get<1>(result), Pass::Status::SuccessWithoutChange);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ TrimCapabilitiesPassTestSubgroupClustered_Unsigned_I,
+ TrimCapabilitiesPassTestSubgroupClustered_Unsigned,
+ ::testing::Combine(::testing::ValuesIn(kSubgroupTestCases),
+ ::testing::Values("ClusteredReduce")),
+ [](const ::testing::TestParamInfo<
+ TrimCapabilitiesPassTestSubgroupClustered_Unsigned::ParamType>& info) {
+ return std::get<0>(info.param).opcode + "_" + std::get<1>(info.param);
+ });
+
} // namespace
} // namespace opt
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/opt/type_manager_test.cpp b/third_party/SPIRV-Tools/test/opt/type_manager_test.cpp
index d4d0fef..86d6bc0 100644
--- a/third_party/SPIRV-Tools/test/opt/type_manager_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/type_manager_test.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2016 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -147,6 +149,7 @@
types.emplace_back(new Pointer(f32, spv::StorageClass::Input));
types.emplace_back(new Pointer(sts32f32, spv::StorageClass::Function));
types.emplace_back(new Pointer(a42f32, spv::StorageClass::Function));
+ types.emplace_back(new Pointer(nullptr, spv::StorageClass::Uniform));
// Function
types.emplace_back(new Function(voidt, {}));
@@ -174,6 +177,18 @@
types.emplace_back(new CooperativeMatrixKHR(f32, 8, 8, 8, 1002));
types.emplace_back(new RayQueryKHR());
types.emplace_back(new HitObjectNV());
+ types.emplace_back(new CooperativeVectorNV(f32, 16));
+
+ // SPV_AMDX_shader_enqueue
+ types.emplace_back(new NodePayloadArrayAMDX(sts32f32));
+
+ // Tensors
+ types.emplace_back(new TensorARM(f32));
+ types.emplace_back(new TensorARM(f32, 4));
+ types.emplace_back(new TensorARM(f32, 4, 44));
+
+ types.emplace_back(new TensorLayoutNV(1002, 1000));
+ types.emplace_back(new TensorViewNV(1002, 1003, {1000, 1001}));
return types;
}
@@ -240,6 +255,12 @@
%cm = OpTypeCooperativeMatrixNV %f64 %id4 %id4 %id4
%id2 = OpConstant %u32 2
%cmkhr = OpTypeCooperativeMatrixKHR %f64 %id4 %id4 %id4 %id2
+ %untyped = OpTypeUntypedPointerKHR Uniform
+ ; ID 43
+ %ts_shape = OpConstantComposite %a5u32 %id4 %id4 %id4 %id4
+ %ts = OpTypeTensorARM %u32
+ %tsr = OpTypeTensorARM %u32 %id4
+ %tss = OpTypeTensorARM %u32 %id4 %ts_shape
)";
std::vector<std::pair<uint32_t, std::string>> type_id_strs = {
@@ -279,10 +300,15 @@
{38, "[sint32, id(34), words(2,34)]"},
{39, "<float64, 6, 6, 6>"},
{41, "<float64, 6, 6, 6, 40>"},
+ {42, "untyped_ptr 2*"}, // Include storage class number
+ // Id 43 is OpConstantComposite %a5u32 %id4 %id4 %id4 %id4
+ {44, "tensor<uint32, id(0), id(0)>"},
+ {45, "tensor<uint32, id(6), id(0)>"},
+ {46, "tensor<uint32, id(6), id(43)>"},
};
std::unique_ptr<IRContext> context =
- BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, text);
+ BuildModule(SPV_ENV_UNIVERSAL_1_4, nullptr, text);
ASSERT_NE(nullptr, context.get()); // It assembled
TypeManager manager(nullptr, context.get());
@@ -1037,8 +1063,11 @@
; CHECK: [[uniform_ptr:%\w+]] = OpTypePointer Uniform [[uint]]
; CHECK: [[uint2:%\w+]] = OpConstant [[uint]] 2
; CHECK: [[uint8:%\w+]] = OpConstant [[uint]] 8
+; CHECK: [[uint4:%\w+]] = OpConstant [[uint]] 4
+; CHECK: [[uint_arr4:%\w+]] = OpTypeArray [[uint]] [[uint4]]
; CHECK: [[uint24:%\w+]] = OpConstant [[uint]] 24
; CHECK: [[uint42:%\w+]] = OpConstant [[uint]] 42
+; CHECK: [[uint_arr4_44:%\w+]] = OpConstantComposite [[uint_arr4]] [[uint4]] [[uint4]] [[uint4]] [[uint4]]
; CHECK: [[uint100:%\w+]] = OpConstant [[uint]] 100
; CHECK: [[void:%\w+]] = OpTypeVoid
; CHECK: [[bool:%\w+]] = OpTypeBool
@@ -1095,6 +1124,9 @@
; CHECK: OpTypeCooperativeMatrixKHR [[f32]] [[uint8]] [[uint8]] [[uint8]] [[uint2]]
; CHECK: OpTypeRayQueryKHR
; CHECK: OpTypeHitObjectNV
+; CHECK: OpTypeTensorARM [[f32]]
+; CHECK: OpTypeTensorARM [[f32]] [[uint4]]
+; CHECK: OpTypeTensorARM [[f32]] [[uint4]] [[uint_arr4_44]]
OpCapability Shader
OpCapability Int64
OpCapability Linkage
@@ -1102,11 +1134,17 @@
%uint = OpTypeInt 32 0
%1 = OpTypePointer Input %uint
%2 = OpTypePointer Uniform %uint
+%1000 = OpConstant %uint 0
+%1001 = OpConstant %uint 1
%1002 = OpConstant %uint 2
%8 = OpConstant %uint 8
+%4 = OpConstant %uint 4
+%5 = OpTypeArray %uint %4
%24 = OpConstant %uint 24
%42 = OpConstant %uint 42
+%44 = OpConstantComposite %5 %4 %4 %4 %4
%100 = OpConstant %uint 100
+%1003 = OpConstantFalse %bool
)";
std::unique_ptr<IRContext> context =
@@ -1233,6 +1271,35 @@
EXPECT_EQ(id, 1201);
}
+TEST(TypeManager, AttachLinkageDecoration) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability Linkage
+ OpMemoryModel Logical GLSL450
+ OpDecorate %1000 LinkageAttributes "_1000" Export
+ %800 = OpTypeInt 32 0
+ %1000 = OpTypeStruct %800
+ %1200 = OpTypeStruct %800
+ )";
+
+ std::unique_ptr<IRContext> context =
+ BuildModule(SPV_ENV_UNIVERSAL_1_5, nullptr, text,
+ SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ TypeManager manager(nullptr, context.get());
+
+ constexpr uint32_t source_id = 1000u;
+ constexpr uint32_t target_id = 1200u;
+ std::vector<Instruction*> decorations =
+ context->get_decoration_mgr()->GetDecorationsFor(source_id, true);
+ Type* type = context->get_type_mgr()->GetType(target_id);
+ for (auto dec : decorations) {
+ manager.AttachDecoration(*dec, type);
+ }
+ EXPECT_FALSE(type->decoration_empty());
+ EXPECT_TRUE(
+ type->HasSameDecorations(context->get_type_mgr()->GetType(source_id)));
+}
+
} // namespace
} // namespace analysis
} // namespace opt
diff --git a/third_party/SPIRV-Tools/test/opt/types_test.cpp b/third_party/SPIRV-Tools/test/opt/types_test.cpp
index 4ceeb14..d4bd0e1 100644
--- a/third_party/SPIRV-Tools/test/opt/types_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/types_test.cpp
@@ -226,6 +226,7 @@
types.emplace_back(new Pointer(sts32f32, spv::StorageClass::Function));
types.emplace_back(new Pointer(a42f32, spv::StorageClass::Function));
types.emplace_back(new Pointer(voidt, spv::StorageClass::Function));
+ types.emplace_back(new Pointer(nullptr, spv::StorageClass::Uniform));
// Function
types.emplace_back(new Function(voidt, {}));
@@ -364,6 +365,20 @@
}
}
+TEST(Types, FloatFPEncoding) {
+ std::vector<spv::FPEncoding> encodings = {
+ spv::FPEncoding::BFloat16KHR,
+ spv::FPEncoding::Max,
+ };
+ std::vector<std::unique_ptr<Float>> types;
+ for (spv::FPEncoding encoding : encodings) {
+ types.emplace_back(new Float(16, encoding));
+ }
+ for (size_t i = 0; i < encodings.size(); i++) {
+ EXPECT_EQ(encodings[i], types[i]->encoding());
+ }
+}
+
TEST(Types, VectorElementCount) {
auto s32 = MakeUnique<Integer>(32, true);
for (uint32_t c : {2, 3, 4}) {
@@ -443,6 +458,15 @@
}
}
+TEST(Types, UntypedPointer) {
+ std::unique_ptr<Type> type(new Pointer(nullptr, spv::StorageClass::Uniform));
+ const auto untyped = type->AsPointer();
+ EXPECT_NE(untyped, nullptr);
+ EXPECT_TRUE(untyped->is_untyped());
+ EXPECT_EQ(untyped->pointee_type(), nullptr);
+ EXPECT_EQ(untyped->storage_class(), spv::StorageClass::Uniform);
+}
+
} // namespace
} // namespace analysis
} // namespace opt
diff --git a/third_party/SPIRV-Tools/test/opt/upgrade_memory_model_test.cpp b/third_party/SPIRV-Tools/test/opt/upgrade_memory_model_test.cpp
index d213b8b..45581fb 100644
--- a/third_party/SPIRV-Tools/test/opt/upgrade_memory_model_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/upgrade_memory_model_test.cpp
@@ -434,6 +434,394 @@
SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
}
+TEST_F(UpgradeMemoryModelTest, VariablePointerStoreToFunctionAndPrivate) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK-NOT: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer {{%\w+}}
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%void = OpTypeVoid
+%uint = OpTypeInt 32 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %void %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_Private__ptr_StorageBuffer__struct_4 = OpTypePointer Private %_ptr_StorageBuffer__struct_4
+%var_bufPtr_pri = OpVariable %_ptr_Private__ptr_StorageBuffer__struct_4 Private
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %void None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%bb_entry = OpLabel
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf
+OpStore %param_buf %buf
+OpStore %var_bufPtr_pri %buf
+OpReturn
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectLoad) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[buffer:%\w+]] = OpLoad {{%\w+}} {{%\w+}}
+; CHECK: [[ld_gep:%\w+]] = OpAccessChain {{%\w+}} [[buffer]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep]] MakePointerVisible|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %uint None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf
+%offset = OpLoad %uint %param_offset
+%ld_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf %uint_0 %offset
+%data = OpLoad %uint %ld_gep
+OpReturnValue %data
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectLoadWithPrivateAS) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[ld_gep:%\w+]] = OpAccessChain {{%\w+}} [[buffer:%\w+]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep]] MakePointerVisible|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%_ptr_Private__ptr_StorageBuffer__struct_4 = OpTypePointer Private %_ptr_StorageBuffer__struct_4
+%var_bufPtr_pri = OpVariable %_ptr_Private__ptr_StorageBuffer__struct_4 Private
+%functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %uint None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%buf0 = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf
+OpStore %var_bufPtr_pri %buf0
+%offset = OpLoad %uint %param_offset
+%buf1 = OpLoad %_ptr_StorageBuffer__struct_4 %var_bufPtr_pri
+%ld_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf1 %uint_0 %offset
+%data = OpLoad %uint %ld_gep
+OpReturnValue %data
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectStore) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[st_gep:%\w+]] = OpAccessChain
+; CHECK: OpStore [[st_gep]] {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%void = OpTypeVoid
+%uint_0 = OpConstant %uint 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %void %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %void None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf
+%offset = OpLoad %uint %param_offset
+%st_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf %uint_0 %offset
+OpStore %st_gep %uint_0
+OpReturn
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectStoreWithPrivateAS) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[st_gep:%\w+]] = OpAccessChain
+; CHECK: OpStore [[st_gep]] {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%void = OpTypeVoid
+%uint_0 = OpConstant %uint 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%_ptr_Private__ptr_StorageBuffer__struct_4 = OpTypePointer Private %_ptr_StorageBuffer__struct_4
+%var_bufPtr_pri = OpVariable %_ptr_Private__ptr_StorageBuffer__struct_4 Private
+%functy = OpTypeFunction %void %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %void None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%buf0 = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf
+OpStore %var_bufPtr_pri %buf0
+%offset = OpLoad %uint %param_offset
+%buf1 = OpLoad %_ptr_StorageBuffer__struct_4 %var_bufPtr_pri
+%st_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf1 %uint_0 %offset
+OpStore %st_gep %uint_0
+OpReturn
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectSelect) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[buffer:%\w+]] = OpLoad {{%\w+}} {{%\w+}}
+; CHECK: [[ld_gep:%\w+]] = OpAccessChain {{%\w+}} [[buffer]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep]] MakePointerVisible|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%bool = OpTypeBool
+%true = OpConstantTrue %bool
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%null = OpConstantNull %_ptr_Function__ptr_StorageBuffer__struct_4
+%func = OpFunction %uint None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%select = OpSelect %_ptr_Function__ptr_StorageBuffer__struct_4 %true %param_buf %null
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %select
+%offset = OpLoad %uint %param_offset
+%ld_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf %uint_0 %offset
+%data = OpLoad %uint %ld_gep
+OpReturnValue %data
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectCopied) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[buffer:%\w+]] = OpLoad {{%\w+}} {{%\w+}}
+; CHECK: [[ld_gep:%\w+]] = OpAccessChain {{%\w+}} [[buffer]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep]] MakePointerVisible|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %uint None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%copy = OpCopyObject %_ptr_Function__ptr_StorageBuffer__struct_4 %param_buf
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %copy
+%offset = OpLoad %uint %param_offset
+%ld_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf %uint_0 %offset
+%data = OpLoad %uint %ld_gep
+OpReturnValue %data
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectPhi) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[buffer:%\w+]] = OpLoad {{%\w+}} {{%\w+}}
+; CHECK: [[ld_gep:%\w+]] = OpAccessChain {{%\w+}} [[buffer]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep]] MakePointerVisible|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpMemberDecorate %_struct_4 0 Coherent
+OpDecorate %_struct_4 Block
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%bool = OpTypeBool
+%true = OpConstantTrue %bool
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%null = OpConstantNull %_ptr_Function__ptr_StorageBuffer__struct_4
+%func = OpFunction %uint None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+OpSelectionMerge %bb_end None
+OpBranchConditional %true %bb_then %bb_else
+%bb_then = OpLabel
+OpBranch %bb_end
+%bb_else = OpLabel
+OpBranch %bb_end
+%bb_end = OpLabel
+%phi_buf_ptr = OpPhi %_ptr_Function__ptr_StorageBuffer__struct_4 %param_buf %bb_then %null %bb_else
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %phi_buf_ptr
+%offset = OpLoad %uint %param_offset
+%ld_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf %uint_0 %offset
+%data = OpLoad %uint %ld_gep
+OpReturnValue %data
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
+TEST_F(UpgradeMemoryModelTest, VariablePointerIndirectFuncCall) {
+ const std::string text = R"(
+; CHECK-NOT: OpDecorate {{%\w+}} Coherent
+; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5
+; CHECK: [[buffer:%\w+]] = OpLoad {{%\w+}} {{%\w+}}
+; CHECK: [[ld_gep:%\w+]] = OpAccessChain {{%\w+}} [[buffer]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep]] MakePointerVisible|NonPrivatePointer [[scope]]
+; CHECK: [[buffer2:%\w+]] = OpLoad {{%\w+}} {{%\w+}} Volatile
+; CHECK: [[ld_gep2:%\w+]] = OpAccessChain {{%\w+}} [[buffer2]] {{%\w+}} {{%\w+}}
+; CHECK: OpLoad {{%\w+}} [[ld_gep2]] Volatile|MakePointerVisible|NonPrivatePointer [[scope]]
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpExtension "SPV_KHR_variable_pointers"
+OpMemoryModel Logical GLSL450
+OpDecorate %_runtimearr_uint ArrayStride 4
+OpMemberDecorate %_struct_4 0 Offset 0
+OpDecorate %_struct_4 Block
+OpDecorate %param_buf Coherent
+OpDecorate %param_buf_1 Coherent
+OpDecorate %param_buf_1 Volatile
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_1024 = OpConstant %uint 1024
+%_runtimearr_uint = OpTypeRuntimeArray %uint
+%_struct_4 = OpTypeStruct %_runtimearr_uint
+%_ptr_StorageBuffer__struct_4 = OpTypePointer StorageBuffer %_struct_4
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function__ptr_StorageBuffer__struct_4 = OpTypePointer Function %_ptr_StorageBuffer__struct_4
+%functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4 %_ptr_Function_uint
+%local_functy = OpTypeFunction %uint %_ptr_Function__ptr_StorageBuffer__struct_4
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+%func = OpFunction %uint None %functy
+%param_buf = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%param_offset = OpFunctionParameter %_ptr_Function_uint
+%bb_entry = OpLabel
+%buf = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf
+%offset = OpLoad %uint %param_offset
+%ld_gep = OpAccessChain %_ptr_StorageBuffer_uint %buf %uint_0 %offset
+%data = OpLoad %uint %ld_gep
+%data_2 = OpFunctionCall %uint %local_func %param_buf
+%ret = OpIAdd %uint %data %data_2
+OpReturnValue %ret
+OpFunctionEnd
+%local_func = OpFunction %uint None %local_functy
+%param_buf_1 = OpFunctionParameter %_ptr_Function__ptr_StorageBuffer__struct_4
+%bb_entry_1 = OpLabel
+%buf_1 = OpLoad %_ptr_StorageBuffer__struct_4 %param_buf_1
+%ld_gep_1 = OpAccessChain %_ptr_StorageBuffer_uint %buf_1 %uint_0 %uint_1024
+%data_1 = OpLoad %uint %ld_gep_1
+OpReturnValue %data_1
+OpFunctionEnd
+)";
+ SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true);
+}
+
TEST_F(UpgradeMemoryModelTest, CoherentStructElement) {
const std::string text = R"(
; CHECK-NOT: OpMemberDecorate
diff --git a/third_party/SPIRV-Tools/test/opt/value_table_test.cpp b/third_party/SPIRV-Tools/test/opt/value_table_test.cpp
index 3d7aaad..c3be991 100644
--- a/third_party/SPIRV-Tools/test/opt/value_table_test.cpp
+++ b/third_party/SPIRV-Tools/test/opt/value_table_test.cpp
@@ -25,7 +25,16 @@
using ::testing::HasSubstr;
using ::testing::MatchesRegex;
-using ValueTableTest = PassTest<::testing::Test>;
+
+struct ValueTableTest : public PassTest<::testing::Test> {
+ virtual void SetUp() override {
+ SetTargetEnv(SPV_ENV_UNIVERSAL_1_2);
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ SetDisassembleOptions(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES |
+ SPV_BINARY_TO_TEXT_OPTION_INDENT |
+ SPV_BINARY_TO_TEXT_OPTION_NO_HEADER);
+ }
+};
TEST_F(ValueTableTest, SameInstructionSameValue) {
const std::string text = R"(
@@ -724,9 +733,147 @@
ValueNumberTable vtable(context.get());
Instruction* load1 = context->get_def_use_mgr()->GetDef(17);
Instruction* load2 = context->get_def_use_mgr()->GetDef(18);
+ // Considered the same because the underlying memory is read-only
EXPECT_EQ(vtable.GetValueNumber(load1), vtable.GetValueNumber(load2));
}
+TEST_F(ValueTableTest, ImageRead_ConsideredDifferent) {
+ // Image reads are considered different because they can be read-write storage
+ // image.
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %var "s"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %v2zero = OpConstantNull %v2int
+ %float = OpTypeFloat 32
+ %v2float = OpTypeVector %float 2
+ %v4float = OpTypeVector %float 4
+ %i_ty = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+ %ptr_s_ty = OpTypePointer UniformConstant %i_ty
+ %var = OpVariable %ptr_s_ty UniformConstant
+ %main = OpFunction %void None %6
+ %15 = OpLabel
+ %16 = OpLoad %i_ty %var
+ %100 = OpImageRead %v4float %16 %v2zero
+ %101 = OpImageRead %v4float %16 %v2zero
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto context = AssembleModule(text);
+ ValueNumberTable vtable(context.get());
+ Instruction* read1 = context->get_def_use_mgr()->GetDef(100);
+ Instruction* read2 = context->get_def_use_mgr()->GetDef(101);
+ ASSERT_NE(read1, nullptr);
+ ASSERT_NE(read2, nullptr);
+ EXPECT_NE(vtable.GetValueNumber(read1), vtable.GetValueNumber(read2));
+}
+
+TEST_F(ValueTableTest, LoadSampler_ConsideredDifferent) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %var "var"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %s_ty = OpTypeSampler
+ %ptr_s_ty = OpTypePointer UniformConstant %s_ty
+ %var = OpVariable %ptr_s_ty UniformConstant
+ %main = OpFunction %void None %6
+ %15 = OpLabel
+ %100 = OpLoad %s_ty %var
+ %101 = OpLoad %s_ty %var
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto context = AssembleModule(text);
+ ValueNumberTable vtable(context.get());
+ Instruction* load1 = context->get_def_use_mgr()->GetDef(100);
+ Instruction* load2 = context->get_def_use_mgr()->GetDef(101);
+ ASSERT_NE(load1, nullptr) << Disassemble(context->module());
+ ASSERT_NE(load2, nullptr);
+ EXPECT_NE(vtable.GetValueNumber(load1), vtable.GetValueNumber(load2));
+}
+
+TEST_F(ValueTableTest, LoadImage_ConsideredDifferent) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %var "var"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %i_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %ptr_i_ty = OpTypePointer UniformConstant %i_ty
+ %var = OpVariable %ptr_i_ty UniformConstant
+ %main = OpFunction %void None %6
+ %15 = OpLabel
+ %100 = OpLoad %i_ty %var
+ %101 = OpLoad %i_ty %var
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto context = AssembleModule(text);
+ ValueNumberTable vtable(context.get());
+ Instruction* load1 = context->get_def_use_mgr()->GetDef(100);
+ Instruction* load2 = context->get_def_use_mgr()->GetDef(101);
+ ASSERT_NE(load1, nullptr);
+ ASSERT_NE(load2, nullptr);
+ EXPECT_NE(vtable.GetValueNumber(load1), vtable.GetValueNumber(load2));
+}
+
+TEST_F(ValueTableTest, LoadSampledImage_ConsideredDifferent) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginLowerLeft
+ OpName %main "main"
+ OpName %var "var"
+ OpDecorate %var DescriptorSet 0
+ OpDecorate %var Binding 0
+ %void = OpTypeVoid
+ %6 = OpTypeFunction %void
+ %s_ty = OpTypeSampler
+ %float = OpTypeFloat 32
+ %i_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+ %si_ty = OpTypeSampledImage %i_ty
+ %ptr_si_ty = OpTypePointer UniformConstant %si_ty
+ %var = OpVariable %ptr_si_ty UniformConstant
+ %main = OpFunction %void None %6
+ %15 = OpLabel
+ %100 = OpLoad %si_ty %var
+ %101 = OpLoad %si_ty %var
+ OpReturn
+ OpFunctionEnd
+ )";
+ auto context = AssembleModule(text);
+ ValueNumberTable vtable(context.get());
+ Instruction* load1 = context->get_def_use_mgr()->GetDef(100);
+ Instruction* load2 = context->get_def_use_mgr()->GetDef(101);
+ ASSERT_NE(load1, nullptr);
+ ASSERT_NE(load2, nullptr);
+ EXPECT_NE(vtable.GetValueNumber(load1), vtable.GetValueNumber(load2));
+}
+
TEST_F(ValueTableTest, DifferentDebugLocalVariableSameValue) {
const std::string text = R"(
OpCapability Shader
diff --git a/third_party/SPIRV-Tools/test/parse_number_test.cpp b/third_party/SPIRV-Tools/test/parse_number_test.cpp
index c99205c..40bdd02 100644
--- a/third_party/SPIRV-Tools/test/parse_number_test.cpp
+++ b/third_party/SPIRV-Tools/test/parse_number_test.cpp
@@ -898,6 +898,120 @@
EXPECT_EQ("Invalid 16-bit float literal: -1e400", err_msg);
}
+TEST(ParseAndEncodeFloat8_E4M3, Sample) {
+ EncodeNumberStatus rc = EncodeNumberStatus::kSuccess;
+ std::string err_msg;
+ NumberType type = {8, SPV_NUMBER_FLOATING, SPV_FP_ENCODING_FLOAT8_E4M3};
+
+ // Invalid
+ rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: ", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: 0=", err_msg);
+
+ // Representative samples
+ rc = ParseAndEncodeFloatingPointNumber(
+ "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "-0.0", type, [](uint32_t word) { EXPECT_EQ(0x80u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "1.0", type, [](uint32_t word) { EXPECT_EQ(0x38u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "2.5", type, [](uint32_t word) { EXPECT_EQ(0x42u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "-0.625", type, [](uint32_t word) { EXPECT_EQ(0xB2u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+
+ // Overflow
+ rc =
+ ParseAndEncodeFloatingPointNumber("1e38", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: 1e38", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("-1e38", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: -1e38", err_msg);
+ rc =
+ ParseAndEncodeFloatingPointNumber("1e40", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: 1e40", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("-1e40", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: -1e40", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: 1e400", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E4M3 float literal: -1e400", err_msg);
+}
+
+TEST(ParseAndEncodeFloat8_E5M2, Sample) {
+ EncodeNumberStatus rc = EncodeNumberStatus::kSuccess;
+ std::string err_msg;
+ NumberType type = {8, SPV_NUMBER_FLOATING, SPV_FP_ENCODING_FLOAT8_E5M2};
+
+ // Invalid
+ rc = ParseAndEncodeFloatingPointNumber("", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: ", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("0=", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: 0=", err_msg);
+
+ // Representative samples
+ rc = ParseAndEncodeFloatingPointNumber(
+ "0.0", type, [](uint32_t word) { EXPECT_EQ(0x0u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "-0.0", type, [](uint32_t word) { EXPECT_EQ(0x80u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "1.0", type, [](uint32_t word) { EXPECT_EQ(0x3cu, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "2.5", type, [](uint32_t word) { EXPECT_EQ(0x41u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+ rc = ParseAndEncodeFloatingPointNumber(
+ "-0.625", type, [](uint32_t word) { EXPECT_EQ(0xB9u, word); }, nullptr);
+ EXPECT_EQ(EncodeNumberStatus::kSuccess, rc);
+
+ // Overflow
+ rc =
+ ParseAndEncodeFloatingPointNumber("1e38", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: 1e38", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("-1e38", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: -1e38", err_msg);
+ rc =
+ ParseAndEncodeFloatingPointNumber("1e40", type, AssertEmitFunc, &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: 1e40", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("-1e40", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: -1e40", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("1e400", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: 1e400", err_msg);
+ rc = ParseAndEncodeFloatingPointNumber("-1e400", type, AssertEmitFunc,
+ &err_msg);
+ EXPECT_EQ(EncodeNumberStatus::kInvalidText, rc);
+ EXPECT_EQ("Invalid E5M2 float literal: -1e400", err_msg);
+}
+
TEST(ParseAndEncodeFloatingPointNumber, TypeNone) {
EncodeNumberStatus rc = EncodeNumberStatus::kSuccess;
std::string err_msg;
diff --git a/third_party/SPIRV-Tools/test/reduce/CMakeLists.txt b/third_party/SPIRV-Tools/test/reduce/CMakeLists.txt
index 121cd4f..d3eaa84 100644
--- a/third_party/SPIRV-Tools/test/reduce/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/test/reduce/CMakeLists.txt
@@ -31,6 +31,7 @@
structured_construct_to_block_test.cpp
structured_loop_to_selection_test.cpp
validation_during_reduction_test.cpp
+ ${spirv-tools_SOURCE_DIR}/tools/io.cpp
LIBS SPIRV-Tools-reduce
)
diff --git a/third_party/SPIRV-Tools/test/string_utils_test.cpp b/third_party/SPIRV-Tools/test/string_utils_test.cpp
index 5851415..b4ce29f 100644
--- a/third_party/SPIRV-Tools/test/string_utils_test.cpp
+++ b/third_party/SPIRV-Tools/test/string_utils_test.cpp
@@ -12,10 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <string>
-
-#include "gtest/gtest.h"
#include "source/util/string_utils.h"
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "source/util/small_vector.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
@@ -186,6 +189,50 @@
EXPECT_EQ("1225th", CardinalToOrdinal(1225));
}
+using MakeVectorMakeStringRoundTripTest = ::testing::TestWithParam<std::string>;
+
+TEST_P(MakeVectorMakeStringRoundTripTest, ViaStdVector) {
+ const std::string str = GetParam();
+ const auto& vec = MakeVector<std::vector<uint32_t>>(str);
+ // Allow for the terminating null byte that must be present.
+ const auto expected_vec_len = (str.size() + 4) / 4;
+ EXPECT_EQ(vec.size(), expected_vec_len);
+ const std::string back_to_string = MakeString(vec);
+ EXPECT_EQ(str, back_to_string);
+}
+
+TEST_P(MakeVectorMakeStringRoundTripTest, ViaSmallVector1) {
+ const std::string str = GetParam();
+ // Allow for the terminating null byte that must be present.
+ const auto expected_vec_len = (str.size() + 4) / 4;
+ const auto& vec = MakeVector<spvtools::utils::SmallVector<uint32_t, 1>>(str);
+ EXPECT_EQ(vec.size(), expected_vec_len);
+ const std::string back_to_string = MakeString(vec);
+ EXPECT_EQ(str, back_to_string);
+}
+
+TEST_P(MakeVectorMakeStringRoundTripTest, ViaSmallVector100) {
+ const std::string str = GetParam();
+ // Allow for the terminating null byte that must be present.
+ const auto expected_vec_len = (str.size() + 4) / 4;
+ const auto& vec =
+ MakeVector<spvtools::utils::SmallVector<uint32_t, 100>>(str);
+ EXPECT_EQ(vec.size(), expected_vec_len);
+ const std::string back_to_string = MakeString(vec);
+ EXPECT_EQ(str, back_to_string);
+}
+
+INSTANTIATE_TEST_SUITE_P(Examples, MakeVectorMakeStringRoundTripTest,
+ testing::ValuesIn(std::vector<std::string>{
+ "",
+ "a",
+ "bc",
+ "def",
+ "ghij",
+ "klmno",
+ "dustclouds disappear without a trace",
+ }));
+
} // namespace
} // namespace utils
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/target_env_test.cpp b/third_party/SPIRV-Tools/test/target_env_test.cpp
index 7917cbf..05898df 100644
--- a/third_party/SPIRV-Tools/test/target_env_test.cpp
+++ b/third_party/SPIRV-Tools/test/target_env_test.cpp
@@ -79,9 +79,16 @@
{"spv1.1", true, SPV_ENV_UNIVERSAL_1_1},
{"spv1.2", true, SPV_ENV_UNIVERSAL_1_2},
{"spv1.3", true, SPV_ENV_UNIVERSAL_1_3},
+ {"spv1.4", true, SPV_ENV_UNIVERSAL_1_4},
+ {"spv1.5", true, SPV_ENV_UNIVERSAL_1_5},
+ {"spv1.6", true, SPV_ENV_UNIVERSAL_1_6},
+ {"spv1.7", false, SPV_ENV_UNIVERSAL_1_3},
{"vulkan1.0", true, SPV_ENV_VULKAN_1_0},
{"vulkan1.1", true, SPV_ENV_VULKAN_1_1},
{"vulkan1.2", true, SPV_ENV_VULKAN_1_2},
+ {"vulkan1.3", true, SPV_ENV_VULKAN_1_3},
+ {"vulkan1.4", true, SPV_ENV_VULKAN_1_4},
+ {"vulkan1.5", false, SPV_ENV_UNIVERSAL_1_0},
{"opencl2.1", true, SPV_ENV_OPENCL_2_1},
{"opencl2.2", true, SPV_ENV_OPENCL_2_2},
{"opengl4.0", true, SPV_ENV_OPENGL_4_0},
@@ -170,5 +177,61 @@
{VK(99, 0), SPV(1, 0), false, SPV_ENV_UNIVERSAL_1_0},
}));
-} // namespace
+// A test case for parsing the text header of disassembly.
+struct ParseEnvInDisassemblyCase {
+ std::string text;
+ bool success; // Expect to successfully parse?
+ spv_target_env env; // The parsed environment, if successful.
+};
+
+using TargetParseEnvInDisassemblyTest =
+ ::testing::TestWithParam<ParseEnvInDisassemblyCase>;
+
+constexpr spv_target_env kSentinelEnv = SPV_ENV_OPENCL_2_2;
+
+TEST_P(TargetParseEnvInDisassemblyTest, Samples) {
+ const std::string& text = GetParam().text;
+ const std::vector<char> text_vec(text.begin(), text.end());
+ spv_target_env got_env = kSentinelEnv;
+ bool parsed = spvReadEnvironmentFromText(text_vec, &got_env);
+ EXPECT_EQ(parsed, GetParam().success);
+ EXPECT_EQ(got_env, GetParam().env) << '"' << text << '"';
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ TargetTextParsing, TargetParseEnvInDisassemblyTest,
+ ValuesIn(std::vector<ParseEnvInDisassemblyCase>{
+ {"; Version: 1.0", true, SPV_ENV_UNIVERSAL_1_0},
+ {"; Version: 1.1", true, SPV_ENV_UNIVERSAL_1_1},
+ {"; Version: 1.2", true, SPV_ENV_UNIVERSAL_1_2},
+ {"; Version: 1.3", true, SPV_ENV_UNIVERSAL_1_3},
+ {"; Version: 1.4", true, SPV_ENV_UNIVERSAL_1_4},
+ {"; Version: 1.5", true, SPV_ENV_UNIVERSAL_1_5},
+ {"; Version: 1.6", true, SPV_ENV_UNIVERSAL_1_6},
+ {"; Version: 1.7", false, kSentinelEnv},
+ {"; Version: 1.8", false, kSentinelEnv},
+ {"; Version: 1.9", false, kSentinelEnv},
+ {"; Version: 2.0", false, kSentinelEnv},
+
+ // Check trailing text
+ {"; Version: 1.1\n", true, SPV_ENV_UNIVERSAL_1_1},
+ {"; Version: 1.1\t", true, SPV_ENV_UNIVERSAL_1_1},
+ {"; Version: 1.1 ", true, SPV_ENV_UNIVERSAL_1_1},
+ {"; Version: 1.1x", true, SPV_ENV_UNIVERSAL_1_1},
+ // Not a digit.
+ {"; Version: 1.10", false, kSentinelEnv},
+
+ // Unexpected prefix
+ {";Version: 1.1", false, kSentinelEnv},
+
+ // Leading spaces
+ {" \t ; Version: 1.1", true, SPV_ENV_UNIVERSAL_1_1},
+ // Previous lines
+ {"; SPIR-V\n; Version: 1.1", true, SPV_ENV_UNIVERSAL_1_1},
+ {"; -\n; SPIR-V\n; Version: 1.1", true, SPV_ENV_UNIVERSAL_1_1},
+
+ // After a non-header line
+ {"OpCapability Shader\n; Version: 1.1", false, kSentinelEnv}}));
+
+} // anonymous namespace
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/test_fixture.h b/third_party/SPIRV-Tools/test/test_fixture.h
index 029fc85..424f5ee 100644
--- a/third_party/SPIRV-Tools/test/test_fixture.h
+++ b/third_party/SPIRV-Tools/test/test_fixture.h
@@ -111,13 +111,15 @@
std::string EncodeAndDecodeSuccessfully(
const std::string& txt,
uint32_t disassemble_options = SPV_BINARY_TO_TEXT_OPTION_NONE,
+ uint32_t assemble_options = SPV_TEXT_TO_BINARY_OPTION_NONE,
spv_target_env env = SPV_ENV_UNIVERSAL_1_0, bool flip_words = false) {
DestroyBinary();
DestroyDiagnostic();
ScopedContext context(env);
disassemble_options |= SPV_BINARY_TO_TEXT_OPTION_NO_HEADER;
- spv_result_t error = spvTextToBinary(context.context, txt.c_str(),
- txt.size(), &binary, &diagnostic);
+ spv_result_t error =
+ spvTextToBinaryWithOptions(context.context, txt.c_str(), txt.size(),
+ assemble_options, &binary, &diagnostic);
if (error) {
spvDiagnosticPrint(diagnostic);
spvDiagnosticDestroy(diagnostic);
diff --git a/third_party/SPIRV-Tools/test/text_to_binary.annotation_test.cpp b/third_party/SPIRV-Tools/test/text_to_binary.annotation_test.cpp
index 826812b..edf886f 100644
--- a/third_party/SPIRV-Tools/test/text_to_binary.annotation_test.cpp
+++ b/third_party/SPIRV-Tools/test/text_to_binary.annotation_test.cpp
@@ -55,10 +55,10 @@
{1, uint32_t(std::get<1>(GetParam()).value())},
std::get<1>(GetParam()).operands())));
// Also check disassembly.
- EXPECT_THAT(
- EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE,
- std::get<0>(GetParam())),
- Eq(input.str()));
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE, std::get<0>(GetParam())),
+ Eq(input.str()));
}
// Like above, but parameters to the decoration are IDs.
@@ -78,10 +78,10 @@
{1, uint32_t(std::get<1>(GetParam()).value())},
std::get<1>(GetParam()).operands())));
// Also check disassembly.
- EXPECT_THAT(
- EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE,
- std::get<0>(GetParam())),
- Eq(input.str()));
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE, std::get<0>(GetParam())),
+ Eq(input.str()));
}
#define CASE(NAME) spv::Decoration::NAME, #NAME
@@ -460,10 +460,10 @@
{1, 42, uint32_t(std::get<1>(GetParam()).value())},
std::get<1>(GetParam()).operands())));
// Also check disassembly.
- EXPECT_THAT(
- EncodeAndDecodeSuccessfully(input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE,
- std::get<0>(GetParam())),
- Eq(input.str()));
+ EXPECT_THAT(EncodeAndDecodeSuccessfully(
+ input.str(), SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE, std::get<0>(GetParam())),
+ Eq(input.str()));
}
#define CASE(NAME) spv::Decoration::NAME, #NAME
diff --git a/third_party/SPIRV-Tools/test/text_to_binary.composite_test.cpp b/third_party/SPIRV-Tools/test/text_to_binary.composite_test.cpp
index 6ae1cd3..2f255ac 100644
--- a/third_party/SPIRV-Tools/test/text_to_binary.composite_test.cpp
+++ b/third_party/SPIRV-Tools/test/text_to_binary.composite_test.cpp
@@ -35,7 +35,8 @@
TEST_F(CompositeRoundTripTest, Good) {
std::string spirv = "%2 = OpCopyLogical %1 %3\n";
std::string disassembly = EncodeAndDecodeSuccessfully(
- spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_ENV_UNIVERSAL_1_4);
+ spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_TEXT_TO_BINARY_OPTION_NONE,
+ SPV_ENV_UNIVERSAL_1_4);
EXPECT_THAT(disassembly, Eq(spirv));
}
diff --git a/third_party/SPIRV-Tools/test/text_to_binary.extension_test.cpp b/third_party/SPIRV-Tools/test/text_to_binary.extension_test.cpp
index 8e78312..39accfc 100644
--- a/third_party/SPIRV-Tools/test/text_to_binary.extension_test.cpp
+++ b/third_party/SPIRV-Tools/test/text_to_binary.extension_test.cpp
@@ -70,9 +70,15 @@
Eq("Import Id is being defined a second time"));
}
-TEST_F(TextToBinaryTest, TooManyArguments) {
+TEST_F(TextToBinaryTest, TooManyArgumentsIdEqualQuote) {
const std::string input = R"(%opencl = OpExtInstImport "OpenCL.std"
- %2 = OpExtInst %float %opencl cos %x %oops")";
+ %2 = OpExtInst %float %opencl cos %x %oops=")";
+ EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream."));
+}
+
+TEST_F(TextToBinaryTest, TooManyArgumentsIdEqual) {
+ const std::string input = R"(%opencl = OpExtInstImport "OpenCL.std"
+ %2 = OpExtInst %float %opencl cos %x %oops=)";
EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream."));
}
@@ -130,9 +136,10 @@
EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected));
// Check round trip through the disassembler.
- EXPECT_THAT(EncodeAndDecodeSuccessfully(ac.input,
- SPV_BINARY_TO_TEXT_OPTION_NONE, env),
- Eq(ac.input))
+ EXPECT_THAT(
+ EncodeAndDecodeSuccessfully(ac.input, SPV_BINARY_TO_TEXT_OPTION_NONE,
+ SPV_TEXT_TO_BINARY_OPTION_NONE, env),
+ Eq(ac.input))
<< "target env: " << spvTargetEnvDescription(env) << "\n";
}
@@ -1300,5 +1307,266 @@
(uint32_t)spv::FPFastMathModeMask::AllowTransform})},
})));
+// SPV_EXT_replicated_composites
+
+INSTANTIATE_TEST_SUITE_P(
+ SPV_EXT_replicated_composites, ExtensionRoundTripTest,
+ Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_6,
+ SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2,
+ SPV_ENV_VULKAN_1_3, SPV_ENV_OPENCL_2_1),
+ ValuesIn(std::vector<AssemblyCase>{
+ {"OpExtension \"SPV_EXT_replicated_composites\"\n",
+ MakeInstruction(spv::Op::OpExtension,
+ MakeVector("SPV_EXT_replicated_composites"))},
+ {"OpCapability ReplicatedCompositesEXT\n",
+ MakeInstruction(
+ spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::ReplicatedCompositesEXT})},
+ {"%2 = OpConstantCompositeReplicateEXT %1 %3\n",
+ MakeInstruction(spv::Op::OpConstantCompositeReplicateEXT,
+ {1, 2, 3})},
+ {"%2 = OpSpecConstantCompositeReplicateEXT %1 %3\n",
+ MakeInstruction(spv::Op::OpSpecConstantCompositeReplicateEXT,
+ {1, 2, 3})},
+ {"%2 = OpCompositeConstructReplicateEXT %1 %3\n",
+ MakeInstruction(spv::Op::OpCompositeConstructReplicateEXT,
+ {1, 2, 3})},
+ })));
+
+// SPV_KHR_untyped_pointers
+INSTANTIATE_TEST_SUITE_P(
+ SPV_KHR_untyped_pointers, ExtensionRoundTripTest,
+ Combine(
+ Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0,
+ SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2),
+ ValuesIn(std::vector<AssemblyCase>{
+ {"OpExtension \"SPV_KHR_untyped_pointers\"\n",
+ MakeInstruction(spv::Op::OpExtension,
+ MakeVector("SPV_KHR_untyped_pointers"))},
+ {"OpCapability UntypedPointersKHR\n",
+ MakeInstruction(spv::Op::OpCapability,
+ {(int)spv::Capability::UntypedPointersKHR})},
+ {"OpCapability UntypedPointersKHR\n",
+ MakeInstruction(spv::Op::OpCapability, {4473})},
+ {"%1 = OpTypeUntypedPointerKHR Workgroup\n",
+ MakeInstruction(spv::Op::OpTypeUntypedPointerKHR,
+ {1, int(spv::StorageClass::Workgroup)})},
+ {"%2 = OpUntypedVariableKHR %1 Workgroup %3\n",
+ MakeInstruction(spv::Op::OpUntypedVariableKHR,
+ {1, 2, int(spv::StorageClass::Workgroup), 3})},
+ {"%2 = OpUntypedVariableKHR %1 Workgroup %3 %4\n",
+ MakeInstruction(spv::Op::OpUntypedVariableKHR,
+ {1, 2, int(spv::StorageClass::Workgroup), 3, 4})},
+ {"%2 = OpUntypedAccessChainKHR %1 %3 %4\n",
+ MakeInstruction(spv::Op::OpUntypedAccessChainKHR, {1, 2, 3, 4})},
+ {"%2 = OpUntypedAccessChainKHR %1 %3 %4 %5 %6 %7\n",
+ MakeInstruction(spv::Op::OpUntypedAccessChainKHR,
+ {1, 2, 3, 4, 5, 6, 7})},
+ {"%2 = OpUntypedInBoundsAccessChainKHR %1 %3 %4\n",
+ MakeInstruction(spv::Op::OpUntypedInBoundsAccessChainKHR,
+ {1, 2, 3, 4})},
+ {"%2 = OpUntypedInBoundsAccessChainKHR %1 %3 %4 %5 %6 %7\n",
+ MakeInstruction(spv::Op::OpUntypedInBoundsAccessChainKHR,
+ {1, 2, 3, 4, 5, 6, 7})},
+ {"%2 = OpUntypedPtrAccessChainKHR %1 %3 %4 %5\n",
+ MakeInstruction(spv::Op::OpUntypedPtrAccessChainKHR,
+ {1, 2, 3, 4, 5})},
+ {"%2 = OpUntypedPtrAccessChainKHR %1 %3 %4 %5 %6 %7\n",
+ MakeInstruction(spv::Op::OpUntypedPtrAccessChainKHR,
+ {1, 2, 3, 4, 5, 6, 7})},
+ {"%2 = OpUntypedInBoundsPtrAccessChainKHR %1 %3 %4 %5\n",
+ MakeInstruction(spv::Op::OpUntypedInBoundsPtrAccessChainKHR,
+ {1, 2, 3, 4, 5})},
+ {"%2 = OpUntypedInBoundsPtrAccessChainKHR %1 %3 %4 %5 %6 %7\n",
+ MakeInstruction(spv::Op::OpUntypedInBoundsPtrAccessChainKHR,
+ {1, 2, 3, 4, 5, 6, 7})},
+ })));
+
+// SPV_ARM_tensors
+INSTANTIATE_TEST_SUITE_P(
+ SPV_ARM_tensors, ExtensionRoundTripTest,
+ Combine(
+ Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_0,
+ SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3,
+ SPV_ENV_OPENCL_2_1),
+ ValuesIn(std::vector<AssemblyCase>{
+ {"OpExtension \"SPV_ARM_tensors\"\n",
+ MakeInstruction(spv::Op::OpExtension,
+ MakeVector("SPV_ARM_tensors"))},
+ {"OpCapability TensorsARM\n",
+ MakeInstruction(spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::TensorsARM})},
+ {"OpCapability StorageTensorArrayDynamicIndexingARM\n",
+ MakeInstruction(
+ spv::Op::OpCapability,
+ {(uint32_t)
+ spv::Capability::StorageTensorArrayDynamicIndexingARM})},
+ {"OpCapability StorageTensorArrayNonUniformIndexingARM\n",
+ MakeInstruction(spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::
+ StorageTensorArrayNonUniformIndexingARM})},
+ {"%1 = OpTypeTensorARM %2\n",
+ MakeInstruction(spv::Op::OpTypeTensorARM, {1, 2})},
+ {"%1 = OpTypeTensorARM %2 %3\n",
+ MakeInstruction(spv::Op::OpTypeTensorARM, {1, 2, 3})},
+ {"%1 = OpTypeTensorARM %2 %3 %4\n",
+ MakeInstruction(spv::Op::OpTypeTensorARM, {1, 2, 3, 4})},
+ {"%2 = OpTensorReadARM %1 %3 %4\n",
+ MakeInstruction(spv::Op::OpTensorReadARM, {1, 2, 3, 4})},
+ {"%2 = OpTensorReadARM %1 %3 %4 NoneARM\n",
+ MakeInstruction(spv::Op::OpTensorReadARM,
+ {1, 2, 3, 4,
+ (uint32_t)spv::TensorOperandsMask::MaskNone})},
+ {"%2 = OpTensorReadARM %1 %3 %4 NontemporalARM\n",
+ MakeInstruction(
+ spv::Op::OpTensorReadARM,
+ {1, 2, 3, 4,
+ (uint32_t)spv::TensorOperandsMask::NontemporalARM})},
+ {"%2 = OpTensorReadARM %1 %3 %4 OutOfBoundsValueARM %5\n",
+ MakeInstruction(
+ spv::Op::OpTensorReadARM,
+ {1, 2, 3, 4,
+ (uint32_t)spv::TensorOperandsMask::OutOfBoundsValueARM, 5})},
+ {"%2 = OpTensorReadARM %1 %3 %4 MakeElementVisibleARM %5\n",
+ MakeInstruction(
+ spv::Op::OpTensorReadARM,
+ {1, 2, 3, 4,
+ (uint32_t)spv::TensorOperandsMask::MakeElementVisibleARM,
+ 5})},
+ {"%2 = OpTensorReadARM %1 %3 %4 NonPrivateElementARM\n",
+ MakeInstruction(
+ spv::Op::OpTensorReadARM,
+ {1, 2, 3, 4,
+ (uint32_t)spv::TensorOperandsMask::NonPrivateElementARM})},
+ {"OpTensorWriteARM %1 %2 %3\n",
+ MakeInstruction(spv::Op::OpTensorWriteARM, {1, 2, 3})},
+ {"OpTensorWriteARM %1 %2 %3 NoneARM\n",
+ MakeInstruction(spv::Op::OpTensorWriteARM,
+ {1, 2, 3,
+ (uint32_t)spv::TensorOperandsMask::MaskNone})},
+ {"OpTensorWriteARM %1 %2 %3 NontemporalARM\n",
+ MakeInstruction(
+ spv::Op::OpTensorWriteARM,
+ {1, 2, 3, (uint32_t)spv::TensorOperandsMask::NontemporalARM})},
+ {"OpTensorWriteARM %1 %2 %3 MakeElementAvailableARM %4\n",
+ MakeInstruction(
+ spv::Op::OpTensorWriteARM,
+ {1, 2, 3,
+ (uint32_t)spv::TensorOperandsMask::MakeElementAvailableARM,
+ 4})},
+ {"OpTensorWriteARM %1 %2 %3 NonPrivateElementARM\n",
+ MakeInstruction(
+ spv::Op::OpTensorWriteARM,
+ {1, 2, 3,
+ (uint32_t)spv::TensorOperandsMask::NonPrivateElementARM})},
+ {"%2 = OpTensorQuerySizeARM %1 %3 %4\n",
+ MakeInstruction(spv::Op::OpTensorQuerySizeARM, {1, 2, 3, 4})},
+ })));
+
+// SPV_EXT_float8
+INSTANTIATE_TEST_SUITE_P(
+ SPV_EXT_float8, ExtensionRoundTripTest,
+ Combine(
+ Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_0,
+ SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3,
+ SPV_ENV_OPENCL_2_1),
+ ValuesIn(std::vector<AssemblyCase>{
+ {"OpExtension \"SPV_EXT_float8\"\n",
+ MakeInstruction(spv::Op::OpExtension,
+ MakeVector("SPV_EXT_float8"))},
+ {"OpCapability Float8EXT\n",
+ MakeInstruction(spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::Float8EXT})},
+ {"OpCapability Float8CooperativeMatrixEXT\n",
+ MakeInstruction(
+ spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::Float8CooperativeMatrixEXT})},
+ {"%1 = OpTypeFloat 8 Float8E4M3EXT\n",
+ MakeInstruction(spv::Op::OpTypeFloat,
+ {1, 8, (uint32_t)spv::FPEncoding::Float8E4M3EXT})},
+ {"%1 = OpTypeFloat 8 Float8E5M2EXT\n",
+ MakeInstruction(spv::Op::OpTypeFloat,
+ {1, 8, (uint32_t)spv::FPEncoding::Float8E5M2EXT})},
+ {"OpDecorate %1 SaturatedToLargestFloat8NormalConversionEXT\n",
+ MakeInstruction(
+ spv::Op::OpDecorate,
+ {1,
+ uint32_t(spv::Decoration::
+ SaturatedToLargestFloat8NormalConversionEXT)})},
+ })));
+
+// SPV_INTEL_function_variants
+// https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_function_variants.asciidoc
+INSTANTIATE_TEST_SUITE_P(
+ SPV_INTEL_function_variants, ExtensionRoundTripTest,
+ Combine(
+ Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_6),
+ ValuesIn(std::vector<AssemblyCase>{
+ {"OpExtension \"SPV_INTEL_function_variants\"\n",
+ MakeInstruction(spv::Op::OpExtension,
+ MakeVector("SPV_INTEL_function_variants"))},
+ {"OpCapability SpecConditionalINTEL\n",
+ MakeInstruction(
+ spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::SpecConditionalINTEL})},
+ {"OpCapability FunctionVariantsINTEL\n",
+ MakeInstruction(
+ spv::Op::OpCapability,
+ {(uint32_t)spv::Capability::FunctionVariantsINTEL})},
+ {"OpDecorate %1 ConditionalINTEL %2\n",
+ MakeInstruction(spv::Op::OpDecorate,
+ {1, (uint32_t)spv::Decoration::ConditionalINTEL,
+ 2})},
+
+ {"OpConditionalExtensionINTEL %1 \"foo\"\n",
+ MakeInstruction(spv::Op::OpConditionalExtensionINTEL, {1},
+ MakeVector("foo"))},
+
+ {"OpConditionalEntryPointINTEL %1 Kernel %2 \"foo\"\n",
+ MakeInstruction(spv::Op::OpConditionalEntryPointINTEL,
+ {1, (uint32_t)spv::ExecutionModel::Kernel, 2},
+ MakeVector("foo"))},
+
+ {"OpConditionalCapabilityINTEL %1 Kernel\n",
+ MakeInstruction(spv::Op::OpConditionalCapabilityINTEL,
+ {1, (uint32_t)spv::ExecutionModel::Kernel})},
+
+ {"%2 = OpSpecConstantTargetINTEL %1 42\n",
+ MakeInstruction(spv::Op::OpSpecConstantTargetINTEL, {1, 2, 42})},
+
+ {"%2 = OpSpecConstantTargetINTEL %1 42 99\n",
+ MakeInstruction(spv::Op::OpSpecConstantTargetINTEL,
+ {1, 2, 42, 99})},
+
+ {"%2 = OpSpecConstantTargetINTEL %1 42 99 108\n",
+ MakeInstruction(spv::Op::OpSpecConstantTargetINTEL,
+ {1, 2, 42, 99, 108})},
+
+ {"%2 = OpSpecConstantArchitectureINTEL %1 42 99 108 72\n",
+ MakeInstruction(spv::Op::OpSpecConstantArchitectureINTEL,
+ {1, 2, 42, 99, 108, 72})},
+
+ {"%2 = OpSpecConstantCapabilitiesINTEL %1\n",
+ MakeInstruction(spv::Op::OpSpecConstantCapabilitiesINTEL, {1, 2})},
+
+ {"%2 = OpSpecConstantCapabilitiesINTEL %1 Kernel\n",
+ MakeInstruction(spv::Op::OpSpecConstantCapabilitiesINTEL,
+ {1, 2, (uint32_t)spv::Capability::Kernel})},
+
+ {"%2 = OpSpecConstantCapabilitiesINTEL %1 Kernel Shader\n",
+ MakeInstruction(spv::Op::OpSpecConstantCapabilitiesINTEL,
+ {1, 2, (uint32_t)spv::Capability::Kernel,
+ (uint32_t)spv::Capability::Shader})},
+
+ {"%2 = OpConditionalCopyObjectINTEL %1 %3 %4\n",
+ MakeInstruction(spv::Op::OpConditionalCopyObjectINTEL,
+ {1, 2, 3, 4})},
+
+ {"%2 = OpConditionalCopyObjectINTEL %1 %3 %4 %5 %6\n",
+ MakeInstruction(spv::Op::OpConditionalCopyObjectINTEL,
+ {1, 2, 3, 4, 5, 6})},
+
+ })));
+
} // namespace
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/text_to_binary.memory_test.cpp b/third_party/SPIRV-Tools/test/text_to_binary.memory_test.cpp
index 629ab66..43523d1 100644
--- a/third_party/SPIRV-Tools/test/text_to_binary.memory_test.cpp
+++ b/third_party/SPIRV-Tools/test/text_to_binary.memory_test.cpp
@@ -107,7 +107,8 @@
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_4),
Eq(MakeInstruction(spv::Op::OpPtrEqual, {1, 2, 3, 4})));
std::string disassembly = EncodeAndDecodeSuccessfully(
- spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_ENV_UNIVERSAL_1_4);
+ spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_TEXT_TO_BINARY_OPTION_NONE,
+ SPV_ENV_UNIVERSAL_1_4);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -124,7 +125,8 @@
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_4),
Eq(MakeInstruction(spv::Op::OpPtrNotEqual, {1, 2, 3, 4})));
std::string disassembly = EncodeAndDecodeSuccessfully(
- spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_ENV_UNIVERSAL_1_4);
+ spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_TEXT_TO_BINARY_OPTION_NONE,
+ SPV_ENV_UNIVERSAL_1_4);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -141,7 +143,8 @@
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_4),
Eq(MakeInstruction(spv::Op::OpPtrDiff, {1, 2, 3, 4})));
std::string disassembly = EncodeAndDecodeSuccessfully(
- spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_ENV_UNIVERSAL_1_4);
+ spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_TEXT_TO_BINARY_OPTION_NONE,
+ SPV_ENV_UNIVERSAL_1_4);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -151,7 +154,8 @@
// write tests.
std::string spirv = "%2 = OpPtrDiff %1 %3 %4\n";
std::string disassembly = EncodeAndDecodeSuccessfully(
- spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_ENV_UNIVERSAL_1_4);
+ spirv, SPV_BINARY_TO_TEXT_OPTION_NONE, SPV_TEXT_TO_BINARY_OPTION_NONE,
+ SPV_ENV_UNIVERSAL_1_4);
}
// OpCopyMemory
@@ -160,8 +164,7 @@
std::string spirv = "OpCopyMemory %1 %2\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -182,8 +185,7 @@
std::string spirv = "OpCopyMemory %1 %2 None\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 0})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -191,8 +193,7 @@
std::string spirv = "OpCopyMemory %1 %2 Volatile\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 1})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -200,8 +201,7 @@
std::string spirv = "OpCopyMemory %1 %2 Aligned 8\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 2, 8})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -209,8 +209,7 @@
std::string spirv = "OpCopyMemory %1 %2 Nontemporal\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 4})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -218,8 +217,7 @@
std::string spirv = "OpCopyMemory %1 %2 MakePointerAvailable %3\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 8, 3})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -227,8 +225,7 @@
std::string spirv = "OpCopyMemory %1 %2 MakePointerVisible %3\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 16, 3})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -236,8 +233,7 @@
std::string spirv = "OpCopyMemory %1 %2 NonPrivatePointer\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 32})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -248,8 +244,7 @@
"MakePointerVisible|NonPrivatePointer 16 %3 %4\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 63, 16, 3, 4})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -258,8 +253,7 @@
// Note: This will assemble but should not validate for SPIR-V 1.3
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_3),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 1, 1})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -267,8 +261,7 @@
std::string spirv = "OpCopyMemory %1 %2 Volatile Volatile\n";
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_4),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 1, 1})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -280,8 +273,7 @@
EXPECT_THAT(
CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemory, {1, 2, 21, 3, 42, 16, 4})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -291,8 +283,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -313,8 +304,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 None\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 0})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -322,8 +312,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 Volatile\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 1})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -331,8 +320,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 Aligned 8\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 2, 8})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -340,8 +328,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 Nontemporal\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 4})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -349,8 +336,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 MakePointerAvailable %4\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 8, 4})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -359,8 +345,7 @@
EXPECT_THAT(
CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 16, 4})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -368,8 +353,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 NonPrivatePointer\n";
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 32})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -381,8 +365,7 @@
EXPECT_THAT(
CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 63, 16, 4, 5})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -391,8 +374,7 @@
// Note: This will assemble but should not validate for SPIR-V 1.3
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_3),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 1, 1})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -400,8 +382,7 @@
std::string spirv = "OpCopyMemorySized %1 %2 %3 Volatile Volatile\n";
EXPECT_THAT(CompiledInstructions(spirv, SPV_ENV_UNIVERSAL_1_4),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized, {1, 2, 3, 1, 1})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
@@ -413,8 +394,7 @@
EXPECT_THAT(CompiledInstructions(spirv),
Eq(MakeInstruction(spv::Op::OpCopyMemorySized,
{1, 2, 3, 21, 4, 42, 16, 5})));
- std::string disassembly =
- EncodeAndDecodeSuccessfully(spirv, SPV_BINARY_TO_TEXT_OPTION_NONE);
+ std::string disassembly = EncodeAndDecodeSuccessfully(spirv);
EXPECT_THAT(disassembly, Eq(spirv));
}
diff --git a/third_party/SPIRV-Tools/source/enum_string_mapping.cpp b/third_party/SPIRV-Tools/test/to_string_test.cpp
similarity index 61%
copy from third_party/SPIRV-Tools/source/enum_string_mapping.cpp
copy to third_party/SPIRV-Tools/test/to_string_test.cpp
index 32361a0..5973318 100644
--- a/third_party/SPIRV-Tools/source/enum_string_mapping.cpp
+++ b/third_party/SPIRV-Tools/test/to_string_test.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017 Google Inc.
+// Copyright (c) 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,18 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "source/enum_string_mapping.h"
+#include "source/to_string.h"
-#include <algorithm>
-#include <cassert>
-#include <cstring>
-#include <string>
-#include <unordered_map>
+#include "gmock/gmock.h"
-#include "source/extensions.h"
+namespace {
-namespace spvtools {
+TEST(ToString, Uint32) {
+ EXPECT_EQ(spvtools::to_string(0u), "0");
+ EXPECT_EQ(spvtools::to_string(1u), "1");
+ EXPECT_EQ(spvtools::to_string(1234567890u), "1234567890");
+ EXPECT_EQ(spvtools::to_string(0xffffffffu), "4294967295");
+}
-#include "enum_string_mapping.inc"
-
-} // namespace spvtools
+} // namespace
diff --git a/third_party/SPIRV-Tools/test/tools/opt/flags.py b/third_party/SPIRV-Tools/test/tools/opt/flags.py
index 52a43c5..5f56e1d 100644
--- a/third_party/SPIRV-Tools/test/tools/opt/flags.py
+++ b/third_party/SPIRV-Tools/test/tools/opt/flags.py
@@ -113,7 +113,7 @@
'remove-duplicates',
'replace-invalid-opcode',
'ssa-rewrite',
- 'scalar-replacement=100',
+ 'scalar-replacement=0',
'scalar-replacement=42',
'strength-reduction',
'strip-debug',
@@ -148,7 +148,7 @@
'eliminate-local-single-block',
'eliminate-local-single-store',
'eliminate-dead-code-aggressive',
- 'scalar-replacement=100',
+ 'scalar-replacement=0',
'convert-local-access-chains',
'eliminate-local-single-block',
'eliminate-local-single-store',
@@ -162,7 +162,7 @@
'redundancy-elimination',
'combine-access-chains',
'simplify-instructions',
- 'scalar-replacement=100',
+ 'scalar-replacement=0',
'convert-local-access-chains',
'eliminate-local-single-block',
'eliminate-local-single-store',
diff --git a/third_party/SPIRV-Tools/test/util/CMakeLists.txt b/third_party/SPIRV-Tools/test/util/CMakeLists.txt
index 20038f7..c5cbc17 100644
--- a/third_party/SPIRV-Tools/test/util/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/test/util/CMakeLists.txt
@@ -17,6 +17,8 @@
bit_vector_test.cpp
bitutils_test.cpp
hash_combine_test.cpp
+ index_range_test.cpp
small_vector_test.cpp
+ span_test.cpp
LIBS SPIRV-Tools-opt
)
diff --git a/third_party/SPIRV-Tools/test/util/bitutils_test.cpp b/third_party/SPIRV-Tools/test/util/bitutils_test.cpp
index 3be7ed2..aea7897 100644
--- a/third_party/SPIRV-Tools/test/util/bitutils_test.cpp
+++ b/third_party/SPIRV-Tools/test/util/bitutils_test.cpp
@@ -188,6 +188,46 @@
EXPECT_TRUE(IsBitAtPositionSet(max_u64, i));
}
}
+
+struct ExtendedValueTestCase {
+ uint32_t input;
+ uint32_t bit_width;
+ uint32_t expected_result;
+};
+
+using SignExtendedValueTest = ::testing::TestWithParam<ExtendedValueTestCase>;
+
+TEST_P(SignExtendedValueTest, SignExtendValue) {
+ const auto& tc = GetParam();
+ auto result = SignExtendValue(tc.input, tc.bit_width);
+ EXPECT_EQ(result, tc.expected_result);
+}
+INSTANTIATE_TEST_SUITE_P(
+ SignExtendValue, SignExtendedValueTest,
+ ::testing::Values(ExtendedValueTestCase{1, 1, 0xFFFFFFFF},
+ ExtendedValueTestCase{1, 2, 0x1},
+ ExtendedValueTestCase{2, 1, 0x0},
+ ExtendedValueTestCase{0x8, 4, 0xFFFFFFF8},
+ ExtendedValueTestCase{0x8765, 16, 0xFFFF8765},
+ ExtendedValueTestCase{0x7765, 16, 0x7765},
+ ExtendedValueTestCase{0xDEADBEEF, 32, 0xDEADBEEF}));
+
+using ZeroExtendedValueTest = ::testing::TestWithParam<ExtendedValueTestCase>;
+
+TEST_P(ZeroExtendedValueTest, ZeroExtendValue) {
+ const auto& tc = GetParam();
+ auto result = ZeroExtendValue(tc.input, tc.bit_width);
+ EXPECT_EQ(result, tc.expected_result);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ ZeroExtendValue, ZeroExtendedValueTest,
+ ::testing::Values(ExtendedValueTestCase{1, 1, 0x1},
+ ExtendedValueTestCase{1, 2, 0x1},
+ ExtendedValueTestCase{2, 1, 0x0},
+ ExtendedValueTestCase{0x8, 4, 0x8},
+ ExtendedValueTestCase{0xFF8765, 16, 0x8765},
+ ExtendedValueTestCase{0xDEADBEEF, 32, 0xDEADBEEF}));
} // namespace
} // namespace utils
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/util/index_range_test.cpp b/third_party/SPIRV-Tools/test/util/index_range_test.cpp
new file mode 100644
index 0000000..0ae3954
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/util/index_range_test.cpp
@@ -0,0 +1,79 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/util/index_range.h"
+
+#include "gmock/gmock.h"
+
+namespace spvtools {
+namespace utils {
+namespace {
+
+using IndexRangeTest = ::testing::Test;
+
+using ushort = unsigned short;
+
+TEST(IndexRangeTest, Initialize_Default) {
+ double sentinel_a = 0.0;
+ double sentinel_b = 1.0;
+ const IndexRange<double, unsigned, ushort> ir;
+
+ EXPECT_EQ(ir.first(), unsigned(0));
+ EXPECT_EQ(ir.count(), ushort(0));
+ EXPECT_TRUE(ir.empty());
+
+ auto span_null = ir.apply(nullptr);
+ EXPECT_EQ(span_null.data(), nullptr);
+ EXPECT_EQ(span_null.size(), 0);
+ EXPECT_TRUE(span_null.empty());
+
+ auto span_a = ir.apply(&sentinel_a);
+ EXPECT_EQ(span_a.data(), &sentinel_a);
+ EXPECT_EQ(span_a.size(), 0);
+ EXPECT_TRUE(span_a.empty());
+
+ auto span_b = ir.apply(&sentinel_b);
+ EXPECT_EQ(span_b.data(), &sentinel_b);
+ EXPECT_EQ(span_b.size(), 0);
+ EXPECT_TRUE(span_b.empty());
+}
+
+TEST(IndexRangeTest, Initialize_NonEmpty) {
+ const IndexRange<double, unsigned, ushort> ir(1, 2);
+
+ EXPECT_EQ(ir.first(), unsigned(1));
+ EXPECT_EQ(ir.count(), ushort(2));
+ EXPECT_FALSE(ir.empty());
+
+ auto span_null = ir.apply(nullptr);
+ EXPECT_EQ(span_null.data(), nullptr);
+ EXPECT_EQ(span_null.size(), 0);
+ EXPECT_TRUE(span_null.empty());
+
+ double arr[] = {0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0};
+
+ auto span_a = ir.apply(arr);
+ EXPECT_EQ(span_a.begin(), arr + 1);
+ EXPECT_EQ(span_a.end(), arr + 3);
+ EXPECT_FALSE(span_a.empty());
+
+ auto span_b = ir.apply(arr + 3);
+ EXPECT_EQ(span_b.begin(), arr + 4);
+ EXPECT_EQ(span_b.end(), arr + 6);
+ EXPECT_FALSE(span_a.empty());
+}
+
+} // namespace
+} // namespace utils
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/util/span_test.cpp b/third_party/SPIRV-Tools/test/util/span_test.cpp
new file mode 100644
index 0000000..cfffa7a
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/util/span_test.cpp
@@ -0,0 +1,223 @@
+// Copyright (c) 2025 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/util/span.h"
+
+#include "gmock/gmock.h"
+
+namespace spvtools {
+namespace utils {
+namespace {
+
+using SpanTest = ::testing::Test;
+
+TEST(SpanTest, Initialize_Default) {
+ const Span<int> s;
+
+ EXPECT_EQ(s.begin(), nullptr);
+ EXPECT_EQ(s.end(), nullptr);
+ EXPECT_EQ(s.cbegin(), nullptr);
+ EXPECT_EQ(s.cend(), nullptr);
+
+ EXPECT_EQ(s.size(), std::size_t(0));
+ EXPECT_EQ(s.size_bytes(), std::size_t(0));
+ EXPECT_TRUE(s.empty());
+
+ EXPECT_EQ(s.data(), nullptr);
+}
+
+TEST(SpanTest, Initialize_EmptySpan) {
+ int ints[3];
+ int* first = ints + 1;
+ const Span<int> s(first, 0);
+
+ EXPECT_EQ(s.begin(), first);
+ EXPECT_EQ(s.end(), first);
+ EXPECT_EQ(s.begin(), s.end());
+ EXPECT_EQ(s.cbegin(), first);
+ EXPECT_EQ(s.cend(), first);
+ EXPECT_EQ(s.cbegin(), s.cend());
+
+ EXPECT_EQ(s.size(), std::size_t(0));
+ EXPECT_EQ(s.size_bytes(), std::size_t(0));
+ EXPECT_TRUE(s.empty());
+
+ EXPECT_EQ(s.data(), first);
+}
+
+TEST(SpanTest, Initialize_NonemptySpan) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 3);
+
+ EXPECT_EQ(s.begin(), first);
+ EXPECT_EQ(s.end(), first + 3);
+ EXPECT_NE(s.begin(), s.end());
+ EXPECT_EQ(s.cbegin(), first);
+ EXPECT_EQ(s.cend(), first + 3);
+ EXPECT_NE(s.cbegin(), s.cend());
+
+ EXPECT_EQ(s.size(), std::size_t(3));
+ EXPECT_EQ(s.size_bytes(), 3 * sizeof(int));
+ EXPECT_FALSE(s.empty());
+
+ EXPECT_EQ(&(s.front()), first);
+ EXPECT_EQ(s.front(), 20);
+ EXPECT_EQ(&(s.back()), first + 2);
+ EXPECT_EQ(s.back(), 40);
+
+ EXPECT_EQ(s.data(), first);
+ EXPECT_EQ(&s[0], first);
+ EXPECT_EQ(s[0], 20);
+ EXPECT_EQ(&s[1], first + 1);
+ EXPECT_EQ(s[1], 30);
+ EXPECT_EQ(&s[2], first + 2);
+ EXPECT_EQ(s[2], 40);
+ EXPECT_EQ(&s[3], first + 3);
+ EXPECT_EQ(&s[3], s.end());
+}
+
+TEST(SpanTest, Initialize_NonemptySpan_Iterator_PostIncrement) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 3);
+
+ auto iter = s.begin();
+ EXPECT_NE(iter, s.end());
+ EXPECT_EQ(*iter++, 20);
+
+ EXPECT_NE(iter, s.end());
+ EXPECT_EQ(*iter++, 30);
+
+ EXPECT_NE(iter, s.end());
+ EXPECT_EQ(*iter++, 40);
+
+ EXPECT_EQ(iter, s.end());
+}
+
+TEST(SpanTest, Initialize_NonemptySpan_Iterator_PreIncrement) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 3);
+
+ auto iter = s.begin();
+ EXPECT_EQ(*++iter, 30);
+
+ EXPECT_NE(iter, s.end());
+ EXPECT_EQ(*++iter, 40);
+
+ EXPECT_EQ(++iter, s.end());
+}
+
+TEST(SpanTest, Initialize_NonemptySpan_Iterator_PostDecrement) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 3);
+
+ auto iter = s.end();
+ EXPECT_EQ(iter--, s.end());
+ EXPECT_EQ(*iter--, 40);
+
+ EXPECT_NE(iter, s.begin());
+ EXPECT_EQ(*iter--, 30);
+
+ EXPECT_EQ(iter, s.begin());
+ EXPECT_EQ(*iter--, 20);
+
+ EXPECT_NE(iter, s.begin());
+}
+
+TEST(SpanTest, Initialize_NonemptySpan_Iterator_PreDecrement) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 3);
+
+ auto iter = s.end();
+ EXPECT_EQ(*--iter, 40);
+
+ EXPECT_NE(iter, s.begin());
+ EXPECT_EQ(*--iter, 30);
+
+ EXPECT_NE(iter, s.begin());
+ EXPECT_EQ(*--iter, 20);
+
+ EXPECT_EQ(iter, s.begin());
+}
+
+TEST(SpanTest, Subspan_FromNil) {
+ const Span<int> snil(nullptr, 0);
+
+ const auto s0 = snil.subspan(0);
+ const auto s2 = snil.subspan(2);
+
+ EXPECT_EQ(s0.begin(), nullptr);
+ EXPECT_EQ(s0.end(), nullptr);
+ EXPECT_EQ(s0.size(), 0u);
+ EXPECT_TRUE(s0.empty());
+
+ EXPECT_EQ(s2.begin(), nullptr);
+ EXPECT_EQ(s2.end(), nullptr);
+ EXPECT_EQ(s2.size(), 0u);
+ EXPECT_TRUE(s2.empty());
+}
+
+TEST(SpanTest, Subspan_FromEmpty) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 0);
+
+ const auto s0 = s.subspan(0);
+ const auto s2 = s.subspan(2);
+
+ EXPECT_EQ(s0.begin(), nullptr);
+ EXPECT_EQ(s0.end(), nullptr);
+ EXPECT_EQ(s0.size(), 0u);
+ EXPECT_TRUE(s0.empty());
+
+ EXPECT_EQ(s2.begin(), nullptr);
+ EXPECT_EQ(s2.end(), nullptr);
+ EXPECT_EQ(s2.size(), 0u);
+ EXPECT_TRUE(s2.empty());
+}
+
+TEST(SpanTest, Subspan_FromNonEmpty) {
+ int ints[10] = {0, 10, 20, 30, 40, 50, 60};
+ int* first = ints + 2;
+ const Span<int> s(first, 3);
+
+ const auto s0 = s.subspan(0);
+ const auto s2 = s.subspan(2);
+ const auto s3 = s.subspan(3);
+ const auto s4 = s.subspan(4);
+
+ EXPECT_EQ(s0.begin(), s.begin());
+ EXPECT_EQ(s0.end(), s.end());
+ EXPECT_EQ(s0.size(), 3u);
+
+ EXPECT_EQ(s2.begin(), s.begin() + 2);
+ EXPECT_EQ(s2.end(), s.end());
+ EXPECT_EQ(s2.size(), 1u);
+
+ EXPECT_EQ(s3.begin(), nullptr);
+ EXPECT_EQ(s3.end(), nullptr);
+ EXPECT_EQ(s3.size(), 0u);
+
+ EXPECT_EQ(s4.begin(), nullptr);
+ EXPECT_EQ(s4.end(), nullptr);
+ EXPECT_EQ(s4.size(), 0u);
+}
+
+} // namespace
+} // namespace utils
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/CMakeLists.txt b/third_party/SPIRV-Tools/test/val/CMakeLists.txt
index 9d6f6ea..f003be9 100644
--- a/third_party/SPIRV-Tools/test/val/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/test/val/CMakeLists.txt
@@ -38,6 +38,7 @@
val_derivatives_test.cpp
val_entry_point_test.cpp
val_explicit_reserved_test.cpp
+ val_invalid_type_test.cpp
val_extensions_test.cpp
val_extension_spv_khr_expect_assume_test.cpp
val_extension_spv_khr_linkonce_odr_test.cpp
@@ -47,6 +48,7 @@
val_extension_spv_khr_terminate_invocation_test.cpp
val_extension_spv_khr_subgroup_rotate_test.cpp
val_extension_spv_nv_raw_access_chains.cpp
+ val_extension_spv_intel_inline_assembly.cpp
val_ext_inst_test.cpp
val_ext_inst_debug_test.cpp
${VAL_TEST_COMMON_SRCS}
@@ -99,6 +101,7 @@
val_ssa_test.cpp
val_state_test.cpp
val_storage_test.cpp
+ val_tensor_test.cpp
val_type_unique_test.cpp
val_validation_state_test.cpp
val_version_test.cpp
diff --git a/third_party/SPIRV-Tools/test/val/val_annotation_test.cpp b/third_party/SPIRV-Tools/test/val/val_annotation_test.cpp
index 97dde2d..e4a9474 100644
--- a/third_party/SPIRV-Tools/test/val/val_annotation_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_annotation_test.cpp
@@ -230,6 +230,49 @@
"FPFastMathMode and NoContraction cannot decorate the same target"));
}
+TEST_F(DecorationTest, RestrictOnUntypedPointer) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpCapability SampleRateShading
+OpCapability TransformFeedback
+OpCapability GeometryStreams
+OpCapability Tessellation
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpDecorate %param Restrict
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void = OpTypeVoid
+%f_ty = OpTypeFunction %void %ptr
+%f = OpFunction %void None %f_ty
+%param = OpFunctionParameter %ptr
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(DecorationTest, ArrayStrideUntypedPointerKHR) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpDecorate %ptr ArrayStride 4
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
using MemberOnlyDecorations = spvtest::ValidateBase<std::string>;
TEST_P(MemberOnlyDecorations, MemberDecoration) {
diff --git a/third_party/SPIRV-Tools/test/val/val_arithmetics_test.cpp b/third_party/SPIRV-Tools/test/val/val_arithmetics_test.cpp
index 58ac442..85653c5 100644
--- a/third_party/SPIRV-Tools/test/val/val_arithmetics_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_arithmetics_test.cpp
@@ -1166,6 +1166,50 @@
"vector size of the right operand: OuterProduct"));
}
+std::string GenerateBFloatCode(const std::string& main_body) {
+ const std::string prefix =
+ R"(
+OpCapability Shader
+OpCapability BFloat16TypeKHR
+OpCapability BFloat16DotProductKHR
+OpCapability BFloat16CooperativeMatrixKHR
+OpExtension "SPV_KHR_bfloat16"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpSource GLSL 450
+OpName %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bfloat16 = OpTypeFloat 16 BFloat16KHR
+%_ptr_Function_bfloat16 = OpTypePointer Function %bfloat16
+%v2bfloat16 = OpTypeVector %bfloat16 2
+%_ptr_Function_v2bfloat16 = OpTypePointer Function %v2bfloat16
+%main = OpFunction %void None %func
+%main_entry = OpLabel)";
+
+ const std::string suffix =
+ R"(
+OpReturn
+OpFunctionEnd)";
+
+ return prefix + main_body + suffix;
+}
+
+TEST_F(ValidateArithmetics, DotBfloat16) {
+ const std::string body = R"(
+%v1 = OpVariable %_ptr_Function_v2bfloat16 Function
+%v2 = OpVariable %_ptr_Function_v2bfloat16 Function
+%12 = OpLoad %v2bfloat16 %v1
+%14 = OpLoad %v2bfloat16 %v2
+%15 = OpDot %bfloat16 %12 %14
+)";
+
+ CompileSuccessfully(GenerateBFloatCode(body).c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
std::string GenerateCoopMatCode(const std::string& extra_types,
const std::string& main_body) {
const std::string prefix =
@@ -1280,14 +1324,14 @@
TEST_F(ValidateArithmetics, CoopMatScopeFail) {
const std::string types = R"(
-%workgroup = OpConstant %u32 2
+%device = OpConstant %u32 1
-%mat16x16_wg = OpTypeCooperativeMatrixNV %f16 %workgroup %u32_16 %u32_16
-%f16matwg_16x16_1 = OpConstantComposite %mat16x16_wg %f16_1
+%mat16x16_dv = OpTypeCooperativeMatrixNV %f16 %device %u32_16 %u32_16
+%f16matdv_16x16_1 = OpConstantComposite %mat16x16_dv %f16_1
)";
const std::string body = R"(
-%val1 = OpCooperativeMatrixMulAddNV %mat16x16 %f16mat_16x4_1 %f16mat_4x16_1 %f16matwg_16x16_1
+%val1 = OpCooperativeMatrixMulAddNV %mat16x16 %f16mat_16x4_1 %f16mat_4x16_1 %f16matdv_16x16_1
)";
CompileSuccessfully(GenerateCoopMatCode(types, body).c_str());
@@ -1475,9 +1519,13 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability CooperativeMatrixReductionsNV
+OpCapability CooperativeMatrixPerElementOperationsNV
+OpCapability VulkanMemoryModel
OpExtension "SPV_KHR_cooperative_matrix"
+OpExtension "SPV_NV_cooperative_matrix2"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical Vulkan
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -1487,6 +1535,7 @@
%u32 = OpTypeInt 32 0
%s32 = OpTypeInt 32 1
+%u32_8 = OpConstant %u32 8
%u32_16 = OpConstant %u32 16
%u32_4 = OpConstant %u32 4
%subgroup = OpConstant %u32 3
@@ -1560,8 +1609,9 @@
%val18 = OpCooperativeMatrixMulAddKHR %u32matC %u32mat_A_1 %u32mat_B_1 %u32mat_C_1
)";
- CompileSuccessfully(GenerateCoopMatKHRCode("", body).c_str());
- ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+ CompileSuccessfully(GenerateCoopMatKHRCode("", body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
TEST_F(ValidateArithmetics, CoopMatMatrixKHRTimesScalarMismatchFail) {
@@ -1569,8 +1619,10 @@
%val1 = OpMatrixTimesScalar %f16matA %f16mat_A_1 %f32_1
)";
- CompileSuccessfully(GenerateCoopMatKHRCode("", body).c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(GenerateCoopMatKHRCode("", body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected scalar operand type to be equal to the component "
@@ -1579,17 +1631,19 @@
TEST_F(ValidateArithmetics, CoopMatKHRScopeFail) {
const std::string types = R"(
-%workgroup = OpConstant %u32 2
-%mat16x16_wg = OpTypeCooperativeMatrixKHR %f16 %workgroup %u32_16 %u32_16 %useC
-%f16matwg_16x16_1 = OpConstantComposite %mat16x16_wg %f16_1
+%device = OpConstant %u32 1
+%mat16x16_dv = OpTypeCooperativeMatrixKHR %f16 %device %u32_16 %u32_16 %useC
+%f16matdv_16x16_1 = OpConstantComposite %mat16x16_dv %f16_1
)";
const std::string body = R"(
-%val1 = OpFAdd %f16matA %f16matwg_16x16_1 %f16mat_A_1
+%val1 = OpFAdd %f16matA %f16matdv_16x16_1 %f16mat_A_1
)";
- CompileSuccessfully(GenerateCoopMatKHRCode(types, body).c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(GenerateCoopMatKHRCode(types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected scopes of Matrix and Result Type to be identical"));
@@ -1605,13 +1659,425 @@
%val1 = OpCooperativeMatrixMulAddKHR %mat16x4 %f16mat_A_1 %f16mat_B_1 %mat16x4_C_1
)";
- CompileSuccessfully(GenerateCoopMatKHRCode(types, body).c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(GenerateCoopMatKHRCode(types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Cooperative matrix 'N' mismatch: CooperativeMatrixMulAddKHR"));
}
+TEST_F(ValidateArithmetics, CoopMat2ReduceSuccess) {
+ const std::string extra_types = R"(
+
+%f16matC8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_8 %useC
+%f16matC16x8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_16 %u32_8 %useC
+%f16matC8x16 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_16 %useC
+
+%functy = OpTypeFunction %f16 %f16 %f16
+%reducefunc = OpFunction %f16 None %functy
+%x = OpFunctionParameter %f16
+%y = OpFunctionParameter %f16
+%entry2 = OpLabel
+%sum = OpFAdd %f16 %x %y
+OpReturnValue %sum
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixReduceNV %f16matC8 %f16mat_C_1 2x2 %reducefunc
+%val2 = OpCooperativeMatrixReduceNV %f16matC16x8 %f16mat_C_1 Row %reducefunc
+%val3 = OpCooperativeMatrixReduceNV %f16matC8x16 %f16mat_C_1 Column %reducefunc
+%val4 = OpCooperativeMatrixReduceNV %f16matC %f16mat_C_1 Row|Column %reducefunc
+%val5 = OpCooperativeMatrixReduceNV %f16matC8 %f16mat_C_1 Row|Column %reducefunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2Reduce2x2DimFail) {
+ const std::string extra_types = R"(
+
+%functy = OpTypeFunction %f16 %f16 %f16
+%reducefunc = OpFunction %f16 None %functy
+%x = OpFunctionParameter %f16
+%y = OpFunctionParameter %f16
+%entry2 = OpLabel
+%sum = OpFAdd %f16 %x %y
+OpReturnValue %sum
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixReduceNV %f16matC %f16mat_C_1 2x2 %reducefunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("For Reduce2x2, result rows/cols must be half of "
+ "matrix rows/cols: CooperativeMatrixReduceNV"));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2ReduceRowDimFail) {
+ const std::string extra_types = R"(
+
+%f16matC8x16 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_16 %useC
+
+%functy = OpTypeFunction %f16 %f16 %f16
+%reducefunc = OpFunction %f16 None %functy
+%x = OpFunctionParameter %f16
+%y = OpFunctionParameter %f16
+%entry2 = OpLabel
+%sum = OpFAdd %f16 %x %y
+OpReturnValue %sum
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixReduceNV %f16matC8x16 %f16mat_C_1 Row %reducefunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("For ReduceRow, result rows must match matrix rows: "
+ "CooperativeMatrixReduceNV"));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2ReduceColDimFail) {
+ const std::string extra_types = R"(
+
+%f16matC16x8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_16 %u32_8 %useC
+
+%functy = OpTypeFunction %f16 %f16 %f16
+%reducefunc = OpFunction %f16 None %functy
+%x = OpFunctionParameter %f16
+%y = OpFunctionParameter %f16
+%entry2 = OpLabel
+%sum = OpFAdd %f16 %x %y
+OpReturnValue %sum
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixReduceNV %f16matC16x8 %f16mat_C_1 Column %reducefunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("For ReduceColumn, result cols must match matrix cols: "
+ "CooperativeMatrixReduceNV"));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2ReduceMaskFail) {
+ const std::string extra_types = R"(
+
+%f16matC8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_8 %useC
+
+%functy = OpTypeFunction %f16 %f16 %f16
+%reducefunc = OpFunction %f16 None %functy
+%x = OpFunctionParameter %f16
+%y = OpFunctionParameter %f16
+%entry2 = OpLabel
+%sum = OpFAdd %f16 %x %y
+OpReturnValue %sum
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixReduceNV %f16matC8 %f16mat_C_1 Row|Column|2x2 %reducefunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Reduce 2x2 must not be used with Row/Column: "
+ "CooperativeMatrixReduceNV"));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2ReduceFuncTypeFail) {
+ const std::string extra_types = R"(
+
+%functy = OpTypeFunction %f32 %f32 %f32
+%reducefunc = OpFunction %f32 None %functy
+%x = OpFunctionParameter %f32
+%y = OpFunctionParameter %f32
+%entry2 = OpLabel
+%sum = OpFAdd %f32 %x %y
+OpReturnValue %sum
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixReduceNV %f16matC %f16mat_C_1 Row|Column %reducefunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("CombineFunc return type and parameters must match "
+ "matrix component type: CooperativeMatrixReduceNV"));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2PerElementOpSuccess) {
+ const std::string extra_types = R"(
+
+%functy = OpTypeFunction %f16 %u32 %u32 %f16
+%functy2 = OpTypeFunction %f16 %u32 %u32 %f16 %u32
+
+%elemfunc = OpFunction %f16 None %functy
+%row = OpFunctionParameter %u32
+%col = OpFunctionParameter %u32
+%el = OpFunctionParameter %f16
+%entry2 = OpLabel
+OpReturnValue %el
+OpFunctionEnd
+
+%elemfunc2 = OpFunction %f16 None %functy2
+%row2 = OpFunctionParameter %u32
+%col2 = OpFunctionParameter %u32
+%el2 = OpFunctionParameter %f16
+%x = OpFunctionParameter %u32
+%entry3 = OpLabel
+OpReturnValue %el2
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixPerElementOpNV %f16matC %f16mat_C_1 %elemfunc
+%val2 = OpCooperativeMatrixPerElementOpNV %f16matC %f16mat_C_1 %elemfunc2 %f16_1
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2PerElementOpElemTyFail) {
+ const std::string extra_types = R"(
+
+%functy = OpTypeFunction %f32 %u32 %u32 %f32
+
+%elemfunc = OpFunction %f32 None %functy
+%row = OpFunctionParameter %u32
+%col = OpFunctionParameter %u32
+%el = OpFunctionParameter %f32
+%entry2 = OpLabel
+OpReturnValue %el
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixPerElementOpNV %f16matC %f16mat_C_1 %elemfunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("must match matrix component type"));
+}
+
+TEST_F(ValidateArithmetics, CoopMat2PerElementOpRowTyFail) {
+ const std::string extra_types = R"(
+
+%functy = OpTypeFunction %f16 %f16 %u32 %f16
+
+%elemfunc = OpFunction %f16 None %functy
+%row = OpFunctionParameter %f16
+%col = OpFunctionParameter %u32
+%el = OpFunctionParameter %f16
+%entry2 = OpLabel
+OpReturnValue %el
+OpFunctionEnd
+
+ )";
+ const std::string body = R"(
+%val1 = OpCooperativeMatrixPerElementOpNV %f16matC %f16mat_C_1 %elemfunc
+)";
+
+ CompileSuccessfully(GenerateCoopMatKHRCode(extra_types, body).c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a 32-bit integer"));
+}
+
+std::string GenerateCoopVecCode(const std::string& extra_types,
+ const std::string& main_body) {
+ const std::string prefix =
+ R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpCapability ReplicatedCompositesEXT
+OpExtension "SPV_NV_cooperative_vector"
+OpExtension "SPV_EXT_replicated_composites"
+%ext_inst = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+%s32 = OpTypeInt 32 1
+
+%u32_8 = OpConstant %u32 8
+%u32_16 = OpConstant %u32 16
+%u32_4 = OpConstant %u32 4
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_8
+%f16vec4 = OpTypeCooperativeVectorNV %f16 %u32_4
+%u32vec = OpTypeCooperativeVectorNV %u32 %u32_8
+%s32vec = OpTypeCooperativeVectorNV %s32 %u32_8
+
+%f16_1 = OpConstant %f16 1
+%f32_1 = OpConstant %f32 1
+%u32_1 = OpConstant %u32 1
+%s32_1 = OpConstant %s32 1
+
+%f16vec4_1 = OpConstantComposite %f16vec4 %f16_1 %f16_1 %f16_1 %f16_1
+%f16vec_1 = OpConstantComposite %f16vec %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1
+%u32vec_1 = OpConstantComposite %u32vec %u32_1 %u32_1 %u32_1 %u32_1 %u32_1 %u32_1 %u32_1 %u32_1
+%s32vec_1 = OpConstantComposite %s32vec %s32_1 %s32_1 %s32_1 %s32_1 %s32_1 %s32_1 %s32_1 %s32_1
+
+%u32_c1 = OpSpecConstant %u32 1
+%u32_c2 = OpSpecConstant %u32 2
+
+%f16vecc = OpTypeCooperativeVectorNV %f16 %u32_c1
+%f16vecc_1 = OpConstantCompositeReplicateEXT %f16vecc %f16_1
+)";
+
+ const std::string func_begin =
+ R"(
+%main = OpFunction %void None %func
+%main_entry = OpLabel)";
+
+ const std::string suffix =
+ R"(
+OpReturn
+OpFunctionEnd)";
+
+ return prefix + extra_types + func_begin + main_body + suffix;
+}
+
+TEST_F(ValidateArithmetics, CoopVecSuccess) {
+ const std::string body = R"(
+%val1 = OpFAdd %f16vec %f16vec_1 %f16vec_1
+%val2 = OpFSub %f16vec %f16vec_1 %f16vec_1
+%val3 = OpFDiv %f16vec %f16vec_1 %f16vec_1
+%val4 = OpFNegate %f16vec %f16vec_1
+%val5 = OpIAdd %u32vec %u32vec_1 %u32vec_1
+%val6 = OpISub %u32vec %u32vec_1 %u32vec_1
+%val7 = OpUDiv %u32vec %u32vec_1 %u32vec_1
+%val8 = OpIAdd %s32vec %s32vec_1 %s32vec_1
+%val9 = OpISub %s32vec %s32vec_1 %s32vec_1
+%val10 = OpSDiv %s32vec %s32vec_1 %s32vec_1
+%val11 = OpSNegate %s32vec %s32vec_1
+%val12 = OpVectorTimesScalar %f16vec %f16vec_1 %f16_1
+%val13 = OpExtInst %f16vec %ext_inst FMin %f16vec_1 %f16vec_1
+%val14 = OpExtInst %f16vec %ext_inst FMax %f16vec_1 %f16vec_1
+%val15 = OpExtInst %f16vec %ext_inst FClamp %f16vec_1 %f16vec_1 %f16vec_1
+%val16 = OpExtInst %f16vec %ext_inst NClamp %f16vec_1 %f16vec_1 %f16vec_1
+%val17 = OpExtInst %f16vec %ext_inst Step %f16vec_1 %f16vec_1
+%val18 = OpExtInst %f16vec %ext_inst Exp %f16vec_1
+%val19 = OpExtInst %f16vec %ext_inst Log %f16vec_1
+%val20 = OpExtInst %f16vec %ext_inst Tanh %f16vec_1
+%val21 = OpExtInst %f16vec %ext_inst Atan %f16vec_1
+%val22 = OpExtInst %f16vec %ext_inst Fma %f16vec_1 %f16vec_1 %f16vec_1
+%val23 = OpExtInst %u32vec %ext_inst UMin %u32vec_1 %u32vec_1
+%val24 = OpExtInst %u32vec %ext_inst UMax %u32vec_1 %u32vec_1
+%val25 = OpExtInst %u32vec %ext_inst UClamp %u32vec_1 %u32vec_1 %u32vec_1
+%val26 = OpExtInst %s32vec %ext_inst SMin %s32vec_1 %s32vec_1
+%val27 = OpExtInst %s32vec %ext_inst SMax %s32vec_1 %s32vec_1
+%val28 = OpExtInst %s32vec %ext_inst SClamp %s32vec_1 %s32vec_1 %s32vec_1
+%val29 = OpShiftRightLogical %u32vec %u32vec_1 %u32vec_1
+%val30 = OpShiftRightArithmetic %u32vec %u32vec_1 %u32vec_1
+%val31 = OpShiftLeftLogical %u32vec %u32vec_1 %u32vec_1
+%val32 = OpBitwiseOr %u32vec %u32vec_1 %u32vec_1
+%val33 = OpBitwiseXor %u32vec %u32vec_1 %u32vec_1
+%val34 = OpBitwiseAnd %u32vec %u32vec_1 %u32vec_1
+%val35 = OpNot %u32vec %u32vec_1
+)";
+
+ CompileSuccessfully(GenerateCoopVecCode("", body).c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateArithmetics, CoopVecFMulPass) {
+ const std::string body = R"(
+%val1 = OpFMul %f16vec %f16vec_1 %f16vec_1
+)";
+
+ CompileSuccessfully(GenerateCoopVecCode("", body).c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateArithmetics, CoopVecVectorTimesScalarMismatchFail) {
+ const std::string body = R"(
+%val1 = OpVectorTimesScalar %f16vec %f16vec_1 %f32_1
+)";
+
+ CompileSuccessfully(GenerateCoopVecCode("", body).c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Expected scalar operand type to be equal to the component "
+ "type of the vector operand: VectorTimesScalar"));
+}
+
+TEST_F(ValidateArithmetics, CoopVecDimFail) {
+ const std::string body = R"(
+%val1 = OpFMul %f16vec %f16vec_1 %f16vec4_1
+)";
+
+ CompileSuccessfully(GenerateCoopVecCode("", body).c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected number of components to be identical"));
+}
+
+TEST_F(ValidateArithmetics, CoopVecComponentTypeNotScalarNumeric) {
+ const std::string types = R"(
+%bad = OpTypeCooperativeVectorNV %bool %u32_8
+)";
+
+ CompileSuccessfully(GenerateCoopVecCode(types, "").c_str());
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpTypeCooperativeVectorNV Component Type <id> "
+ "'5[%bool]' is not a scalar numerical type."));
+}
+
+TEST_F(ValidateArithmetics, CoopVecDimNotConstantInt) {
+ const std::string types = R"(
+%bad = OpTypeCooperativeVectorNV %f16 %f32_1
+)";
+
+ CompileSuccessfully(GenerateCoopVecCode(types, "").c_str());
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpTypeCooperativeVectorNV component count <id> "
+ "'19[%float_1]' is not a constant integer type"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_atomics_test.cpp b/third_party/SPIRV-Tools/test/val/val_atomics_test.cpp
index 0f65634..4edd884 100644
--- a/third_party/SPIRV-Tools/test/val/val_atomics_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_atomics_test.cpp
@@ -1142,9 +1142,8 @@
CompileSuccessfully(GenerateKernelCode(body));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- HasSubstr("AtomicStore: expected Pointer to be of type OpTypePointer"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("AtomicStore: expected Pointer to be a pointer type"));
}
TEST_F(ValidateAtomics, AtomicStoreWrongPointerDataType) {
@@ -1607,7 +1606,7 @@
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("AtomicFlagTestAndSet: "
- "expected Pointer to be of type OpTypePointer"));
+ "expected Pointer to be a pointer type"));
}
TEST_F(ValidateAtomics, AtomicFlagTestAndSetNotIntPointer) {
@@ -1681,7 +1680,7 @@
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("AtomicFlagClear: "
- "expected Pointer to be of type OpTypePointer"));
+ "expected Pointer to be a pointer type"));
}
TEST_F(ValidateAtomics, AtomicFlagClearNotIntPointer) {
@@ -2560,8 +2559,8 @@
OpFunctionEnd
)";
- CompileSuccessfully(spirv);
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
TEST_F(ValidateAtomics, CompareExchangeVolatileMismatch) {
@@ -2588,8 +2587,8 @@
OpFunctionEnd
)";
- CompileSuccessfully(spirv);
- EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Volatile mask setting must match for Equal and "
"Unequal memory semantics"));
@@ -2622,8 +2621,8 @@
)";
// This is ok because we cannot evaluate the spec constant defaults.
- CompileSuccessfully(spirv);
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
TEST_F(ValidateAtomics, VolatileRequiresVulkanMemoryModel) {
@@ -2847,6 +2846,125 @@
"float scalar type"));
}
+TEST_F(ValidateAtomics, AtomicLoadUntypedPointer) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%load = OpAtomicLoad %int %var %int_1 %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateAtomics, AtomicStoreUntypedPointer) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpAtomicStore %var %int_1 %int_0 %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateAtomics, AtomicExchangeUntypedPointer) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%ex = OpAtomicExchange %int %var %int_1 %int_0 %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateAtomics, AtomicFlagClearUntypedPointer) {
+ const std::string spirv = R"(
+OpCapability Kernel
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical OpenCL
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpAtomicFlagClear %var %int_1 %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Untyped pointers are not supported by atomic flag instructions"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_barriers_test.cpp b/third_party/SPIRV-Tools/test/val/val_barriers_test.cpp
index ba8ac7d..bd84353 100644
--- a/third_party/SPIRV-Tools/test/val/val_barriers_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_barriers_test.cpp
@@ -511,6 +511,39 @@
"Vulkan-supported storage class if Memory Semantics is not None"));
}
+TEST_F(ValidateBarriers, OpControlBarrierVulkanAcquireRelease) {
+ const std::string body = R"(
+OpControlBarrier %workgroup %device %acquire_release
+)";
+
+ CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpControlBarrier-04650"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "ControlBarrier: expected Memory Semantics to include a "
+ "Vulkan-supported storage class if Memory Semantics is not None"));
+}
+
+TEST_F(ValidateBarriers, OpControlBarrierVulkanWorkgroupMemory) {
+ const std::string body = R"(
+OpControlBarrier %workgroup %workgroup %workgroup_memory
+)";
+
+ CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpControlBarrier-10609"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "ControlBarrier: Vulkan specification requires non-zero "
+ "Memory Semantics to have one of the following bits set: Acquire, "
+ "Release, AcquireRelease or SequentiallyConsistent"));
+}
+
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionFragment1p1) {
const std::string body = R"(
OpControlBarrier %subgroup %subgroup %acquire_release_workgroup
@@ -687,9 +720,8 @@
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("OpControlBarrier requires one of the following "
- "Execution "
- "Models: TessellationControl, GLCompute, Kernel, "
- "MeshNV or TaskNV"));
+ "Execution Models: TessellationControl, GLCompute, "
+ "Kernel, MeshNV or TaskNV"));
}
TEST_F(ValidateBarriers, OpMemoryBarrierSuccess) {
@@ -1396,8 +1428,9 @@
OpFunctionEnd
)";
- CompileSuccessfully(text);
- EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(text, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Memory Semantics Volatile can only be used with "
"atomic instructions"));
@@ -1423,8 +1456,9 @@
OpFunctionEnd
)";
- CompileSuccessfully(text);
- EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(text, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Memory Semantics Volatile can only be used with "
"atomic instructions"));
@@ -1452,8 +1486,8 @@
OpFunctionEnd
)";
- CompileSuccessfully(text);
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ CompileSuccessfully(text, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
TEST_F(ValidateBarriers, CooperativeMatrixNonConstantSemantics) {
@@ -1478,8 +1512,9 @@
OpFunctionEnd
)";
- CompileSuccessfully(text);
- EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(text, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Memory Semantics must be a constant instruction when "
"CooperativeMatrixNV capability is present"));
diff --git a/third_party/SPIRV-Tools/test/val/val_bitwise_test.cpp b/third_party/SPIRV-Tools/test/val/val_bitwise_test.cpp
index b849e7b..c906e47 100644
--- a/third_party/SPIRV-Tools/test/val/val_bitwise_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_bitwise_test.cpp
@@ -420,13 +420,22 @@
CompileSuccessfully(GenerateShaderCode(body).c_str(), SPV_ENV_VULKAN_1_0);
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
- EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Base-04781"));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-RuntimeSpirv-None-10824"));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected 32-bit int type for Base operand: BitFieldInsert"));
}
+TEST_F(ValidateBitwise, OpBitFieldInsertNot32Allow) {
+ const std::string body = R"(
+ %val1 = OpBitFieldInsert %u64 %u64_1 %u64_2 %s32_1 %s32_2
+ )";
+
+ CompileSuccessfully(GenerateShaderCode(body).c_str(), SPV_ENV_VULKAN_1_0);
+ spvValidatorOptionsSetAllowVulkan32BitBitwise(getValidatorOptions(), true);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
TEST_F(ValidateBitwise, OpBitFieldSExtractSuccess) {
const std::string body = R"(
%val1 = OpBitFieldSExtract %u64 %u64_1 %s32_1 %s32_2
@@ -504,8 +513,7 @@
CompileSuccessfully(GenerateShaderCode(body).c_str(), SPV_ENV_VULKAN_1_0);
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
- EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Base-04781"));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-RuntimeSpirv-None-10824"));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected 32-bit int type for Base operand: BitFieldSExtract"));
@@ -562,8 +570,7 @@
CompileSuccessfully(GenerateShaderCode(body).c_str(), SPV_ENV_VULKAN_1_0);
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
- EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Base-04781"));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-RuntimeSpirv-None-10824"));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected 32-bit int type for Base operand: BitReverse"));
@@ -607,10 +614,8 @@
%val1 = OpBitCount %u32 %f64_1
)";
- CompileSuccessfully(GenerateShaderCode(body).c_str(), SPV_ENV_VULKAN_1_0);
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
- EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Base-04781"));
+ CompileSuccessfully(GenerateShaderCode(body).c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
@@ -637,8 +642,7 @@
CompileSuccessfully(GenerateShaderCode(body).c_str(), SPV_ENV_VULKAN_1_0);
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
- EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Base-04781"));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-RuntimeSpirv-None-10824"));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Expected 32-bit int type for Base operand: BitCount"));
}
diff --git a/third_party/SPIRV-Tools/test/val/val_builtins_test.cpp b/third_party/SPIRV-Tools/test/val/val_builtins_test.cpp
index 0104969..802e0dd 100644
--- a/third_party/SPIRV-Tools/test/val/val_builtins_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_builtins_test.cpp
@@ -26,8 +26,6 @@
#include <vector>
#include "gmock/gmock.h"
-#include "source/spirv_target_env.h"
-#include "test/unit_spirv.h"
#include "test/val/val_code_generator.h"
#include "test/val/val_fixtures.h"
@@ -99,6 +97,10 @@
generator.before_types_ += built_in;
generator.before_types_ += "\n";
+ if (strncmp(built_in, "TessLevel", 9) == 0) {
+ generator.before_types_ += "OpMemberDecorate %built_in_type 0 Patch\n";
+ }
+
std::ostringstream after_types;
after_types << "%built_in_type = OpTypeStruct " << data_type << "\n";
@@ -258,6 +260,10 @@
generator.before_types_ += built_in;
generator.before_types_ += "\n";
+ if (strncmp(built_in, "TessLevel", 9) == 0) {
+ generator.before_types_ += "OpMemberDecorate %built_in_type 0 Patch\n";
+ }
+
std::ostringstream after_types;
after_types << "%built_in_type = OpTypeStruct " << data_type << "\n";
if (InitializerRequired(storage_class)) {
@@ -395,6 +401,11 @@
generator.before_types_ = "OpDecorate %built_in_var BuiltIn ";
generator.before_types_ += built_in;
generator.before_types_ += "\n";
+
+ if (strncmp(built_in, "TessLevel", 9) == 0) {
+ generator.before_types_ += "OpDecorate %built_in_var Patch\n";
+ }
+
if ((0 == std::strcmp(storage_class, "Input")) &&
(0 == std::strcmp(execution_model, "Fragment"))) {
// ensure any needed input types that might require Flat
@@ -1423,16 +1434,6 @@
"to be used only with Fragment execution model"))));
INSTANTIATE_TEST_SUITE_P(
- SampleMaskWrongStorageClass,
- ValidateVulkanCombineBuiltInExecutionModelDataTypeResult,
- Combine(Values("SampleMask"), Values("Fragment"), Values("Workgroup"),
- Values("%u32arr2"), Values("VUID-SampleMask-SampleMask-04358"),
- Values(TestResult(
- SPV_ERROR_INVALID_DATA,
- "Vulkan spec allows BuiltIn SampleMask to be only used for "
- "variables with Input or Output storage class"))));
-
-INSTANTIATE_TEST_SUITE_P(
SampleMaskNotArray,
ValidateVulkanCombineBuiltInExecutionModelDataTypeResult,
Combine(Values("SampleMask"), Values("Fragment"), Values("Input"),
@@ -3614,6 +3615,7 @@
entry_point.name = "main_d_r";
entry_point.execution_model = "MeshNV";
entry_point.interfaces = "%gl_PrimitiveID %gl_Layer %gl_ViewportIndex";
+ entry_point.body = "%ref_load = OpLoad %_arr_float_uint_81 %gl_PrimitiveID";
generator.entry_points_.push_back(std::move(entry_point));
CompileSuccessfully(generator.Build(), SPV_ENV_VULKAN_1_1);
@@ -3947,7 +3949,8 @@
Values(TestResult(
SPV_ERROR_INVALID_DATA,
"Vulkan spec allows BuiltIn PrimitiveShadingRateKHR to be used "
- "only with Vertex, Geometry, or MeshNV execution models."))));
+ "only with Vertex, Geometry, MeshNV or MeshEXT execution "
+ "models."))));
INSTANTIATE_TEST_SUITE_P(
PrimitiveShadingRateInvalidStorageClass,
@@ -4325,6 +4328,29 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
}
+TEST_F(ValidateBuiltIns,
+ VulkanPrimitiveTriangleIndicesEXTInvalidExecutionMode) {
+ const std::string declarations = R"(
+%array = OpTypeArray %v3uint %uint_16
+%array_ptr = OpTypePointer Output %array
+%var = OpVariable %array_ptr Output
+%ptr = OpTypePointer Output %v3uint
+)";
+ const std::string body = R"(
+%access = OpAccessChain %ptr %var %int_0
+)";
+
+ CompileSuccessfully(
+ GenerateMeshShadingCode("PrimitiveTriangleIndicesEXT", "OutputPoints",
+ body, declarations)
+ .c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveTriangleIndicesEXT-"
+ "PrimitiveTriangleIndicesEXT-07054"));
+}
+
TEST_F(ValidateBuiltIns, VulkanPrimitiveTriangleIndicesEXTStorageClass) {
const std::string declarations = R"(
%array = OpTypeArray %v3uint %uint_16
@@ -4408,6 +4434,28 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
}
+TEST_F(ValidateBuiltIns, VulkanPrimitiveLineIndicesEXTInvalidExecutionMode) {
+ const std::string declarations = R"(
+ %array = OpTypeArray %v2uint %uint_16
+ %array_ptr = OpTypePointer Output %array
+ %var = OpVariable %array_ptr Output
+ %ptr = OpTypePointer Output %v2uint
+ )";
+ const std::string body = R"(
+ %access = OpAccessChain %ptr %var %int_0
+ )";
+
+ CompileSuccessfully(
+ GenerateMeshShadingCode("PrimitiveLineIndicesEXT", "OutputPoints", body,
+ declarations)
+ .c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07048"));
+}
+
TEST_F(ValidateBuiltIns, VulkanPrimitiveLineIndicesEXTStorageClass) {
const std::string declarations = R"(
%array = OpTypeArray %v2uint %uint_16
@@ -4471,6 +4519,28 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
}
+TEST_F(ValidateBuiltIns, VulkanPrimitivePointIndicesEXTInvalidExecutionMode) {
+ const std::string declarations = R"(
+ %array = OpTypeArray %uint %uint_16
+ %array_ptr = OpTypePointer Output %array
+ %var = OpVariable %array_ptr Output
+ %ptr = OpTypePointer Output %uint
+ )";
+ const std::string body = R"(
+ %access = OpAccessChain %ptr %var %int_0
+ )";
+
+ CompileSuccessfully(
+ GenerateMeshShadingCode("PrimitivePointIndicesEXT", "OutputTrianglesNV",
+ body, declarations)
+ .c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07042"));
+}
+
TEST_F(ValidateBuiltIns, VulkanPrimitivePointIndicesEXTStorageClass) {
const std::string declarations = R"(
%array = OpTypeArray %uint %uint_16
@@ -4515,6 +4585,2153 @@
AnyVUID("VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07044"));
}
+TEST_F(ValidateBuiltIns, VulkanBuiltinPrimtiveIDWithPerPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpCapability Shader
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %MainMesh "MainMesh" %gl_PrimitiveID
+ OpExecutionMode %MainMesh OutputPrimitivesNV 1
+ OpExecutionMode %MainMesh OutputVertices 3
+ OpExecutionMode %MainMesh OutputTrianglesNV
+ OpExecutionMode %MainMesh LocalSize 1 1 1
+ OpSource Slang 1
+ OpName %MainMesh "MainMesh"
+ OpDecorate %gl_PrimitiveID BuiltIn PrimitiveId
+ OpDecorate %gl_PrimitiveID PerPrimitiveNV
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ %uint_1 = OpConstant %uint 1
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %int_3 = OpConstant %int 3
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %uint_0 = OpConstant %uint 0
+ %v3float = OpTypeVector %float 3
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%_ptr_Output_int = OpTypePointer Output %int
+%_arr_int_int_1 = OpTypeArray %int %int_1
+%_ptr_Output__arr_int_int_1 = OpTypePointer Output %_arr_int_int_1
+%gl_PrimitiveID = OpVariable %_ptr_Output__arr_int_int_1 Output
+ %MainMesh = OpFunction %void None %9
+ %25 = OpLabel
+ OpSetMeshOutputsEXT %uint_3 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinPrimtiveIDWithPerPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpCapability Shader
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %MainMesh "MainMesh" %gl_PrimitiveID
+ OpExecutionMode %MainMesh OutputPrimitivesNV 1
+ OpExecutionMode %MainMesh OutputVertices 3
+ OpExecutionMode %MainMesh OutputTrianglesNV
+ OpExecutionMode %MainMesh LocalSize 1 1 1
+ OpSource Slang 1
+ OpName %MainMesh "MainMesh"
+ OpDecorate %gl_PrimitiveID BuiltIn PrimitiveId
+%void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%int = OpTypeInt 32 1
+%int_1 = OpConstant %int 1
+%int_3 = OpConstant %int 3
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%uint_0 = OpConstant %uint 0
+%v3float = OpTypeVector %float 3
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%v3uint = OpTypeVector %uint 3
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%_ptr_Output_int = OpTypePointer Output %int
+%_arr_int_int_1 = OpTypeArray %int %int_1
+%_ptr_Output__arr_int_int_1 = OpTypePointer Output %_arr_int_int_1
+%gl_PrimitiveID = OpVariable %_ptr_Output__arr_int_int_1 Output
+%MainMesh = OpFunction %void None %9
+ %25 = OpLabel
+%ref_load = OpLoad %_arr_int_int_1 %gl_PrimitiveID
+ OpSetMeshOutputsEXT %uint_3 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveId-PrimitiveId-07040"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinViewportIndexWithPerPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpCapability Shader
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %MainMesh "MainMesh" %gl_ViewportIndex
+ OpExecutionMode %MainMesh OutputPrimitivesNV 1
+ OpExecutionMode %MainMesh OutputVertices 3
+ OpExecutionMode %MainMesh OutputTrianglesNV
+ OpExecutionMode %MainMesh LocalSize 1 1 1
+ OpSource Slang 1
+ OpName %MainMesh "MainMesh"
+ OpDecorate %gl_ViewportIndex BuiltIn ViewportIndex
+%void = OpTypeVoid
+%9 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 1
+%int_1 = OpConstant %int 1
+%int_3 = OpConstant %int 3
+%uint_0 = OpConstant %uint 0
+%v3float = OpTypeVector %float 3
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%v3uint = OpTypeVector %uint 3
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%_ptr_Output_int = OpTypePointer Output %int
+%_arr_int_int_1 = OpTypeArray %int %int_1
+%_ptr_Output__arr_int_int_1 = OpTypePointer Output %_arr_int_int_1
+%gl_ViewportIndex = OpVariable %_ptr_Output__arr_int_int_1 Output
+%MainMesh = OpFunction %void None %9
+%25 = OpLabel
+%ref_load = OpLoad %_arr_int_int_1 %gl_ViewportIndex
+ OpSetMeshOutputsEXT %uint_3 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-ViewportIndex-ViewportIndex-07060"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinPrimitivePointIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitivePointIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputPoints
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitivePointIndicesEXT "gl_PrimitivePointIndicesEXT"
+ OpDecorate %gl_PrimitivePointIndicesEXT BuiltIn PrimitivePointIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+%_ptr_Output__arr_uint_uint_32 = OpTypePointer Output %_arr_uint_uint_32
+%gl_PrimitivePointIndicesEXT = OpVariable %_ptr_Output__arr_uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%_ptr_Output_uint = OpTypePointer Output %uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ %15 = OpAccessChain %_ptr_Output_uint %gl_PrimitivePointIndicesEXT %int_0
+ OpStore %15 %uint_0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinPrimitiveLineIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveLineIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputLinesEXT
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveLineIndicesEXT "gl_PrimitiveLineIndicesEXT"
+ OpDecorate %gl_PrimitiveLineIndicesEXT BuiltIn PrimitiveLineIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%v2uint = OpTypeVector %uint 2
+%uint_32 = OpConstant %uint 32
+%_arr_v2uint_uint_32 = OpTypeArray %v2uint %uint_32
+%_ptr_Output__arr_v2uint_uint_32 = OpTypePointer Output %_arr_v2uint_uint_32
+%gl_PrimitiveLineIndicesEXT = OpVariable %_ptr_Output__arr_v2uint_uint_32 Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+ %15 = OpConstantComposite %v2uint %uint_0 %uint_0
+%_ptr_Output_v2uint = OpTypePointer Output %v2uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %17 = OpAccessChain %_ptr_Output_v2uint %gl_PrimitiveLineIndicesEXT %int_0
+ OpStore %17 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinPrimitiveLineIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveLineIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputPoints
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveLineIndicesEXT "gl_PrimitiveLineIndicesEXT"
+ OpDecorate %gl_PrimitiveLineIndicesEXT BuiltIn PrimitiveLineIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%v2uint = OpTypeVector %uint 2
+%uint_32 = OpConstant %uint 32
+%_arr_v2uint_uint_32 = OpTypeArray %v2uint %uint_32
+%_ptr_Output__arr_v2uint_uint_32 = OpTypePointer Output %_arr_v2uint_uint_32
+%gl_PrimitiveLineIndicesEXT = OpVariable %_ptr_Output__arr_v2uint_uint_32 Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+ %15 = OpConstantComposite %v2uint %uint_0 %uint_0
+%_ptr_Output_v2uint = OpTypePointer Output %v2uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %17 = OpAccessChain %_ptr_Output_v2uint %gl_PrimitiveLineIndicesEXT %int_0
+ OpStore %17 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07048"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinPrimitivePointIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitivePointIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitivePointIndicesEXT "gl_PrimitivePointIndicesEXT"
+ OpDecorate %gl_PrimitivePointIndicesEXT BuiltIn PrimitivePointIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+%_ptr_Output__arr_uint_uint_32 = OpTypePointer Output %_arr_uint_uint_32
+%gl_PrimitivePointIndicesEXT = OpVariable %_ptr_Output__arr_uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%_ptr_Output_uint = OpTypePointer Output %uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ %15 = OpAccessChain %_ptr_Output_uint %gl_PrimitivePointIndicesEXT %int_0
+ OpStore %15 %uint_0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07042"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinPrimitiveTriangleIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveTriangleIndicesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveTriangleIndicesEXT "gl_PrimitiveTriangleIndicesEXT"
+ OpDecorate %gl_PrimitiveTriangleIndicesEXT BuiltIn PrimitiveTriangleIndicesEXT
+%void = OpTypeVoid
+%7 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_32 = OpTypeArray %v3uint %uint_32
+%_ptr_Output__arr_v3uint_uint_32 = OpTypePointer Output %_arr_v3uint_uint_32
+%gl_PrimitiveTriangleIndicesEXT = OpVariable %_ptr_Output__arr_v3uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%15 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_0
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%17 = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %7
+%18 = OpLabel
+%19 = OpAccessChain %_ptr_Output_v3uint %gl_PrimitiveTriangleIndicesEXT %int_0
+ OpStore %19 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinPrimitiveTriangleIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveTriangleIndicesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputPoints
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveTriangleIndicesEXT "gl_PrimitiveTriangleIndicesEXT"
+ OpDecorate %gl_PrimitiveTriangleIndicesEXT BuiltIn PrimitiveTriangleIndicesEXT
+%void = OpTypeVoid
+%7 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_32 = OpTypeArray %v3uint %uint_32
+%_ptr_Output__arr_v3uint_uint_32 = OpTypePointer Output %_arr_v3uint_uint_32
+%gl_PrimitiveTriangleIndicesEXT = OpVariable %_ptr_Output__arr_v3uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%15 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_0
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%17 = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %7
+%18 = OpLabel
+%19 = OpAccessChain %_ptr_Output_v3uint %gl_PrimitiveTriangleIndicesEXT %int_0
+ OpStore %19 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveTriangleIndicesEXT-"
+ "PrimitiveTriangleIndicesEXT-07054"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanPrimitivePointIndicesArraySizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitivePointIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputPoints
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitivePointIndicesEXT "gl_PrimitivePointIndicesEXT"
+ OpDecorate %gl_PrimitivePointIndicesEXT BuiltIn PrimitivePointIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+%_ptr_Output__arr_uint_uint_32 = OpTypePointer Output %_arr_uint_uint_32
+%gl_PrimitivePointIndicesEXT = OpVariable %_ptr_Output__arr_uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%_ptr_Output_uint = OpTypePointer Output %uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %3
+%5 = OpLabel
+%15 = OpAccessChain %_ptr_Output_uint %gl_PrimitivePointIndicesEXT %int_0
+ OpStore %15 %uint_0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07046"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanPrimitiveLineIndicesArraySizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveLineIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputLinesEXT
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveLineIndicesEXT "gl_PrimitiveLineIndicesEXT"
+ OpDecorate %gl_PrimitiveLineIndicesEXT BuiltIn PrimitiveLineIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%v2uint = OpTypeVector %uint 2
+%uint_32 = OpConstant %uint 32
+%_arr_v2uint_uint_32 = OpTypeArray %v2uint %uint_32
+%_ptr_Output__arr_v2uint_uint_32 = OpTypePointer Output %_arr_v2uint_uint_32
+%gl_PrimitiveLineIndicesEXT = OpVariable %_ptr_Output__arr_v2uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%15 = OpConstantComposite %v2uint %uint_0 %uint_0
+%_ptr_Output_v2uint = OpTypePointer Output %v2uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%17 = OpAccessChain %_ptr_Output_v2uint %gl_PrimitiveLineIndicesEXT %int_0
+ OpStore %17 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveLineIndicesEXT-PrimitiveLineIndicesEXT-07052"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanPrimitiveTriangleIndicesArraySizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveTriangleIndicesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveTriangleIndicesEXT "gl_PrimitiveTriangleIndicesEXT"
+ OpDecorate %gl_PrimitiveTriangleIndicesEXT BuiltIn PrimitiveTriangleIndicesEXT
+%void = OpTypeVoid
+%7 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_32 = OpTypeArray %v3uint %uint_32
+%_ptr_Output__arr_v3uint_uint_32 = OpTypePointer Output %_arr_v3uint_uint_32
+%gl_PrimitiveTriangleIndicesEXT = OpVariable %_ptr_Output__arr_v3uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%15 = OpConstantComposite %v3uint %uint_0 %uint_0 %uint_0
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%17 = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %7
+%18 = OpLabel
+%19 = OpAccessChain %_ptr_Output_v3uint %gl_PrimitiveTriangleIndicesEXT %int_0
+ OpStore %19 %15
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveTriangleIndicesEXT-"
+ "PrimitiveTriangleIndicesEXT-07058"));
+}
+
+TEST_F(ValidateBuiltIns, BadExecModelVulkanPrimitivePointIndicesEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingNV
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_NV_mesh_shader"
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshNV %main "main" %gl_PrimitivePointIndicesEXT
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputPoints
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitivePointIndicesEXT "gl_PrimitivePointIndicesEXT"
+ OpDecorate %gl_PrimitivePointIndicesEXT BuiltIn PrimitivePointIndicesEXT
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%_arr_uint_uint_32 = OpTypeArray %uint %uint_32
+%_ptr_Output__arr_uint_uint_32 = OpTypePointer Output %_arr_uint_uint_32
+%gl_PrimitivePointIndicesEXT = OpVariable %_ptr_Output__arr_uint_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint_0 = OpConstant %uint 0
+%_ptr_Output_uint = OpTypePointer Output %uint
+%v3uint = OpTypeVector %uint 3
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %3
+%5 = OpLabel
+%15 = OpAccessChain %_ptr_Output_uint %gl_PrimitivePointIndicesEXT %int_0
+ OpStore %15 %uint_0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitivePointIndicesEXT-PrimitivePointIndicesEXT-07041"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinCullPrimitiveEXTInBlock) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_CullPrimitiveEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinCullPrimitiveEXTBlockArraySize) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_CullPrimitiveEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_32 = OpConstant %uint 32
+ %uint_16 = OpConstant %uint 16
+ %uint_1 = OpConstant %uint 1
+ %int = OpTypeInt 32 1
+ %bool = OpTypeBool
+ %gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+ %_arr_gl_MeshPerPrimitiveEXT_uint_16 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_16
+ %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_16 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_16
+ %gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_16 Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_16 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-10590"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinCullPrimitiveEXTMissingBlock) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_CullPrimitiveEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-07036"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("Scalar boolean must be in a Block"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinCullPrimitiveEXTType) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_CullPrimitiveEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-07036"));
+}
+
+// from https://github.com/KhronosGroup/SPIRV-Tools/issues/5980
+TEST_F(ValidateBuiltIns, VulkanBuiltinCullPrimitiveEXTArrayOfBool) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationIndex %gl_Position %4 %5
+ OpExecutionMode %main LocalSize 2 1 1
+ OpExecutionMode %main OutputTrianglesEXT
+ OpExecutionMode %main OutputVertices 2
+ OpExecutionMode %main OutputPrimitivesEXT 2
+ OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorate %4 BuiltIn PrimitiveTriangleIndicesEXT
+ OpDecorate %5 BuiltIn CullPrimitiveEXT
+ OpDecorate %5 PerPrimitiveEXT
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %bool = OpTypeBool
+ %false = OpConstantFalse %bool
+%_ptr_Input_uint = OpTypePointer Input %uint
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_ptr_Output__arr_v4float_uint_2 = OpTypePointer Output %_arr_v4float_uint_2
+ %v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_2 = OpTypeArray %v3uint %uint_2
+%_ptr_Output__arr_v3uint_uint_2 = OpTypePointer Output %_arr_v3uint_uint_2
+%_arr_bool_uint_2 = OpTypeArray %bool %uint_2
+%_ptr_Output__arr_bool_uint_2 = OpTypePointer Output %_arr_bool_uint_2
+ %void = OpTypeVoid
+ %21 = OpTypeFunction %void
+%_ptr_Output_bool = OpTypePointer Output %bool
+%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
+%gl_Position = OpVariable %_ptr_Output__arr_v4float_uint_2 Output
+ %4 = OpVariable %_ptr_Output__arr_v3uint_uint_2 Output
+ %5 = OpVariable %_ptr_Output__arr_bool_uint_2 Output
+ %main = OpFunction %void None %21
+ %23 = OpLabel
+ %24 = OpLoad %uint %gl_LocalInvocationIndex
+ OpSetMeshOutputsEXT %uint_2 %uint_2
+ %25 = OpAccessChain %_ptr_Output_bool %5 %24
+ OpStore %25 %false
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinCullPrimitiveEXTArrayType) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationIndex %gl_Position %4 %5
+ OpExecutionMode %main LocalSize 2 1 1
+ OpExecutionMode %main OutputTrianglesEXT
+ OpExecutionMode %main OutputVertices 2
+ OpExecutionMode %main OutputPrimitivesEXT 2
+ OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorate %4 BuiltIn PrimitiveTriangleIndicesEXT
+ OpDecorate %5 BuiltIn CullPrimitiveEXT
+ OpDecorate %5 PerPrimitiveEXT
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %bool = OpTypeBool
+ %false = OpConstantFalse %bool
+%_ptr_Input_uint = OpTypePointer Input %uint
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_ptr_Output__arr_v4float_uint_2 = OpTypePointer Output %_arr_v4float_uint_2
+ %v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_2 = OpTypeArray %v3uint %uint_2
+%_ptr_Output__arr_v3uint_uint_2 = OpTypePointer Output %_arr_v3uint_uint_2
+%_arr_uint_uint_2 = OpTypeArray %uint %uint_2
+%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2
+ %void = OpTypeVoid
+ %21 = OpTypeFunction %void
+%_ptr_Output_uint = OpTypePointer Output %uint
+%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
+%gl_Position = OpVariable %_ptr_Output__arr_v4float_uint_2 Output
+ %4 = OpVariable %_ptr_Output__arr_v3uint_uint_2 Output
+ %5 = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+ %main = OpFunction %void None %21
+ %23 = OpLabel
+ %24 = OpLoad %uint %gl_LocalInvocationIndex
+ OpSetMeshOutputsEXT %uint_2 %uint_2
+ %25 = OpAccessChain %_ptr_Output_uint %5 %24
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-07036"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinCullPrimitiveEXTArrayOfBoolSize) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationIndex %gl_Position %4 %5
+ OpExecutionMode %main LocalSize 2 1 1
+ OpExecutionMode %main OutputTrianglesEXT
+ OpExecutionMode %main OutputVertices 2
+ OpExecutionMode %main OutputPrimitivesEXT 2
+ OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorate %4 BuiltIn PrimitiveTriangleIndicesEXT
+ OpDecorate %5 BuiltIn CullPrimitiveEXT
+ OpDecorate %5 PerPrimitiveEXT
+ %uint = OpTypeInt 32 0
+%uint_2 = OpConstant %uint 2
+%uint_4 = OpConstant %uint 4
+ %bool = OpTypeBool
+ %false = OpConstantFalse %bool
+%_ptr_Input_uint = OpTypePointer Input %uint
+ %float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_ptr_Output__arr_v4float_uint_2 = OpTypePointer Output %_arr_v4float_uint_2
+%v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_2 = OpTypeArray %v3uint %uint_2
+%_ptr_Output__arr_v3uint_uint_2 = OpTypePointer Output %_arr_v3uint_uint_2
+%_arr_bool_uint_4 = OpTypeArray %bool %uint_4
+%_ptr_Output__arr_bool_uint_4 = OpTypePointer Output %_arr_bool_uint_4
+ %void = OpTypeVoid
+ %21 = OpTypeFunction %void
+%_ptr_Output_bool = OpTypePointer Output %bool
+%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
+%gl_Position = OpVariable %_ptr_Output__arr_v4float_uint_2 Output
+ %4 = OpVariable %_ptr_Output__arr_v3uint_uint_2 Output
+ %5 = OpVariable %_ptr_Output__arr_bool_uint_4 Output
+ %main = OpFunction %void None %21
+ %23 = OpLabel
+ %24 = OpLoad %uint %gl_LocalInvocationIndex
+ OpSetMeshOutputsEXT %uint_2 %uint_2
+ %25 = OpAccessChain %_ptr_Output_bool %5 %24
+ OpStore %25 %false
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-10589"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinCullPrimitiveEXTInterfaceVariable) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationIndex %gl_Position %4 %5 %gl_MeshPrimitivesEXT
+ OpExecutionMode %main LocalSize 2 1 1
+ OpExecutionMode %main OutputTrianglesEXT
+ OpExecutionMode %main OutputVertices 2
+ OpExecutionMode %main OutputPrimitivesEXT 2
+ OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
+ OpDecorate %gl_Position BuiltIn Position
+ OpDecorate %4 BuiltIn PrimitiveTriangleIndicesEXT
+ OpDecorate %5 BuiltIn CullPrimitiveEXT
+ OpDecorate %5 PerPrimitiveEXT
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+ %uint = OpTypeInt 32 0
+%uint_2 = OpConstant %uint 2
+ %bool = OpTypeBool
+%false = OpConstantFalse %bool
+%_ptr_Input_uint = OpTypePointer Input %uint
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%_arr_v4float_uint_2 = OpTypeArray %v4float %uint_2
+%_ptr_Output__arr_v4float_uint_2 = OpTypePointer Output %_arr_v4float_uint_2
+%v3uint = OpTypeVector %uint 3
+%_arr_v3uint_uint_2 = OpTypeArray %v3uint %uint_2
+%_ptr_Output__arr_v3uint_uint_2 = OpTypePointer Output %_arr_v3uint_uint_2
+%_arr_bool_uint_2 = OpTypeArray %bool %uint_2
+%_ptr_Output__arr_bool_uint_2 = OpTypePointer Output %_arr_bool_uint_2
+ %void = OpTypeVoid
+ %21 = OpTypeFunction %void
+%_ptr_Output_bool = OpTypePointer Output %bool
+%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
+%gl_Position = OpVariable %_ptr_Output__arr_v4float_uint_2 Output
+ %4 = OpVariable %_ptr_Output__arr_v3uint_uint_2 Output
+ %5 = OpVariable %_ptr_Output__arr_bool_uint_2 Output
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_2 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_2
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_2 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_2
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_2 Output
+ %main = OpFunction %void None %21
+ %23 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_2 %gl_MeshPrimitivesEXT
+ %24 = OpLoad %uint %gl_LocalInvocationIndex
+ OpSetMeshOutputsEXT %uint_2 %uint_2
+ %25 = OpAccessChain %_ptr_Output_bool %5 %24
+ OpStore %25 %false
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-10591"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinCullPrimitiveEXTStorageClass) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_CullPrimitiveEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Input %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Input
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-07035"));
+}
+
+TEST_F(ValidateBuiltIns, BadBuiltinCullPrimitiveEXTWithPerPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_CullPrimitiveEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ %ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-07038"));
+}
+
+TEST_F(ValidateBuiltIns, BadBuiltinPrimitiveShadingRateWithPerPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_PrimitiveShadingRateKHR"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn PrimitiveShadingRateKHR
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-07059"));
+}
+
+TEST_F(ValidateBuiltIns, BadExecModelVulkanCullPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingNV
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_NV_mesh_shader"
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshNV %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesNV 32
+ OpExecutionMode %main OutputTrianglesNV
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn CullPrimitiveEXT
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+ %bool = OpTypeBool
+ %int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_ptr_Output_bool = OpTypePointer Output %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %18 = OpAccessChain %_ptr_Output_bool %gl_MeshPrimitivesEXT %int_0 %int_0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-CullPrimitiveEXT-CullPrimitiveEXT-07034"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinLayerInBlockMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_Layer"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn Layer
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinLayerAsArrayOfIntMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_Layer
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpDecorate %gl_Layer BuiltIn Layer
+ OpDecorate %gl_Layer PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_Layer_uint_32 = OpTypeArray %int %uint_32
+%_ptr_Output__arr_gl_Layer_uint_32 = OpTypePointer Output %_arr_gl_Layer_uint_32
+%gl_Layer = OpVariable %_ptr_Output__arr_gl_Layer_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinLayerArrayTypeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_Layer
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpDecorate %gl_Layer BuiltIn Layer
+ OpDecorate %gl_Layer PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_Layer_uint_32 = OpTypeArray %bool %uint_32
+%_ptr_Output__arr_gl_Layer_uint_32 = OpTypePointer Output %_arr_gl_Layer_uint_32
+%gl_Layer = OpVariable %_ptr_Output__arr_gl_Layer_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_Layer_uint_32 %gl_Layer
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-Layer-Layer-10592"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinLayerInBlockMeshEXTType) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_Layer"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn Layer
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ %ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-Layer-Layer-10592"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinLayerArrayOfIntSizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_Layer
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpDecorate %gl_Layer BuiltIn Layer
+ OpDecorate %gl_Layer PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_Layer_uint_32 = OpTypeArray %int %uint_32
+%_ptr_Output__arr_gl_Layer_uint_32 = OpTypePointer Output %_arr_gl_Layer_uint_32
+%gl_Layer = OpVariable %_ptr_Output__arr_gl_Layer_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_Layer_uint_32 %gl_Layer
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-Layer-Layer-10593"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinLayerInBlockArraySizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_Layer"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn Layer
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-Layer-Layer-10594"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinLayerWithPerPrimitiveEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpCapability Shader
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %MainMesh "MainMesh" %gl_Layer
+ OpExecutionMode %MainMesh OutputPrimitivesNV 1
+ OpExecutionMode %MainMesh OutputVertices 3
+ OpExecutionMode %MainMesh OutputTrianglesNV
+ OpExecutionMode %MainMesh LocalSize 1 1 1
+ OpSource Slang 1
+ OpName %MainMesh "MainMesh"
+ OpDecorate %gl_Layer BuiltIn Layer
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+ %float = OpTypeFloat 32
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %int_3 = OpConstant %int 3
+%uint_0 = OpConstant %uint 0
+%v3float = OpTypeVector %float 3
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%v3uint = OpTypeVector %uint 3
+%_ptr_Output_v3uint = OpTypePointer Output %v3uint
+%_ptr_Output_int = OpTypePointer Output %int
+%_arr_int_int_1 = OpTypeArray %int %int_1
+%_ptr_Output__arr_int_int_1 = OpTypePointer Output %_arr_int_int_1
+%gl_Layer = OpVariable %_ptr_Output__arr_int_int_1 Output
+%MainMesh = OpFunction %void None %9
+ %25 = OpLabel
+%ref_load = OpLoad %_arr_int_int_1 %gl_Layer
+ OpSetMeshOutputsEXT %uint_3 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-Layer-Layer-07039"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinPrimitiveShadingRateKHRInBlockMeshEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_PrimitiveShadingRateEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn PrimitiveShadingRateKHR
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+%5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns,
+ VulkanBuiltinPrimitiveShadingRateKHRInArrayOfIntMeshEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveShadingRateEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveShadingRateEXT "gl_PrimitiveShadingRateEXT"
+ OpDecorate %gl_PrimitiveShadingRateEXT BuiltIn PrimitiveShadingRateKHR
+ OpDecorate %gl_PrimitiveShadingRateEXT PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_PrimitiveShadingRateEXT_uint_32 = OpTypeArray %int %uint_32
+%_ptr_Output__arr_gl_PrimitiveShadingRateEXT_uint_32 = OpTypePointer Output %_arr_gl_PrimitiveShadingRateEXT_uint_32
+%gl_PrimitiveShadingRateEXT = OpVariable %_ptr_Output__arr_gl_PrimitiveShadingRateEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_PrimitiveShadingRateEXT_uint_32 %gl_PrimitiveShadingRateEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns,
+ BadVulkanBuiltinPrimitiveShadingRateKHRInArrayTypeMeshEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveShadingRateEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveShadingRateEXT "gl_PrimitiveShadingRateEXT"
+ OpDecorate %gl_PrimitiveShadingRateEXT BuiltIn PrimitiveShadingRateKHR
+ OpDecorate %gl_PrimitiveShadingRateEXT PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_PrimitiveShadingRateEXT_uint_32 = OpTypeArray %bool %uint_32
+%_ptr_Output__arr_gl_PrimitiveShadingRateEXT_uint_32 = OpTypePointer Output %_arr_gl_PrimitiveShadingRateEXT_uint_32
+%gl_PrimitiveShadingRateEXT = OpVariable %_ptr_Output__arr_gl_PrimitiveShadingRateEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ %ref_load = OpLoad %_arr_gl_PrimitiveShadingRateEXT_uint_32 %gl_PrimitiveShadingRateEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10598"));
+}
+
+TEST_F(ValidateBuiltIns,
+ BadVulkanBuiltinPrimitiveShadingRateKHRInBlockTypeMeshEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_PrimitiveShadingRateEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn PrimitiveShadingRateKHR
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+%5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10598"));
+}
+
+TEST_F(ValidateBuiltIns,
+ BadVulkanBuiltinPrimitiveShadingRateKHRInBlockSizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_PrimitiveShadingRateEXT"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn PrimitiveShadingRateKHR
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+%5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10600"));
+}
+
+TEST_F(ValidateBuiltIns,
+ BadVulkanBuiltinPrimitiveShadingRateKHRInArraySizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_PrimitiveShadingRateEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_PrimitiveShadingRateEXT "gl_PrimitiveShadingRateEXT"
+ OpDecorate %gl_PrimitiveShadingRateEXT BuiltIn PrimitiveShadingRateKHR
+ OpDecorate %gl_PrimitiveShadingRateEXT PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_PrimitiveShadingRateEXT_uint_32 = OpTypeArray %int %uint_32
+%_ptr_Output__arr_gl_PrimitiveShadingRateEXT_uint_32 = OpTypePointer Output %_arr_gl_PrimitiveShadingRateEXT_uint_32
+%gl_PrimitiveShadingRateEXT = OpVariable %_ptr_Output__arr_gl_PrimitiveShadingRateEXT_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_PrimitiveShadingRateEXT_uint_32 %gl_PrimitiveShadingRateEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveShadingRateKHR-PrimitiveShadingRateKHR-10599"));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinViewportIndexInBlockMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_ViewportIndex"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn ViewportIndex
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+%5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, VulkanBuiltinViewportIndexAsArrayOfIntMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_ViewportIndex
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_ViewportIndex "gl_ViewportIndex"
+ OpDecorate %gl_ViewportIndex BuiltIn ViewportIndex
+ OpDecorate %gl_ViewportIndex PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_ViewportIndex_uint_32 = OpTypeArray %int %uint_32
+%_ptr_Output__arr_gl_ViewportIndex_uint_32 = OpTypePointer Output %_arr_gl_ViewportIndex_uint_32
+%gl_ViewportIndex = OpVariable %_ptr_Output__arr_gl_ViewportIndex_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinViewportIndexInBlockTypeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_ViewportIndex"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn ViewportIndex
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %bool
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+%5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-ViewportIndex-ViewportIndex-10601"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinViewportIndexAsArrayTypeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_ViewportIndex
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_ViewportIndex "gl_ViewportIndex"
+ OpDecorate %gl_ViewportIndex BuiltIn ViewportIndex
+ OpDecorate %gl_ViewportIndex PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_ViewportIndex_uint_32 = OpTypeArray %bool %uint_32
+%_ptr_Output__arr_gl_ViewportIndex_uint_32 = OpTypePointer Output %_arr_gl_ViewportIndex_uint_32
+%gl_ViewportIndex = OpVariable %_ptr_Output__arr_gl_ViewportIndex_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_ViewportIndex_uint_32 %gl_ViewportIndex
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-ViewportIndex-ViewportIndex-10601"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinViewportIndexInBlockArraySizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_MeshPerPrimitiveEXT "gl_MeshPerPrimitiveEXT"
+ OpMemberName %gl_MeshPerPrimitiveEXT 0 "gl_ViewportIndex"
+ OpName %gl_MeshPrimitivesEXT "gl_MeshPrimitivesEXT"
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn ViewportIndex
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %int
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%main = OpFunction %void None %3
+%5 = OpLabel
+%ref_load = OpLoad %_arr_gl_MeshPerPrimitiveEXT_uint_32 %gl_MeshPrimitivesEXT
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-ViewportIndex-ViewportIndex-10603"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinViewportIndexAsArrayOfIntSizeMeshEXT) {
+ const std::string text = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_ViewportIndex
+ OpExecutionModeId %main LocalSizeId %uint_32 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 16
+ OpExecutionMode %main OutputTrianglesEXT
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %gl_ViewportIndex "gl_ViewportIndex"
+ OpDecorate %gl_ViewportIndex BuiltIn ViewportIndex
+ OpDecorate %gl_ViewportIndex PerPrimitiveEXT
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_32 = OpConstant %uint 32
+%uint_1 = OpConstant %uint 1
+%int = OpTypeInt 32 1
+%bool = OpTypeBool
+%_arr_gl_ViewportIndex_uint_32 = OpTypeArray %int %uint_32
+%_ptr_Output__arr_gl_ViewportIndex_uint_32 = OpTypePointer Output %_arr_gl_ViewportIndex_uint_32
+%gl_ViewportIndex = OpVariable %_ptr_Output__arr_gl_ViewportIndex_uint_32 Output
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%ref_load = OpLoad %_arr_gl_ViewportIndex_uint_32 %gl_ViewportIndex
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-ViewportIndex-ViewportIndex-10602"));
+}
+
+TEST_F(ValidateBuiltIns, BadVulkanBuiltinPrimitiveIdFragmentWithRayTracing) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability RayTracingKHR
+ OpExtension "SPV_KHR_ray_tracing"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %outVar %gl_PrimitiveID
+ OpExecutionMode %main OriginUpperLeft
+ OpDecorate %outVar Location 0
+ OpDecorate %gl_PrimitiveID BuiltIn PrimitiveId
+ OpDecorate %gl_PrimitiveID Flat
+ %void = OpTypeVoid
+ %4 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v4int = OpTypeVector %int 4
+%ptrOut = OpTypePointer Output %v4int
+%outVar = OpVariable %ptrOut Output
+ %ptrIn = OpTypePointer Input %int
+%gl_PrimitiveID = OpVariable %ptrIn Input
+ %main = OpFunction %void None %4
+ %6 = OpLabel
+ %13 = OpLoad %int %gl_PrimitiveID
+ %14 = OpCompositeConstruct %v4int %13 %13 %13 %13
+ OpStore %outVar %14
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveId-PrimitiveId-04333"));
+}
+
+TEST_F(ValidateBuiltIns, TessellationMissingPatch) {
+ const std::string spirv = R"(
+ OpCapability Tessellation
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %main "main" %gl_TessLevelInner %gl_TessLevelOuter
+ OpExecutionMode %main OutputVertices 3
+ OpDecorate %gl_TessLevelInner BuiltIn TessLevelInner
+ OpDecorate %gl_TessLevelOuter BuiltIn TessLevelOuter
+ OpDecorate %gl_TessLevelOuter Patch
+ %void = OpTypeVoid
+ %4 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
+%gl_TessLevelInner = OpVariable %_ptr_Output__arr_float_uint_2 Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %float_1 = OpConstant %float 1
+%_ptr_Output_float = OpTypePointer Output %float
+ %uint_4 = OpConstant %uint 4
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+%gl_TessLevelOuter = OpVariable %_ptr_Output__arr_float_uint_4 Output
+ %main = OpFunction %void None %4
+ %6 = OpLabel
+ %17 = OpAccessChain %_ptr_Output_float %gl_TessLevelInner %int_0
+ OpStore %17 %float_1
+ %22 = OpAccessChain %_ptr_Output_float %gl_TessLevelOuter %int_0
+ OpStore %22 %float_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("BuiltIn TessLevelInner variable needs to also have a "
+ "Patch decoration"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-TessLevelInner-10880"));
+}
+
+// From dEQP-VK.mesh_shader.ext.builtin.primitive_id_spirv
+TEST_F(ValidateBuiltIns, PrimitiveIdInFragmentWithMeshCapability) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %9 %gl_PrimitiveID
+ OpExecutionMode %4 OriginUpperLeft
+ OpDecorate %9 Location 0
+ OpDecorate %gl_PrimitiveID Flat
+ OpDecorate %gl_PrimitiveID BuiltIn PrimitiveId
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %9 = OpVariable %_ptr_Output_v4float Output
+ %int = OpTypeInt 32 1
+%_ptr_Input_int = OpTypePointer Input %int
+%gl_PrimitiveID = OpVariable %_ptr_Input_int Input
+%int_1629198956 = OpConstant %int 1629198956
+ %bool = OpTypeBool
+ %float_0 = OpConstant %float 0
+ %float_1 = OpConstant %float 1
+ %19 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
+ %20 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
+ %v4bool = OpTypeVector %bool 4
+ %4 = OpFunction %void None %3
+ %5 = OpLabel
+ %13 = OpLoad %int %gl_PrimitiveID
+ %16 = OpIEqual %bool %13 %int_1629198956
+ %22 = OpCompositeConstruct %v4bool %16 %16 %16 %16
+ %23 = OpSelect %v4float %22 %19 %20
+ OpStore %9 %23
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+// https://github.com/KhronosGroup/SPIRV-Tools/issues/6237
+TEST_F(ValidateBuiltIns, MeshBuiltinUnsignedInt) {
+ const std::string spirv = R"(
+ OpCapability FragmentShadingRateKHR
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpExtension "SPV_KHR_fragment_shading_rate"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_MeshPrimitivesEXT
+ OpExecutionModeId %main LocalSizeId %uint_1 %uint_1 %uint_1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpDecorate %gl_MeshPerPrimitiveEXT Block
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 BuiltIn PrimitiveId
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 0 PerPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 1 BuiltIn Layer
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 1 PerPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 2 BuiltIn ViewportIndex
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 2 PerPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 3 BuiltIn CullPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 3 PerPrimitiveEXT
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 4 BuiltIn PrimitiveShadingRateKHR
+ OpMemberDecorate %gl_MeshPerPrimitiveEXT 4 PerPrimitiveEXT
+ %void = OpTypeVoid
+ %4 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %bool = OpTypeBool
+ %int_0 = OpConstant %int 0
+ %uint_0 = OpConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_2 = OpConstant %uint 2
+ %uint_3 = OpConstant %uint 3
+ %uint_4 = OpConstant %uint 4
+ %uint_81 = OpConstant %uint 81
+ %uint_32 = OpConstant %uint 32
+%gl_MeshPerPrimitiveEXT = OpTypeStruct %uint %uint %uint %bool %uint
+%_arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypeArray %gl_MeshPerPrimitiveEXT %uint_32
+%_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 = OpTypePointer Output %_arr_gl_MeshPerPrimitiveEXT_uint_32
+%gl_MeshPrimitivesEXT = OpVariable %_ptr_Output__arr_gl_MeshPerPrimitiveEXT_uint_32 Output
+%_ptr_Output_uint = OpTypePointer Output %uint
+ %main = OpFunction %void None %4
+ %6 = OpLabel
+ OpSetMeshOutputsEXT %uint_81 %uint_32
+ %20 = OpAccessChain %_ptr_Output_uint %gl_MeshPrimitivesEXT %int_0 %uint_0
+ OpStore %20 %uint_1
+ %22 = OpAccessChain %_ptr_Output_uint %gl_MeshPrimitivesEXT %int_0 %uint_1
+ OpStore %22 %uint_2
+ %24 = OpAccessChain %_ptr_Output_uint %gl_MeshPrimitivesEXT %int_0 %uint_2
+ OpStore %24 %uint_3
+ %26 = OpAccessChain %_ptr_Output_uint %gl_MeshPrimitivesEXT %int_0 %uint_4
+ OpStore %26 %uint_4
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_capability_test.cpp b/third_party/SPIRV-Tools/test/val/val_capability_test.cpp
index 0d84caa..cd4f852 100644
--- a/third_party/SPIRV-Tools/test/val/val_capability_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_capability_test.cpp
@@ -116,6 +116,10 @@
using ValidateCapabilityVulkan11 = spvtest::ValidateBase<CapTestParameter>;
// Always assembles using Vulkan 1.2.
using ValidateCapabilityVulkan12 = spvtest::ValidateBase<CapTestParameter>;
+// Always assembles using Vulkan 1.3.
+using ValidateCapabilityVulkan13 = spvtest::ValidateBase<CapTestParameter>;
+// Always assembles using Vulkan 1.4.
+using ValidateCapabilityVulkan14 = spvtest::ValidateBase<CapTestParameter>;
TEST_F(ValidateCapability, Default) {
const char str[] = R"(
@@ -325,6 +329,119 @@
return *r;
}
+const std::vector<std::string>& AllSpirV16Capabilities() {
+ static const auto r = new std::vector<std::string>{
+ "",
+ "Matrix",
+ "Shader",
+ "Geometry",
+ "Tessellation",
+ "Addresses",
+ "Linkage",
+ "Kernel",
+ "Vector16",
+ "Float16Buffer",
+ "Float16",
+ "Float64",
+ "Int64",
+ "Int64Atomics",
+ "ImageBasic",
+ "ImageReadWrite",
+ "ImageMipmap",
+ "Pipes",
+ "Groups",
+ "DeviceEnqueue",
+ "LiteralSampler",
+ "AtomicStorage",
+ "Int16",
+ "TessellationPointSize",
+ "GeometryPointSize",
+ "ImageGatherExtended",
+ "StorageImageMultisample",
+ "UniformBufferArrayDynamicIndexing",
+ "SampledImageArrayDynamicIndexing",
+ "StorageBufferArrayDynamicIndexing",
+ "StorageImageArrayDynamicIndexing",
+ "ClipDistance",
+ "CullDistance",
+ "ImageCubeArray",
+ "SampleRateShading",
+ "ImageRect",
+ "SampledRect",
+ "GenericPointer",
+ "Int8",
+ "InputAttachment",
+ "SparseResidency",
+ "MinLod",
+ "Sampled1D",
+ "Image1D",
+ "SampledCubeArray",
+ "SampledBuffer",
+ "ImageBuffer",
+ "ImageMSArray",
+ "StorageImageExtendedFormats",
+ "ImageQuery",
+ "DerivativeControl",
+ "InterpolationFunction",
+ "TransformFeedback",
+ "GeometryStreams",
+ "StorageImageReadWithoutFormat",
+ "StorageImageWriteWithoutFormat",
+ "MultiViewport",
+ "SubgroupDispatch",
+ "NamedBarrier",
+ "PipeStorage",
+ "GroupNonUniform",
+ "GroupNonUniformVote",
+ "GroupNonUniformArithmetic",
+ "GroupNonUniformBallot",
+ "GroupNonUniformShuffle",
+ "GroupNonUniformShuffleRelative",
+ "GroupNonUniformClustered",
+ "GroupNonUniformQuad",
+ "DrawParameters",
+ "StorageBuffer16BitAccess",
+ "StorageUniformBufferBlock16",
+ "UniformAndStorageBuffer16BitAccess",
+ "StorageUniform16",
+ "StoragePushConstant16",
+ "StorageInputOutput16",
+ "DeviceGroup",
+ "MultiView",
+ "VariablePointersStorageBuffer",
+ "VariablePointers",
+ "DenormPreserve",
+ "DenormFlushToZero",
+ "SignedZeroInfNanPreserve",
+ "RoundingModeRTE",
+ "RoundingModeRTZ",
+ // Omitted due to extra validation requirements on memory model.
+ //"VulkanMemoryModel",
+ //"VulkanMemoryModelDeviceScope",
+ "StorageBuffer8BitAccess",
+ "UniformAndStorageBuffer8BitAccess",
+ "StoragePushConstant8",
+ "ShaderViewportIndex",
+ "ShaderLayer",
+ "PhysicalStorageBufferAddresses",
+ "RuntimeDescriptorArray",
+ "UniformTexelBufferArrayDynamicIndexing",
+ "StorageTexelBufferArrayDynamicIndexing",
+ "UniformBufferArrayNonUniformIndexing",
+ "SampledImageArrayNonUniformIndexing",
+ "StorageBufferArrayNonUniformIndexing",
+ "StorageImageArrayNonUniformIndexing",
+ "InputAttachmentArrayNonUniformIndexing",
+ "UniformTexelBufferArrayNonUniformIndexing",
+ "StorageTexelBufferArrayNonUniformIndexing",
+ "DotProduct",
+ "DotProductInputAll",
+ "DotProductInput4x8Bit",
+ "DotProductInput4x8BitPacked"
+ };
+ return *r;
+}
+
const std::vector<std::string>& AllSpirV10Capabilities() {
static const auto r = new std::vector<std::string>{
"",
@@ -586,6 +703,194 @@
return *r;
}
+const std::vector<std::string>& AllVulkan13Capabilities() {
+ static const auto r = new std::vector<std::string>{
+ "",
+ "Matrix",
+ "Shader",
+ "InputAttachment",
+ "Sampled1D",
+ "Image1D",
+ "SampledBuffer",
+ "ImageBuffer",
+ "ImageQuery",
+ "DerivativeControl",
+ "Geometry",
+ "Tessellation",
+ "Float16",
+ "Float64",
+ "Int64",
+ "Int64Atomics",
+ "Int16",
+ "TessellationPointSize",
+ "GeometryPointSize",
+ "ImageGatherExtended",
+ "StorageImageMultisample",
+ "UniformBufferArrayDynamicIndexing",
+ "SampledImageArrayDynamicIndexing",
+ "StorageBufferArrayDynamicIndexing",
+ "StorageImageArrayDynamicIndexing",
+ "ClipDistance",
+ "CullDistance",
+ "ImageCubeArray",
+ "SampleRateShading",
+ "Int8",
+ "SparseResidency",
+ "MinLod",
+ "SampledCubeArray",
+ "ImageMSArray",
+ "StorageImageExtendedFormats",
+ "InterpolationFunction",
+ "StorageImageReadWithoutFormat",
+ "StorageImageWriteWithoutFormat",
+ "MultiViewport",
+ "GroupNonUniform",
+ "GroupNonUniformVote",
+ "GroupNonUniformArithmetic",
+ "GroupNonUniformBallot",
+ "GroupNonUniformShuffle",
+ "GroupNonUniformShuffleRelative",
+ "GroupNonUniformClustered",
+ "GroupNonUniformQuad",
+ "DrawParameters",
+ "StorageBuffer16BitAccess",
+ "StorageUniformBufferBlock16",
+ "UniformAndStorageBuffer16BitAccess",
+ "StorageUniform16",
+ "StoragePushConstant16",
+ "StorageInputOutput16",
+ "DeviceGroup",
+ "MultiView",
+ "VariablePointersStorageBuffer",
+ "VariablePointers",
+ "TransformFeedback",
+ "GeometryStreams",
+ "DenormPreserve",
+ "DenormFlushToZero",
+ "SignedZeroInfNanPreserve",
+ "RoundingModeRTE",
+ "RoundingModeRTZ",
+ "VulkanMemoryModel",
+ "VulkanMemoryModelDeviceScope",
+ "StorageBuffer8BitAccess",
+ "UniformAndStorageBuffer8BitAccess",
+ "StoragePushConstant8",
+ "ShaderViewportIndex",
+ "ShaderLayer",
+ "PhysicalStorageBufferAddresses",
+ "RuntimeDescriptorArray",
+ "UniformTexelBufferArrayDynamicIndexing",
+ "StorageTexelBufferArrayDynamicIndexing",
+ "UniformBufferArrayNonUniformIndexing",
+ "SampledImageArrayNonUniformIndexing",
+ "StorageBufferArrayNonUniformIndexing",
+ "StorageImageArrayNonUniformIndexing",
+ "InputAttachmentArrayNonUniformIndexing",
+ "UniformTexelBufferArrayNonUniformIndexing",
+ "StorageTexelBufferArrayNonUniformIndexing",
+ "DotProduct",
+ "DotProductInputAll",
+ "DotProductInput4x8Bit",
+ "DotProductInput4x8BitPacked",
+ "DemoteToHelperInvocation",
+ };
+ return *r;
+}
+
+const std::vector<std::string>& AllVulkan14Capabilities() {
+ static const auto r = new std::vector<std::string>{
+ "",
+ "Matrix",
+ "Shader",
+ "InputAttachment",
+ "Sampled1D",
+ "Image1D",
+ "SampledBuffer",
+ "ImageBuffer",
+ "ImageQuery",
+ "DerivativeControl",
+ "Geometry",
+ "Tessellation",
+ "Float16",
+ "Float64",
+ "Int64",
+ "Int64Atomics",
+ "Int16",
+ "TessellationPointSize",
+ "GeometryPointSize",
+ "ImageGatherExtended",
+ "StorageImageMultisample",
+ "UniformBufferArrayDynamicIndexing",
+ "SampledImageArrayDynamicIndexing",
+ "StorageBufferArrayDynamicIndexing",
+ "StorageImageArrayDynamicIndexing",
+ "ClipDistance",
+ "CullDistance",
+ "ImageCubeArray",
+ "SampleRateShading",
+ "Int8",
+ "SparseResidency",
+ "MinLod",
+ "SampledCubeArray",
+ "ImageMSArray",
+ "StorageImageExtendedFormats",
+ "InterpolationFunction",
+ "StorageImageReadWithoutFormat",
+ "StorageImageWriteWithoutFormat",
+ "MultiViewport",
+ "GroupNonUniform",
+ "GroupNonUniformVote",
+ "GroupNonUniformArithmetic",
+ "GroupNonUniformBallot",
+ "GroupNonUniformShuffle",
+ "GroupNonUniformShuffleRelative",
+ "GroupNonUniformClustered",
+ "GroupNonUniformQuad",
+ "DrawParameters",
+ "StorageBuffer16BitAccess",
+ "StorageUniformBufferBlock16",
+ "UniformAndStorageBuffer16BitAccess",
+ "StorageUniform16",
+ "StoragePushConstant16",
+ "StorageInputOutput16",
+ "DeviceGroup",
+ "MultiView",
+ "VariablePointersStorageBuffer",
+ "VariablePointers",
+ "TransformFeedback",
+ "GeometryStreams",
+ "DenormPreserve",
+ "DenormFlushToZero",
+ "SignedZeroInfNanPreserve",
+ "RoundingModeRTE",
+ "RoundingModeRTZ",
+ "VulkanMemoryModel",
+ "VulkanMemoryModelDeviceScope",
+ "StorageBuffer8BitAccess",
+ "UniformAndStorageBuffer8BitAccess",
+ "StoragePushConstant8",
+ "ShaderViewportIndex",
+ "ShaderLayer",
+ "PhysicalStorageBufferAddresses",
+ "RuntimeDescriptorArray",
+ "UniformTexelBufferArrayDynamicIndexing",
+ "StorageTexelBufferArrayDynamicIndexing",
+ "UniformBufferArrayNonUniformIndexing",
+ "SampledImageArrayNonUniformIndexing",
+ "StorageBufferArrayNonUniformIndexing",
+ "StorageImageArrayNonUniformIndexing",
+ "InputAttachmentArrayNonUniformIndexing",
+ "UniformTexelBufferArrayNonUniformIndexing",
+ "StorageTexelBufferArrayNonUniformIndexing",
+ "DotProduct",
+ "DotProductInputAll",
+ "DotProductInput4x8Bit",
+ "DotProductInput4x8BitPacked",
+ "DemoteToHelperInvocation",
+ };
+ return *r;
+}
+
const std::vector<std::string>& MatrixDependencies() {
static const auto r = new std::vector<std::string>{
"Matrix",
@@ -1940,6 +2245,54 @@
AllVulkan12Capabilities())
)));
+INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityVulkan13,
+ Combine(
+ // All capabilities to try.
+ ValuesIn(AllSpirV16Capabilities()),
+ Values(
+std::make_pair(std::string(kGLSL450MemoryModel) +
+ "OpEntryPoint Vertex %func \"shader\" %var\n" +
+ "OpDecorate %var BuiltIn PointSize\n"
+ "%float = OpTypeFloat 32\n"
+ "%ptr_output_float = OpTypePointer Output %float\n"
+ "%var = OpVariable %ptr_output_float Output\n" + std::string(kVoidFVoid),
+ AllVulkan13Capabilities()),
+std::make_pair(std::string(kGLSL450MemoryModel) +
+ "OpEntryPoint Vertex %func \"shader\" %var\n" +
+ "OpDecorate %var BuiltIn CullDistance\n"
+ "%float = OpTypeFloat 32\n"
+ "%int = OpTypeInt 32 0\n"
+ "%int_1 = OpConstant %int 1\n"
+ "%array = OpTypeArray %float %int_1\n"
+ "%ptr = OpTypePointer Output %array\n"
+ "%var = OpVariable %ptr Output\n" + std::string(kVoidFVoid),
+ AllVulkan13Capabilities())
+)));
+
+INSTANTIATE_TEST_SUITE_P(Capabilities, ValidateCapabilityVulkan14,
+ Combine(
+ // All capabilities to try.
+ ValuesIn(AllSpirV16Capabilities()),
+ Values(
+std::make_pair(std::string(kGLSL450MemoryModel) +
+ "OpEntryPoint Vertex %func \"shader\" %var\n" +
+ "OpDecorate %var BuiltIn PointSize\n"
+ "%float = OpTypeFloat 32\n"
+ "%ptr_output_float = OpTypePointer Output %float\n"
+ "%var = OpVariable %ptr_output_float Output\n" + std::string(kVoidFVoid),
+ AllVulkan14Capabilities()),
+std::make_pair(std::string(kGLSL450MemoryModel) +
+ "OpEntryPoint Vertex %func \"shader\" %var\n" +
+ "OpDecorate %var BuiltIn CullDistance\n"
+ "%float = OpTypeFloat 32\n"
+ "%int = OpTypeInt 32 0\n"
+ "%int_1 = OpConstant %int 1\n"
+ "%array = OpTypeArray %float %int_1\n"
+ "%ptr = OpTypePointer Output %array\n"
+ "%var = OpVariable %ptr Output\n" + std::string(kVoidFVoid),
+ AllVulkan14Capabilities())
+)));
+
// TODO(umar): Selection Control
// TODO(umar): Loop Control
// TODO(umar): Function Control
@@ -2017,24 +2370,16 @@
// TODO(umar): Instruction capability checks
spv_result_t spvCoreOperandTableNameLookup(spv_target_env env,
- const spv_operand_table table,
const spv_operand_type_t type,
const char* name,
const size_t nameLength) {
- if (!table) return SPV_ERROR_INVALID_TABLE;
if (!name) return SPV_ERROR_INVALID_POINTER;
- for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) {
- const auto& group = table->types[typeIndex];
- if (type != group.type) continue;
- for (uint64_t index = 0; index < group.count; ++index) {
- const auto& entry = group.entries[index];
- // Check for min version only.
- if (spvVersionForTargetEnv(env) >= entry.minVersion &&
- nameLength == strlen(entry.name) &&
- !strncmp(entry.name, name, nameLength)) {
- return SPV_SUCCESS;
- }
+ const spvtools::OperandDesc* entry = nullptr;
+ if (SPV_SUCCESS == spvtools::LookupOperand(type, name, nameLength, &entry)) {
+ // Check for min version only.
+ if (spvVersionForTargetEnv(env) >= entry->minVersion) {
+ return SPV_SUCCESS;
}
}
@@ -2045,8 +2390,7 @@
bool Exists(const std::string& capability, spv_target_env env) {
ScopedContext sc(env);
return SPV_SUCCESS ==
- spvCoreOperandTableNameLookup(env, sc.context->operand_table,
- SPV_OPERAND_TYPE_CAPABILITY,
+ spvCoreOperandTableNameLookup(env, SPV_OPERAND_TYPE_CAPABILITY,
capability.c_str(), capability.size());
}
@@ -2114,6 +2458,28 @@
}
}
+TEST_P(ValidateCapabilityVulkan13, Capability) {
+ const std::string capability = Capability(GetParam());
+ if (Exists(capability, SPV_ENV_VULKAN_1_3)) {
+ const std::string test_code = MakeAssembly(GetParam());
+ CompileSuccessfully(test_code, SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(ExpectedResult(GetParam()),
+ ValidateInstructions(SPV_ENV_VULKAN_1_3))
+ << test_code;
+ }
+}
+
+TEST_P(ValidateCapabilityVulkan14, Capability) {
+ const std::string capability = Capability(GetParam());
+ if (Exists(capability, SPV_ENV_VULKAN_1_4)) {
+ const std::string test_code = MakeAssembly(GetParam());
+ CompileSuccessfully(test_code, SPV_ENV_VULKAN_1_4);
+ ASSERT_EQ(ExpectedResult(GetParam()),
+ ValidateInstructions(SPV_ENV_VULKAN_1_4))
+ << test_code;
+ }
+}
+
TEST_P(ValidateCapabilityOpenGL40, Capability) {
const std::string capability = Capability(GetParam());
if (Exists(capability, SPV_ENV_OPENGL_4_0)) {
@@ -2253,6 +2619,26 @@
HasSubstr("Capability DrawParameters is not allowed by Vulkan 1.0"));
}
+using OpenCLFloat16CapabilityBase = spvtest::ValidateBase<spv_target_env>;
+
+TEST_P(OpenCLFloat16CapabilityBase, OpenCLFloat16Capability) {
+ const std::string spirv = R"(
+OpCapability Kernel
+OpCapability Addresses
+OpCapability Linkage
+OpCapability Float16
+OpMemoryModel Physical64 OpenCL
+%f16 = OpTypeFloat 16
+)";
+ CompileSuccessfully(spirv, GetParam());
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(GetParam()));
+}
+
+INSTANTIATE_TEST_SUITE_P(OpenCLFloat16Capability, OpenCLFloat16CapabilityBase,
+ ValuesIn(std::vector<spv_target_env>{
+ SPV_ENV_OPENCL_1_2, SPV_ENV_OPENCL_2_0,
+ SPV_ENV_OPENCL_2_1, SPV_ENV_OPENCL_2_2}));
+
TEST_F(ValidateCapability, NonOpenCL12FullCapability) {
const std::string spirv = R"(
OpCapability Kernel
@@ -2828,7 +3214,8 @@
: "";
return std::string("OpCapability ") + cap + extra_cap + R"(
OpCapability Shader
-OpMemoryModel Logical )" + mem_model + R"(
+OpMemoryModel Logical )" +
+ mem_model + R"(
OpEntryPoint Vertex %main "main"
%void = OpTypeVoid
%void_fn = OpTypeFunction %void
@@ -2977,6 +3364,43 @@
EXPECT_THAT(getDiagnosticString(), Eq(""));
}
+TEST_F(ValidateCapability,
+ CooperativeMatrixKHRShaderRequiresVulkanMemoryModel) {
+ const auto spirv = R"(
+OpCapability Shader
+OpCapability CooperativeMatrixKHR
+OpCapability Linkage
+OpExtension "SPV_KHR_cooperative_matrix"
+OpMemoryModel Logical GLSL450
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_6);
+ EXPECT_EQ(SPV_ERROR_INVALID_CAPABILITY,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "If the Shader and CooperativeMatrixKHR capabilities are declared, "
+ "the VulkanMemoryModel capability must also be declared"));
+}
+
+TEST_F(ValidateCapability, TileShadingQCOM) {
+ const auto spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Vertex %func "main"
+)" + std::string(kVoidFVoid);
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The TileShadingQCOM capability must not be enabled "
+ "in any stage other than compute or fragment"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_cfg_test.cpp b/third_party/SPIRV-Tools/test/val/val_cfg_test.cpp
index 233aee6..ae2e45b 100644
--- a/third_party/SPIRV-Tools/test/val/val_cfg_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_cfg_test.cpp
@@ -5118,6 +5118,129 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateCFG, StructurallyUnreachableContinuePredecessor) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpSource ESSL 310
+ OpName %main "main"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %int_n7 = OpConstant %int -7
+ %bool = OpTypeBool
+ %main = OpFunction %void None %3
+ %8 = OpLabel
+ OpBranch %9
+ %9 = OpLabel
+ %10 = OpPhi %int %int_1 %8 %int_n7 %15
+ %12 = OpSGreaterThan %bool %10 %int_n7
+ OpLoopMerge %13 %15 None
+ OpBranchConditional %12 %14 %13
+ %14 = OpLabel
+ OpBranch %15
+ %15 = OpLabel
+ OpBranch %9
+ %17 = OpLabel
+ OpBranch %15
+ %13 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, FullyLoopPrecedingSwitchToContinue) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpName %main "main"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %bool = OpTypeBool
+ %true = OpConstantTrue %bool
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %main = OpFunction %void None %3
+ %4 = OpLabel
+ OpBranch %7
+ %7 = OpLabel
+ OpLoopMerge %8 %6 None
+ OpBranch %5
+ %5 = OpLabel
+ OpSelectionMerge %9 None
+ OpBranchConditional %true %10 %9
+ %10 = OpLabel
+ OpSelectionMerge %16 None
+ OpSwitch %int_0 %13
+ %13 = OpLabel
+ OpBranch %19
+ %19 = OpLabel
+ OpLoopMerge %20 %18 None
+ OpBranch %17
+ %17 = OpLabel
+ OpReturn
+ %18 = OpLabel
+ OpBranch %19
+ %20 = OpLabel
+ OpSelectionMerge %23 None
+ OpSwitch %int_1 %21
+ %21 = OpLabel
+ OpBranch %6
+ %23 = OpLabel
+ OpBranch %16
+ %16 = OpLabel
+ OpBranch %9
+ %9 = OpLabel
+ OpBranch %6
+ %6 = OpLabel
+ OpBranch %7
+ %8 = OpLabel
+ OpUnreachable
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateCFG, CaseBreak) {
+ const std::string text = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginUpperLeft
+OpName %main "main"
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%bool = OpTypeBool
+%true = OpConstantTrue %bool
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%main = OpFunction %void None %3
+%4 = OpLabel
+OpSelectionMerge %merge None
+OpSwitch %int_1 %case 2 %merge
+%case = OpLabel
+OpBranch %merge
+%merge = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_composites_test.cpp b/third_party/SPIRV-Tools/test/val/val_composites_test.cpp
index 6e0d7c0..7ac0df2 100644
--- a/third_party/SPIRV-Tools/test/val/val_composites_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_composites_test.cpp
@@ -1565,9 +1565,10 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -1592,8 +1593,8 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
@@ -1606,9 +1607,10 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -1633,8 +1635,9 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected Constituent type to be equal to the component type"));
@@ -2102,6 +2105,191 @@
HasSubstr("OpCopyObject cannot have void result type"));
}
+TEST_F(ValidateComposites, CoopVecConstantCompositePass) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpExtension "SPV_NV_cooperative_vector"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_16
+
+%f16_1 = OpConstant %f16 1
+
+%f16vec_1 = OpConstantComposite %f16vec %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateComposites, CoopVecConstantCompositeMismatchFail) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpExtension "SPV_NV_cooperative_vector"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_16
+
+%f32_1 = OpConstant %f32 1
+
+%f16vec_1 = OpConstantComposite %f16vec %f32_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpConstantComposite Constituent <id> count does not match "
+ "Result Type <id> '11[%11]'s vector component count"));
+}
+
+TEST_F(ValidateComposites, CoopVecCompositeConstructPass) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpExtension "SPV_NV_cooperative_vector"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_16
+
+%f16_1 = OpConstant %f16 1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%f16vec_1 = OpCompositeConstruct %f16vec %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateComposites, CoopVecCompositeConstructMismatchFail) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpExtension "SPV_NV_cooperative_vector"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_16
+
+%f32_1 = OpConstant %f32 1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%f16vec_1 = OpCompositeConstruct %f16vec %f32_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected Constituents to be scalars or vectors of the "
+ "same type as Result Type components"));
+}
+
+TEST_F(ValidateComposites, CoopVecInsertExtractDynamicPass) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpExtension "SPV_NV_cooperative_vector"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+
+%u32_1 = OpConstant %u32 1
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_16
+
+%f16_1 = OpConstant %f16 1
+%f16vec_1 = OpConstantComposite %f16vec %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1 %f16_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%insert = OpVectorInsertDynamic %f16vec %f16vec_1 %f16_1 %u32_1
+%extract = OpVectorExtractDynamic %f16 %insert %u32_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_conversion_test.cpp b/third_party/SPIRV-Tools/test/val/val_conversion_test.cpp
index 0128aa1..2d18333 100644
--- a/third_party/SPIRV-Tools/test/val/val_conversion_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_conversion_test.cpp
@@ -39,6 +39,7 @@
const std::string capabilities =
R"(
OpCapability Shader
+OpCapability Float16
OpCapability Int64
OpCapability Float64)";
@@ -54,6 +55,7 @@
%func = OpTypeFunction %void
%bool = OpTypeBool
%f32 = OpTypeFloat 32
+%f16 = OpTypeFloat 16
%u32 = OpTypeInt 32 0
%s32 = OpTypeInt 32 1
%f64 = OpTypeFloat 64
@@ -84,6 +86,8 @@
%f32_3 = OpConstant %f32 3
%f32_4 = OpConstant %f32 4
+%f16_1 = OpConstant %f16 1
+
%s32_0 = OpConstant %s32 0
%s32_1 = OpConstant %s32 1
%s32_2 = OpConstant %s32 2
@@ -581,7 +585,7 @@
"Type: FConvert"));
}
-TEST_F(ValidateConversion, FConvertSameBitWidth) {
+TEST_F(ValidateConversion, FConvertSameBitWidthNoEncoding) {
const std::string body = R"(
%val = OpFConvert %f32 %f32_1
)";
@@ -589,8 +593,46 @@
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Expected input to have different bit width from "
- "Result Type: FConvert"));
+ HasSubstr("Expected component type of Value to be different from "
+ "component type of Result Type: FConvert"));
+}
+
+TEST_F(ValidateConversion, ValidFConvertSameBitWidthDifferentEncoding) {
+ const std::string extensions = R"(
+OpCapability Float8EXT
+OpExtension "SPV_EXT_float8"
+)";
+ const std::string types = R"(
+%fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
+%fp8e5m2 = OpTypeFloat 8 Float8E5M2EXT
+%fp8e4m3_1 = OpConstant %fp8e4m3 1
+%fp8e5m2_1 = OpConstant %fp8e5m2 1
+)";
+ const std::string body = R"(
+%val1 = OpFConvert %fp8e4m3 %fp8e5m2_1
+%val2 = OpFConvert %fp8e5m2 %fp8e4m3_1
+)";
+
+ CompileSuccessfully(GenerateShaderCode(body, extensions, "", types).c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateConversion, FConvertFloat16ToBFloat16) {
+ const std::string extensions = R"(
+OpCapability BFloat16TypeKHR
+OpExtension "SPV_KHR_bfloat16"
+)";
+
+ const std::string types = R"(
+%bf16 = OpTypeFloat 16 BFloat16KHR
+)";
+
+ const std::string body = R"(
+%val = OpFConvert %bf16 %f16_1
+)";
+
+ CompileSuccessfully(GenerateShaderCode(body, extensions, "", types).c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
TEST_F(ValidateConversion, QuantizeToF16Success) {
@@ -1196,9 +1238,10 @@
OpCapability Float16
OpCapability Int16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -1263,8 +1306,8 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
TEST_F(ValidateConversion, CoopMatKHRConversionUseMismatchFail) {
@@ -1273,9 +1316,10 @@
OpCapability Float16
OpCapability Int16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -1308,8 +1352,9 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected Use of Matrix type and Result Type to be identical"));
@@ -1321,9 +1366,10 @@
OpCapability Float16
OpCapability Int16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -1338,11 +1384,11 @@
%u32_8 = OpConstant %u32 8
%u32_4 = OpConstant %u32 4
%subgroup = OpConstant %u32 3
-%workgroup = OpConstant %u32 2
+%device = OpConstant %u32 1
%use_A = OpConstant %u32 0
%f16mat = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_8 %use_A
-%f32mat = OpTypeCooperativeMatrixKHR %f32 %workgroup %u32_8 %u32_8 %use_A
+%f32mat = OpTypeCooperativeMatrixKHR %f32 %device %u32_8 %u32_8 %use_A
%f16_1 = OpConstant %f16 1
@@ -1356,8 +1402,9 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Expected scopes of Matrix and Result Type to be identical"));
@@ -1940,6 +1987,64 @@
"uint vector as input"));
}
+TEST_F(ValidateConversion, BitcastUntypedPointerInput) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%cast = OpBitcast %int %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateConversion, BitcastUntypedPointerOutput) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%cast = OpBitcast %ptr %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
using ValidateSmallConversions = spvtest::ValidateBase<std::string>;
CodeGenerator GetSmallConversionsCodeGenerator() {
@@ -2082,6 +2187,320 @@
"%inst = OpBitcast %short %ld_half",
"%inst = OpBitcast %short2 %ld_half2"));
+TEST_F(ValidateConversion, CoopMat2ConversionSuccess) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int16
+OpCapability CooperativeMatrixConversionsNV
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
+OpExtension "SPV_KHR_cooperative_matrix"
+OpExtension "SPV_NV_cooperative_matrix2"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical VulkanKHR
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u16 = OpTypeInt 16 0
+%u32 = OpTypeInt 32 0
+%s16 = OpTypeInt 16 1
+%s32 = OpTypeInt 32 1
+
+%u32_8 = OpConstant %u32 8
+%u32_16 = OpConstant %u32 16
+%use_A = OpConstant %u32 0
+%use_B = OpConstant %u32 1
+%use_Acc = OpConstant %u32 2
+%subgroup = OpConstant %u32 3
+
+%f16matA = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_8 %use_A
+%f32matA = OpTypeCooperativeMatrixKHR %f32 %subgroup %u32_8 %u32_8 %use_A
+%u16matA = OpTypeCooperativeMatrixKHR %u16 %subgroup %u32_8 %u32_8 %use_A
+%u32matA = OpTypeCooperativeMatrixKHR %u32 %subgroup %u32_8 %u32_8 %use_A
+%s16matA = OpTypeCooperativeMatrixKHR %s16 %subgroup %u32_8 %u32_8 %use_A
+%s32matA = OpTypeCooperativeMatrixKHR %s32 %subgroup %u32_8 %u32_8 %use_A
+
+%f16matB = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_8 %use_B
+%f32matB = OpTypeCooperativeMatrixKHR %f32 %subgroup %u32_8 %u32_8 %use_B
+%u16matB = OpTypeCooperativeMatrixKHR %u16 %subgroup %u32_8 %u32_8 %use_B
+%u32matB = OpTypeCooperativeMatrixKHR %u32 %subgroup %u32_8 %u32_8 %use_B
+%s16matB = OpTypeCooperativeMatrixKHR %s16 %subgroup %u32_8 %u32_8 %use_B
+%s32matB = OpTypeCooperativeMatrixKHR %s32 %subgroup %u32_8 %u32_8 %use_B
+
+%f16matAcc = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_8 %use_Acc
+%f32matAcc = OpTypeCooperativeMatrixKHR %f32 %subgroup %u32_8 %u32_8 %use_Acc
+%u16matAcc = OpTypeCooperativeMatrixKHR %u16 %subgroup %u32_8 %u32_8 %use_Acc
+%u32matAcc = OpTypeCooperativeMatrixKHR %u32 %subgroup %u32_8 %u32_8 %use_Acc
+%s16matAcc = OpTypeCooperativeMatrixKHR %s16 %subgroup %u32_8 %u32_8 %use_Acc
+%s32matAcc = OpTypeCooperativeMatrixKHR %s32 %subgroup %u32_8 %u32_8 %use_Acc
+
+%f16matAcc16x8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_16 %u32_8 %use_Acc
+%f16matB8x16 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_8 %u32_16 %use_B
+
+%f16_1 = OpConstant %f16 1
+%f32_1 = OpConstant %f32 1
+%u16_1 = OpConstant %u16 1
+%u32_1 = OpConstant %u32 1
+%s16_1 = OpConstant %s16 1
+%s32_1 = OpConstant %s32 1
+
+%f16matAcc_1 = OpConstantComposite %f16matAcc %f16_1
+%f32matAcc_1 = OpConstantComposite %f32matAcc %f32_1
+%u16matAcc_1 = OpConstantComposite %u16matAcc %u16_1
+%u32matAcc_1 = OpConstantComposite %u32matAcc %u32_1
+%s16matAcc_1 = OpConstantComposite %s16matAcc %s16_1
+%s32matAcc_1 = OpConstantComposite %s32matAcc %s32_1
+
+%f16matAcc16x8_1 = OpConstantComposite %f16matAcc16x8 %f16_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%val11A = OpConvertFToU %u16matA %f16matAcc_1
+%val12A = OpConvertFToU %u32matA %f16matAcc_1
+%val13A = OpConvertFToS %s16matA %f16matAcc_1
+%val14A = OpConvertFToS %s32matA %f16matAcc_1
+%val15A = OpFConvert %f32matA %f16matAcc_1
+
+%val11B = OpConvertFToU %u16matB %f16matAcc_1
+%val12B = OpConvertFToU %u32matB %f16matAcc_1
+%val13B = OpConvertFToS %s16matB %f16matAcc_1
+%val14B = OpConvertFToS %s32matB %f16matAcc_1
+%val15B = OpFConvert %f32matB %f16matAcc_1
+
+%val21A = OpConvertFToU %u16matA %f32matAcc_1
+%val22A = OpConvertFToU %u32matA %f32matAcc_1
+%val23A = OpConvertFToS %s16matA %f32matAcc_1
+%val24A = OpConvertFToS %s32matA %f32matAcc_1
+%val25A = OpFConvert %f16matA %f32matAcc_1
+
+%val21B = OpConvertFToU %u16matB %f32matAcc_1
+%val22B = OpConvertFToU %u32matB %f32matAcc_1
+%val23B = OpConvertFToS %s16matB %f32matAcc_1
+%val24B = OpConvertFToS %s32matB %f32matAcc_1
+%val25B = OpFConvert %f16matB %f32matAcc_1
+
+%val31A = OpConvertUToF %f16matA %u16matAcc_1
+%val32A = OpConvertUToF %f32matA %u16matAcc_1
+%val33A = OpUConvert %u32matA %u16matAcc_1
+%val34A = OpSConvert %s32matA %u16matAcc_1
+
+%val31B = OpConvertUToF %f16matB %u16matAcc_1
+%val32B = OpConvertUToF %f32matB %u16matAcc_1
+%val33B = OpUConvert %u32matB %u16matAcc_1
+%val34B = OpSConvert %s32matB %u16matAcc_1
+
+%val41A = OpConvertSToF %f16matA %s16matAcc_1
+%val42A = OpConvertSToF %f32matA %s16matAcc_1
+%val43A = OpUConvert %u32matA %s16matAcc_1
+%val44A = OpSConvert %s32matA %s16matAcc_1
+
+%val41B = OpConvertSToF %f16matB %s16matAcc_1
+%val42B = OpConvertSToF %f32matB %s16matAcc_1
+%val43B = OpUConvert %u32matB %s16matAcc_1
+%val44B = OpSConvert %s32matB %s16matAcc_1
+
+%val51A = OpCooperativeMatrixConvertNV %f16matA %f16matAcc_1
+%val52A = OpCooperativeMatrixConvertNV %f32matA %f32matAcc_1
+%val53A = OpCooperativeMatrixConvertNV %u16matA %u16matAcc_1
+%val54A = OpCooperativeMatrixConvertNV %s16matA %s16matAcc_1
+
+%val51B = OpCooperativeMatrixConvertNV %f16matB %f16matAcc_1
+%val52B = OpCooperativeMatrixConvertNV %f32matB %f32matAcc_1
+%val53B = OpCooperativeMatrixConvertNV %u16matB %u16matAcc_1
+%val54B = OpCooperativeMatrixConvertNV %s16matB %s16matAcc_1
+
+%val61B = OpCooperativeMatrixTransposeNV %f16matB %f16matAcc_1
+%val62B = OpCooperativeMatrixTransposeNV %f32matB %f32matAcc_1
+%val63B = OpCooperativeMatrixTransposeNV %u16matB %u16matAcc_1
+%val64B = OpCooperativeMatrixTransposeNV %s16matB %s16matAcc_1
+
+%val71B = OpCooperativeMatrixTransposeNV %f16matB8x16 %f16matAcc16x8_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateConversion, CoopMat2TransposeShapeFail) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int16
+OpCapability CooperativeMatrixConversionsNV
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
+OpExtension "SPV_KHR_cooperative_matrix"
+OpExtension "SPV_NV_cooperative_matrix2"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical VulkanKHR
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%u32 = OpTypeInt 32 0
+
+%u32_8 = OpConstant %u32 8
+%u32_16 = OpConstant %u32 16
+%use_B = OpConstant %u32 1
+%use_Acc = OpConstant %u32 2
+%subgroup = OpConstant %u32 3
+
+%f16matAcc16x8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_16 %u32_8 %use_Acc
+%f16matB16x8 = OpTypeCooperativeMatrixKHR %f16 %subgroup %u32_16 %u32_8 %use_B
+
+%f16_1 = OpConstant %f16 1
+
+%f16matAcc16x8_1 = OpConstantComposite %f16matAcc16x8 %f16_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%val71B = OpCooperativeMatrixTransposeNV %f16matB16x8 %f16matAcc16x8_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected rows of Matrix type and Result Type to be "
+ "swapped with columns"));
+}
+
+TEST_F(ValidateConversion, CoopVecConversionSuccess) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int16
+OpCapability CooperativeVectorNV
+OpCapability ReplicatedCompositesEXT
+OpExtension "SPV_NV_cooperative_vector"
+OpExtension "SPV_EXT_replicated_composites"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u16 = OpTypeInt 16 0
+%u32 = OpTypeInt 32 0
+%s16 = OpTypeInt 16 1
+%s32 = OpTypeInt 32 1
+
+%u32_8 = OpConstant %u32 8
+%use_A = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_8
+%f32vec = OpTypeCooperativeVectorNV %f32 %u32_8
+%u16vec = OpTypeCooperativeVectorNV %u16 %u32_8
+%u32vec = OpTypeCooperativeVectorNV %u32 %u32_8
+%s16vec = OpTypeCooperativeVectorNV %s16 %u32_8
+%s32vec = OpTypeCooperativeVectorNV %s32 %u32_8
+
+%f16_1 = OpConstant %f16 1
+%f32_1 = OpConstant %f32 1
+%u16_1 = OpConstant %u16 1
+%u32_1 = OpConstant %u32 1
+%s16_1 = OpConstant %s16 1
+%s32_1 = OpConstant %s32 1
+
+%f16vec_1 = OpConstantCompositeReplicateEXT %f16vec %f16_1
+%f32vec_1 = OpConstantCompositeReplicateEXT %f32vec %f32_1
+%u16vec_1 = OpConstantCompositeReplicateEXT %u16vec %u16_1
+%u32vec_1 = OpConstantCompositeReplicateEXT %u32vec %u32_1
+%s16vec_1 = OpConstantCompositeReplicateEXT %s16vec %s16_1
+%s32vec_1 = OpConstantCompositeReplicateEXT %s32vec %s32_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%val11 = OpConvertFToU %u16vec %f16vec_1
+%val12 = OpConvertFToU %u32vec %f16vec_1
+%val13 = OpConvertFToS %s16vec %f16vec_1
+%val14 = OpConvertFToS %s32vec %f16vec_1
+%val15 = OpFConvert %f32vec %f16vec_1
+
+%val21 = OpConvertFToU %u16vec %f32vec_1
+%val22 = OpConvertFToU %u32vec %f32vec_1
+%val23 = OpConvertFToS %s16vec %f32vec_1
+%val24 = OpConvertFToS %s32vec %f32vec_1
+%val25 = OpFConvert %f16vec %f32vec_1
+
+%val31 = OpConvertUToF %f16vec %u16vec_1
+%val32 = OpConvertUToF %f32vec %u16vec_1
+%val33 = OpUConvert %u32vec %u16vec_1
+%val34 = OpSConvert %s32vec %u16vec_1
+
+%val41 = OpConvertSToF %f16vec %s16vec_1
+%val42 = OpConvertSToF %f32vec %s16vec_1
+%val43 = OpUConvert %u32vec %s16vec_1
+%val44 = OpSConvert %s32vec %s16vec_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateConversion, CoopVecConversionDimMismatchFail) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int16
+OpCapability CooperativeVectorNV
+OpCapability ReplicatedCompositesEXT
+OpExtension "SPV_NV_cooperative_vector"
+OpExtension "SPV_EXT_replicated_composites"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u16 = OpTypeInt 16 0
+%u32 = OpTypeInt 32 0
+%s16 = OpTypeInt 16 1
+%s32 = OpTypeInt 32 1
+
+%u32_8 = OpConstant %u32 8
+%u32_4 = OpConstant %u32 4
+%subgroup = OpConstant %u32 3
+%use_A = OpConstant %u32 0
+%use_B = OpConstant %u32 1
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_8
+%f32vec = OpTypeCooperativeVectorNV %f32 %u32_4
+
+%f16_1 = OpConstant %f16 1
+
+%f16vec_1 = OpConstantCompositeReplicateEXT %f16vec %f16_1
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%val1 = OpFConvert %f32vec %f16vec_1
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected number of components to be identical"));
+}
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_data_test.cpp b/third_party/SPIRV-Tools/test/val/val_data_test.cpp
index 349e5e9..b699649 100644
--- a/third_party/SPIRV-Tools/test/val/val_data_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_data_test.cpp
@@ -71,6 +71,44 @@
OpCapability Int64
OpMemoryModel Logical GLSL450
)";
+std::string header_with_bfloat16 = R"(
+ OpCapability Shader
+ OpCapability Linkage
+ OpCapability BFloat16TypeKHR
+ OpCapability BFloat16DotProductKHR
+ OpCapability BFloat16CooperativeMatrixKHR
+ OpExtension "SPV_KHR_bfloat16"
+ OpMemoryModel Logical GLSL450
+)";
+std::string header_with_float8 = R"(
+ OpCapability Shader
+ OpCapability Linkage
+ OpCapability Float8EXT
+ OpCapability Float8CooperativeMatrixEXT
+ OpExtension "SPV_EXT_float8"
+ OpMemoryModel Logical GLSL450
+)";
+std::string header_with_float8_and_bfloat16 = R"(
+ OpCapability Shader
+ OpCapability Linkage
+ OpCapability Float8EXT
+ OpCapability Float8CooperativeMatrixEXT
+ OpCapability BFloat16TypeKHR
+ OpExtension "SPV_EXT_float8"
+ OpExtension "SPV_KHR_bfloat16"
+ OpMemoryModel Logical GLSL450
+)";
+std::string header_with_float8_no_coop_matrix = R"(
+ OpCapability Shader
+ OpCapability Linkage
+ OpCapability Float8EXT
+ OpCapability CooperativeMatrixKHR
+ OpCapability VulkanMemoryModel
+ OpExtension "SPV_EXT_float8"
+ OpExtension "SPV_KHR_cooperative_matrix"
+ OpExtension "SPV_KHR_vulkan_memory_model"
+ OpMemoryModel Logical VulkanKHR
+)";
std::string header_with_float16 = R"(
OpCapability Shader
OpCapability Linkage
@@ -334,6 +372,66 @@
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateData, float8_good) {
+ std::string str = header_with_float8 +
+ R"(%2 = OpTypeFloat 8 Float8E4M3EXT
+%3 = OpTypeFloat 8 Float8E5M2EXT
+)";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateData, bfloat16_good) {
+ std::string str = header_with_bfloat16 + "%2 = OpTypeFloat 16 BFloat16KHR";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateData, cooperative_matrix_bfloat16_good) {
+ std::string str = header_with_bfloat16 + R"(
+%u32 = OpTypeInt 32 0
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+%bf16 = OpTypeFloat 16 BFloat16KHR
+%bf16matA = OpTypeCooperativeMatrixKHR %bf16 %subgroup %u32_16 %u32_16 %useA
+)";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateData, cooperative_matrix_float8_good) {
+ std::string str = header_with_float8 + R"(
+%u32 = OpTypeInt 32 0
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+%fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
+%fp8e5m2 = OpTypeFloat 8 Float8E5M2EXT
+%fp8e4m3_matA = OpTypeCooperativeMatrixKHR %fp8e4m3 %subgroup %u32_16 %u32_16 %useA
+%fp8e5m2_matA = OpTypeCooperativeMatrixKHR %fp8e5m2 %subgroup %u32_16 %u32_16 %useA
+)";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateData, cooperative_matrix_float8_no_capability_bad) {
+ std::string str = header_with_float8_no_coop_matrix + R"(
+%u32 = OpTypeInt 32 0
+%u32_16 = OpConstant %u32 16
+%useA = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+%fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
+%fp8e5m2 = OpTypeFloat 8 Float8E5M2EXT
+%fp8e4m3_matA = OpTypeCooperativeMatrixKHR %fp8e4m3 %subgroup %u32_16 %u32_16 %useA
+%fp8e5m2_matA = OpTypeCooperativeMatrixKHR %fp8e5m2 %subgroup %u32_16 %u32_16 %useA
+)";
+ CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("require Float8CooperativeMatrixEXT be declared"));
+}
+
TEST_F(ValidateData, float16_buffer_good) {
std::string str = header_with_float16_buffer + "%2 = OpTypeFloat 16";
CompileSuccessfully(str.c_str());
@@ -347,8 +445,84 @@
EXPECT_THAT(getDiagnosticString(), HasSubstr(missing_float16_cap_error));
}
+TEST_F(ValidateData, bfloat16_bad) {
+ std::string str = header + "%2 = OpTypeFloat 16 BFloat16KHR";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("requires one of these capabilities: BFloat16TypeKHR"));
+}
+
+TEST_F(ValidateData, float8_bad) {
+ std::string str = header +
+ R"(%2 = OpTypeFloat 8 Float8E4M3EXT
+%3 = OpTypeFloat 8 Float8E5M2EXT
+)";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("requires one of these capabilities: Float8EXT"));
+}
+
+TEST_F(ValidateData, float8_no_encoding_bad) {
+ std::string str = header_with_float8 + "%2 = OpTypeFloat 8";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("8-bit floating point type requires an encoding"));
+}
+
+TEST_F(ValidateData, float8_bad_encoding) {
+ std::string str =
+ header_with_float8_and_bfloat16 + "%2 = OpTypeFloat 8 BFloat16KHR";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Unsupported 8-bit floating point encoding"));
+}
+
+TEST_F(ValidateData, dot_bfloat16_bad) {
+ std::string str = R"(
+ OpCapability Shader
+ OpCapability BFloat16TypeKHR
+ OpExtension "SPV_KHR_bfloat16"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpSource GLSL 450
+ OpName %main "main"
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %bfloat16 = OpTypeFloat 16 BFloat16KHR
+%_ptr_Function_bfloat16 = OpTypePointer Function %bfloat16
+ %v2bfloat16 = OpTypeVector %bfloat16 2
+%_ptr_Function_v2bfloat16 = OpTypePointer Function %v2bfloat16
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %v1 = OpVariable %_ptr_Function_v2bfloat16 Function
+ %v2 = OpVariable %_ptr_Function_v2bfloat16 Function
+ %12 = OpLoad %v2bfloat16 %v1
+ %14 = OpLoad %v2bfloat16 %v2
+ %15 = OpDot %bfloat16 %12 %14
+ OpReturn
+ OpFunctionEnd
+)";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("requires BFloat16DotProductKHR be declared."));
+}
+
+TEST_F(ValidateData, bfloat16_without_float16_capability_good) {
+ std::string str = header_with_bfloat16 + "%2 = OpTypeFloat 16 BFloat16KHR";
+ CompileSuccessfully(str.c_str());
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
TEST_F(ValidateData, float64_good) {
std::string str = header_with_float64 + "%2 = OpTypeFloat 64";
+
CompileSuccessfully(str.c_str());
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -627,7 +801,8 @@
OpExtension "SPV_KHR_variable_pointers"
OpExtension "SPV_KHR_16bit_storage"
OpMemoryModel Logical GLSL450
- OpDecorate %_ FPRoundingMode )" + mode + R"(
+ OpDecorate %_ FPRoundingMode )" +
+ mode + R"(
%half = OpTypeFloat 16
%float = OpTypeFloat 32
%float_1_25 = OpConstant %float 1.25
diff --git a/third_party/SPIRV-Tools/test/val/val_decoration_test.cpp b/third_party/SPIRV-Tools/test/val/val_decoration_test.cpp
index ba0e959..19f9d9d 100644
--- a/third_party/SPIRV-Tools/test/val/val_decoration_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_decoration_test.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2017 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -2074,6 +2076,68 @@
"another Block or BufferBlock."));
}
+TEST_F(ValidateDecorations, BlockCannotAppearWithinBlockArray) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Vertex %main "main"
+OpMemberDecorate %outer 0 Offset 0
+OpMemberDecorate %outer 1 Offset 4
+OpMemberDecorate %outer 2 Offset 20
+OpDecorate %outer Block
+OpMemberDecorate %inner 0 Offset 0
+OpDecorate %inner Block
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%inner = OpTypeStruct %int
+%array = OpTypeArray %inner %int_4
+%outer = OpTypeStruct %int %array %int
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("rules: A Block or BufferBlock cannot be nested within "
+ "another Block or BufferBlock."));
+}
+
+TEST_F(ValidateDecorations, BlockCannotAppearWithinBlockMultiArray) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Vertex %main "main"
+OpMemberDecorate %outer 0 Offset 0
+OpMemberDecorate %outer 1 Offset 4
+OpDecorate %outer Block
+OpMemberDecorate %inner 0 Offset 0
+OpDecorate %inner Block
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%inner = OpTypeStruct %int
+%array1 = OpTypeArray %inner %int_4
+%array2 = OpTypeArray %array1 %int_4
+%outer = OpTypeStruct %int %array2
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("rules: A Block or BufferBlock cannot be nested within "
+ "another Block or BufferBlock."));
+}
+
TEST_F(ValidateDecorations, BlockLayoutForbidsTightScalarVec3PackingBad) {
// See https://github.com/KhronosGroup/SPIRV-Tools/issues/1666
std::string spirv = R"(
@@ -5381,6 +5445,97 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+// OpDecorateId
+
+TEST_F(ValidateDecorations, DecorateIdGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %subgroupscope "subgroupscope"
+OpName %int0 "int0"
+OpName %fn "fn"
+OpDecorateId %int0 UniformId %subgroupscope
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 1
+%subgroupscope = OpConstant %int 3
+%int0 = OpConstantNull %int
+%fn = OpTypeFunction %void
+%main = OpFunction %void None %fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, DecorateIdGroupBad) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %subgroupscope "subgroupscope"
+OpName %int0 "int0"
+OpName %fn "fn"
+OpName %group "group"
+OpDecorateId %group UniformId %subgroupscope
+%group = OpDecorationGroup
+OpGroupDecorate %group %int0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 1
+%subgroupscope = OpConstant %int 3
+%int0 = OpConstantNull %int
+%fn = OpTypeFunction %void
+%main = OpFunction %void None %fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("must not be an OpDecorationGroup instruction.\n"
+ " OpDecorateId %group UniformId %subgroupscope"));
+}
+
+TEST_F(ValidateDecorations, DecorateIdOutOfOrderBad) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical Simple
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %subgroupscope "subgroupscope"
+OpName %int0 "int0"
+OpName %fn "fn"
+OpDecorateId %int0 UniformId %subgroupscope
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 1
+%int0 = OpConstantNull %int
+%subgroupscope = OpConstant %int 3
+%fn = OpTypeFunction %void
+%main = OpFunction %void None %fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("[%subgroupscope]' must appear earlier in the"
+ " binary than the target\n"
+ " OpDecorateId %int0 UniformId %subgroupscope"));
+}
+
// Uniform and UniformId decorations
TEST_F(ValidateDecorations, UniformDecorationGood) {
@@ -5422,6 +5577,7 @@
OpName %call "call"
OpName %myfunc "myfunc"
OpName %int0 "int0"
+OpName %int1 "int1"
OpName %float0 "float0"
OpName %fn "fn"
)") + inst +
@@ -5429,10 +5585,11 @@
%void = OpTypeVoid
%float = OpTypeFloat 32
%int = OpTypeInt 32 1
-%int0 = OpConstantNull %int
+%int1 = OpConstant %int 1
%int_99 = OpConstant %int 99
%subgroupscope = OpConstant %int 3
%float0 = OpConstantNull %float
+%int0 = OpConstantNull %int
%fn = OpTypeFunction %void
%myfunc = OpFunction %void None %fn
%myfuncentry = OpLabel
@@ -5549,7 +5706,7 @@
TEST_F(ValidateDecorations, UniformDecorationWithScopeIdV14VulkanEnv) {
const std::string spirv =
- ShaderWithUniformLikeDecoration("OpDecorateId %int0 UniformId %int0");
+ ShaderWithUniformLikeDecoration("OpDecorateId %int0 UniformId %int1");
CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1_SPIRV_1_4);
EXPECT_EQ(SPV_ERROR_INVALID_DATA,
@@ -6179,34 +6336,6 @@
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
-TEST_F(ValidateDecorations, PSBAliasedRestrictPointerMissing) {
- const std::string body = R"(
-OpCapability PhysicalStorageBufferAddresses
-OpCapability Int64
-OpCapability Shader
-OpExtension "SPV_EXT_physical_storage_buffer"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Fragment %main "main"
-OpExecutionMode %main OriginUpperLeft
-%uint64 = OpTypeInt 64 0
-%ptr = OpTypePointer PhysicalStorageBuffer %uint64
-%pptr_f = OpTypePointer Function %ptr
-%void = OpTypeVoid
-%voidfn = OpTypeFunction %void
-%main = OpFunction %void None %voidfn
-%entry = OpLabel
-%val1 = OpVariable %pptr_f Function
-OpReturn
-OpFunctionEnd
-)";
-
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("expected AliasedPointer or RestrictPointer for "
- "PhysicalStorageBuffer pointer"));
-}
-
TEST_F(ValidateDecorations, PSBAliasedRestrictPointerBoth) {
const std::string body = R"(
OpCapability PhysicalStorageBufferAddresses
@@ -6233,8 +6362,8 @@
CompileSuccessfully(body.c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("can't specify both AliasedPointer and RestrictPointer "
- "for PhysicalStorageBuffer pointer"));
+ HasSubstr("decorated with both AliasedPointer and "
+ "RestrictPointer is not allowed"));
}
TEST_F(ValidateDecorations, PSBAliasedRestrictFunctionParamSuccess) {
@@ -6267,38 +6396,6 @@
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
-TEST_F(ValidateDecorations, PSBAliasedRestrictFunctionParamMissing) {
- const std::string body = R"(
-OpCapability PhysicalStorageBufferAddresses
-OpCapability Int64
-OpCapability Shader
-OpExtension "SPV_EXT_physical_storage_buffer"
-OpMemoryModel PhysicalStorageBuffer64 GLSL450
-OpEntryPoint Fragment %main "main"
-OpExecutionMode %main OriginUpperLeft
-%uint64 = OpTypeInt 64 0
-%ptr = OpTypePointer PhysicalStorageBuffer %uint64
-%void = OpTypeVoid
-%voidfn = OpTypeFunction %void
-%fnptr = OpTypeFunction %void %ptr
-%main = OpFunction %void None %voidfn
-%entry = OpLabel
-OpReturn
-OpFunctionEnd
-%fn = OpFunction %void None %fnptr
-%fparam = OpFunctionParameter %ptr
-%lab = OpLabel
-OpReturn
-OpFunctionEnd
-)";
-
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("expected Aliased or Restrict for "
- "PhysicalStorageBuffer pointer"));
-}
-
TEST_F(ValidateDecorations, PSBAliasedRestrictFunctionParamBoth) {
const std::string body = R"(
OpCapability PhysicalStorageBufferAddresses
@@ -6328,9 +6425,9 @@
CompileSuccessfully(body.c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("can't specify both Aliased and Restrict for "
- "PhysicalStorageBuffer pointer"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("decorated with both Aliased and Restrict is not allowed"));
}
TEST_F(ValidateDecorations, PSBFPRoundingModeSuccess) {
@@ -6591,12 +6688,14 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1));
}
-// NonWritable
+// NonReadable/NonWritable
// Returns a SPIR-V shader module with variables in various storage classes,
-// parameterizable by which ID should be decorated as NonWritable.
-std::string ShaderWithNonWritableTarget(const std::string& target,
- bool member_decorate = false) {
+// parameterizable by which ID should be decorated as NonReadable or
+// NonWritable.
+std::string ShaderWithNonReadableNonWritableTarget(
+ const std::string& target, bool member_decorate = false,
+ const std::string& decoration = "NonWritable") {
const std::string decoration_inst =
std::string(member_decorate ? "OpMemberDecorate " : "OpDecorate ") +
target + (member_decorate ? " 0" : "");
@@ -6604,8 +6703,10 @@
return std::string(R"(
OpCapability Shader
OpCapability RuntimeDescriptorArrayEXT
+ OpCapability TensorsARM
OpExtension "SPV_EXT_descriptor_indexing"
OpExtension "SPV_KHR_storage_buffer_storage_class"
+ OpExtension "SPV_ARM_tensors"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %main "main"
OpName %label "label"
@@ -6625,9 +6726,9 @@
OpMemberDecorate %struct_b_rtarr 0 Offset 0
OpDecorate %rtarr ArrayStride 4
)") + decoration_inst +
+ " " + decoration +
- R"( NonWritable
-
+ R"(
%void = OpTypeVoid
%void_fn = OpTypeFunction %void
%float = OpTypeFloat 32
@@ -6642,6 +6743,8 @@
%imstor = OpTypeImage %float 2D 0 0 0 2 R32f
; sampled image
%imsam = OpTypeImage %float 2D 0 0 0 1 R32f
+ ; tensor
+ %tensor = OpTypeTensorARM %float %int_2
%array_imstor = OpTypeArray %imstor %int_2
%rta_imstor = OpTypeRuntimeArray %imstor
@@ -6655,6 +6758,7 @@
%_ptr_imsam = OpTypePointer UniformConstant %imsam
%_ptr_array_imstor = OpTypePointer UniformConstant %array_imstor
%_ptr_rta_imstor = OpTypePointer UniformConstant %rta_imstor
+%_ptr_tensor_UniformConstant = OpTypePointer UniformConstant %tensor
%extra_fn = OpTypeFunction %void %float %_ptr_Private %_ptr_imstor
@@ -6667,6 +6771,7 @@
%var_imsam = OpVariable %_ptr_imsam UniformConstant
%var_array_imstor = OpVariable %_ptr_array_imstor UniformConstant
%var_rta_imstor = OpVariable %_ptr_rta_imstor UniformConstant
+%var_tensor = OpVariable %_ptr_tensor_UniformConstant UniformConstant
%helper = OpFunction %void None %extra_fn
%param_f = OpFunctionParameter %float
@@ -6686,7 +6791,7 @@
}
TEST_F(ValidateDecorations, NonWritableLabelTargetBad) {
- std::string spirv = ShaderWithNonWritableTarget("%label");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%label");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
@@ -6695,7 +6800,7 @@
}
TEST_F(ValidateDecorations, NonWritableTypeTargetBad) {
- std::string spirv = ShaderWithNonWritableTarget("%void");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%void");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
@@ -6704,7 +6809,7 @@
}
TEST_F(ValidateDecorations, NonWritableValueTargetBad) {
- std::string spirv = ShaderWithNonWritableTarget("%float_0");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%float_0");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
@@ -6713,7 +6818,7 @@
}
TEST_F(ValidateDecorations, NonWritableValueParamBad) {
- std::string spirv = ShaderWithNonWritableTarget("%param_f");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%param_f");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
@@ -6721,7 +6826,7 @@
}
TEST_F(ValidateDecorations, NonWritablePointerParamButWrongTypeBad) {
- std::string spirv = ShaderWithNonWritableTarget("%param_p");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%param_p");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
@@ -6729,12 +6834,13 @@
getDiagnosticString(),
HasSubstr(
"Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
"buffer\n %param_p = OpFunctionParameter %_ptr_Private_float"));
}
TEST_F(ValidateDecorations, NonWritablePointerParamStorageImageGood) {
- std::string spirv = ShaderWithNonWritableTarget("%param_pimstor");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%param_pimstor");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -6742,7 +6848,7 @@
}
TEST_F(ValidateDecorations, NonWritableVarStorageImageGood) {
- std::string spirv = ShaderWithNonWritableTarget("%var_imstor");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_imstor");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -6750,18 +6856,20 @@
}
TEST_F(ValidateDecorations, NonWritableVarSampledImageBad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_imsam");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_imsam");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_imsam"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_imsam"));
}
TEST_F(ValidateDecorations, NonWritableVarUboGood) {
- std::string spirv = ShaderWithNonWritableTarget("%var_ubo");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_ubo");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -6794,7 +6902,7 @@
}
TEST_F(ValidateDecorations, NonWritableVarSsboInStorageBufferGood) {
- std::string spirv = ShaderWithNonWritableTarget("%var_ssbo_sb");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_ssbo_sb");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -6802,7 +6910,8 @@
}
TEST_F(ValidateDecorations, NonWritableMemberOfSsboInStorageBufferGood) {
- std::string spirv = ShaderWithNonWritableTarget("%struct_b_rtarr", true);
+ std::string spirv =
+ ShaderWithNonReadableNonWritableTarget("%struct_b_rtarr", true);
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -6810,59 +6919,99 @@
}
TEST_F(ValidateDecorations, NonWritableMemberOfStructGood) {
- std::string spirv = ShaderWithNonWritableTarget("%simple_struct", true);
+ std::string spirv =
+ ShaderWithNonReadableNonWritableTarget("%simple_struct", true);
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateDecorations, NonWritableTensorVarUniformConstantGood) {
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_tensor");
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
+TEST_F(ValidateDecorations, NonReadableTensorVarUniformConstantGood) {
+ std::string spirv = ShaderWithNonReadableNonWritableTarget(
+ "%var_tensor", false, "NonReadable");
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), Eq(""));
+}
+
TEST_F(ValidateDecorations, NonWritableVarWorkgroupBad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_wg");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_wg");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_wg"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_wg"));
+}
+
+TEST_F(ValidateDecorations, NonReadableVarWorkgroupBad) {
+ std::string spirv =
+ ShaderWithNonReadableNonWritableTarget("%var_wg", false, "NonReadable");
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonReadable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_wg"));
}
TEST_F(ValidateDecorations, NonWritableVarWorkgroupV14Bad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_wg");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_wg");
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, storage "
- "buffer, or variable in Private or Function storage "
- "class\n %var_wg"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, storage "
+ "buffer, or variable in Private or Function storage class\n "
+ "%var_wg"));
}
TEST_F(ValidateDecorations, NonWritableVarPrivateBad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_priv");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_priv");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_priv"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_priv"));
}
TEST_F(ValidateDecorations, NonWritableVarPrivateV13Bad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_priv");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_priv");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_priv"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_priv"));
}
TEST_F(ValidateDecorations, NonWritableVarPrivateV14Good) {
- std::string spirv = ShaderWithNonWritableTarget("%var_priv");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_priv");
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
@@ -6870,36 +7019,41 @@
}
TEST_F(ValidateDecorations, NonWritableVarPrivateV13TargetV14Bad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_priv");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_priv");
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_priv"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_priv"));
}
TEST_F(ValidateDecorations, NonWritableVarFunctionBad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_func");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_func");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_func"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_func"));
}
TEST_F(ValidateDecorations, NonWritableArrayGood) {
- std::string spirv = ShaderWithNonWritableTarget("%var_array_imstor");
+ std::string spirv =
+ ShaderWithNonReadableNonWritableTarget("%var_array_imstor");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
TEST_F(ValidateDecorations, NonWritableRuntimeArrayGood) {
- std::string spirv = ShaderWithNonWritableTarget("%var_rta_imstor");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_rta_imstor");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
@@ -6940,18 +7094,20 @@
"is not valid for the Vulkan execution environment."))));
TEST_F(ValidateDecorations, NonWritableVarFunctionV13Bad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_func");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_func");
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_func"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_func"));
}
TEST_F(ValidateDecorations, NonWritableVarFunctionV14Good) {
- std::string spirv = ShaderWithNonWritableTarget("%var_func");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_func");
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
@@ -6959,14 +7115,16 @@
}
TEST_F(ValidateDecorations, NonWritableVarFunctionV13TargetV14Bad) {
- std::string spirv = ShaderWithNonWritableTarget("%var_func");
+ std::string spirv = ShaderWithNonReadableNonWritableTarget("%var_func");
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
- EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Target of NonWritable decoration is invalid: must "
- "point to a storage image, uniform block, or storage "
- "buffer\n %var_func"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Target of NonWritable decoration is invalid: must "
+ "point to a storage image, tensor variable in UniformConstant "
+ "storage class, uniform block, or storage "
+ "buffer\n %var_func"));
}
TEST_F(ValidateDecorations, BufferBlockV13ValV14Good) {
@@ -7072,7 +7230,7 @@
CompileSuccessfully(spirv, env);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState(env));
EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Component-04924"));
+ AnyVUID("VUID-StandaloneSpirv-Component-10583"));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component decoration specified for type"));
EXPECT_THAT(getDiagnosticString(), HasSubstr("is not a scalar or vector"));
@@ -9362,6 +9520,37 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
}
+TEST_F(ValidateDecorations, UntypedVariableDuplicateInterface) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var %var
+OpName %var "var"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Non-unique OpEntryPoint interface '2[%var]' is disallowed"));
+}
+
TEST_F(ValidateDecorations, PhysicalStorageBufferMissingOffset) {
const std::string spirv = R"(
OpCapability Shader
@@ -9444,6 +9633,1643 @@
"contains an array with stride 0, but with an element size of 4"));
}
+TEST_F(ValidateDecorations, MatrixArrayMissingMajorness) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpMemberDecorate %block 0 MatrixStride 16
+OpDecorate %array ArrayStride 32
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%vec = OpTypeVector %float 2
+%mat = OpTypeMatrix %vec 2
+%array = OpTypeArray %mat %int_2
+%block = OpTypeStruct %array
+%ptr = OpTypePointer Uniform %block
+%var = OpVariable %ptr Uniform
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "must be explicitly laid out with RowMajor or ColMajor decorations"));
+}
+
+TEST_F(ValidateDecorations, MatrixArrayMissingStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpMemberDecorate %block 0 ColMajor
+OpDecorate %array ArrayStride 32
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%vec = OpTypeVector %float 2
+%mat = OpTypeMatrix %vec 2
+%array = OpTypeArray %mat %int_2
+%block = OpTypeStruct %array
+%ptr = OpTypePointer Uniform %block
+%var = OpVariable %ptr Uniform
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("must be explicitly laid out with MatrixStride decorations"));
+}
+
+TEST_F(ValidateDecorations, MatrixArrayBadStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpMemberDecorate %block 0 ColMajor
+OpMemberDecorate %block 0 MatrixStride 8
+OpDecorate %array ArrayStride 32
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%vec = OpTypeVector %float 2
+%mat = OpTypeMatrix %vec 2
+%array = OpTypeArray %mat %int_2
+%block = OpTypeStruct %array
+%ptr = OpTypePointer Uniform %block
+%var = OpVariable %ptr Uniform
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("is a matrix with stride 8 not satisfying alignment to 16"));
+}
+
+TEST_F(ValidateDecorations, MatrixArrayArrayMissingMajorness) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpMemberDecorate %block 0 MatrixStride 16
+OpDecorate %array ArrayStride 32
+OpDecorate %rta ArrayStride 64
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%vec = OpTypeVector %float 2
+%mat = OpTypeMatrix %vec 2
+%array = OpTypeArray %mat %int_2
+%rta = OpTypeRuntimeArray %array
+%block = OpTypeStruct %rta
+%ptr = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "must be explicitly laid out with RowMajor or ColMajor decorations"));
+}
+
+TEST_F(ValidateDecorations, MatrixArrayArrayMissingStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpMemberDecorate %block 0 ColMajor
+OpDecorate %array ArrayStride 32
+OpDecorate %rta ArrayStride 64
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%vec = OpTypeVector %float 2
+%mat = OpTypeMatrix %vec 2
+%array = OpTypeArray %mat %int_2
+%rta = OpTypeRuntimeArray %array
+%block = OpTypeStruct %rta
+%ptr = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("must be explicitly laid out with MatrixStride decorations"));
+}
+
+TEST_F(ValidateDecorations, MatrixArrayArrayBadStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpMemberDecorate %block 0 ColMajor
+OpMemberDecorate %block 0 MatrixStride 8
+OpDecorate %array ArrayStride 32
+OpDecorate %a ArrayStride 64
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%vec = OpTypeVector %float 2
+%mat = OpTypeMatrix %vec 2
+%array = OpTypeArray %mat %int_2
+%a = OpTypeArray %array %int_2
+%block = OpTypeStruct %a
+%ptr = OpTypePointer Uniform %block
+%var = OpVariable %ptr Uniform
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("is a matrix with stride 8 not satisfying alignment to 16"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsInputVertex) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpCapability DrawParameters
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %main "main" %_ %gl_BaseInstance1 %gl_BaseInstance2
+ OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+ OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
+ OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
+ OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
+ OpDecorate %gl_PerVertex Block
+ OpDecorate %gl_BaseInstance1 BuiltIn BaseInstance
+ OpDecorate %gl_BaseInstance2 BuiltIn BaseInstance
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
+%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+ %_ = OpVariable %_ptr_Output_gl_PerVertex Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %float_0 = OpConstant %float 0
+ %17 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+%_ptr_Input_int = OpTypePointer Input %int
+%gl_BaseInstance1 = OpVariable %_ptr_Input_int Input
+%gl_BaseInstance2 = OpVariable %_ptr_Input_int Input
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %20 = OpLoad %int %gl_BaseInstance1
+ %21 = OpConvertSToF %float %20
+ %22 = OpVectorTimesScalar %v4float %17 %21
+ %24 = OpAccessChain %_ptr_Output_v4float %_ %int_0
+ OpStore %24 %22
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpEntryPoint contains duplicate input variables with "
+ "BaseInstance builtin"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09658"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsInputMesh) {
+ const std::string body = R"(
+ OpCapability DrawParameters
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_DrawID_1 %gl_DrawID_2
+ OpExecutionMode %main LocalSize 1 1 1
+ OpExecutionMode %main OutputVertices 32
+ OpExecutionMode %main OutputPrimitivesEXT 32
+ OpExecutionMode %main OutputTrianglesEXT
+ OpDecorate %gl_DrawID_1 BuiltIn DrawIndex
+ OpDecorate %gl_DrawID_2 BuiltIn DrawIndex
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%_ptr_Input_int = OpTypePointer Input %int
+ %gl_DrawID_1 = OpVariable %_ptr_Input_int Input
+ %gl_DrawID_2 = OpVariable %_ptr_Input_int Input
+ %uint = OpTypeInt 32 0
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %9 = OpLoad %int %gl_DrawID_1
+ %11 = OpBitcast %uint %9
+ %12 = OpLoad %int %gl_DrawID_2
+ %13 = OpBitcast %uint %12
+ OpSetMeshOutputsEXT %11 %13
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpEntryPoint contains duplicate input variables with "
+ "DrawIndex builtin"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09658"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsInputCompute) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main" %_ %gl_WorkGroupID_1 %gl_WorkGroupID_2
+ OpExecutionMode %main LocalSize 1 1 1
+ OpMemberDecorate %Buffers 0 Offset 0
+ OpDecorate %Buffers Block
+ OpDecorate %_ DescriptorSet 0
+ OpDecorate %_ Binding 0
+ OpDecorate %gl_WorkGroupID_1 BuiltIn WorkgroupId
+ OpDecorate %gl_WorkGroupID_2 BuiltIn WorkgroupId
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %Buffers = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_Buffers = OpTypePointer StorageBuffer %Buffers
+ %_ = OpVariable %_ptr_StorageBuffer_Buffers StorageBuffer
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_WorkGroupID_1 = OpVariable %_ptr_Input_v3uint Input
+%gl_WorkGroupID_2 = OpVariable %_ptr_Input_v3uint Input
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %15 = OpLoad %v3uint %gl_WorkGroupID_1
+ %16 = OpLoad %v3uint %gl_WorkGroupID_2
+ %17 = OpIAdd %v3uint %15 %16
+ %19 = OpAccessChain %_ptr_StorageBuffer_v3uint %_ %int_0
+ OpStore %19 %17
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpEntryPoint contains duplicate input variables with "
+ "WorkgroupId builtin"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09658"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsOutputFragment) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %gl_FragDepth_1 %gl_FragDepth_2
+ OpExecutionMode %main OriginUpperLeft
+ OpExecutionMode %main DepthReplacing
+ OpDecorate %gl_FragDepth_1 BuiltIn FragDepth
+ OpDecorate %gl_FragDepth_2 BuiltIn FragDepth
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+%_ptr_Output_float = OpTypePointer Output %float
+%gl_FragDepth_1 = OpVariable %_ptr_Output_float Output
+%gl_FragDepth_2 = OpVariable %_ptr_Output_float Output
+ %float_1 = OpConstant %float 1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpStore %gl_FragDepth_1 %float_1
+ %10 = OpLoad %float %gl_FragDepth_1
+ %11 = OpFAdd %float %10 %float_1
+ OpStore %gl_FragDepth_2 %11
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpEntryPoint contains duplicate output variables with "
+ "FragDepth builtin"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09659"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsRayTmaxKHR) {
+ const std::string body = R"(
+ OpCapability RayTracingKHR
+ OpExtension "SPV_KHR_ray_tracing"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint AnyHitKHR %main "main" %gl_RayTmaxEXT %gl_HitTEXT %incomingPayload
+ OpDecorate %gl_RayTmaxEXT BuiltIn RayTmaxKHR
+ OpDecorate %gl_HitTEXT BuiltIn RayTmaxKHR
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Input_float = OpTypePointer Input %float
+%gl_RayTmaxEXT = OpVariable %_ptr_Input_float Input
+ %gl_HitTEXT = OpVariable %_ptr_Input_float Input
+ %v4float = OpTypeVector %float 4
+%_ptr_IncomingRayPayloadKHR_v4float = OpTypePointer IncomingRayPayloadKHR %v4float
+%incomingPayload = OpVariable %_ptr_IncomingRayPayloadKHR_v4float IncomingRayPayloadKHR
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %a = OpVariable %_ptr_Function_float Function
+ %b = OpVariable %_ptr_Function_float Function
+ %11 = OpLoad %float %gl_RayTmaxEXT
+ OpStore %a %11
+ %14 = OpLoad %float %gl_HitTEXT
+ OpStore %b %14
+ %18 = OpLoad %float %a
+ %19 = OpLoad %float %b
+ %22 = OpCompositeConstruct %v4float %18 %18 %19 %19
+ OpStore %incomingPayload %22
+ OpTerminateRayKHR
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "OpEntryPoint contains duplicate input variables with RayTmax"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09658"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsBlock) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %main "main" %var
+ OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+ OpMemberDecorate %gl_PerVertex 1 BuiltIn Position
+ OpDecorate %gl_PerVertex Block
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%gl_PerVertex = OpTypeStruct %v4float %v4float
+%_ptr_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+ %var = OpVariable %_ptr_gl_PerVertex Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float_0 = OpConstant %float 0
+ %17 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %ptr_vec4 = OpTypePointer Output %v4float
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %19 = OpAccessChain %ptr_vec4 %var %int_0
+ OpStore %19 %17
+ %22 = OpAccessChain %ptr_vec4 %var %int_1
+ OpStore %22 %17
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_0);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "OpEntryPoint contains duplicate output variables with Position"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09659"));
+}
+
+TEST_F(ValidateDecorations, MultipleBuiltinsBlockMixed) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %main "main" %var %position
+ OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+ OpDecorate %gl_PerVertex Block
+ OpDecorate %position BuiltIn Position
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%gl_PerVertex = OpTypeStruct %v4float
+%_ptr_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+ %var = OpVariable %_ptr_gl_PerVertex Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %int_1 = OpConstant %int 1
+ %float_0 = OpConstant %float 0
+ %17 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
+ %ptr_vec4 = OpTypePointer Output %v4float
+ %position = OpVariable %ptr_vec4 Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %19 = OpAccessChain %ptr_vec4 %var %int_0
+ OpStore %19 %17
+ OpStore %position %17
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_0);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "OpEntryPoint contains duplicate output variables with Position"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-09659"));
+}
+
+TEST_F(ValidateDecorations, UntypedVariableWorkgroupRequiresStruct) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Untyped workgroup variables in shaders must be block "
+ "decorated structs"));
+}
+
+TEST_F(ValidateDecorations, UntypedVariableWorkgroupRequiresBlockStruct) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Untyped workgroup variables in shaders must be block "
+ "decorated"));
+}
+
+TEST_F(ValidateDecorations, UntypedVariableStorageBufferMissingBlock) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %struct "struct"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("StorageBuffer id '2' is missing Block decoration"));
+}
+
+TEST_F(ValidateDecorations, UntypedVariableUniformMissingBlock) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %struct "struct"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Uniform
+%var = OpUntypedVariableKHR %ptr Uniform %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Uniform id '2' is missing Block or BufferBlock decoration"));
+}
+
+TEST_F(ValidateDecorations, UntypedVariablePushConstantMissingBlock) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %struct "struct"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR PushConstant
+%var = OpUntypedVariableKHR %ptr PushConstant %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("PushConstant id '2' is missing Block decoration"));
+}
+
+using UntypedVariableSetAndBinding = spvtest::ValidateBase<std::string>;
+
+TEST_P(UntypedVariableSetAndBinding, MissingSet) {
+ const auto sc = GetParam();
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %var "var"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %var Binding 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR )" +
+ sc + R"(
+%var = OpUntypedVariableKHR %ptr )" +
+ sc + R"( %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%load = OpLoad %struct %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr(sc + " id '2' is missing DescriptorSet decoration"));
+}
+
+TEST_P(UntypedVariableSetAndBinding, MissingBinding) {
+ const auto sc = GetParam();
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %var "var"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %var DescriptorSet 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR )" +
+ sc + R"(
+%var = OpUntypedVariableKHR %ptr )" +
+ sc + R"( %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%load = OpLoad %struct %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr(sc + " id '2' is missing Binding decoration"));
+}
+
+INSTANTIATE_TEST_SUITE_P(ValidateUntypedVariableSetAndBinding,
+ UntypedVariableSetAndBinding,
+ Values("StorageBuffer", "Uniform"));
+
+using UntypedPointerLayout =
+ spvtest::ValidateBase<std::tuple<std::string, std::string>>;
+
+TEST_P(UntypedPointerLayout, BadOffset) {
+ const auto sc = std::get<0>(GetParam());
+ const auto op = std::get<1>(GetParam());
+ const std::string set = (sc == "StorageBuffer" || sc == "Uniform"
+ ? R"(OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+)"
+ : R"()");
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpExecutionMode %main LocalSize 1 1 1
+OpName %var "var"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpMemberDecorate %struct 1 Offset 4
+)" + set + R"(OpMemberDecorate %test_type 0 Offset 0
+OpMemberDecorate %test_type 1 Offset 1
+OpDecorate %ptr ArrayStride 16
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%struct = OpTypeStruct %int %int
+%test_type = OpTypeStruct %int %int
+%test_val = OpConstantNull %test_type
+%ptr = OpTypeUntypedPointerKHR )" +
+ sc + R"(
+%var = OpUntypedVariableKHR %ptr )" +
+ sc + R"( %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+)" + op + R"(
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ const bool read_only = sc == "Uniform" || sc == "PushConstant";
+ if (!read_only || op.find("OpStore") == std::string::npos) {
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("member 1 at offset 1 is not aligned to"));
+ }
+}
+
+TEST_P(UntypedPointerLayout, BadStride) {
+ const auto sc = std::get<0>(GetParam());
+ const auto op = std::get<1>(GetParam());
+ const std::string set = (sc == "StorageBuffer" || sc == "Uniform"
+ ? R"(OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+)"
+ : R"()");
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpExecutionMode %main LocalSize 1 1 1
+OpName %var "var"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpMemberDecorate %struct 1 Offset 4
+)" + set + R"(OpDecorate %test_type ArrayStride 4
+OpDecorate %ptr ArrayStride 16
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%int_4 = OpConstant %int 4
+%int4 = OpTypeVector %int 4
+%test_type = OpTypeArray %int4 %int_4
+%test_val = OpConstantNull %test_type
+%struct = OpTypeStruct %int %int
+%ptr = OpTypeUntypedPointerKHR )" +
+ sc + R"(
+%var = OpUntypedVariableKHR %ptr )" +
+ sc + R"( %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+)" + op + R"(
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ const bool read_only = sc == "Uniform" || sc == "PushConstant";
+ if (!read_only || op.find("OpStore") == std::string::npos) {
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("array with stride 4 not satisfying alignment to 16"));
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ ValidateUntypedPointerLayout, UntypedPointerLayout,
+ Combine(Values("StorageBuffer", "Uniform", "PushConstant", "Workgroup"),
+ Values("%gep = OpUntypedAccessChainKHR %ptr %test_type %var %int_0",
+ "%gep = OpUntypedInBoundsAccessChainKHR %ptr %test_type "
+ "%var %int_0",
+ "%gep = OpUntypedPtrAccessChainKHR %ptr %test_type %var "
+ "%int_0 %int_0",
+ "%ld = OpLoad %test_type %var", "OpStore %var %test_val")));
+
+TEST_F(ValidateDecorations, UntypedArrayLengthMissingOffset) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%struct = OpTypeStruct %array
+%block = OpTypeStruct %array
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%len = OpUntypedArrayLengthKHR %int %struct %var 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("member 0 is missing an Offset decoration"));
+}
+
+TEST_F(ValidateDecorations, ComponentMultipleArrays) {
+ const std::string spirv = R"(
+ OpCapability Tessellation
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationEvaluation %main "main" %_ %FOO %FOO0
+ OpExecutionMode %main Triangles
+ OpExecutionMode %main SpacingEqual
+ OpExecutionMode %main VertexOrderCcw
+ OpSource GLSL 460
+ OpSourceExtension "GL_EXT_nonuniform_qualifier"
+ OpName %main "main"
+ OpName %gl_PerVertex "gl_PerVertex"
+ OpMemberName %gl_PerVertex 0 "gl_Position"
+ OpMemberName %gl_PerVertex 1 "gl_PointSize"
+ OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
+ OpMemberName %gl_PerVertex 3 "gl_CullDistance"
+ OpName %_ ""
+ OpName %FOO "FOO"
+ OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
+ OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
+ OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
+ OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
+ OpDecorate %gl_PerVertex Block
+ OpDecorate %FOO Component 2
+ OpDecorate %FOO Location 1
+ OpDecorate %FOO0 Location 1
+ OpDecorate %FOO0 Component 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_arr_float_uint_1 = OpTypeArray %float %uint_1
+%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
+%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
+ %_ = OpVariable %_ptr_Output_gl_PerVertex Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %v2float = OpTypeVector %float 2
+ %uint_2 = OpConstant %uint 2
+%_arr_v2float_uint_2 = OpTypeArray %v2float %uint_2
+ %uint_32 = OpConstant %uint 32
+%_arr__arr_v2float_uint_2_uint_32 = OpTypeArray %_arr_v2float_uint_2 %uint_32
+%_ptr_Input__arr__arr_v2float_uint_2_uint_32 = OpTypePointer Input %_arr__arr_v2float_uint_2_uint_32
+ %FOO = OpVariable %_ptr_Input__arr__arr_v2float_uint_2_uint_32 Input
+ %FOO0 = OpVariable %_ptr_Input__arr__arr_v2float_uint_2_uint_32 Input
+%_ptr_Input_v2float = OpTypePointer Input %v2float
+ %int_1 = OpConstant %int 1
+ %uint_0 = OpConstant %uint 0
+%_ptr_Output_float = OpTypePointer Output %float
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %24 = OpAccessChain %_ptr_Input_v2float %FOO %int_0 %int_0
+ %25 = OpLoad %v2float %24
+ %27 = OpAccessChain %_ptr_Input_v2float %FOO0 %int_1 %int_1
+ %28 = OpLoad %v2float %27
+ %29 = OpFAdd %v2float %25 %28
+ %32 = OpAccessChain %_ptr_Output_float %_ %int_0 %uint_0
+ %33 = OpCompositeExtract %float %29 0
+ OpStore %32 %33
+ %34 = OpAccessChain %_ptr_Output_float %_ %int_0 %uint_1
+ %35 = OpCompositeExtract %float %29 1
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+const std::string kNodeShaderPrelude = R"(
+OpCapability Shader
+OpCapability ShaderEnqueueAMDX
+OpExtension "SPV_AMDX_shader_enqueue"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpEntryPoint GLCompute %other "other"
+)";
+
+const std::string kNodeShaderPostlude = R"(
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%node0 = OpConstantStringAMDX "node0"
+%node1 = OpConstantStringAMDX "node1"
+%node2 = OpConstantStringAMDX "node2"
+%S = OpTypeStruct
+%_payloadarr_S_0 = OpTypeNodePayloadArrayAMDX %S
+%_payloadarr_S = OpTypeNodePayloadArrayAMDX %S
+%bool = OpTypeBool
+%true = OpConstantTrue %bool
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+%other = OpFunction %void None %void_fn
+%entry0 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+TEST_F(ValidateDecorations, NodeShader) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(env));
+}
+
+TEST_F(ValidateDecorations, NodeShaderDecoratePayloadNodeName) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorate %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorate %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Decorations taking ID parameters may not be used with OpDecorate"));
+}
+
+TEST_F(ValidateDecorations, NodeShaderDecoratePayloadNodeBaseIndex) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorate %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Decorations taking ID parameters may not be used with OpDecorate"));
+}
+
+TEST_F(ValidateDecorations, NodeShaderDecoratePayloadNodeArraySize) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorate %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Decorations taking ID parameters may not be used with OpDecorate"));
+}
+
+TEST_F(ValidateDecorations, NodeShaderDecorateNodeSharesPayloadLimitsWith) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorate %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Decorations taking ID parameters may not be used with OpDecorate"));
+}
+
+TEST_F(ValidateDecorations, BlockArrayWithStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %array ArrayStride 4
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%struct = OpTypeStruct %int
+%array = OpTypeArray %struct %int_4
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Array containing a Block or BufferBlock must not be "
+ "decorated with ArrayStride"));
+}
+
+TEST_F(ValidateDecorations, BufferBlockRuntimeArrayWithStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+OpDecorate %struct BufferBlock
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %array ArrayStride 4
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%array = OpTypeRuntimeArray %struct
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Array containing a Block or BufferBlock must not be "
+ "decorated with ArrayStride"));
+}
+
+TEST_F(ValidateDecorations, BlockArrayWithoutStride) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%struct = OpTypeStruct %int
+%array = OpTypeArray %struct %int_4
+%ptr = OpTypePointer StorageBuffer %array
+%var = OpVariable %ptr StorageBuffer
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateDecorations, BlockArrayWithoutStrideUntypedAccessChain) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%struct = OpTypeStruct %int
+%array = OpTypeArray %struct %int_4
+%void = OpTypeVoid
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %array
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %ptr %array %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutBlockFunctionPre1p4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %block Block
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%block = OpTypeStruct %int
+%ptr_function_block = OpTypePointer Function %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_function_block Function
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutBlockFunctionPost1p4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %block Block
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%block = OpTypeStruct %int
+%ptr_function_block = OpTypePointer Function %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_function_block Function
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutOffsetPrivatePre1p4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%block = OpTypeStruct %int
+%ptr_private_block = OpTypePointer Private %block
+%void_fn = OpTypeFunction %void
+%var = OpVariable %ptr_private_block Private
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutOffsetPrivatePost1p4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%block = OpTypeStruct %int
+%ptr_private_block = OpTypePointer Private %block
+%void_fn = OpTypeFunction %void
+%var = OpVariable %ptr_private_block Private
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutArrayStrideWorkgroupExplicitLayout) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%array = OpTypeArray %int %int_4
+%ptr_wg_block = OpTypePointer Workgroup %array
+%void_fn = OpTypeFunction %void
+%var = OpVariable %ptr_wg_block Workgroup
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutArrayStrideWorkgroup) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%array = OpTypeArray %int %int_4
+%ptr_wg_block = OpTypePointer Workgroup %array
+%void_fn = OpTypeFunction %void
+%var = OpVariable %ptr_wg_block Workgroup
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutArrayStrideUniformConstant) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %array ArrayStride 4
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%sampler = OpTypeSampler
+%array = OpTypeArray %sampler %int_4
+%ptr_uc_block = OpTypePointer UniformConstant %array
+%void_fn = OpTypeFunction %void
+%var = OpVariable %ptr_uc_block UniformConstant
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutMatrixStrideFunctionPost1p4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpMemberDecorate %block 0 MatrixStride 16
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%mat4x4 = OpTypeMatrix %v4float 4
+%block = OpTypeStruct %mat4x4
+%ptr_function_block = OpTypePointer Function %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_function_block Function
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutNestedMatrixStrideFunctionPost1p4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpMemberDecorate %block 0 MatrixStride 16
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%mat4x4 = OpTypeMatrix %v4float 4
+%block = OpTypeStruct %mat4x4
+%block2 = OpTypeStruct %block
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%array = OpTypeArray %block2 %int_2
+%ptr_function_array = OpTypePointer Function %array
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_function_array Function
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutBufferBlockWorkgroup) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %block BufferBlock
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%block = OpTypeStruct %int
+%ptr_wg_block = OpTypePointer Workgroup %block
+%void_fn = OpTypeFunction %void
+%var = OpVariable %ptr_wg_block Workgroup
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10684"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Invalid explicit layout decorations on type for operand"));
+}
+
+TEST_F(ValidateDecorations, InvalidLayoutUntypedStore) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%block = OpTypeStruct %int
+%block_null = OpConstantNull %block
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpStore %var %block_null
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateDecorations, ExplicitLayoutOnPtrPhysicalStorageBuffer) {
+ const std::string spirv = R"(
+OpCapability PhysicalStorageBufferAddresses
+OpCapability Int64
+OpCapability Shader
+OpExtension "SPV_KHR_physical_storage_buffer"
+OpMemoryModel PhysicalStorageBuffer64 GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %_ptr_PhysicalStorageBuffer_int ArrayStride 4
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int ; ArrayStride 4
+%Foo = OpTypeStruct %_ptr_PhysicalStorageBuffer_int
+%_ptr_Function_Foo = OpTypePointer Function %Foo
+%int_0 = OpConstant %int 0
+%_ptr_Function__ptr_PhysicalStorageBuffer_int = OpTypePointer Function %_ptr_PhysicalStorageBuffer_int
+%ulong = OpTypeInt 64 0
+%ulong_0 = OpConstant %ulong 0
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%obj = OpVariable %_ptr_Function_Foo Function
+%obj_member = OpAccessChain %_ptr_Function__ptr_PhysicalStorageBuffer_int %obj %int_0
+%nullptr = OpConvertUToPtr %_ptr_PhysicalStorageBuffer_int %ulong_0
+OpStore %obj_member %nullptr
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateDecorations, RuntimeArrayNotLargestOffsetInBlock) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 16
+OpMemberDecorate %block 1 Offset 0
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %int %array
+%ptr = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr StorageBuffer
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("has a runtime array at offset 0, but other members at "
+ "larger offsets"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeRuntimeArray-04680"));
+}
+
+TEST_F(ValidateDecorations, RuntimeArrayNotLargestOffsetInBufferBlock) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block BufferBlock
+OpMemberDecorate %block 0 Offset 16
+OpMemberDecorate %block 1 Offset 0
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %int %array
+%ptr = OpTypePointer Uniform %block
+%var = OpVariable %ptr Uniform
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("has a runtime array at offset 0, but other members at "
+ "larger offsets"));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeRuntimeArray-04680"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_derivatives_test.cpp b/third_party/SPIRV-Tools/test/val/val_derivatives_test.cpp
index e605f3a..6ddafe4 100644
--- a/third_party/SPIRV-Tools/test/val/val_derivatives_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_derivatives_test.cpp
@@ -156,8 +156,8 @@
CompileSuccessfully(GenerateShaderCode(body, "", "Vertex").c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Derivative instructions require Fragment or GLCompute "
- "execution model: DPdx"));
+ HasSubstr("Derivative instructions require Fragment, GLCompute, "
+ "MeshEXT or TaskEXT execution model: DPdx"));
}
TEST_F(ValidateDerivatives, NoExecutionModeGLCompute) {
@@ -181,8 +181,9 @@
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Derivative instructions require "
- "DerivativeGroupQuadsNV or DerivativeGroupLinearNV "
- "execution mode for GLCompute execution model"));
+ "DerivativeGroupQuadsKHR or DerivativeGroupLinearKHR "
+ "execution mode for GLCompute, MeshEXT or TaskEXT "
+ "execution model"));
}
using ValidateHalfDerivatives = spvtest::ValidateBase<std::string>;
diff --git a/third_party/SPIRV-Tools/test/val/val_ext_inst_debug_test.cpp b/third_party/SPIRV-Tools/test/val/val_ext_inst_debug_test.cpp
index 8f0da42..445be08 100644
--- a/third_party/SPIRV-Tools/test/val/val_ext_inst_debug_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_ext_inst_debug_test.cpp
@@ -21,6 +21,7 @@
#include <vector>
#include "gmock/gmock.h"
+#include "spirv-tools/libspirv.h"
#include "test/unit_spirv.h"
#include "test/val/val_fixtures.h"
@@ -84,6 +85,15 @@
spvtest::ValidateBase<std::pair<std::string, std::string>>;
using ValidateVulkan100DebugInfo = spvtest::ValidateBase<std::string>;
+const static std::string shader_extension = R"(
+OpExtension "SPV_KHR_non_semantic_info"
+%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+)";
+
+const static std::string opencl_extension = R"(
+%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
+)";
+
std::string GenerateShaderCodeForDebugInfo(
const std::string& op_string_instructions,
const std::string& op_const_instructions,
@@ -118,6 +128,7 @@
ss << "OpExecutionMode %main OriginUpperLeft\n";
}
+ ss << "%main_name = OpString \"main\"\n";
ss << op_string_instructions;
ss << R"(
@@ -181,6 +192,9 @@
%u32_1 = OpConstant %u32 1
%u32_2 = OpConstant %u32 2
%u32_3 = OpConstant %u32 3
+%u32_4 = OpConstant %u32 4
+%u32_5 = OpConstant %u32 5
+%u32_32 = OpConstant %u32 32
%s32_0 = OpConstant %s32 0
%s32_1 = OpConstant %s32 1
@@ -308,12 +322,8 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -327,12 +337,8 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", "", dbg_inst,
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", "", dbg_inst, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -352,13 +358,8 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", "", dbg_inst,
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", "", dbg_inst, shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -373,8 +374,6 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%int_name = OpString "int"
%foo_name = OpString "foo"
)";
@@ -384,7 +383,7 @@
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_0 Signed
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main
%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %int_info %dbg_src 1 1 %main_info FlagIsLocal
%expr = OpExtInst %void %DbgExt DebugExpression
)";
@@ -394,12 +393,8 @@
%foo_val = OpLoad %u32 %foo
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header + GetParam(), body, extension, "Vertex"));
+ src, "", dbg_inst_header + GetParam(), body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("DebugScope, DebugNoScope, DebugDeclare, DebugValue "
@@ -412,8 +407,6 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%int_name = OpString "int"
%foo_name = OpString "foo"
)";
@@ -423,7 +416,7 @@
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_0 %u32_1 %u32_0
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_1
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %int_info %dbg_src %u32_1 %u32_1 %main_info %u32_4
%expr = OpExtInst %void %DbgExt DebugExpression
)";
@@ -434,18 +427,8 @@
%foo_val = OpLoad %u32 %foo
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header + GetParam(), body, extension, "Vertex"));
+ src, "", dbg_inst_header + GetParam(), body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("DebugScope, DebugNoScope, DebugDeclare, DebugValue "
@@ -465,27 +448,21 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
)";
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main
)";
const std::string body = R"(
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -494,8 +471,6 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
)";
const std::string dbg_inst_header = R"(
@@ -503,19 +478,15 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %dbgNone
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %dbgNone
)";
const std::string body = R"(
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -528,8 +499,6 @@
}
"
%float_name = OpString "float"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string size_const = R"(
@@ -542,7 +511,7 @@
%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %int_32 Float
%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main
)";
const std::string body = R"(
@@ -550,12 +519,8 @@
%foo = OpVariable %f32_ptr_function Function
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, body, extension, "Vertex"));
+ src, size_const, dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -575,12 +540,8 @@
%opaque = OpExtInst %void %DbgExt DebugTypeComposite %ty_name Class %dbg_src 1 1 %comp_unit %ty_name %dbg_none FlagIsPublic
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -615,12 +576,8 @@
%VS_OUTPUT_color_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_color_name %v4float_info %dbg_src 3 3 %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -654,12 +611,8 @@
%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("forward referenced IDs have not been defined"));
@@ -753,12 +706,8 @@
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -773,12 +722,8 @@
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %src HLSL
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst, "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Source must be a result id of "
@@ -796,18 +741,8 @@
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %src %u32_5
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, dbg_inst,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Source must be a result id of "
@@ -835,12 +770,8 @@
%float_info = OpExtInst %void %DbgExt DebugTypeBasic %int_32 %int_32 Float
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Name must be a result id of "
@@ -858,25 +789,14 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
%float_info = OpExtInst %void %DbgExt DebugTypeBasic %u32_32 %u32_32 %u32_3 %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Name must be a result id of "
@@ -904,12 +824,8 @@
%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %float_name Float
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Size must be a result id of "
@@ -927,31 +843,45 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %float_name %u32_3 %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Size must be a result id of "
"OpConstant"));
}
+TEST_F(ValidateVulkan100DebugInfo, DebugTypeBasicFailFlags) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() {}"
+%float_name = OpString "float"
+)";
+
+ const std::string constants = R"(
+%f32_32 = OpConstant %f32 32
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_3 %u32_3 %f32_32
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("expected operand Flags must be a result id of 32-bit "
+ "unsigned OpConstant"));
+}
+
TEST_F(ValidateOpenCL100DebugInfo, DebugTypePointer) {
const std::string src = R"(
%src = OpString "simple.hlsl"
@@ -974,12 +904,8 @@
%pfloat_info = OpExtInst %void %DbgExt DebugTypePointer %float_info Function FlagIsLocal
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1005,12 +931,8 @@
%pfloat_info = OpExtInst %void %DbgExt DebugTypePointer %dbg_src Function FlagIsLocal
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -1039,12 +961,8 @@
%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %float_info ConstType
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1070,12 +988,8 @@
%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %comp_unit ConstType
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -1092,12 +1006,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1105,13 +1013,8 @@
%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %float_info %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1126,12 +1029,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1139,13 +1036,8 @@
%cfloat_info = OpExtInst %void %DbgExt DebugTypeQualifier %comp_unit %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -1170,12 +1062,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %int_32
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1185,7 +1073,6 @@
%code = OpString "main() {}"
%float_name = OpString "float"
%int_name = OpString "int"
-%main_name = OpString "main"
%foo_name = OpString "foo"
)";
@@ -1204,12 +1091,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1231,12 +1114,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %comp_unit %int_32
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Base Type is not a valid debug "
@@ -1261,12 +1140,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %float_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1293,12 +1168,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %f32_4
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1325,12 +1196,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_0
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1344,7 +1211,6 @@
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
%float_name = OpString "float"
-%main_name = OpString "main"
%foo_name = OpString "foo"
)";
@@ -1362,12 +1228,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1383,12 +1245,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1396,13 +1252,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_32
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1412,15 +1263,11 @@
%code = OpString "main() {}"
%float_name = OpString "float"
%uint_name = OpString "uint"
-%main_name = OpString "main"
%foo_name = OpString "foo"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_6 = OpConstant %u32 6
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -1434,13 +1281,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1451,12 +1293,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1464,13 +1300,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %comp_unit %u32_32
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Base Type is not a valid debug "
@@ -1484,12 +1315,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1497,13 +1322,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %float_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1519,12 +1339,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1532,13 +1346,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %f32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1554,12 +1363,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1567,13 +1370,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1582,15 +1380,11 @@
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
%float_name = OpString "float"
-%main_name = OpString "main"
%foo_name = OpString "foo"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_6 = OpConstant %u32 6
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -1603,13 +1397,8 @@
%float_arr_info = OpExtInst %void %DbgExt DebugTypeArray %float_info %foo_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be OpConstant with a 32- or "
@@ -1636,12 +1425,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1663,12 +1448,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 4
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Base Type must be a result id of "
@@ -1693,12 +1474,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 0
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Base Type must be a result id of "
@@ -1723,12 +1500,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src 5
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Base Type must be a result id of "
@@ -1742,12 +1515,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1755,13 +1522,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1772,12 +1534,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1785,13 +1541,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %dbg_src %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Base Type must be a result id of "
@@ -1805,12 +1556,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1818,13 +1563,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be positive "
@@ -1838,12 +1578,6 @@
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -1851,13 +1585,8 @@
%vfloat_info = OpExtInst %void %DbgExt DebugTypeVector %float_info %u32_5
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Component Count must be positive "
@@ -1872,9 +1601,6 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%true = OpConstantTrue %bool
)";
@@ -1886,13 +1612,8 @@
%mfloat_info = OpExtInst %void %DbgExt DebugTypeMatrix %vfloat_info %u32_4 %true
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -1904,9 +1625,6 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%true = OpConstantTrue %bool
)";
@@ -1918,13 +1636,8 @@
%mfloat_info = OpExtInst %void %DbgExt DebugTypeMatrix %dbg_src %u32_4 %true
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Vector Type must be a result id of "
@@ -1939,9 +1652,6 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%true = OpConstantTrue %bool
)";
@@ -1953,13 +1663,8 @@
%mfloat_info = OpExtInst %void %DbgExt DebugTypeMatrix %vfloat_info %dbg_src %true
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Vector Count must be a result id of "
@@ -1974,9 +1679,6 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%true = OpConstantTrue %bool
)";
@@ -1988,13 +1690,8 @@
%mfloat_info = OpExtInst %void %DbgExt DebugTypeMatrix %vfloat_info %u32_0 %true
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Vector Count must be positive "
@@ -2009,9 +1706,6 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%true = OpConstantTrue %bool
)";
@@ -2023,13 +1717,8 @@
%mfloat_info = OpExtInst %void %DbgExt DebugTypeMatrix %vfloat_info %u32_5 %true
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Vector Count must be positive "
@@ -2055,12 +1744,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypedef %foo_name %float_info %dbg_src 1 1 %comp_unit
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2086,12 +1771,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypedef )";
ss << param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, size_const, ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second +
@@ -2119,12 +1800,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -2132,13 +1807,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypedef %foo_name %float_info %dbg_src %u32_1 %u32_1 %comp_unit
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2150,12 +1820,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const auto& param = GetParam();
std::ostringstream ss;
@@ -2166,13 +1830,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypedef )";
ss << param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second +
@@ -2200,8 +1859,6 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%float_name = OpString "float"
)";
@@ -2219,12 +1876,8 @@
%main_type_info4 = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void %float_info %float_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2232,8 +1885,6 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%float_name = OpString "float"
)";
@@ -2248,12 +1899,8 @@
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %dbg_src %float_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -2264,8 +1911,6 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%float_name = OpString "float"
)";
@@ -2280,12 +1925,8 @@
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %float_info %void
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -2296,17 +1937,9 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -2317,13 +1950,8 @@
%main_type_info4 = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void %float_info %float_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2331,17 +1959,9 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -2349,13 +1969,8 @@
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %dbg_src %float_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -2366,17 +1981,9 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
%float_name = OpString "float"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -2384,13 +1991,8 @@
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %float_info %void
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -2419,12 +2021,8 @@
%foo_info3 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src 1 1 %comp_unit %int_32 FlagIsPublic
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2450,12 +2048,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypeEnum )";
ss << param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, size_const, ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -2498,12 +2092,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -2514,13 +2102,8 @@
%foo_info3 = OpExtInst %void %DbgExt DebugTypeEnum %foo_name %none %dbg_src %u32_1 %u32_1 %comp_unit %u32_32 %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2532,12 +2115,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const auto& param = GetParam();
std::ostringstream ss;
@@ -2548,13 +2125,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypeEnum )";
ss << param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -2604,8 +2176,6 @@
%foo_name = OpString "foo"
%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION"
%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string size_const = R"(
@@ -2621,17 +2191,13 @@
%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4
%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main
%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic
%child = OpExtInst %void %DbgExt DebugTypeInheritance %foo_info %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2650,8 +2216,6 @@
%foo_name = OpString "foo"
%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION"
%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string size_const = R"(
@@ -2672,17 +2236,13 @@
%v4float_info = OpExtInst %void %DbgExt DebugTypeVector %float_info 4
%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember %VS_OUTPUT_pos_name %v4float_info %dbg_src 2 3 %VS_OUTPUT_info %u32_0 %int_128 FlagIsPublic
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %v4float_info %float_info
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main
%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name Structure %dbg_src 1 1 %comp_unit %foo_name %u32_0 FlagIsPublic
%child = OpExtInst %void %DbgExt DebugTypeInheritance %foo_info %VS_OUTPUT_info %int_128 %int_128 FlagIsPublic
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, size_const, ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second + " must be "));
@@ -2746,12 +2306,8 @@
%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember )";
ss << param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, size_const, ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
if (!param.second.empty()) {
EXPECT_THAT(getDiagnosticString(),
@@ -2805,12 +2361,8 @@
%child = OpExtInst %void %DbgExt DebugTypeInheritance )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -2849,14 +2401,9 @@
%foo_name = OpString "foo"
%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION"
%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%u32_128 = OpConstant %u32 128
)";
@@ -2870,13 +2417,8 @@
%foo_info = OpExtInst %void %DbgExt DebugTypeComposite %foo_name %u32_1 %dbg_src %u32_1 %u32_1 %comp_unit %foo_name %u32_0 %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -2895,14 +2437,9 @@
%foo_name = OpString "foo"
%VS_OUTPUT_pos_name = OpString "pos : SV_POSITION"
%VS_OUTPUT_linkage_name = OpString "VS_OUTPUT"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%u32_128 = OpConstant %u32 128
)";
@@ -2918,13 +2455,8 @@
%VS_OUTPUT_info = OpExtInst %void %DbgExt DebugTypeComposite )";
ss << param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second + " must be "));
@@ -2971,9 +2503,6 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
%u32_128 = OpConstant %u32 128
)";
@@ -2987,13 +2516,8 @@
%VS_OUTPUT_pos_info = OpExtInst %void %DbgExt DebugTypeMember )";
ss << param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
if (!param.second.empty()) {
EXPECT_THAT(getDiagnosticString(),
@@ -3033,23 +2557,17 @@
};
main() {}
"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)";
+%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3061,8 +2579,6 @@
};
main() {}
"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const auto& param = GetParam();
@@ -3072,16 +2588,12 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic
+%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic
%main_info = OpExtInst %void %DbgExt DebugFunction )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3091,25 +2603,25 @@
AllOpenCL100DebugInfoFail, ValidateOpenCL100DebugInfoDebugFunction,
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
std::make_pair(
- R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)",
+ R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main)",
"Name"),
std::make_pair(
- R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)",
+ R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main)",
"Type"),
std::make_pair(
- R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main)",
+ R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_name FlagIsPublic 13 %main)",
"Source"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_linkage_name FlagIsPublic 13 %main)",
+ R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_name FlagIsPublic 13 %main)",
"Parent"),
std::make_pair(
R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %void FlagIsPublic 13 %main)",
"Linkage Name"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %void)",
+ R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %void)",
"Function"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic 13 %main %dbg_src)",
+ R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic 13 %main %dbg_src)",
"Declaration"),
}));
@@ -3121,8 +2633,6 @@
};
main() {}
"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const auto& param = GetParam();
@@ -3135,12 +2645,8 @@
%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3151,16 +2657,16 @@
ValidateOpenCL100DebugInfoDebugFunctionDeclaration,
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
std::make_pair(
- R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic)",
+ R"(%u32_0 %main_type_info %dbg_src 12 1 %comp_unit %main_name FlagIsPublic)",
"Name"),
std::make_pair(
- R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_linkage_name FlagIsPublic)",
+ R"(%main_name %dbg_src %dbg_src 12 1 %comp_unit %main_name FlagIsPublic)",
"Type"),
std::make_pair(
- R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_linkage_name FlagIsPublic)",
+ R"(%main_name %main_type_info %comp_unit 12 1 %comp_unit %main_name FlagIsPublic)",
"Source"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_linkage_name FlagIsPublic)",
+ R"(%main_name %main_type_info %dbg_src 12 1 %dbg_src %main_name FlagIsPublic)",
"Parent"),
std::make_pair(
R"(%main_name %main_type_info %dbg_src 12 1 %comp_unit %void FlagIsPublic)",
@@ -3175,13 +2681,9 @@
};
main() {}
"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_12 = OpConstant %u32 12
%u32_13 = OpConstant %u32 13
)";
@@ -3190,17 +2692,12 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
-%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13
-)";
-
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3 %u32_13
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3212,13 +2709,9 @@
};
main() {}
"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_12 = OpConstant %u32 12
%u32_13 = OpConstant %u32 13
)";
@@ -3230,17 +2723,12 @@
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
-%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3
+%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration %main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3
%main_info = OpExtInst %void %DbgExt DebugFunction )"
<< param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3250,22 +2738,22 @@
AllVulkan100DebugInfoFail, ValidateVulkan100DebugInfoDebugFunction,
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
std::make_pair(
- R"(%u32_0 %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13)",
+ R"(%u32_0 %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3 %u32_13)",
"Name"),
std::make_pair(
- R"(%main_name %dbg_src %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13)",
+ R"(%main_name %dbg_src %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3 %u32_13)",
"Type"),
std::make_pair(
- R"(%main_name %main_type_info %comp_unit %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13)",
+ R"(%main_name %main_type_info %comp_unit %u32_12 %u32_1 %comp_unit %main_name %u32_3 %u32_13)",
"Source"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %dbg_src %main_linkage_name %u32_3 %u32_13)",
+ R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %dbg_src %main_name %u32_3 %u32_13)",
"Parent"),
std::make_pair(
R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %void %u32_3 %u32_13)",
"Linkage Name"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3 %u32_13 %dbg_src)",
+ R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3 %u32_13 %dbg_src)",
"Declaration"),
}));
@@ -3277,13 +2765,9 @@
};
main() {}
"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v4f_main_f"
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_12 = OpConstant %u32 12
%u32_13 = OpConstant %u32 13
)";
@@ -3298,13 +2782,8 @@
%main_decl = OpExtInst %void %DbgExt DebugFunctionDeclaration )"
<< param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3315,27 +2794,54 @@
ValidateVulkan100DebugInfoDebugFunctionDeclaration,
::testing::ValuesIn(std::vector<std::pair<std::string, std::string>>{
std::make_pair(
- R"(%u32_0 %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3)",
+ R"(%u32_0 %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3)",
"Name"),
std::make_pair(
- R"(%main_name %dbg_src %dbg_src %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3)",
+ R"(%main_name %dbg_src %dbg_src %u32_12 %u32_1 %comp_unit %main_name %u32_3)",
"Type"),
std::make_pair(
- R"(%main_name %main_type_info %comp_unit %u32_12 %u32_1 %comp_unit %main_linkage_name %u32_3)",
+ R"(%main_name %main_type_info %comp_unit %u32_12 %u32_1 %comp_unit %main_name %u32_3)",
"Source"),
std::make_pair(
- R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %dbg_src %main_linkage_name %u32_3)",
+ R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %dbg_src %main_name %u32_3)",
"Parent"),
std::make_pair(
R"(%main_name %main_type_info %dbg_src %u32_12 %u32_1 %comp_unit %void %u32_3)",
"Linkage Name"),
}));
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionType) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "main() {}"
+%float_name = OpString "float"
+%uint_name = OpString "uint"
+)";
+
+ const std::string constants = R"(
+%u32_6 = OpConstant %u32 6
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%float_info = OpExtInst %void %DbgExt DebugTypeBasic %float_name %u32_32 %u32_3 %u32_0
+%uint_info = OpExtInst %void %DbgExt DebugTypeBasic %uint_name %u32_32 %u32_6 %u32_0
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %uint_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunction: expected operand Type must be a result "
+ "id of DebugTypeFunction"));
+}
+
TEST_F(ValidateOpenCL100DebugInfo, DebugLexicalBlock) {
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
)";
const std::string dbg_inst_header = R"(
@@ -3343,12 +2849,8 @@
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_block = OpExtInst %void %DbgExt DebugLexicalBlock %dbg_src 1 1 %comp_unit %main_name)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3356,7 +2858,6 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
)";
const auto& param = GetParam();
@@ -3368,12 +2869,8 @@
%main_block = OpExtInst %void %DbgExt DebugLexicalBlock )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, "", ss.str(), "",
- extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3402,12 +2899,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %dbg_src
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope"));
}
@@ -3427,12 +2920,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %comp_unit %dbg_src
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined At"));
}
@@ -3441,12 +2930,6 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
)";
const std::string dbg_inst_header = R"(
@@ -3455,13 +2938,8 @@
%main_block = OpExtInst %void %DbgExt DebugLexicalBlock %dbg_src %u32_1 %u32_1 %comp_unit %main_name
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3469,12 +2947,6 @@
const std::string src = R"(
%src = OpString "simple.hlsl"
%code = OpString "main() {}"
-%main_name = OpString "main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
)";
const auto& param = GetParam();
@@ -3486,13 +2958,8 @@
%main_block = OpExtInst %void %DbgExt DebugLexicalBlock )"
<< param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3514,11 +2981,6 @@
%code = OpString "void main() {}"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -3528,13 +2990,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %dbg_src
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope"));
}
@@ -3545,11 +3002,6 @@
%code = OpString "void main() {}"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -3559,13 +3011,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %comp_unit %dbg_src
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined At"));
}
@@ -3589,12 +3036,8 @@
%foo = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src 1 10 %comp_unit FlagIsLocal 0
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3620,12 +3063,8 @@
%foo = OpExtInst %void %DbgExt DebugLocalVariable )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, size_const, ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3657,10 +3096,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -3670,13 +3106,8 @@
%foo = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, constants, dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3689,10 +3120,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const auto& param = GetParam();
@@ -3705,13 +3133,8 @@
%foo = OpExtInst %void %DbgExt DebugLocalVariable )"
<< param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3759,12 +3182,8 @@
%decl = OpExtInst %void %DbgExt DebugDeclare %foo_info %foo %null_expr
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, body, extension, "Vertex"));
+ src, size_const, dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3859,12 +3278,8 @@
%decl = OpExtInst %void %DbgExt DebugDeclare )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, ss.str(), extension, "Vertex"));
+ src, size_const, dbg_inst_header, ss.str(), opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -3887,10 +3302,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -3901,18 +3313,13 @@
%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const std::string body = R"(
%foo = OpVariable %f32_ptr_function Function
%decl = OpExtInst %void %DbgExt DebugDeclare %foo_info %foo %null_expr
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, constants, dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -3994,10 +3401,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -4008,11 +3412,6 @@
%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const auto& param = GetParam();
std::ostringstream ss;
@@ -4022,7 +3421,7 @@
<< param.first;
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, ss.str(), extension, "Vertex"));
+ src, constants, dbg_inst_header, ss.str(), shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -4043,12 +3442,8 @@
%null_expr = OpExtInst %void %DbgExt DebugExpression %op0 %op1
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ "", "", dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4058,12 +3453,8 @@
%null_expr = OpExtInst %void %DbgExt DebugExpression %op %void
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ "", "", dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -4078,13 +3469,8 @@
%null_expr = OpExtInst %void %DbgExt DebugExpression %op0 %op1
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ "", "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4094,13 +3480,8 @@
%null_expr = OpExtInst %void %DbgExt DebugExpression %op %void
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo("", "", dbg_inst_header,
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ "", "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -4134,12 +3515,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4171,12 +3548,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %temp %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4189,7 +3562,6 @@
%float_name = OpString "float"
%ty_name = OpString "Texture"
%t_name = OpString "T"
-%main_name = OpString "main"
)";
const std::string size_const = R"(
@@ -4208,12 +3580,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %param
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4226,7 +3594,6 @@
%float_name = OpString "float"
%ty_name = OpString "Texture"
%t_name = OpString "T"
-%main_name = OpString "main"
)";
const std::string size_const = R"(
@@ -4243,12 +3610,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %float_info %param
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Target must be DebugTypeComposite or "
@@ -4264,7 +3627,6 @@
%float_name = OpString "float"
%ty_name = OpString "Texture"
%t_name = OpString "T"
-%main_name = OpString "main"
)";
const std::string size_const = R"(
@@ -4283,12 +3645,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %float_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -4308,12 +3666,6 @@
%t_name = OpString "T"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_none = OpExtInst %void %DbgExt DebugInfoNone
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
@@ -4324,13 +3676,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %param
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4346,12 +3693,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_none = OpExtInst %void %DbgExt DebugInfoNone
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
@@ -4363,13 +3704,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %temp %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4382,13 +3718,6 @@
%float_name = OpString "float"
%ty_name = OpString "Texture"
%t_name = OpString "T"
-%main_name = OpString "main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -4402,13 +3731,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %main_info %param
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4421,13 +3745,6 @@
%float_name = OpString "float"
%ty_name = OpString "Texture"
%t_name = OpString "T"
-%main_name = OpString "main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -4439,13 +3756,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %float_info %param
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand Target must be DebugTypeComposite or "
@@ -4461,13 +3773,6 @@
%float_name = OpString "float"
%ty_name = OpString "Texture"
%t_name = OpString "T"
-%main_name = OpString "main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -4480,13 +3785,8 @@
%temp = OpExtInst %void %DbgExt DebugTypeTemplate %opaque %float_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
@@ -4514,12 +3814,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4544,12 +3840,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %f32_input FlagIsProtected|FlagIsPrivate %a
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4573,12 +3865,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %dbgNone FlagIsProtected|FlagIsPrivate
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4601,12 +3889,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src 0 0 %comp_unit %foo_name %int_32 FlagIsProtected|FlagIsPrivate
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, "", extension, "Vertex"));
+ src, size_const, dbg_inst_header, "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4632,12 +3916,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, size_const, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, size_const, ss.str(), "", opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -4674,12 +3954,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -4687,13 +3961,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4705,12 +3974,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -4720,13 +3983,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %t %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %f32_input %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4738,12 +3996,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbgNone = OpExtInst %void %DbgExt DebugInfoNone
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
@@ -4752,13 +4004,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %dbgNone %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4770,12 +4017,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
@@ -4783,13 +4024,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable %foo_name %float_info %dbg_src %u32_0 %u32_0 %comp_unit %foo_name %u32_32 %u32_3
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, "", extension, "Vertex"));
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4801,12 +4037,6 @@
%foo_name = OpString "foo"
)";
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
-)";
-
const auto& param = GetParam();
std::ostringstream ss;
@@ -4817,13 +4047,8 @@
%foo = OpExtInst %void %DbgExt DebugGlobalVariable )"
<< param.first;
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
- CompileSuccessfully(GenerateShaderCodeForDebugInfo(src, constants, ss.str(),
- "", extension, "Vertex"));
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", ss.str(), "", shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -4857,15 +4082,13 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
)";
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main
%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info
%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info %inlined_at
)";
@@ -4874,12 +4097,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4888,15 +4107,13 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
)";
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main
%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info
%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %inlined_at
)";
@@ -4905,12 +4122,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope"));
}
@@ -4920,15 +4133,13 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
)";
const std::string dbg_inst_header = R"(
%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit 2 4 %dbg_src HLSL
%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction FlagIsPublic %void
-%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_linkage_name FlagIsPublic 1 %main
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src 1 1 %comp_unit %main_name FlagIsPublic 1 %main
%inlined_at = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info
%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt 0 %main_info %main_info
)";
@@ -4937,12 +4148,8 @@
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, "", dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined"));
}
@@ -4952,14 +4159,6 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -4971,17 +4170,12 @@
%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info %inlined_at
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const std::string body = R"(
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -4990,14 +4184,6 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -5009,17 +4195,12 @@
%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %inlined_at %inlined_at
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const std::string body = R"(
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Scope"));
}
@@ -5029,14 +4210,6 @@
%src = OpString "simple.hlsl"
%code = OpString "void main() {}"
%void_name = OpString "void"
-%main_name = OpString "main"
-%main_linkage_name = OpString "v_main"
-)";
-
- const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -5048,17 +4221,12 @@
%inlined_at_recursive = OpExtInst %void %DbgExt DebugInlinedAt %u32_0 %main_info %main_info
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const std::string body = R"(
%main_scope = OpExtInst %void %DbgExt DebugScope %main_info %inlined_at
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr("expected operand Inlined"));
}
@@ -5089,12 +4257,8 @@
%value = OpExtInst %void %DbgExt DebugValue %foo_info %int_32 %null_expr %int_3
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, body, extension, "Vertex"));
+ src, size_const, dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -5128,12 +4292,8 @@
%value = OpExtInst %void %DbgExt DebugValue %foo_info %int_32 %null_expr %len_info
)";
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, body, extension, "Vertex"));
+ src, size_const, dbg_inst_header, body, opencl_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -5164,12 +4324,8 @@
%decl = OpExtInst %void %DbgExt DebugValue )"
<< param.first;
- const std::string extension = R"(
-%DbgExt = OpExtInstImport "OpenCL.DebugInfo.100"
-)";
-
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, size_const, dbg_inst_header, ss.str(), extension, "Vertex"));
+ src, size_const, dbg_inst_header, ss.str(), opencl_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -5192,10 +4348,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -5207,17 +4360,12 @@
%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const std::string body = R"(
%value = OpExtInst %void %DbgExt DebugValue %foo_info %u32_32 %null_expr %u32_3
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, constants, dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -5232,10 +4380,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -5249,17 +4394,12 @@
%len_info = OpExtInst %void %DbgExt DebugLocalVariable %len_name %int_info %dbg_src %u32_0 %u32_0 %comp_unit %u32_4
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const std::string body = R"(
%value = OpExtInst %void %DbgExt DebugValue %foo_info %u32_32 %null_expr %len_info
)";
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, body, extension, "Vertex"));
+ src, constants, dbg_inst_header, body, shader_extension, "Vertex"));
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -5272,10 +4412,7 @@
)";
const std::string constants = R"(
-%u32_4 = OpConstant %u32 4
-%u32_5 = OpConstant %u32 5
%u32_10 = OpConstant %u32 10
-%u32_32 = OpConstant %u32 32
)";
const std::string dbg_inst_header = R"(
@@ -5287,11 +4424,6 @@
%foo_info = OpExtInst %void %DbgExt DebugLocalVariable %foo_name %v4float_info %dbg_src %u32_1 %u32_10 %comp_unit %u32_4 %u32_0
)";
- const std::string extension = R"(
-OpExtension "SPV_KHR_non_semantic_info"
-%DbgExt = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
-)";
-
const auto& param = GetParam();
std::ostringstream ss;
@@ -5300,7 +4432,7 @@
<< param.first;
CompileSuccessfully(GenerateShaderCodeForDebugInfo(
- src, constants, dbg_inst_header, ss.str(), extension, "Vertex"));
+ src, constants, dbg_inst_header, ss.str(), shader_extension, "Vertex"));
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("expected operand " + param.second));
@@ -5475,6 +4607,446 @@
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDefinition) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDefinitionFailFunction) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_type_info %main
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunctionDefinition: expected operand Function "
+ "must be a result id of DebugFunction"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDefinitionFailDefinition) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main_name
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunctionDefinition: expected operand Definition "
+ "must be a result id of OpFunction"));
+}
+
+// TODO - Need to track in function scope
+TEST_F(ValidateVulkan100DebugInfo, DISABLED_DebugFunctionDefinitionDuplicate) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info1 = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+%main_info2 = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def1 = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info1 %main
+%main_def2 = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info2 %main
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunctionDefinition: Was used multiple times in "
+ "single function block"));
+}
+
+// TODO - Need to track in function scope
+TEST_F(ValidateVulkan100DebugInfo,
+ DISABLED_DebugFunctionDefinitionDuplicateReference) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main
+OpReturn
+OpFunctionEnd
+
+%foo = OpFunction %void None %func
+%foo_entry = OpLabel
+%foo_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %foo
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunctionDefinition: Was referenced a "
+ "DebugFunction that was already referenced before"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDefinitionWrongDefinition) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+%foo_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main
+OpReturn
+OpFunctionEnd
+
+%foo = OpFunction %void None %func
+%foo_entry = OpLabel
+%foo_def = OpExtInst %void %DbgExt DebugFunctionDefinition %foo_info %main
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunctionDefinition: operand Definition must "
+ "point to the OpFunction it is inside"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDefinitionNonEntryBlock) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string constants = R"(
+%false = OpConstantFalse %bool
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+OpSelectionMerge %merge_block None
+OpBranchConditional %false %second_block %merge_block
+%second_block = OpLabel
+OpReturn
+%merge_block = OpLabel
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, constants, dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugFunctionDefinition: must be in the entry basic "
+ "block of the function"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugFunctionDefinitionMultiFunctions) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%comp_unit = OpExtInst %void %DbgExt DebugCompilationUnit %u32_2 %u32_4 %dbg_src %u32_5
+%main_type_info = OpExtInst %void %DbgExt DebugTypeFunction %u32_3 %void
+%main_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+%foo_info = OpExtInst %void %DbgExt DebugFunction %main_name %main_type_info %dbg_src %u32_1 %u32_1 %comp_unit %main_name %u32_3 %u32_1
+)";
+
+ const std::string body = R"(
+%main_def = OpExtInst %void %DbgExt DebugFunctionDefinition %main_info %main
+OpReturn
+OpFunctionEnd
+
+%foo = OpFunction %void None %func
+%foo_entry = OpLabel
+%foo_def = OpExtInst %void %DbgExt DebugFunctionDefinition %foo_info %foo
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLine) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_1 %u32_2 %u32_0 %u32_0
+%line2 = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_1 %u32_2 %u32_0 %u32_0
+%no_line = OpExtInst %void %DbgExt DebugNoLine
+%line3 = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_1 %u32_2 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugNoLineOutOfBlock) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%no_line = OpExtInst %void %DbgExt DebugNoLine
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("debug info extension must appear in a function body"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineOutOfBlock) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%line = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_1 %u32_2 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, "", shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("debug info extension must appear in a function body"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineSource) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+%int_name = OpString "int"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%int_info = OpExtInst %void %DbgExt DebugTypeBasic %int_name %u32_0 %u32_1 %u32_0
+)";
+
+ const std::string body = R"(
+%line = OpExtInst %void %DbgExt DebugLine %int_info %u32_2 %u32_2 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugLine: expected operand Source must be a result "
+ "id of DebugSource"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineFloat) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %f32_1 %u32_2 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugLine: expected operand Line Start must be a "
+ "result id of 32-bit unsigned OpConstant"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineInt64) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %u64_1 %u64_1 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugLine: expected operand Line Start must be a "
+ "result id of 32-bit unsigned OpConstant"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineSpecConstant) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+%spec_int = OpSpecConstant %u32 2
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %spec_int %u32_1 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugLine: expected operand Line Start must be a "
+ "result id of 32-bit unsigned OpConstant"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineLineEndSmaller) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_2 %u32_1 %u32_0 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("DebugLine: operand Line End (1) is less than Line Start (2)"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineColumnEndSmaller) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_1 %u32_1 %u32_1 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("DebugLine: operand Column End (0) is less than Column "
+ "Start (1) when Line Start equals Line End"));
+}
+
+TEST_F(ValidateVulkan100DebugInfo, DebugLineColumnEndSmallerMultiline) {
+ const std::string src = R"(
+%src = OpString "simple.hlsl"
+%code = OpString "int main() { }"
+)";
+
+ const std::string dbg_inst_header = R"(
+%dbg_src = OpExtInst %void %DbgExt DebugSource %src %code
+)";
+
+ const std::string body = R"(
+%line1 = OpExtInst %void %DbgExt DebugLine %dbg_src %u32_1 %u32_2 %u32_1 %u32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCodeForDebugInfo(
+ src, "", dbg_inst_header, body, shader_extension, "Vertex"));
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_ext_inst_test.cpp b/third_party/SPIRV-Tools/test/val/val_ext_inst_test.cpp
index 8f0bcce..23fd3aa 100644
--- a/third_party/SPIRV-Tools/test/val/val_ext_inst_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_ext_inst_test.cpp
@@ -447,6 +447,7 @@
%u8arr_uniform_constant = OpVariable %u8arr_ptr_uniform_constant UniformConstant
%u8_ptr_uniform_constant = OpTypePointer UniformConstant %u8
%u8_ptr_generic = OpTypePointer Generic %u8
+%u8_ptr_input = OpTypePointer Input %u8
%main = OpFunction %void None %func
%main_entry = OpLabel
@@ -5269,6 +5270,26 @@
"be UniformConstant"));
}
+TEST_F(ValidateExtInst,
+ OpenCLStdPrintfFormatWithExtensionNotAllowedStorageClass) {
+ const std::string body = R"(
+%format_const = OpAccessChain %u8_ptr_uniform_constant %u8arr_uniform_constant %u32_0
+%format = OpBitcast %u8_ptr_input %format_const
+%val1 = OpExtInst %u32 %extinst printf %format %u32_0 %u32_1
+)";
+
+ const std::string extension = R"(
+OpExtension "SPV_EXT_relaxed_printf_string_address_space"
+)";
+
+ CompileSuccessfully(GenerateKernelCode(body, extension));
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpenCL.std printf: expected Format storage class to "
+ "be UniformConstant, Crossworkgroup, Workgroup, "
+ "Function, or Generic"));
+}
+
TEST_F(ValidateExtInst, OpenCLStdPrintfFormatNotU8Pointer) {
const std::string body = R"(
%format = OpAccessChain %u32_ptr_uniform_constant %u32vec8_uniform_constant %u32_0
@@ -7472,6 +7493,82 @@
}
}
+TEST_F(ValidateExtInst, OpExtInstWithForwardNotAllowedSemantic) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ %extinst = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+ %3 = OpString "sample"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %f32 = OpTypeFloat 32
+ %uint_0 = OpConstant %uint 0
+ %f32_0 = OpConstant %f32 0
+ %f32_1 = OpConstant %f32 1
+ %7 = OpTypeFunction %void
+ %8 = OpExtInst %void %1 DebugSource %3 %3
+ %9 = OpExtInst %void %1 DebugCompilationUnit %uint_0 %uint_0 %8 %uint_0
+ %10 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction %uint_0 %11
+ %12 = OpExtInstWithForwardRefsKHR %void %1 DebugFunction %3 %10 %8 %uint_0 %uint_0 %11 %3 %uint_0 %uint_0
+ %11 = OpExtInst %void %1 DebugTypeComposite %3 %uint_0 %8 %uint_0 %uint_0 %9 %3 %uint_0 %uint_0 %12
+ %2 = OpFunction %void None %7
+ %13 = OpLabel
+ %18 = OpExtInstWithForwardRefsKHR %f32 %extinst FMin %f32_0 %19
+ %19 = OpExtInst %f32 %extinst FMin %f32_0 %f32_1
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "OpExtInstWithForwardRefsKHR is only allowed with non-semantic "
+ "instructions.\n"
+ " %18 = OpExtInstWithForwardRefsKHR %float %2 FMin %float_0 %19\n"));
+}
+
+TEST_F(ValidateExtInst, OpExtInstRequiresNonSemanticBefore16) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ %extinst = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+ %3 = OpString "sample"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %7 = OpTypeFunction %void
+ %8 = OpExtInst %void %1 DebugSource %3 %3
+ %9 = OpExtInst %void %1 DebugCompilationUnit %uint_0 %uint_0 %8 %uint_0
+ %10 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction %uint_0 %11
+ %12 = OpExtInstWithForwardRefsKHR %void %1 DebugFunction %3 %10 %8 %uint_0 %uint_0 %11 %3 %uint_0 %uint_0
+ %11 = OpExtInst %void %1 DebugTypeComposite %3 %uint_0 %8 %uint_0 %uint_0 %9 %3 %uint_0 %uint_0 %12
+ %2 = OpFunction %void None %7
+ %13 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body);
+ ASSERT_EQ(SPV_ERROR_MISSING_EXTENSION, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("ExtInstWithForwardRefsKHR requires one of the following "
+ "extensions: SPV_KHR_relaxed_extended_instruction \n"
+ " %11 = OpExtInstWithForwardRefsKHR %void %1 "
+ "DebugTypeFunction %uint_0 %12\n"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_extension_spv_intel_inline_assembly.cpp b/third_party/SPIRV-Tools/test/val/val_extension_spv_intel_inline_assembly.cpp
new file mode 100644
index 0000000..a683afd
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/val/val_extension_spv_intel_inline_assembly.cpp
@@ -0,0 +1,109 @@
+// Copyright 2025 The Khronos Group Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Tests for SPV_INTEL_inline_assembly
+
+#include <string>
+
+#include "gmock/gmock.h"
+#include "test/val/val_fixtures.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+using ::testing::HasSubstr;
+
+using ValidateSpvINTELInlineAssembly = spvtest::ValidateBase<bool>;
+
+TEST_F(ValidateSpvINTELInlineAssembly, Valid) {
+ const std::string str = R"(
+ OpCapability Kernel
+ OpCapability Addresses
+ OpCapability Linkage
+ OpCapability AsmINTEL
+ OpExtension "SPV_INTEL_inline_assembly"
+ OpMemoryModel Physical32 OpenCL
+ OpDecorate %1 SideEffectsINTEL
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpAsmTargetINTEL "spirv64-unknown-unknown"
+ %1 = OpAsmINTEL %2 %3 %4 "nop" ""
+ %5 = OpFunction %2 None %3
+ %6 = OpLabel
+ %7 = OpAsmCallINTEL %2 %1
+ OpReturn
+ OpFunctionEnd
+ )";
+ CompileSuccessfully(str.c_str());
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateSpvINTELInlineAssembly, RequiresExtension) {
+ const std::string str = R"(
+ OpCapability Kernel
+ OpCapability Addresses
+ OpCapability Linkage
+ OpCapability AsmINTEL
+ OpMemoryModel Physical32 OpenCL
+ OpDecorate %1 SideEffectsINTEL
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpAsmTargetINTEL "spirv64-unknown-unknown"
+ %1 = OpAsmINTEL %2 %3 %4 "nop" ""
+ %5 = OpFunction %2 None %3
+ %6 = OpLabel
+ %7 = OpAsmCallINTEL %2 %1
+ OpReturn
+ OpFunctionEnd
+ )";
+ CompileSuccessfully(str.c_str());
+ EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+ const std::string diag = getDiagnosticString();
+ EXPECT_THAT(
+ diag,
+ HasSubstr("1st operand of Capability: operand AsmINTEL(5606) requires "
+ "one of these extensions: SPV_INTEL_inline_assembly"));
+ EXPECT_THAT(diag, HasSubstr("OpCapability AsmINTEL"));
+}
+
+TEST_F(ValidateSpvINTELInlineAssembly, RequiresCapability) {
+ const std::string str = R"(
+ OpCapability Kernel
+ OpCapability Addresses
+ OpCapability Linkage
+ OpExtension "SPV_INTEL_inline_assembly"
+ OpMemoryModel Physical32 OpenCL
+ OpDecorate %1 SideEffectsINTEL
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %4 = OpAsmTargetINTEL "spirv64-unknown-unknown"
+ %1 = OpAsmINTEL %2 %3 %4 "nop" ""
+ %5 = OpFunction %2 None %3
+ %6 = OpLabel
+ %7 = OpAsmCallINTEL %2 %1
+ OpReturn
+ OpFunctionEnd
+)";
+ CompileSuccessfully(str.c_str());
+ EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+ const std::string diag = getDiagnosticString();
+ EXPECT_THAT(diag, HasSubstr("Operand 2 of Decorate requires one of these "
+ "capabilities: AsmINTEL"));
+ EXPECT_THAT(diag, HasSubstr("OpDecorate %1 SideEffectsINTEL"));
+}
+
+} // namespace
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp b/third_party/SPIRV-Tools/test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp
new file mode 100644
index 0000000..c4c8355
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/val/val_extension_spv_khr_subgroup_uniform_control_flow.cpp
@@ -0,0 +1,110 @@
+// Copyright (c) 2021 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Tests for OpExtension validator rules.
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "source/extensions.h"
+#include "source/spirv_target_env.h"
+#include "source/table2.h"
+#include "test/test_fixture.h"
+#include "test/unit_spirv.h"
+#include "test/val/val_fixtures.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+using ::testing::HasSubstr;
+using ::testing::Values;
+using ::testing::ValuesIn;
+
+using ValidateSpvKHRSubgroupUniformControlFlow = spvtest::ValidateBase<bool>;
+
+TEST_F(ValidateSpvKHRSubgroupUniformControlFlow, Valid) {
+ const std::string str = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_subgroup_uniform_control_flow"
+ OpMemoryModel Logical Simple
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpExecutionMode %main SubgroupUniformControlFlowKHR
+
+ %void = OpTypeVoid
+ %void_fn = OpTypeFunction %void
+
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ CompileSuccessfully(str.c_str());
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateSpvKHRSubgroupUniformControlFlow, RequiresExtension) {
+ const std::string str = R"(
+ OpCapability Shader
+ OpMemoryModel Logical Simple
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ OpExecutionMode %main SubgroupUniformControlFlowKHR
+
+ %void = OpTypeVoid
+ %void_fn = OpTypeFunction %void
+
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ CompileSuccessfully(str.c_str());
+ EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("2nd operand of ExecutionMode: operand "
+ "SubgroupUniformControlFlowKHR(4421) "
+ "requires one of these extensions: "
+ "SPV_KHR_subgroup_uniform_control_flow"));
+}
+
+TEST_F(ValidateSpvKHRSubgroupUniformControlFlow, RequiresShaderCapability) {
+ const std::string str = R"(
+ OpCapability Kernel
+ OpCapability Addresses
+ OpExtension "SPV_KHR_subgroup_uniform_control_flow"
+ OpMemoryModel Physical32 OpenCL
+ OpEntryPoint Kernel %main "main"
+ OpExecutionMode %main SubgroupUniformControlFlowKHR
+
+ %void = OpTypeVoid
+ %void_fn = OpTypeFunction %void
+
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ CompileSuccessfully(str.c_str());
+ EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Operand 2 of ExecutionMode requires one of these "
+ "capabilities: Shader"));
+}
+
+} // namespace
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_extensions_test.cpp b/third_party/SPIRV-Tools/test/val/val_extensions_test.cpp
index 932bbee..cba306c 100644
--- a/third_party/SPIRV-Tools/test/val/val_extensions_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_extensions_test.cpp
@@ -61,7 +61,8 @@
"SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask",
"SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
"SPV_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing",
- "SPV_KHR_terminate_invocation"));
+ "SPV_KHR_terminate_invocation", "SPV_KHR_relaxed_extended_instruction",
+ "SPV_EXT_float8"));
INSTANTIATE_TEST_SUITE_P(FailSilently, ValidateUnknownExtensions,
Values("ERROR_unknown_extension", "SPV_KHR_",
@@ -550,6 +551,44 @@
}));
// clang-format on
+using ValidateRelaxedExtendedInstructionExt = spvtest::ValidateBase<bool>;
+
+TEST_F(ValidateRelaxedExtendedInstructionExt, RequiresExtension) {
+ const std::string str = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+ %3 = OpString "sample"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %7 = OpTypeFunction %void
+ %8 = OpExtInst %void %1 DebugSource %3 %3
+ %9 = OpExtInst %void %1 DebugCompilationUnit %uint_0 %uint_0 %8 %uint_0
+ %10 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction %uint_0 %11
+ %12 = OpExtInstWithForwardRefsKHR %void %1 DebugFunction %3 %10 %8 %uint_0 %uint_0 %11 %3 %uint_0 %uint_0
+ %11 = OpExtInst %void %1 DebugTypeComposite %3 %uint_0 %8 %uint_0 %uint_0 %9 %3 %uint_0 %uint_0 %12
+ %2 = OpFunction %void None %7
+ %13 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(str.c_str());
+ EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "ExtInstWithForwardRefsKHR requires one of the following extensions:"
+ " SPV_KHR_relaxed_extended_instruction \n"
+ " %10 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction "
+ "%uint_0 "
+ "%11\n"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_fixtures.h b/third_party/SPIRV-Tools/test/val/val_fixtures.h
index 98d8d32..db9d045 100644
--- a/third_party/SPIRV-Tools/test/val/val_fixtures.h
+++ b/third_party/SPIRV-Tools/test/val/val_fixtures.h
@@ -76,6 +76,8 @@
diagnostic_ = nullptr;
}
+ void SetAssembleOptions(uint32_t options) { assemble_options_ = options; }
+
std::string getDiagnosticString();
spv_position_t getErrorPosition();
spv_validator_options getValidatorOptions();
@@ -84,6 +86,7 @@
spv_diagnostic diagnostic_;
spv_validator_options options_;
std::unique_ptr<spvtools::val::ValidationState_t> vstate_;
+ uint32_t assemble_options_ = SPV_TEXT_TO_BINARY_OPTION_NONE;
};
template <typename T>
@@ -132,8 +135,9 @@
DestroyBinary();
spv_diagnostic diagnostic = nullptr;
ScopedContext context(env);
- auto status = spvTextToBinary(context.context, code.c_str(), code.size(),
- &binary_, &diagnostic);
+ auto status =
+ spvTextToBinaryWithOptions(context.context, code.c_str(), code.size(),
+ assemble_options_, &binary_, &diagnostic);
EXPECT_EQ(SPV_SUCCESS, status)
<< "ERROR: " << diagnostic->error
<< "\nSPIR-V could not be compiled into binary:\n"
diff --git a/third_party/SPIRV-Tools/test/val/val_function_test.cpp b/third_party/SPIRV-Tools/test/val/val_function_test.cpp
index 24b5263..119edd3 100644
--- a/third_party/SPIRV-Tools/test/val/val_function_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_function_test.cpp
@@ -836,6 +836,113 @@
HasSubstr("type does not match Function <id>"));
}
+TEST_F(ValidateFunctionCall, UntypedPointerParameterMismatch) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %var "var"
+OpName %ptr2 "ptr2"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%ptr = OpTypeUntypedPointerKHR Private
+%ptr2 = OpTypeUntypedPointerKHR Private
+%var = OpUntypedVariableKHR %ptr Private %int
+%void_fn = OpTypeFunction %void
+%ptr_fn = OpTypeFunction %void %ptr2
+%foo = OpFunction %void None %ptr_fn
+%param = OpFunctionParameter %ptr2
+%first = OpLabel
+OpReturn
+OpFunctionEnd
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%call = OpFunctionCall %void %foo %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpFunctionCall Argument <id> '2[%var]'s type does not "
+ "match Function <id> '3[%ptr2]'s parameter type"));
+}
+
+TEST_F(ValidateFunctionCall, UntypedPointerParameterGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %var "var"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%ptr = OpTypeUntypedPointerKHR Private
+%var = OpUntypedVariableKHR %ptr Private %int
+%void_fn = OpTypeFunction %void
+%ptr_fn = OpTypeFunction %void %ptr
+%foo = OpFunction %void None %ptr_fn
+%param = OpFunctionParameter %ptr
+%first = OpLabel
+OpReturn
+OpFunctionEnd
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%call = OpFunctionCall %void %foo %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateFunctionCall,
+ UntypedPointerParameterNotMemoryObjectDeclaration) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %var "var"
+OpName %gep "gep"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Private
+%var = OpUntypedVariableKHR %ptr Private %int
+%void_fn = OpTypeFunction %void
+%ptr_fn = OpTypeFunction %void %ptr
+%foo = OpFunction %void None %ptr_fn
+%param = OpFunctionParameter %ptr
+%first = OpLabel
+OpReturn
+OpFunctionEnd
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %ptr %struct %var %int_0
+%call = OpFunctionCall %void %foo %gep
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Pointer operand '3[%gep]' must be a memory object declaration"));
+}
+
INSTANTIATE_TEST_SUITE_P(StorageClass, ValidateFunctionCall,
Values("UniformConstant", "Input", "Uniform", "Output",
"Workgroup", "Private", "Function",
diff --git a/third_party/SPIRV-Tools/test/val/val_id_test.cpp b/third_party/SPIRV-Tools/test/val/val_id_test.cpp
index cc29736..b376afe 100644
--- a/third_party/SPIRV-Tools/test/val/val_id_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_id_test.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2015-2016 The Khronos Group Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -77,8 +79,7 @@
OpExtension "SPV_KHR_variable_pointers"
)";
-std::string kGLSL450MemoryModel =
- kOpCapabilitySetup + kOpVariablePtrSetUp + R"(
+std::string kGLSL450MemoryModel = kOpCapabilitySetup + kOpVariablePtrSetUp + R"(
OpMemoryModel Logical GLSL450
)";
@@ -578,9 +579,8 @@
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr(make_message(
- "Interfaces passed to OpEntryPoint must be of type "
- "OpTypeVariable. Found OpTypePointer.")));
+ HasSubstr("Interfaces passed to OpEntryPoint must be variables. "
+ "Found OpTypePointer."));
}
TEST_P(ValidateIdWithMessage, OpEntryPointInterfaceStorageClassBad) {
@@ -708,6 +708,24 @@
"'2[%_ptr_UniformConstant_float]' is not a scalar type.")));
}
+TEST_P(ValidateIdWithMessage, OpTypeVectorComponentTypeCanBePointerType) {
+ std::string spirv = R"(
+OpCapability Addresses
+OpCapability Linkage
+OpCapability Kernel
+OpCapability Int64
+OpCapability GenericPointer
+OpCapability MaskedGatherScatterINTEL
+OpExtension "SPV_INTEL_masked_gather_scatter"
+OpMemoryModel Physical64 OpenCL
+
+%2 = OpTypeInt 32 0
+%3 = OpTypePointer Generic %2
+%4 = OpTypeVector %3 4)";
+ CompileSuccessfully(spirv.c_str());
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
TEST_P(ValidateIdWithMessage, OpTypeVectorColumnCountLessThanTwoBad) {
std::string spirv = kGLSL450MemoryModel + R"(
%1 = OpTypeFloat 32
@@ -1167,6 +1185,160 @@
"type.")));
}
+TEST_P(ValidateIdWithMessage, OpTypePointerCanHaveUntypedPointer) {
+ const std::string spirv = R"(
+OpCapability Kernel
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical OpenCL
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%ptr2 = OpTypePointer Private %ptr
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerWorkgroupGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%ptr = OpTypeUntypedPointerKHR Workgroup
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_P(ValidateIdWithMessage,
+ OpTypeUntypedPointerWorkgroupMissingExplicitLayout) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Workgroup storage class untyped pointers in Vulkan require "
+ "WorkgroupMemoryExplicitLayoutKHR be declared"));
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerWorkgroupGoodAll) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%ptr = OpTypeUntypedPointerKHR Workgroup
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerStorageBufferGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerUniformGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%ptr = OpTypeUntypedPointerKHR Uniform
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerPushConstantGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%ptr = OpTypeUntypedPointerKHR PushConstant
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerCrossWorkgroupGood) {
+ const std::string spirv = R"(
+OpCapability Kernel
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical OpenCL
+%ptr = OpTypeUntypedPointerKHR CrossWorkgroup
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateIdWithMessage, OpTypeUntypedPointerVulkanInvalidStorageClass) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%ptr = OpTypeUntypedPointerKHR Private
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("In Vulkan, untyped pointers can only be used in an "
+ "explicitly laid out storage class"));
+}
+
TEST_P(ValidateIdWithMessage, OpTypeFunctionGood) {
std::string spirv = kGLSL450MemoryModel + R"(
%1 = OpTypeVoid
@@ -2270,9 +2442,8 @@
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr(make_message(
- "OpVariable Initializer <id> '8[%8]' is not a constant "
- "or module-scope variable")));
+ HasSubstr("Variable Initializer <id> '8[%8]' is not a constant "
+ "or module-scope variable"));
}
TEST_P(ValidateIdWithMessage, OpVariableInitializerIsModuleVarGood) {
@@ -2317,7 +2488,8 @@
"be used with non-externally visible shader Storage Classes: "
"Workgroup, CrossWorkgroup, Private, Function, Input, Output, "
"RayPayloadKHR, IncomingRayPayloadKHR, HitAttributeKHR, "
- "CallableDataKHR, IncomingCallableDataKHR, or UniformConstant")));
+ "CallableDataKHR, IncomingCallableDataKHR, NodePayloadAMDX, or "
+ "UniformConstant")));
}
TEST_P(ValidateIdWithMessage, OpVariableContainsBoolPrivateGood) {
@@ -3869,8 +4041,7 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%float_entry = )" +
- instr +
+%float_entry = )" + instr +
R"( %float %my_matrix )" + elem +
R"(%int_0 %int_1
OpReturn
@@ -3890,8 +4061,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%float_entry = )" +
- instr + " %_ptr_Private_float %void " + elem +
+%float_entry = )" + instr +
+ " %_ptr_Private_float %void " + elem +
R"(%int_0 %int_1
OpReturn
OpFunctionEnd
@@ -3907,8 +4078,7 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_float %_ptr_Private_float )" +
+%entry = )" + instr + R"( %_ptr_Private_float %_ptr_Private_float )" +
elem +
R"(%int_0 %int_1
OpReturn
@@ -3926,8 +4096,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Function_float %my_matrix )" + elem +
+%entry = )" + instr + R"( %_ptr_Function_float %my_matrix )" +
+ elem +
R"(%int_0 %int_1
OpReturn
OpFunctionEnd
@@ -3947,8 +4117,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_float %my_float_var )" + elem +
+%entry = )" + instr + R"( %_ptr_Private_float %my_float_var )" +
+ elem +
R"(%int_0
OpReturn
OpFunctionEnd
@@ -3967,8 +4137,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_float %my_float_var )" + elem +
+%entry = )" + instr + R"( %_ptr_Private_float %my_float_var )" +
+ elem +
R"(
OpReturn
OpFunctionEnd
@@ -3983,8 +4153,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_mat4x3 %my_float_var )" + elem +
+%entry = )" + instr + R"( %_ptr_Private_mat4x3 %my_float_var )" +
+ elem +
R"(
OpReturn
OpFunctionEnd
@@ -4140,8 +4310,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_float %my_matrix )" + elem +
+%entry = )" + instr + R"( %_ptr_Private_float %my_matrix )" +
+ elem +
R"(%float_0 %int_1
OpReturn
OpFunctionEnd
@@ -4159,18 +4329,17 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%f = )" +
- instr + R"( %_ptr_Uniform_float %blockName_var )" + elem +
+%f = )" + instr + R"( %_ptr_Uniform_float %blockName_var )" +
+ elem +
R"(%int_0 %spec_int %int_2
OpReturn
OpFunctionEnd
)";
- const std::string expected_err =
- "The <id> passed to " + instr +
- " to index into a structure must be an OpConstant.";
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr(expected_err));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("The <id> passed to " + instr));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("into a structure must be an OpConstant"));
}
// Invalid: Indexing up to a vec4 granularity, but result type expected float.
@@ -4179,8 +4348,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Uniform_float %blockName_var )" + elem +
+%entry = )" + instr + R"( %_ptr_Uniform_float %blockName_var )" +
+ elem +
R"(%int_0 %int_1 %int_2
OpReturn
OpFunctionEnd
@@ -4199,8 +4368,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Uniform_float %blockName_var )" + elem +
+%entry = )" + instr + R"( %_ptr_Uniform_float %blockName_var )" +
+ elem +
R"(%int_0 %int_2 %int_2
OpReturn
OpFunctionEnd
@@ -4218,13 +4387,13 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Uniform_float %blockName_var )" + elem +
+%entry = )" + instr + R"( %_ptr_Uniform_float %blockName_var )" +
+ elem +
R"(%int_3 %int_2 %int_2
OpReturn
OpFunctionEnd
)";
- const std::string expected_err = "Index is out of bounds: " + instr +
+ const std::string expected_err = "is out of bounds: " + instr +
" cannot find index 3 into the structure "
"<id> '25[%_struct_25]'. This structure "
"has 3 members. Largest valid index is 2.";
@@ -4274,8 +4443,8 @@
" OpDecorate %_ptr_Uniform_blockName ArrayStride 8 ";
std::string spirv = kGLSL450MemoryModel + arrayStride +
kDeeplyNestedStructureSetup + R"(
-%runtime_arr_entry = )" + instr +
- R"( %_ptr_Uniform_float %blockName_var )" + elem +
+%runtime_arr_entry = )" +
+ instr + R"( %_ptr_Uniform_float %blockName_var )" + elem +
R"(%int_2 %int_0
OpReturn
OpFunctionEnd
@@ -4309,8 +4478,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_float %my_matrix )" + elem +
+%entry = )" + instr + R"( %_ptr_Private_float %my_matrix )" +
+ elem +
R"(%int_0 %int_1 %int_0
OpReturn
OpFunctionEnd
@@ -4329,8 +4498,8 @@
const std::string instr = GetParam();
const std::string elem = AccessChainRequiresElemId(instr) ? "%int_0 " : "";
std::string spirv = kGLSL450MemoryModel + kDeeplyNestedStructureSetup + R"(
-%entry = )" +
- instr + R"( %_ptr_Private_mat4x3 %my_matrix )" + elem +
+%entry = )" + instr + R"( %_ptr_Private_mat4x3 %my_matrix )" +
+ elem +
R"(%int_0 %int_1
OpReturn
OpFunctionEnd
@@ -5610,7 +5779,7 @@
%2 = OpFunction %8 None %11
%4 = OpFunctionParameter %10
%15 = OpLabel
-%16 = OpLoad %6 %3 Aligned 0
+%16 = OpLoad %6 %3 Aligned 1
%17 = OpCompositeExtract %5 %16 0
%18 = OpInBoundsPtrAccessChain %13 %4 %17 %12
OpStore %18 %14 Aligned 4
@@ -5644,7 +5813,7 @@
%2 = OpFunction %8 None %12
%4 = OpFunctionParameter %11
%17 = OpLabel
-%18 = OpLoad %6 %3 Aligned 0
+%18 = OpLoad %6 %3 Aligned 1
%19 = OpCompositeExtract %5 %18 0
%20 = OpBitwiseAnd %5 %19 %13
%21 = OpPtrAccessChain %15 %4 %20 %14
@@ -6404,9 +6573,10 @@
%7 = OpConstant %2 2
%8 = OpConstant %2 5
%9 = OpTypeFunction %1
+%12 = OpConstant %2 4
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 NonPrivatePointerKHR|MakePointerAvailableKHR %7
+OpCopyMemorySized %4 %6 %12 NonPrivatePointerKHR|MakePointerAvailableKHR %7
OpReturn
OpFunctionEnd
)";
@@ -6431,10 +6601,11 @@
%6 = OpVariable %5 Uniform
%7 = OpConstant %2 2
%8 = OpConstant %2 5
+%12 = OpConstant %2 4
%9 = OpTypeFunction %1
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 NonPrivatePointerKHR|MakePointerVisibleKHR %8
+OpCopyMemorySized %4 %6 %12 NonPrivatePointerKHR|MakePointerVisibleKHR %8
OpReturn
OpFunctionEnd
)";
@@ -6460,10 +6631,11 @@
%6 = OpVariable %5 Uniform
%7 = OpConstant %2 2
%8 = OpConstant %2 5
+%12 = OpConstant %2 4
%9 = OpTypeFunction %1
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 NonPrivatePointerKHR|MakePointerAvailableKHR|MakePointerVisibleKHR %7 %8
+OpCopyMemorySized %4 %6 %12 NonPrivatePointerKHR|MakePointerAvailableKHR|MakePointerVisibleKHR %7 %8
OpReturn
OpFunctionEnd
)";
@@ -6489,10 +6661,11 @@
%6 = OpVariable %5 Uniform
%7 = OpConstant %2 2
%8 = OpConstant %2 5
+%12 = OpConstant %2 4
%9 = OpTypeFunction %1
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 MakePointerAvailableKHR %7
+OpCopyMemorySized %4 %6 %12 MakePointerAvailableKHR %7
OpReturn
OpFunctionEnd
)";
@@ -6522,10 +6695,11 @@
%6 = OpVariable %5 Uniform
%7 = OpConstant %2 2
%8 = OpConstant %2 5
+%12 = OpConstant %2 4
%9 = OpTypeFunction %1
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 MakePointerVisibleKHR %8
+OpCopyMemorySized %4 %6 %12 MakePointerVisibleKHR %8
OpReturn
OpFunctionEnd
)";
@@ -6555,10 +6729,11 @@
%6 = OpVariable %5 Uniform
%7 = OpConstant %2 2
%8 = OpConstant %2 5
+%12 = OpConstant %2 4
%9 = OpTypeFunction %1
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 NonPrivatePointerKHR
+OpCopyMemorySized %4 %6 %12 NonPrivatePointerKHR
OpReturn
OpFunctionEnd
)";
@@ -6589,10 +6764,11 @@
%6 = OpVariable %5 Input
%7 = OpConstant %2 2
%8 = OpConstant %2 5
+%12 = OpConstant %2 4
%9 = OpTypeFunction %1
%10 = OpFunction %1 None %9
%11 = OpLabel
-OpCopyMemorySized %4 %6 %7 NonPrivatePointerKHR
+OpCopyMemorySized %4 %6 %12 NonPrivatePointerKHR
OpReturn
OpFunctionEnd
)";
@@ -6907,6 +7083,114 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
+TEST_P(ValidateIdWithMessage,
+ OpExtInstWithForwardRefsKHRDisallowedNoForwardRef) {
+ std::string spirv = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %void = OpTypeVoid
+%main_type = OpTypeFunction %void
+ %4 = OpExtInstWithForwardRefsKHR %void %1 DebugInfoNone
+ %main = OpFunction %void None %main_type
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_6);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(make_message("Opcode OpExtInstWithForwardRefsKHR must have at "
+ "least one forward declared ID.")));
+}
+
+TEST_P(ValidateIdWithMessage, OpExtInstNoForwardRef) {
+ std::string spirv = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 1 1 1
+ %void = OpTypeVoid
+%main_type = OpTypeFunction %void
+ %4 = OpExtInst %void %1 DebugInfoNone
+ %main = OpFunction %void None %main_type
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_6);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+}
+
+TEST_P(ValidateIdWithMessage,
+ OpExtInstWithForwardRefsKHRAllowedForwardReferenceInNonSemantic) {
+ std::string spirv = R"(
+ OpCapability Shader
+ OpExtension "SPV_KHR_non_semantic_info"
+ OpExtension "SPV_KHR_relaxed_extended_instruction"
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+ %3 = OpString "sample"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %7 = OpTypeFunction %void
+ %8 = OpExtInst %void %1 DebugSource %3 %3
+ %9 = OpExtInst %void %1 DebugCompilationUnit %uint_0 %uint_0 %8 %uint_0
+ %10 = OpExtInstWithForwardRefsKHR %void %1 DebugTypeFunction %uint_0 %11
+ %12 = OpExtInstWithForwardRefsKHR %void %1 DebugFunction %3 %10 %8 %uint_0 %uint_0 %11 %3 %uint_0 %uint_0
+ %11 = OpExtInst %void %1 DebugTypeComposite %3 %uint_0 %8 %uint_0 %uint_0 %9 %3 %uint_0 %uint_0 %12
+ %2 = OpFunction %void None %7
+ %13 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_6);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+}
+
+TEST_P(ValidateIdWithMessage, OpExtInstNoForwardDeclAllowed) {
+ std::string spirv = R"(
+ OpCapability Shader
+ %1 = OpExtInstImport "NonSemantic.Shader.DebugInfo.100"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint GLCompute %2 "main"
+ OpExecutionMode %2 LocalSize 1 1 1
+ %3 = OpString "sample"
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+ %7 = OpTypeFunction %void
+ %8 = OpExtInst %void %1 DebugSource %3 %3
+ %9 = OpExtInst %void %1 DebugCompilationUnit %uint_0 %uint_0 %8 %uint_0
+ %10 = OpExtInst %void %1 DebugTypeFunction %uint_0 %11
+ %12 = OpExtInst %void %1 DebugFunction %3 %10 %8 %uint_0 %uint_0 %11 %3 %uint_0 %uint_0
+ %11 = OpExtInst %void %1 DebugTypeComposite %3 %uint_0 %8 %uint_0 %uint_0 %9 %3 %uint_0 %uint_0 %12
+ %2 = OpFunction %void None %7
+ %13 = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_6);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr(make_message("ID '11[%11]' has not been defined")));
+}
+
INSTANTIATE_TEST_SUITE_P(, ValidateIdWithMessage, ::testing::Bool());
} // namespace
diff --git a/third_party/SPIRV-Tools/test/val/val_image_test.cpp b/third_party/SPIRV-Tools/test/val/val_image_test.cpp
index 77b042f..1376f6d 100644
--- a/third_party/SPIRV-Tools/test/val/val_image_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_image_test.cpp
@@ -20,6 +20,7 @@
#include <string>
#include "gmock/gmock.h"
+#include "spirv-tools/libspirv.h"
#include "test/unit_spirv.h"
#include "test/val/val_fixtures.h"
@@ -1380,7 +1381,7 @@
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Expected Result Type to be OpTypePointer"));
+ HasSubstr("Expected Result Type to be a pointer"));
}
TEST_F(ValidateImage, ImageTexelPointerResultTypeNotImageClass) {
@@ -1392,7 +1393,7 @@
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Expected Result Type to be OpTypePointer whose "
+ HasSubstr("Expected Result Type to be a pointer whose "
"Storage Class operand is Image"));
}
@@ -1406,7 +1407,7 @@
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("Expected Result Type to be OpTypePointer whose Type operand "
+ HasSubstr("Expected Result Type to be a pointer whose Type operand "
"must be a scalar numerical type or OpTypeVoid"));
}
@@ -1533,7 +1534,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -1667,7 +1669,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -2144,13 +2147,26 @@
CompileSuccessfully(
GenerateShaderCode(body, "", "Fragment", "", SPV_ENV_VULKAN_1_0).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
- EXPECT_THAT(getDiagnosticString(),
- AnyVUID("VUID-StandaloneSpirv-Offset-04663"));
+ EXPECT_THAT(getDiagnosticString(), AnyVUID("VUID-RuntimeSpirv-Offset-10213"));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Image Operand Offset can only be used with "
"OpImage*Gather operations"));
}
+TEST_F(ValidateImage, SampleImplicitLodVulkanOffsetMaintenance8) {
+ const std::string body = R"(
+%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001
+%sampler = OpLoad %type_sampler %uniform_sampler
+%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler
+%res4 = OpImageSampleImplicitLod %f32vec4 %simg %f32vec4_0000 Offset %s32vec2_01
+)";
+
+ CompileSuccessfully(
+ GenerateShaderCode(body, "", "Fragment", "", SPV_ENV_VULKAN_1_0).c_str());
+ spvValidatorOptionsSetAllowOffsetTextureOperand(getValidatorOptions(), true);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
TEST_F(ValidateImage, SampleImplicitLodVulkanOffsetWrongBeforeLegalization) {
const std::string body = R"(
%img = OpLoad %type_image_f32_2d_0001 %uniform_image_f32_2d_0001
@@ -2246,7 +2262,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -2394,7 +2411,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -2529,7 +2547,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -2685,7 +2704,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -2824,7 +2844,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -2962,7 +2983,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -3080,7 +3102,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -3097,7 +3120,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -3271,7 +3295,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -3575,7 +3600,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -4451,7 +4477,7 @@
const std::string body = R"(
%img = OpLoad %type_image_f32_2d_0011 %uniform_image_f32_2d_0011
%sampler = OpLoad %type_sampler %uniform_sampler
-%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler
+%simg = OpSampledImage %type_sampled_image_f32_2d_0011 %img %sampler
%res1 = OpImageQuerySize %u32vec2 %sampler
)";
@@ -4465,7 +4491,7 @@
const std::string body = R"(
%img = OpLoad %type_image_f32_2d_0011 %uniform_image_f32_2d_0011
%sampler = OpLoad %type_sampler %uniform_sampler
-%simg = OpSampledImage %type_sampled_image_f32_2d_0001 %img %sampler
+%simg = OpSampledImage %type_sampled_image_f32_2d_0011 %img %sampler
%res1 = OpImageQuerySize %u32vec2 %simg
)";
@@ -4780,7 +4806,8 @@
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "OpImageQueryLod requires Fragment or GLCompute execution model"));
+ "OpImageQueryLod requires Fragment, GLCompute, MeshEXT or TaskEXT "
+ "execution model"));
}
TEST_F(ValidateImage, QueryLodWrongExecutionModelWithFunc) {
@@ -4801,7 +4828,8 @@
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "OpImageQueryLod requires Fragment or GLCompute execution model"));
+ "OpImageQueryLod requires Fragment, GLCompute, MeshEXT or TaskEXT "
+ "execution model"));
}
TEST_F(ValidateImage, QueryLodComputeShaderDerivatives) {
@@ -4813,12 +4841,12 @@
)";
const std::string extra = R"(
-OpCapability ComputeDerivativeGroupLinearNV
-OpExtension "SPV_NV_compute_shader_derivatives"
+OpCapability ComputeDerivativeGroupLinearKHR
+OpExtension "SPV_KHR_compute_shader_derivatives"
)";
const std::string mode = R"(
OpExecutionMode %main LocalSize 8 8 1
-OpExecutionMode %main DerivativeGroupLinearNV
+OpExecutionMode %main DerivativeGroupLinearKHR
)";
CompileSuccessfully(
GenerateShaderCode(body, extra, "GLCompute", mode).c_str());
@@ -4930,8 +4958,8 @@
)";
const std::string extra = R"(
-OpCapability ComputeDerivativeGroupLinearNV
-OpExtension "SPV_NV_compute_shader_derivatives"
+OpCapability ComputeDerivativeGroupLinearKHR
+OpExtension "SPV_KHR_compute_shader_derivatives"
)";
const std::string mode = R"(
OpExecutionMode %main LocalSize 8 8 1
@@ -4940,9 +4968,9 @@
GenerateShaderCode(body, extra, "GLCompute", mode).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("OpImageQueryLod requires DerivativeGroupQuadsNV or "
- "DerivativeGroupLinearNV execution mode for GLCompute "
- "execution model"));
+ HasSubstr("OpImageQueryLod requires DerivativeGroupQuadsKHR or "
+ "DerivativeGroupLinearKHR execution mode for "
+ "GLCompute, MeshEXT or TaskEXT execution model"));
}
TEST_F(ValidateImage, ImplicitLodWrongExecutionModel) {
@@ -4956,8 +4984,8 @@
CompileSuccessfully(GenerateShaderCode(body, "", "Vertex").c_str());
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("ImplicitLod instructions require Fragment or "
- "GLCompute execution model"));
+ HasSubstr("ImplicitLod instructions require Fragment, "
+ "GLCompute, MeshEXT or TaskEXT execution model"));
}
TEST_F(ValidateImage, ImplicitLodComputeShaderDerivatives) {
@@ -4969,12 +4997,12 @@
)";
const std::string extra = R"(
-OpCapability ComputeDerivativeGroupLinearNV
-OpExtension "SPV_NV_compute_shader_derivatives"
+OpCapability ComputeDerivativeGroupLinearKHR
+OpExtension "SPV_KHR_compute_shader_derivatives"
)";
const std::string mode = R"(
OpExecutionMode %main LocalSize 8 8 1
-OpExecutionMode %main DerivativeGroupLinearNV
+OpExecutionMode %main DerivativeGroupLinearKHR
)";
CompileSuccessfully(
GenerateShaderCode(body, extra, "GLCompute", mode).c_str());
@@ -4990,8 +5018,8 @@
)";
const std::string extra = R"(
-OpCapability ComputeDerivativeGroupLinearNV
-OpExtension "SPV_NV_compute_shader_derivatives"
+OpCapability ComputeDerivativeGroupLinearKHR
+OpExtension "SPV_KHR_compute_shader_derivatives"
)";
const std::string mode = R"(
OpExecutionMode %main LocalSize 8 8 1
@@ -5001,9 +5029,9 @@
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(
getDiagnosticString(),
- HasSubstr("ImplicitLod instructions require DerivativeGroupQuadsNV or "
- "DerivativeGroupLinearNV execution mode for GLCompute "
- "execution model"));
+ HasSubstr("ImplicitLod instructions require DerivativeGroupQuadsKHR or "
+ "DerivativeGroupLinearKHR execution mode for GLCompute, "
+ "MeshEXT or TaskEXT execution model"));
}
TEST_F(ValidateImage, ReadSubpassDataWrongExecutionModel) {
@@ -5039,7 +5067,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5167,7 +5196,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5261,7 +5291,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5478,7 +5509,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5619,7 +5651,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5636,7 +5669,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5655,7 +5689,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
@@ -5677,7 +5712,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
@@ -5698,7 +5734,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5717,7 +5754,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
@@ -5738,7 +5776,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
@@ -5759,7 +5798,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
@@ -5782,7 +5822,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -5799,7 +5840,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_ERROR_INVALID_DATA,
ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
@@ -5822,7 +5864,8 @@
)";
CompileSuccessfully(GenerateShaderCode(body, extra, "Fragment", "",
SPV_ENV_UNIVERSAL_1_3, "VulkanKHR")
- .c_str());
+ .c_str(),
+ SPV_ENV_UNIVERSAL_1_3);
ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
@@ -6308,7 +6351,7 @@
.c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Expected Result Type to be OpTypePointer"));
+ HasSubstr("Expected Result Type to be a pointer"));
}
TEST_F(ValidateImage, ImageTexelPointer64ResultTypeNotImageClass) {
@@ -6324,7 +6367,7 @@
.c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Expected Result Type to be OpTypePointer whose "
+ HasSubstr("Expected Result Type to be a pointer whose "
"Storage Class operand is Image"));
}
@@ -6505,8 +6548,9 @@
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("ImplicitLod instructions require "
- "DerivativeGroupQuadsNV or DerivativeGroupLinearNV "
- "execution mode for GLCompute execution model"));
+ "DerivativeGroupQuadsKHR or DerivativeGroupLinearKHR "
+ "execution mode for GLCompute, MeshEXT or TaskEXT "
+ "execution model"));
}
TEST_F(ValidateImage, TypeSampledImageNotBufferPost1p6) {
@@ -10647,6 +10691,253 @@
EXPECT_THAT(getDiagnosticString(), Eq(""));
}
+TEST_F(ValidateImage, SampledImageTypeDepthMismatch) {
+ const std::string code = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %im_var DescriptorSet 0
+OpDecorate %im_var Binding 0
+OpDecorate %s_var DescriptorSet 1
+OpDecorate %s_var Binding 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%im1_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+%im2_ty = OpTypeImage %float 2D 1 0 0 1 Unknown
+%s_ty = OpTypeSampler
+%s_im_ty = OpTypeSampledImage %im2_ty
+%ptr_im = OpTypePointer UniformConstant %im1_ty
+%ptr_s = OpTypePointer UniformConstant %s_ty
+%im_var = OpVariable %ptr_im UniformConstant
+%s_var = OpVariable %ptr_s UniformConstant
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%im_ld = OpLoad %im1_ty %im_var
+%s_ld = OpLoad %s_ty %s_var
+%sampled_image = OpSampledImage %s_im_ty %im_ld %s_ld
+OpReturn
+OpFunctionEnd
+)";
+
+ const spv_target_env env = SPV_ENV_VULKAN_1_0;
+ CompileSuccessfully(code, env);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(env));
+}
+
+TEST_F(ValidateImage, SampledImageTypeArrayedMismatch) {
+ const std::string code = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %im_var DescriptorSet 0
+OpDecorate %im_var Binding 0
+OpDecorate %s_var DescriptorSet 1
+OpDecorate %s_var Binding 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%im1_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+%im2_ty = OpTypeImage %float 2D 0 1 0 1 Unknown
+%s_ty = OpTypeSampler
+%s_im_ty = OpTypeSampledImage %im2_ty
+%ptr_im = OpTypePointer UniformConstant %im1_ty
+%ptr_s = OpTypePointer UniformConstant %s_ty
+%im_var = OpVariable %ptr_im UniformConstant
+%s_var = OpVariable %ptr_s UniformConstant
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%im_ld = OpLoad %im1_ty %im_var
+%s_ld = OpLoad %s_ty %s_var
+%sampled_image = OpSampledImage %s_im_ty %im_ld %s_ld
+OpReturn
+OpFunctionEnd
+)";
+
+ const spv_target_env env = SPV_ENV_VULKAN_1_0;
+ CompileSuccessfully(code, env);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Image operands must match result image operands except for depth"));
+}
+
+TEST_F(ValidateImage, SampledImageTypeMultisampledMismatch) {
+ const std::string code = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %im_var DescriptorSet 0
+OpDecorate %im_var Binding 0
+OpDecorate %s_var DescriptorSet 1
+OpDecorate %s_var Binding 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%im1_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+%im2_ty = OpTypeImage %float 2D 0 0 1 1 Unknown
+%s_ty = OpTypeSampler
+%s_im_ty = OpTypeSampledImage %im2_ty
+%ptr_im = OpTypePointer UniformConstant %im1_ty
+%ptr_s = OpTypePointer UniformConstant %s_ty
+%im_var = OpVariable %ptr_im UniformConstant
+%s_var = OpVariable %ptr_s UniformConstant
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%im_ld = OpLoad %im1_ty %im_var
+%s_ld = OpLoad %s_ty %s_var
+%sampled_image = OpSampledImage %s_im_ty %im_ld %s_ld
+OpReturn
+OpFunctionEnd
+)";
+
+ const spv_target_env env = SPV_ENV_VULKAN_1_0;
+ CompileSuccessfully(code, env);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Image operands must match result image operands except for depth"));
+}
+
+TEST_F(ValidateImage, SampledImageTypeSampledMismatch) {
+ const std::string code = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %im_var DescriptorSet 0
+OpDecorate %im_var Binding 0
+OpDecorate %s_var DescriptorSet 1
+OpDecorate %s_var Binding 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%im1_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+%im2_ty = OpTypeImage %float 2D 0 0 0 0 Unknown
+%s_ty = OpTypeSampler
+%s_im_ty = OpTypeSampledImage %im2_ty
+%ptr_im = OpTypePointer UniformConstant %im1_ty
+%ptr_s = OpTypePointer UniformConstant %s_ty
+%im_var = OpVariable %ptr_im UniformConstant
+%s_var = OpVariable %ptr_s UniformConstant
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%im_ld = OpLoad %im1_ty %im_var
+%s_ld = OpLoad %s_ty %s_var
+%sampled_image = OpSampledImage %s_im_ty %im_ld %s_ld
+OpReturn
+OpFunctionEnd
+)";
+
+ const spv_target_env env = SPV_ENV_UNIVERSAL_1_0;
+ CompileSuccessfully(code, env);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Image operands must match result image operands except for depth"));
+}
+
+TEST_F(ValidateImage, SampledImageTypeFormatMismatch) {
+ const std::string code = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %im_var DescriptorSet 0
+OpDecorate %im_var Binding 0
+OpDecorate %s_var DescriptorSet 1
+OpDecorate %s_var Binding 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%im1_ty = OpTypeImage %float 2D 0 0 0 1 Unknown
+%im2_ty = OpTypeImage %float 2D 0 0 0 1 R32f
+%s_ty = OpTypeSampler
+%s_im_ty = OpTypeSampledImage %im2_ty
+%ptr_im = OpTypePointer UniformConstant %im1_ty
+%ptr_s = OpTypePointer UniformConstant %s_ty
+%im_var = OpVariable %ptr_im UniformConstant
+%s_var = OpVariable %ptr_s UniformConstant
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%im_ld = OpLoad %im1_ty %im_var
+%s_ld = OpLoad %s_ty %s_var
+%sampled_image = OpSampledImage %s_im_ty %im_ld %s_ld
+OpReturn
+OpFunctionEnd
+)";
+
+ const spv_target_env env = SPV_ENV_UNIVERSAL_1_0;
+ CompileSuccessfully(code, env);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Image operands must match result image operands except for depth"));
+}
+
+TEST_F(ValidateImage, SampledImageTypeAccessQualifierMismatch) {
+ const std::string code = R"(
+OpCapability Kernel
+OpCapability Linkage
+OpMemoryModel Logical OpenCL
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%im1_ty = OpTypeImage %float 2D 0 0 0 0 Unknown ReadWrite
+%im2_ty = OpTypeImage %float 2D 0 0 0 0 Unknown ReadOnly
+%s_ty = OpTypeSampler
+%s_im_ty = OpTypeSampledImage %im2_ty
+%ptr_im = OpTypePointer UniformConstant %im1_ty
+%ptr_s = OpTypePointer UniformConstant %s_ty
+%im_var = OpVariable %ptr_im UniformConstant
+%s_var = OpVariable %ptr_s UniformConstant
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%im_ld = OpLoad %im1_ty %im_var
+%s_ld = OpLoad %s_ty %s_var
+%sampled_image = OpSampledImage %s_im_ty %im_ld %s_ld
+OpReturn
+OpFunctionEnd
+)";
+
+ const spv_target_env env = SPV_ENV_UNIVERSAL_1_0;
+ CompileSuccessfully(code, env);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Image operands must match result image operands except for depth"));
+}
+
+TEST_F(ValidateImage, ImageTexelPointerNotAPointer) {
+ const std::string code = R"(
+ OpCapability ClipDistance
+ OpMemoryModel Logical Simple
+ %void = OpTypeVoid
+ %57 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+%int_538976288 = OpConstant %int 538976288
+%int_538976288_0 = OpConstant %int 538976288
+ %8224 = OpFunction %void None %57
+ %65312 = OpLabel
+ %2097184 = OpImageTexelPointer %void %int_538976288 %int_538976288 %int_538976288_0
+ OpUnreachable
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(code);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected Result Type to be a pointer"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_interfaces_test.cpp b/third_party/SPIRV-Tools/test/val/val_interfaces_test.cpp
index 4f62be7..e5cc97d 100644
--- a/third_party/SPIRV-Tools/test/val/val_interfaces_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_interfaces_test.cpp
@@ -623,6 +623,72 @@
"at location 1"));
}
+TEST_F(ValidateInterfacesTest, VulkanPatchAndNonPatchOverlap) {
+ const std::string text = R"(
+ OpCapability Tessellation
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %main "main" %a %b
+ OpExecutionMode %main OutputVertices 4
+ OpDecorate %a Location 0
+ OpDecorate %b Patch
+ OpDecorate %b Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %uint_4 = OpConstant %uint 4
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+ %a = OpVariable %_ptr_Output__arr_float_uint_4 Output
+%_ptr_Output_float = OpTypePointer Output %float
+ %b = OpVariable %_ptr_Output_float Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateInterfacesTest, VulkanPatchOverlap) {
+ const std::string text = R"(
+ OpCapability Tessellation
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TessellationControl %main "main" %a %b %c
+ OpExecutionMode %main OutputVertices 4
+ OpDecorate %a Location 0
+ OpDecorate %b Patch
+ OpDecorate %b Location 6
+ OpDecorate %c Patch
+ OpDecorate %c Location 6
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %uint_4 = OpConstant %uint 4
+%_arr_float_uint_4 = OpTypeArray %float %uint_4
+%_ptr_Output__arr_float_uint_4 = OpTypePointer Output %_arr_float_uint_4
+ %a = OpVariable %_ptr_Output__arr_float_uint_4 Output
+%_ptr_Output_float = OpTypePointer Output %float
+ %b = OpVariable %_ptr_Output_float Output
+ %c = OpVariable %_ptr_Output_float Output
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-08722"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Entry-point has conflicting output location "
+ "assignment at location 6, component 0"));
+}
+
TEST_F(ValidateInterfacesTest,
VulkanLocationsSameLocationInputAndOutputNoConflict) {
const std::string text = R"(
@@ -1602,7 +1668,7 @@
HasSubstr("Invalid type to assign a location"));
}
-TEST_F(ValidateInterfacesTest, ValidLocationTypePhysicalStorageBufferPointer) {
+TEST_F(ValidateInterfacesTest, PhysicalStorageBufferPointer) {
const std::string text = R"(
OpCapability Shader
OpCapability PhysicalStorageBufferAddresses
@@ -1611,10 +1677,10 @@
OpDecorate %var Location 0
OpDecorate %var RestrictPointer
%void = OpTypeVoid
-%int = OpTypeInt 32 0
-%ptr = OpTypePointer PhysicalStorageBuffer %int
-%ptr2 = OpTypePointer Input %ptr
-%var = OpVariable %ptr2 Input
+%uint = OpTypeInt 32 0
+%psb_ptr = OpTypePointer PhysicalStorageBuffer %uint
+%in_ptr = OpTypePointer Input %psb_ptr
+%var = OpVariable %in_ptr Input
%void_fn = OpTypeFunction %void
%main = OpFunction %void None %void_fn
%entry = OpLabel
@@ -1622,9 +1688,352 @@
OpFunctionEnd
)";
CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-Input-09557"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Input/Output interface variable id <2> contains a "
+ "PhysicalStorageBuffer pointer, which is not allowed"));
+}
+
+TEST_F(ValidateInterfacesTest, PhysicalStorageBufferPointerArray) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability PhysicalStorageBufferAddresses
+ OpMemoryModel PhysicalStorageBuffer64 GLSL450
+ OpEntryPoint Vertex %main "main" %var
+ OpDecorate %var Location 0
+ OpDecorate %var RestrictPointer
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ %psb_ptr = OpTypePointer PhysicalStorageBuffer %uint
+ %array = OpTypeArray %psb_ptr %uint_3
+ %in_ptr = OpTypePointer Input %array
+ %var = OpVariable %in_ptr Input
+ %void_fn = OpTypeFunction %void
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-Input-09557"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Input/Output interface variable id <2> contains a "
+ "PhysicalStorageBuffer pointer, which is not allowed"));
+}
+TEST_F(ValidateInterfacesTest, PhysicalStorageBufferPointerStruct) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability PhysicalStorageBufferAddresses
+ OpMemoryModel PhysicalStorageBuffer64 GLSL450
+ OpEntryPoint Vertex %main "main" %var
+ OpDecorate %var Location 0
+ OpDecorate %var RestrictPointer
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ OpTypeForwardPointer %psb_ptr PhysicalStorageBuffer
+ %struct_0 = OpTypeStruct %int %psb_ptr
+ %struct_1 = OpTypeStruct %int %int
+ %psb_ptr = OpTypePointer PhysicalStorageBuffer %struct_1
+ %in_ptr = OpTypePointer Input %struct_0
+ %var = OpVariable %in_ptr Input
+ %void_fn = OpTypeFunction %void
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-Input-09557"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Input/Output interface variable id <2> contains a "
+ "PhysicalStorageBuffer pointer, which is not allowed"));
+}
+
+TEST_F(ValidateInterfacesTest, PhysicalStorageBufferPointerArrayOfStruct) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability PhysicalStorageBufferAddresses
+ OpMemoryModel PhysicalStorageBuffer64 GLSL450
+ OpEntryPoint Vertex %main "main" %var
+ OpDecorate %var Location 0
+ OpDecorate %var RestrictPointer
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ OpTypeForwardPointer %psb_ptr PhysicalStorageBuffer
+ %array_1 = OpTypeArray %psb_ptr %uint_3
+ %struct_0 = OpTypeStruct %int %array_1
+ %struct_1 = OpTypeStruct %int %int
+ %psb_ptr = OpTypePointer PhysicalStorageBuffer %struct_1
+ %array_0 = OpTypeArray %struct_0 %uint_3
+ %in_ptr = OpTypePointer Input %array_0
+ %var = OpVariable %in_ptr Input
+ %void_fn = OpTypeFunction %void
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-Input-09557"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Input/Output interface variable id <2> contains a "
+ "PhysicalStorageBuffer pointer, which is not allowed"));
+}
+
+TEST_F(ValidateInterfacesTest, PhysicalStorageBufferPointerNestedStruct) {
+ const std::string text = R"(
+ OpCapability Shader
+ OpCapability PhysicalStorageBufferAddresses
+ OpMemoryModel PhysicalStorageBuffer64 GLSL450
+ OpEntryPoint Vertex %main "main" %var
+ OpDecorate %var Location 0
+ OpDecorate %var RestrictPointer
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ OpTypeForwardPointer %psb_ptr PhysicalStorageBuffer
+ %struct_0 = OpTypeStruct %int %psb_ptr
+ %struct_1 = OpTypeStruct %int %int
+ %psb_ptr = OpTypePointer PhysicalStorageBuffer %struct_1
+ %struct_2 = OpTypeStruct %int %struct_0
+ %in_ptr = OpTypePointer Input %struct_2
+ %var = OpVariable %in_ptr Input
+ %void_fn = OpTypeFunction %void
+ %main = OpFunction %void None %void_fn
+ %entry = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-Input-09557"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Input/Output interface variable id <2> contains a "
+ "PhysicalStorageBuffer pointer, which is not allowed"));
+}
+
+TEST_F(ValidateInterfacesTest, UntypedVariableInputMissing) {
+ const std::string text = R"(
+OpCapability Kernel
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical OpenCL
+OpEntryPoint Kernel %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpName %var "var"
+OpDecorate %var BuiltIn LocalInvocationId
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int3 = OpTypeVector %int 3
+%ptr = OpTypeUntypedPointerKHR Input
+%var = OpUntypedVariableKHR %ptr Input %int3
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%load = OpLoad %int3 %var
+OpReturn
+OpFunctionEnd
+)";
+ CompileSuccessfully(text);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Interface variable id <2> is used by entry point "
+ "'main' id <1>, but is not listed as an interface"));
+}
+
+TEST_F(ValidateInterfacesTest, UntypedVariableWorkgroupMissingSpv1p4) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %var "var"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%load = OpLoad %int %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Interface variable id <2> is used by entry point "
+ "'main' id <1>, but is not listed as an interface"));
+}
+
+TEST_F(ValidateInterfacesTest, UntypedIdMatchesInputVulkan1p3) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %var
+OpExecutionMode %main OriginUpperLeft
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %1 Block
+OpMemberDecorate %1 0 Offset 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%1 = OpTypeStruct %float ; this id matches Input storage class
+%ptr = OpTypeUntypedPointerKHR Uniform
+%var = OpUntypedVariableKHR %ptr Uniform %1
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
}
+TEST_F(ValidateInterfacesTest, UntypedIdMatchesPushConstantVulkan1p3) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %var
+OpExecutionMode %main OriginUpperLeft
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %9 Block
+OpMemberDecorate %9 0 Offset 0
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%9 = OpTypeStruct %float ; this id matches PushConstant storage class
+%ptr = OpTypeUntypedPointerKHR Uniform
+%var = OpUntypedVariableKHR %ptr Uniform %9
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateInterfacesTest,
+ InvalidBfloat16VariableWithInputOutputStorageClass) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability BFloat16TypeKHR
+OpExtension "SPV_KHR_bfloat16"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in %out
+OpExecutionMode %main OriginUpperLeft
+OpDecorate %in Location 0
+OpDecorate %out Location 0
+%void = OpTypeVoid
+%bfloat16 = OpTypeFloat 16 BFloat16KHR
+%in_ptr = OpTypePointer Input %bfloat16
+%out_ptr = OpTypePointer Output %bfloat16
+%in = OpVariable %in_ptr Input
+%out = OpVariable %out_ptr Output
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Bfloat16 OpVariable <id> '2[%2]' must not be declared "
+ "with a Storage Class of Input or Output.\n"));
+}
+
+TEST_F(ValidateInterfacesTest,
+ InvalidFP8E4M3VariableWithInputOutputStorageClass) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Float8EXT
+OpExtension "SPV_EXT_float8"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in %out
+OpExecutionMode %main OriginUpperLeft
+OpDecorate %in Location 0
+OpDecorate %out Location 0
+%void = OpTypeVoid
+%fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
+%in_ptr = OpTypePointer Input %fp8e4m3
+%out_ptr = OpTypePointer Output %fp8e4m3
+%in = OpVariable %in_ptr Input
+%out = OpVariable %out_ptr Output
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("FP8 E4M3/E5M2 OpVariable <id> '2[%2]' must not be declared "
+ "with a Storage Class of Input or Output.\n"));
+}
+
+TEST_F(ValidateInterfacesTest,
+ InvalidFP8E5M2VariableWithInputOutputStorageClass) {
+ const std::string text = R"(
+OpCapability Shader
+OpCapability Float8EXT
+OpExtension "SPV_EXT_float8"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main" %in %out
+OpExecutionMode %main OriginUpperLeft
+OpDecorate %in Location 0
+OpDecorate %out Location 0
+%void = OpTypeVoid
+%fp8e5m2 = OpTypeFloat 8 Float8E5M2EXT
+%in_ptr = OpTypePointer Input %fp8e5m2
+%out_ptr = OpTypePointer Output %fp8e5m2
+%in = OpVariable %in_ptr Input
+%out = OpVariable %out_ptr Output
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(text, SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("FP8 E4M3/E5M2 OpVariable <id> '2[%2]' must not be declared "
+ "with a Storage Class of Input or Output.\n"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_invalid_type_test.cpp b/third_party/SPIRV-Tools/test/val/val_invalid_type_test.cpp
new file mode 100644
index 0000000..d19b274
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/val/val_invalid_type_test.cpp
@@ -0,0 +1,246 @@
+// Copyright (c) 2025 Google Inc.
+// Copyright (c) 2025 Arm Ltd.
+//
+// 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.
+
+// Tests for invalid types.
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "source/spirv_target_env.h"
+#include "test/unit_spirv.h"
+#include "test/val/val_fixtures.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+using ::testing::HasSubstr;
+using ::testing::Not;
+using ::testing::Values;
+
+using ValidateInvalidType = spvtest::ValidateBase<bool>;
+
+std::string GenerateBFloatCode(const std::string& main_body) {
+ const std::string prefix =
+ R"(
+OpCapability Shader
+OpCapability BFloat16TypeKHR
+OpCapability AtomicFloat16AddEXT
+OpCapability GroupNonUniformShuffle
+OpExtension "SPV_EXT_shader_atomic_float16_add"
+OpExtension "SPV_KHR_bfloat16"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpSource GLSL 450
+OpName %main "main"
+%void = OpTypeVoid
+%bfloat16 = OpTypeFloat 16 BFloat16KHR
+%func = OpTypeFunction %void
+%u32 = OpTypeInt 32 0
+%u1 = OpConstant %u32 1
+%u0 = OpConstant %u32 0
+%u3 = OpConstant %u32 3
+%bf16_1 = OpConstant %bfloat16 1
+%_ptr_Function_bfloat16 = OpTypePointer Function %bfloat16
+%v2bfloat16 = OpTypeVector %bfloat16 2
+%_ptr_Function_v2bfloat16 = OpTypePointer Function %v2bfloat16
+%bf16_ptr = OpTypePointer Workgroup %bfloat16
+%bf16_var = OpVariable %bf16_ptr Workgroup
+%main = OpFunction %void None %func
+%main_entry = OpLabel)";
+
+ const std::string suffix =
+ R"(
+OpReturn
+OpFunctionEnd)";
+
+ return prefix + main_body + suffix;
+}
+
+TEST_F(ValidateInvalidType, Bfloat16InvalidArithmeticInstruction) {
+ const std::string body = R"(
+%v1 = OpVariable %_ptr_Function_bfloat16 Function
+%v2 = OpVariable %_ptr_Function_bfloat16 Function
+%12 = OpLoad %bfloat16 %v1
+%14 = OpLoad %bfloat16 %v2
+%15 = OpFMul %bfloat16 %12 %14
+)";
+
+ CompileSuccessfully(GenerateBFloatCode(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("FMul doesn't support BFloat16 type."));
+}
+
+TEST_F(ValidateInvalidType, Bfloat16InvalidAtomicInstruction) {
+ const std::string body = R"(
+%val1 = OpAtomicFAddEXT %bfloat16 %bf16_var %u1 %u0 %bf16_1
+)";
+
+ CompileSuccessfully(GenerateBFloatCode(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("AtomicFAddEXT doesn't support BFloat16 type."));
+}
+
+TEST_F(ValidateInvalidType, Bfloat16InvalidGroupNonUniformShuffle) {
+ const std::string body = R"(
+%val1 = OpGroupNonUniformShuffle %bfloat16 %u3 %bf16_1 %u0
+)";
+
+ CompileSuccessfully(GenerateBFloatCode(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("GroupNonUniformShuffle doesn't support BFloat16 type."));
+}
+
+std::string GenerateFP8Code(const std::string& main_body) {
+ const std::string prefix =
+ R"(
+OpCapability Shader
+OpCapability Float8EXT
+OpCapability AtomicFloat16AddEXT
+OpCapability GroupNonUniformShuffle
+OpExtension "SPV_EXT_shader_atomic_float16_add"
+OpExtension "SPV_EXT_float8"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpSource GLSL 450
+OpName %main "main"
+%void = OpTypeVoid
+%fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
+%fp8e5m2 = OpTypeFloat 8 Float8E5M2EXT
+%func = OpTypeFunction %void
+%u32 = OpTypeInt 32 0
+%u1 = OpConstant %u32 1
+%u0 = OpConstant %u32 0
+%u3 = OpConstant %u32 3
+%fp8e4m3_1 = OpConstant %fp8e4m3 1
+%fp8e5m2_1 = OpConstant %fp8e5m2 1
+%_ptr_Function_fp8e4m3 = OpTypePointer Function %fp8e4m3
+%_ptr_Function_fp8e5m2 = OpTypePointer Function %fp8e5m2
+%v2fp8e4m3 = OpTypeVector %fp8e4m3 2
+%v2fp8e5m2 = OpTypeVector %fp8e5m2 2
+%_ptr_Function_v2fp8e4m3 = OpTypePointer Function %v2fp8e4m3
+%_ptr_Function_v2fp8e5m2 = OpTypePointer Function %v2fp8e5m2
+%fp8e4m3_ptr = OpTypePointer Workgroup %fp8e4m3
+%fp8e5m2_ptr = OpTypePointer Workgroup %fp8e5m2
+%fp8e4m3_var = OpVariable %fp8e4m3_ptr Workgroup
+%fp8e5m2_var = OpVariable %fp8e5m2_ptr Workgroup
+%main = OpFunction %void None %func
+%main_entry = OpLabel)";
+
+ const std::string suffix =
+ R"(
+OpReturn
+OpFunctionEnd)";
+
+ return prefix + main_body + suffix;
+}
+
+TEST_F(ValidateInvalidType, FP8E4M3InvalidArithmeticInstruction) {
+ const std::string body = R"(
+%v1 = OpVariable %_ptr_Function_fp8e4m3 Function
+%v2 = OpVariable %_ptr_Function_fp8e4m3 Function
+%12 = OpLoad %fp8e4m3 %v1
+%14 = OpLoad %fp8e4m3 %v2
+%15 = OpFMul %fp8e4m3 %12 %14
+)";
+
+ CompileSuccessfully(GenerateFP8Code(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("FMul doesn't support FP8 E4M3/E5M2 types."));
+}
+
+TEST_F(ValidateInvalidType, FP8E5M2InvalidArithmeticInstruction) {
+ const std::string body = R"(
+%v1 = OpVariable %_ptr_Function_fp8e5m2 Function
+%v2 = OpVariable %_ptr_Function_fp8e5m2 Function
+%12 = OpLoad %fp8e5m2 %v1
+%14 = OpLoad %fp8e5m2 %v2
+%15 = OpFMul %fp8e5m2 %12 %14
+)";
+
+ CompileSuccessfully(GenerateFP8Code(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("FMul doesn't support FP8 E4M3/E5M2 types."));
+}
+
+TEST_F(ValidateInvalidType, FP8E4M3InvalidAtomicInstruction) {
+ const std::string body = R"(
+%val1 = OpAtomicFAddEXT %fp8e4m3 %fp8e4m3_var %u1 %u0 %fp8e4m3_1
+)";
+
+ CompileSuccessfully(GenerateFP8Code(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("AtomicFAddEXT doesn't support FP8 E4M3/E5M2 types."));
+}
+
+TEST_F(ValidateInvalidType, FP8E5M2InvalidAtomicInstruction) {
+ const std::string body = R"(
+%val1 = OpAtomicFAddEXT %fp8e5m2 %fp8e5m2_var %u1 %u0 %fp8e5m2_1
+)";
+
+ CompileSuccessfully(GenerateFP8Code(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("AtomicFAddEXT doesn't support FP8 E4M3/E5M2 types."));
+}
+
+TEST_F(ValidateInvalidType, FP8E4M3InvalidGroupNonUniformShuffle) {
+ const std::string body = R"(
+%val1 = OpGroupNonUniformShuffle %fp8e4m3 %u3 %fp8e4m3_1 %u0
+)";
+
+ CompileSuccessfully(GenerateFP8Code(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("GroupNonUniformShuffle doesn't support FP8 E4M3/E5M2 types."));
+}
+
+TEST_F(ValidateInvalidType, FP8E5M2InvalidGroupNonUniformShuffle) {
+ const std::string body = R"(
+%val1 = OpGroupNonUniformShuffle %fp8e5m2 %u3 %fp8e5m2_1 %u0
+)";
+
+ CompileSuccessfully(GenerateFP8Code(body).c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_6));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("GroupNonUniformShuffle doesn't support FP8 E4M3/E5M2 types."));
+}
+
+} // namespace
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_memory_test.cpp b/third_party/SPIRV-Tools/test/val/val_memory_test.cpp
index 74a17e9..b903174 100644
--- a/third_party/SPIRV-Tools/test/val/val_memory_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_memory_test.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2018 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -352,12 +354,8 @@
)";
CompileSuccessfully(spirv.c_str());
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(
- getDiagnosticString(),
- HasSubstr(
- "From SPIR-V spec, section 3.32.8 on OpVariable:\n"
- "Its Storage Class operand must be the same as the Storage Class "
- "operand of the result type."));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Storage class must match result type storage class"));
}
TEST_F(ValidateMemory, MatchingStorageClassesGood) {
@@ -788,7 +786,7 @@
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
- "The array member in OpArrayLength <id> '11[%11]' must be an the "
+ "The array member in OpArrayLength <id> '11[%11]' must be the "
"last member of the struct.\n %11 = OpArrayLength %uint %10 0\n"));
}
@@ -1465,6 +1463,7 @@
OpMemoryModel Logical VulkanKHR
%void = OpTypeVoid
%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
%device = OpConstant %int 1
%int_ptr_ssbo = OpTypePointer StorageBuffer %int
%var1 = OpVariable %int_ptr_ssbo StorageBuffer
@@ -1472,7 +1471,7 @@
%voidfn = OpTypeFunction %void
%func = OpFunction %void None %voidfn
%entry = OpLabel
-OpCopyMemorySized %var1 %var2 %device MakePointerAvailableKHR|NonPrivatePointerKHR %device
+OpCopyMemorySized %var1 %var2 %int_4 MakePointerAvailableKHR|NonPrivatePointerKHR %device
OpReturn
OpFunctionEnd
)";
@@ -1496,6 +1495,7 @@
OpMemoryModel Logical VulkanKHR
%void = OpTypeVoid
%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
%device = OpConstant %int 1
%workgroup = OpConstant %int 1
%int_ptr_ssbo = OpTypePointer StorageBuffer %int
@@ -1504,7 +1504,7 @@
%voidfn = OpTypeFunction %void
%func = OpFunction %void None %voidfn
%entry = OpLabel
-OpCopyMemorySized %var1 %var2 %device Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %device %workgroup
+OpCopyMemorySized %var1 %var2 %int_4 Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %device %workgroup
OpReturn
OpFunctionEnd
)";
@@ -1528,6 +1528,7 @@
OpMemoryModel Logical VulkanKHR
%void = OpTypeVoid
%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
%device = OpConstant %int 1
%workgroup = OpConstant %int 1
%int_ptr_ssbo = OpTypePointer StorageBuffer %int
@@ -1536,7 +1537,7 @@
%voidfn = OpTypeFunction %void
%func = OpFunction %void None %voidfn
%entry = OpLabel
-OpCopyMemorySized %var1 %var2 %device Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %workgroup %device
+OpCopyMemorySized %var1 %var2 %int_4 Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %workgroup %device
OpReturn
OpFunctionEnd
)";
@@ -1561,6 +1562,7 @@
OpMemoryModel Logical VulkanKHR
%void = OpTypeVoid
%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
%device = OpConstant %int 1
%int_ptr_ssbo = OpTypePointer StorageBuffer %int
%var1 = OpVariable %int_ptr_ssbo StorageBuffer
@@ -1568,7 +1570,7 @@
%voidfn = OpTypeFunction %void
%func = OpFunction %void None %voidfn
%entry = OpLabel
-OpCopyMemorySized %var1 %var2 %device MakePointerAvailableKHR|NonPrivatePointerKHR %device
+OpCopyMemorySized %var1 %var2 %int_4 MakePointerAvailableKHR|NonPrivatePointerKHR %device
OpReturn
OpFunctionEnd
)";
@@ -1588,6 +1590,7 @@
OpMemoryModel Logical VulkanKHR
%void = OpTypeVoid
%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
%device = OpConstant %int 1
%workgroup = OpConstant %int 2
%int_ptr_ssbo = OpTypePointer StorageBuffer %int
@@ -1596,7 +1599,7 @@
%voidfn = OpTypeFunction %void
%func = OpFunction %void None %voidfn
%entry = OpLabel
-OpCopyMemorySized %var1 %var2 %device Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %device %workgroup
+OpCopyMemorySized %var1 %var2 %int_4 Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %device %workgroup
OpReturn
OpFunctionEnd
)";
@@ -1616,6 +1619,7 @@
OpMemoryModel Logical VulkanKHR
%void = OpTypeVoid
%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
%device = OpConstant %int 1
%workgroup = OpConstant %int 2
%int_ptr_ssbo = OpTypePointer StorageBuffer %int
@@ -1624,7 +1628,7 @@
%voidfn = OpTypeFunction %void
%func = OpFunction %void None %voidfn
%entry = OpLabel
-OpCopyMemorySized %var1 %var2 %device Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %workgroup %device
+OpCopyMemorySized %var1 %var2 %int_4 Aligned|MakePointerVisibleKHR|MakePointerAvailableKHR|NonPrivatePointerKHR 4 %workgroup %device
OpReturn
OpFunctionEnd
)";
@@ -1814,6 +1818,68 @@
HasSubstr("Memory accesses with PhysicalStorageBuffer must use Aligned"));
}
+TEST_F(ValidateMemory, PSBStoreAlignedZero) {
+ const std::string body = R"(
+OpCapability PhysicalStorageBufferAddresses
+OpCapability Shader
+OpExtension "SPV_EXT_physical_storage_buffer"
+OpMemoryModel PhysicalStorageBuffer64 GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginUpperLeft
+%uint = OpTypeInt 32 0
+%uint_1 = OpConstant %uint 1
+%ptr = OpTypePointer PhysicalStorageBuffer %uint
+%pptr_f = OpTypePointer Function %ptr
+%void = OpTypeVoid
+%voidfn = OpTypeFunction %void
+%main = OpFunction %void None %voidfn
+%entry = OpLabel
+%val1 = OpVariable %pptr_f Function
+%val2 = OpLoad %ptr %val1
+OpStore %val2 %uint_1 Aligned 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Memory accesses Aligned operand value 0 is not a power of two"));
+}
+
+TEST_F(ValidateMemory, PSBStoreAlignedNonPoT) {
+ const std::string body = R"(
+OpCapability PhysicalStorageBufferAddresses
+OpCapability Shader
+OpExtension "SPV_EXT_physical_storage_buffer"
+OpMemoryModel PhysicalStorageBuffer64 GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main OriginUpperLeft
+%uint = OpTypeInt 32 0
+%uint_1 = OpConstant %uint 1
+%ptr = OpTypePointer PhysicalStorageBuffer %uint
+%pptr_f = OpTypePointer Function %ptr
+%void = OpTypeVoid
+%voidfn = OpTypeFunction %void
+%main = OpFunction %void None %voidfn
+%entry = OpLabel
+%val1 = OpVariable %pptr_f Function
+%val2 = OpLoad %ptr %val1
+OpStore %val2 %uint_1 Aligned 3
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_2);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Memory accesses Aligned operand value 3 is not a power of two."));
+}
+
TEST_F(ValidateMemory, PSBCopyMemoryAlignedSuccess) {
const std::string body = R"(
OpCapability PhysicalStorageBufferAddresses
@@ -2348,19 +2414,281 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+std::string GenCoopMatLoadStoreShaderKHR(const std::string& storeMemoryAccess,
+ const std::string& loadMemoryAccess,
+ unsigned layout = 0,
+ bool useSpecConstantLayout = false,
+ bool useStoreStride = true,
+ bool useLoadStride = true) {
+ std::string s = R"(
+OpCapability Shader
+OpCapability GroupNonUniform
+OpCapability VulkanMemoryModelKHR
+OpCapability CooperativeMatrixKHR
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpExtension "SPV_KHR_cooperative_matrix"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical VulkanKHR
+OpEntryPoint GLCompute %4 "main" %11 %21
+OpExecutionMode %4 LocalSize 1 1 1
+OpDecorate %11 BuiltIn SubgroupId
+OpDecorate %21 BuiltIn WorkgroupId
+OpDecorate %74 ArrayStride 4
+OpMemberDecorate %75 0 Offset 0
+OpDecorate %75 Block
+OpDecorate %77 DescriptorSet 0
+OpDecorate %77 Binding 0
+OpDecorate %92 ArrayStride 4
+OpMemberDecorate %93 0 Offset 0
+OpDecorate %93 Block
+OpDecorate %95 DescriptorSet 0
+OpDecorate %95 Binding 1
+OpDecorate %102 ArrayStride 4
+OpMemberDecorate %103 0 Offset 0
+OpDecorate %103 Block
+OpDecorate %105 DescriptorSet 0
+OpDecorate %105 Binding 2
+OpDecorate %117 ArrayStride 4
+OpMemberDecorate %118 0 Offset 0
+OpDecorate %118 Block
+OpDecorate %120 DescriptorSet 0
+OpDecorate %120 Binding 3
+OpDecorate %123 SpecId 2
+OpDecorate %124 SpecId 3
+OpDecorate %125 SpecId 4
+OpDecorate %126 SpecId 5
+OpDecorate %127 SpecId 0
+OpDecorate %128 SpecId 1
+OpDecorate %129 BuiltIn WorkgroupSize
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeInt 32 0
+%7 = OpTypeVector %6 2
+%8 = OpTypePointer Function %7
+%10 = OpTypePointer Input %6
+%11 = OpVariable %10 Input
+%13 = OpConstant %6 2
+%19 = OpTypeVector %6 3
+%20 = OpTypePointer Input %19
+%21 = OpVariable %20 Input
+%27 = OpConstantComposite %7 %13 %13
+%31 = OpTypePointer Function %6
+%33 = OpConstant %6 1024
+%34 = OpConstant %6 1
+%38 = OpConstant %6 8
+%uint_0 = OpConstant %6 0
+)";
+ if (useSpecConstantLayout) {
+ s += "%layout = OpSpecConstant %6 " + std::to_string(layout);
+ } else {
+ s += "%layout = OpConstant %6 " + std::to_string(layout);
+ }
+ s += R"(
+%68 = OpTypeFloat 32
+%69 = OpConstant %6 16
+%70 = OpConstant %6 3
+%71 = OpTypeCooperativeMatrixKHR %68 %70 %69 %38 %uint_0
+%72 = OpTypePointer Function %71
+%74 = OpTypeRuntimeArray %68
+%75 = OpTypeStruct %74
+%76 = OpTypePointer StorageBuffer %75
+%77 = OpVariable %76 StorageBuffer
+%78 = OpTypeInt 32 1
+%79 = OpConstant %78 0
+%81 = OpConstant %6 5
+%82 = OpTypePointer StorageBuffer %68
+%stride = OpConstant %6 64
+%88 = OpTypePointer Private %71
+%89 = OpVariable %88 Private
+%92 = OpTypeRuntimeArray %68
+%93 = OpTypeStruct %92
+%94 = OpTypePointer StorageBuffer %93
+%95 = OpVariable %94 StorageBuffer
+%99 = OpVariable %88 Private
+%102 = OpTypeRuntimeArray %68
+%103 = OpTypeStruct %102
+%104 = OpTypePointer StorageBuffer %103
+%105 = OpVariable %104 StorageBuffer
+%109 = OpVariable %88 Private
+%111 = OpVariable %88 Private
+%112 = OpSpecConstantOp %6 CooperativeMatrixLengthKHR %71
+%113 = OpSpecConstantOp %78 IAdd %112 %79
+%117 = OpTypeRuntimeArray %68
+%118 = OpTypeStruct %117
+%119 = OpTypePointer StorageBuffer %118
+%120 = OpVariable %119 StorageBuffer
+%123 = OpSpecConstant %78 1
+%124 = OpSpecConstant %78 1
+%125 = OpSpecConstant %78 1
+%126 = OpSpecConstant %78 1
+%127 = OpSpecConstant %6 1
+%128 = OpSpecConstant %6 1
+%129 = OpSpecConstantComposite %19 %127 %128 %34
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%9 = OpVariable %8 Function
+%18 = OpVariable %8 Function
+%32 = OpVariable %31 Function
+%44 = OpVariable %31 Function
+%52 = OpVariable %31 Function
+%60 = OpVariable %31 Function
+%73 = OpVariable %72 Function
+%91 = OpVariable %72 Function
+%101 = OpVariable %72 Function
+%12 = OpLoad %6 %11
+%14 = OpUMod %6 %12 %13
+%15 = OpLoad %6 %11
+%16 = OpUDiv %6 %15 %13
+%17 = OpCompositeConstruct %7 %14 %16
+OpStore %9 %17
+%22 = OpLoad %19 %21
+%23 = OpVectorShuffle %7 %22 %22 0 1
+%24 = OpCompositeExtract %6 %23 0
+%25 = OpCompositeExtract %6 %23 1
+%26 = OpCompositeConstruct %7 %24 %25
+%28 = OpIMul %7 %26 %27
+%29 = OpLoad %7 %9
+%30 = OpIAdd %7 %28 %29
+OpStore %18 %30
+%35 = OpAccessChain %31 %18 %34
+%36 = OpLoad %6 %35
+%37 = OpIMul %6 %33 %36
+%40 = OpAccessChain %31 %18 %uint_0
+%41 = OpLoad %6 %40
+%42 = OpIMul %6 %38 %41
+%43 = OpIAdd %6 %37 %42
+OpStore %32 %43
+%45 = OpAccessChain %31 %18 %34
+%46 = OpLoad %6 %45
+%47 = OpIMul %6 %33 %46
+%48 = OpAccessChain %31 %18 %uint_0
+%49 = OpLoad %6 %48
+%50 = OpIMul %6 %38 %49
+%51 = OpIAdd %6 %47 %50
+OpStore %44 %51
+%53 = OpAccessChain %31 %18 %34
+%54 = OpLoad %6 %53
+%55 = OpIMul %6 %33 %54
+%56 = OpAccessChain %31 %18 %uint_0
+%57 = OpLoad %6 %56
+%58 = OpIMul %6 %38 %57
+%59 = OpIAdd %6 %55 %58
+OpStore %52 %59
+%61 = OpAccessChain %31 %18 %34
+%62 = OpLoad %6 %61
+%63 = OpIMul %6 %33 %62
+%64 = OpAccessChain %31 %18 %uint_0
+%65 = OpLoad %6 %64
+%66 = OpIMul %6 %38 %65
+%67 = OpIAdd %6 %63 %66
+OpStore %60 %67
+%80 = OpLoad %6 %32
+%83 = OpAccessChain %82 %77 %79 %80
+)";
+ if (useLoadStride) {
+ s += "%87 = OpCooperativeMatrixLoadKHR %71 %83 %layout %stride " +
+ loadMemoryAccess + " %81";
+ } else {
+ s += "%87 = OpCooperativeMatrixLoadKHR %71 %83 %layout";
+ }
+ s += R"(
+OpStore %73 %87
+%90 = OpLoad %71 %73
+OpStore %89 %90
+%96 = OpLoad %6 %44
+%97 = OpAccessChain %82 %95 %79 %96
+%98 = OpCooperativeMatrixLoadKHR %71 %97 %layout %stride MakePointerVisibleKHR|NonPrivatePointerKHR %81
+OpStore %91 %98
+%100 = OpLoad %71 %91
+OpStore %99 %100
+%106 = OpLoad %6 %52
+%107 = OpAccessChain %82 %105 %79 %106
+%108 = OpCooperativeMatrixLoadKHR %71 %107 %layout %stride MakePointerVisibleKHR|NonPrivatePointerKHR %81
+OpStore %101 %108
+%110 = OpLoad %71 %101
+OpStore %109 %110
+%114 = OpConvertSToF %68 %113
+%115 = OpCompositeConstruct %71 %114
+OpStore %111 %115
+%116 = OpLoad %71 %111
+%121 = OpLoad %6 %60
+%122 = OpAccessChain %82 %120 %79 %121
+)";
+ if (useStoreStride) {
+ s += "OpCooperativeMatrixStoreKHR %122 %116 %layout %stride " +
+ storeMemoryAccess + " %81";
+ } else {
+ s += "OpCooperativeMatrixStoreKHR %122 %116 %layout";
+ }
+ s += R"(
+OpReturn
+OpFunctionEnd
+)";
+
+ return s;
+}
+
TEST_F(ValidateMemory, CoopMatKHRLoadStoreSuccess) {
- std::string spirv =
- GenCoopMatLoadStoreShader("MakePointerAvailableKHR|NonPrivatePointerKHR",
- "MakePointerVisibleKHR|NonPrivatePointerKHR");
+ std::string spirv = GenCoopMatLoadStoreShaderKHR(
+ "MakePointerAvailableKHR|NonPrivatePointerKHR",
+ "MakePointerVisibleKHR|NonPrivatePointerKHR");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+}
+
+struct StrideMissingCase {
+ unsigned layout;
+ bool useLoadStride;
+ bool useStoreStride;
+};
+
+using ValidateCoopMatrixStrideMissing =
+ spvtest::ValidateBase<StrideMissingCase>;
+
+INSTANTIATE_TEST_SUITE_P(
+ CoopMatrixStrideMissing, ValidateCoopMatrixStrideMissing,
+ Values(
+ StrideMissingCase{(unsigned)spv::CooperativeMatrixLayout::RowMajorKHR,
+ false, true},
+ StrideMissingCase{(unsigned)spv::CooperativeMatrixLayout::RowMajorKHR,
+ true, false},
+ StrideMissingCase{
+ (unsigned)spv::CooperativeMatrixLayout::ColumnMajorKHR, false,
+ true},
+ StrideMissingCase{
+ (unsigned)spv::CooperativeMatrixLayout::ColumnMajorKHR, true,
+ false}));
+
+TEST_P(ValidateCoopMatrixStrideMissing, CoopMatKHRLoadStrideMissingFail) {
+ const StrideMissingCase& param = GetParam();
+ std::string spirv = GenCoopMatLoadStoreShaderKHR(
+ "MakePointerAvailableKHR|NonPrivatePointerKHR",
+ "MakePointerVisibleKHR|NonPrivatePointerKHR", param.layout,
+ false /*useSpecConstantLayout*/, param.useStoreStride,
+ param.useLoadStride);
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("MemoryLayout " + std::to_string(param.layout) +
+ " requires a Stride"));
+}
+
+TEST_F(ValidateMemory, CoopMatKHRMemoryLayoutFromSpecConstantSuccess) {
+ std::string spirv = GenCoopMatLoadStoreShaderKHR(
+ "MakePointerAvailableKHR|NonPrivatePointerKHR",
+ "MakePointerVisibleKHR|NonPrivatePointerKHR",
+ (unsigned)spv::CooperativeMatrixLayout::RowMajorKHR,
+ true /*useSpecConstantLayout*/);
CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1);
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1));
}
TEST_F(ValidateMemory, CoopMatKHRStoreMemoryAccessFail) {
- std::string spirv =
- GenCoopMatLoadStoreShader("MakePointerVisibleKHR|NonPrivatePointerKHR",
- "MakePointerVisibleKHR|NonPrivatePointerKHR");
+ std::string spirv = GenCoopMatLoadStoreShaderKHR(
+ "MakePointerVisibleKHR|NonPrivatePointerKHR",
+ "MakePointerVisibleKHR|NonPrivatePointerKHR");
CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
@@ -2369,9 +2697,9 @@
}
TEST_F(ValidateMemory, CoopMatKHRLoadMemoryAccessFail) {
- std::string spirv =
- GenCoopMatLoadStoreShader("MakePointerAvailableKHR|NonPrivatePointerKHR",
- "MakePointerAvailableKHR|NonPrivatePointerKHR");
+ std::string spirv = GenCoopMatLoadStoreShaderKHR(
+ "MakePointerAvailableKHR|NonPrivatePointerKHR",
+ "MakePointerAvailableKHR|NonPrivatePointerKHR");
CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1);
ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
@@ -2384,9 +2712,10 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -2409,8 +2738,8 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr(
@@ -2424,9 +2753,10 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -2448,8 +2778,8 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("The Result Type of OpCooperativeMatrixLengthKHR <id> "
@@ -2462,9 +2792,10 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -2486,8 +2817,8 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("The type in OpCooperativeMatrixLengthKHR <id> '5[%uint]' "
@@ -2500,9 +2831,10 @@
OpCapability Shader
OpCapability Float16
OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
OpExtension "SPV_KHR_cooperative_matrix"
OpExtension "SPV_KHR_vulkan_memory_model"
-OpMemoryModel Logical GLSL450
+OpMemoryModel Logical VulkanKHR
OpEntryPoint GLCompute %main "main"
%void = OpTypeVoid
%func = OpTypeFunction %void
@@ -2524,8 +2856,8 @@
OpReturn
OpFunctionEnd)";
- CompileSuccessfully(body.c_str());
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
}
TEST_F(ValidateMemory, VulkanRTAOutsideOfStructBad) {
@@ -2848,7 +3180,6 @@
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %func "func"
OpExecutionMode %func OriginUpperLeft
-OpDecorate %array_t ArrayStride 4
OpMemberDecorate %struct_t 0 Offset 0
OpDecorate %struct_t Block
%uint_t = OpTypeInt 32 0
@@ -3094,7 +3425,6 @@
OpEntryPoint Fragment %func "func"
OpExecutionMode %func OriginUpperLeft
OpDecorate %inner_array_t ArrayStride 4
-OpDecorate %array_t ArrayStride 4
OpMemberDecorate %struct_t 0 Offset 0
OpDecorate %struct_t Block
%uint_t = OpTypeInt 32 0
@@ -3124,7 +3454,6 @@
OpEntryPoint Fragment %func "func"
OpExecutionMode %func OriginUpperLeft
OpDecorate %inner_array_t ArrayStride 4
-OpDecorate %array_t ArrayStride 4
OpMemberDecorate %struct_t 0 Offset 0
OpDecorate %struct_t Block
%uint_t = OpTypeInt 32 0
@@ -3620,8 +3949,11 @@
%void = OpTypeVoid
%bool = OpTypeBool
%int = OpTypeInt 32 0
+%float = OpTypeFloat 32
%ptr_int = OpTypePointer Private %int
%var = OpVariable %ptr_int Private
+%ptr_float = OpTypePointer Private %float
+%var2 = OpVariable %ptr_float Private
%func_ty = OpTypeFunction %void
%func = OpFunction %void None %func_ty
%1 = OpLabel
@@ -3634,7 +3966,7 @@
spirv += " %bool ";
}
- spirv += R"(%var %ld
+ spirv += R"(%var %var2
OpReturn
OpFunctionEnd
)";
@@ -3645,6 +3977,223 @@
HasSubstr("The types of Operand 1 and Operand 2 must match"));
}
+TEST_P(ValidatePointerComparisons, GoodUntypedPointerSameType) {
+ const std::string operation = GetParam();
+
+ std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer
+%func_ty = OpTypeFunction %void
+%func = OpFunction %void None %func_ty
+%1 = OpLabel
+%equal = )" + operation;
+
+ if (operation == "OpPtrDiff") {
+ spirv += " %int ";
+ } else {
+ spirv += " %bool ";
+ }
+
+ spirv += R"(%var %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_P(ValidatePointerComparisons, GoodUntypedPointerSameStorageClass) {
+ const std::string operation = GetParam();
+
+ std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%ptr1 = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr1 StorageBuffer
+%ptr2 = OpTypeUntypedPointerKHR StorageBuffer
+%var2 = OpUntypedVariableKHR %ptr2 StorageBuffer
+%func_ty = OpTypeFunction %void
+%func = OpFunction %void None %func_ty
+%1 = OpLabel
+%equal = )" + operation;
+
+ if (operation == "OpPtrDiff") {
+ spirv += " %int ";
+ } else {
+ spirv += " %bool ";
+ }
+
+ spirv += R"(%var %var2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ if (operation == "OpPtrDiff") {
+ EXPECT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The types of Operand 1 and Operand 2 must match"));
+ } else {
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ }
+}
+
+TEST_P(ValidatePointerComparisons, BadUntypedPointerDiffStorageClass) {
+ const std::string operation = GetParam();
+
+ std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%ptr1 = OpTypeUntypedPointerKHR StorageBuffer
+%var1 = OpUntypedVariableKHR %ptr1 StorageBuffer
+%ptr2 = OpTypeUntypedPointerKHR Workgroup
+%var2 = OpUntypedVariableKHR %ptr2 Workgroup %int
+%func_ty = OpTypeFunction %void
+%func = OpFunction %void None %func_ty
+%1 = OpLabel
+%equal = )" + operation;
+
+ if (operation == "OpPtrDiff") {
+ spirv += " %int ";
+ } else {
+ spirv += " %bool ";
+ }
+
+ spirv += R"(%var1 %var2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ if (operation == "OpPtrDiff") {
+ EXPECT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The types of Operand 1 and Operand 2 must match"));
+ } else {
+ EXPECT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Pointer storage classes must match"));
+ }
+}
+
+TEST_P(ValidatePointerComparisons, GoodMixedPointerSameStorageClass) {
+ const std::string operation = GetParam();
+
+ std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointersStorageBuffer
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%ptr1 = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr1 StorageBuffer
+%ptr2 = OpTypePointer StorageBuffer %int
+%var2 = OpVariable %ptr2 StorageBuffer
+%func_ty = OpTypeFunction %void
+%func = OpFunction %void None %func_ty
+%1 = OpLabel
+%equal = )" + operation;
+
+ if (operation == "OpPtrDiff") {
+ spirv += " %int ";
+ } else {
+ spirv += " %bool ";
+ }
+
+ spirv += R"(%var %var2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ if (operation == "OpPtrDiff") {
+ EXPECT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The types of Operand 1 and Operand 2 must match"));
+ } else {
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ }
+}
+
+TEST_P(ValidatePointerComparisons, BadMixedPointerDiffStorageClass) {
+ const std::string operation = GetParam();
+
+ std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%ptr1 = OpTypeUntypedPointerKHR StorageBuffer
+%var1 = OpUntypedVariableKHR %ptr1 StorageBuffer
+%ptr2 = OpTypePointer Workgroup %int
+%var2 = OpVariable %ptr2 Workgroup
+%func_ty = OpTypeFunction %void
+%func = OpFunction %void None %func_ty
+%1 = OpLabel
+%equal = )" + operation;
+
+ if (operation == "OpPtrDiff") {
+ spirv += " %int ";
+ } else {
+ spirv += " %bool ";
+ }
+
+ spirv += R"(%var1 %var2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ if (operation == "OpPtrDiff") {
+ EXPECT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The types of Operand 1 and Operand 2 must match"));
+ } else {
+ EXPECT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Pointer storage classes must match"));
+ }
+}
+
INSTANTIATE_TEST_SUITE_P(PointerComparisons, ValidatePointerComparisons,
Values("OpPtrEqual", "OpPtrNotEqual", "OpPtrDiff"));
@@ -3667,8 +4216,159 @@
CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("Initializer type must match the type pointed to by "
- "the Result Type"));
+ HasSubstr("Initializer type must match the data type"));
+}
+
+TEST_F(ValidateMemory, StoreToImage) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%img = OpTypeImage %int 2D 2 0 0 2 R32i
+%ptr_img = OpTypePointer Function %img
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_img Function
+%value = OpLoad %img %var
+OpStore %var %value
+OpReturn
+OpFunctionEnd
+)";
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeImage-06924"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Cannot store to OpTypeImage, OpTypeSampler, "
+ "OpTypeSampledImage, or OpTypeAccelerationStructureKHR"));
+}
+
+TEST_F(ValidateMemory, StoreToImageArray) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%img = OpTypeImage %int 2D 2 0 0 2 R32i
+%arr_size = OpConstant %int 5
+%i = OpConstant %int 2
+%arr_img = OpTypeArray %img %arr_size
+%ptr_img = OpTypePointer Function %img
+%ptr_arr_img = OpTypePointer Function %arr_img
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_arr_img Function
+%value = OpLoad %arr_img %var
+OpStore %var %value
+OpReturn
+OpFunctionEnd
+)";
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeImage-06924"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Cannot store to OpTypeImage, OpTypeSampler, "
+ "OpTypeSampledImage, or OpTypeAccelerationStructureKHR"));
+}
+
+TEST_F(ValidateMemory, StoreToSampler) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%smp = OpTypeSampler
+%ptr_smp = OpTypePointer Function %smp
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_smp Function
+%value = OpLoad %smp %var
+OpStore %var %value
+OpReturn
+OpFunctionEnd
+)";
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeImage-06924"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Cannot store to OpTypeImage, OpTypeSampler, "
+ "OpTypeSampledImage, or OpTypeAccelerationStructureKHR"));
+}
+
+TEST_F(ValidateMemory, StoreToSampledImage) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%img = OpTypeImage %int 2D 2 0 0 1 R32i
+%samp_img = OpTypeSampledImage %img
+%ptr_samp_img = OpTypePointer Function %samp_img
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_samp_img Function
+%value = OpLoad %samp_img %var
+OpStore %var %value
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeImage-06924"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Cannot store to OpTypeImage, OpTypeSampler, "
+ "OpTypeSampledImage, or OpTypeAccelerationStructureKHR"));
+}
+
+TEST_F(ValidateMemory, StoreToAccelarationStructureKHR) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability RayQueryKHR
+OpExtension "SPV_KHR_ray_query"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%void = OpTypeVoid
+%as = OpTypeAccelerationStructureKHR
+%ptr_as = OpTypePointer Function %as
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%var = OpVariable %ptr_as Function
+%value = OpLoad %as %var
+OpStore %var %value
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeImage-06924"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Cannot store to OpTypeImage, OpTypeSampler, "
+ "OpTypeSampledImage, or OpTypeAccelerationStructureKHR"));
}
TEST_F(ValidateMemory, StoreToUniformBlock) {
@@ -4754,8 +5454,8 @@
OpReturn
OpFunctionEnd
)";
- CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_0);
- EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_3));
EXPECT_THAT(getDiagnosticString(),
AnyVUID(" VUID-StandaloneSpirv-OpVariable-04734"));
EXPECT_THAT(getDiagnosticString(),
@@ -4782,8 +5482,8 @@
OpReturn
OpFunctionEnd
)";
- CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_0);
- EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
}
TEST_F(ValidateMemory, LoadRuntimeArray) {
@@ -4897,6 +5597,128 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateMemory, UntypedVariableGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Private
+%var = OpUntypedVariableKHR %ptr Private %int %int_0
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateMemory, UntypedVariableNoDataType) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateMemory, UntypedVariableNoDataTypeFunction) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Function
+%var = OpUntypedVariableKHR %ptr Function
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Data type must be specified for Function, "
+ "Private, and Workgroup storage classes"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableNoDataTypePrivate) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Private
+%var = OpUntypedVariableKHR %ptr Private
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Data type must be specified for Function, "
+ "Private, and Workgroup storage classes"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableNoDataTypeWorkgroup) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Data type must be specified for Function, "
+ "Private, and Workgroup storage classes"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableNoDataTypeVulkan) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Vulkan requires that data type be specified"));
+}
+
TEST_F(ValidateMemory, PtrAccessChainArrayStrideBad) {
const std::string spirv = R"(
OpCapability Shader
@@ -5137,7 +5959,7 @@
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Index is out of bounds"));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("is out of bounds"));
EXPECT_THAT(getDiagnosticString(), HasSubstr("cannot find index -224"));
}
@@ -5165,10 +5987,3039 @@
CompileSuccessfully(spirv);
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
- EXPECT_THAT(getDiagnosticString(), HasSubstr("Index is out of bounds"));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("is out of bounds"));
EXPECT_THAT(getDiagnosticString(), HasSubstr("cannot find index -224"));
}
+TEST_F(ValidateMemory, UntypedVariableFunctionOutsideFunction) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Function
+%var = OpUntypedVariableKHR %ptr Function %int
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_LAYOUT, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Variables can not have a function[7] storage class "
+ "outside of a function"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableBadResultType) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %int Workgroup %int
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Result type must be an untyped pointer"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableBadDataType) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %int_0
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Data type must be a type instruction"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableBadStorageClass) {
+ const std::string spirv = R"(
+OpCapability Kernel
+OpCapability GenericPointer
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical OpenCL
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Generic
+%var = OpUntypedVariableKHR %ptr Generic %int
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Variable storage class cannot be Generic"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableMismatchedStorageClass) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Private %int
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Storage class must match result type storage class"));
+}
+
+TEST_F(ValidateMemory, UntypedVariableBadInitializer) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%int = OpTypeInt 32 0
+%float = OpTypeFloat 32
+%float_0 = OpConstant %float 0
+%ptr = OpTypeUntypedPointerKHR Private
+%var = OpUntypedVariableKHR %ptr Private %int %float_0
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Initializer type must match the data type"));
+}
+
+TEST_F(ValidateMemory, AccessChainBaseUntypedPointer) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %var "var"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%ptr_ssbo_int = OpTypePointer StorageBuffer %int
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpAccessChain %ptr_ssbo_int %var %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The Base <id> '2[%var]' in OpAccessChain "
+ "instruction must be a pointer"));
+}
+
+using ValidateMemoryUntypedAccessChain = spvtest::ValidateBase<std::string>;
+
+TEST_P(ValidateMemoryUntypedAccessChain, GoodTypedPointerBase) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+ const std::string deco = ptr ? "OpDecorate %ptr_ssbo ArrayStride 4" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+)" + deco + R"(
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_ssbo StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %block %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, GoodUntypedPointerBase) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+ const std::string deco = ptr ? "OpDecorate %ptr ArrayStride 4" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+)" + deco + R"(
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %block %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, ResultTypedPointer) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %gep "gep"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_ssbo StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_int = OpTypePointer StorageBuffer %int
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr_int %block %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The Result Type of " + opcode +
+ " <id> '2[%gep]' must be OpTypeUntypedPointer"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, BaseTypeNotAType) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %gep "gep"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_ssbo StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %int_0 %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Base type must be a non-pointer type"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, BaseTypedPointer) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %gep "gep"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_ssbo StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %ptr_ssbo %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Base type must be a non-pointer type"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, BaseUntypedPointer) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %gep "gep"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_ssbo StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %ptr %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Base type must be a non-pointer type"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, BaseNotAPointer) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %int_0 "int_0"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_ssbo = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_ssbo StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %int %int_0 )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The Base <id> '2[%int_0]' in " + opcode +
+ " instruction must be a pointer"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, StorageClassMismatch) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %int_0 "int_0"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_wg = OpTypePointer Workgroup %block
+%var = OpVariable %ptr_wg Workgroup
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %block %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("The result pointer storage class and base pointer storage "
+ "class in " +
+ opcode + " do not match"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, NonCompositeBase) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %int_0 "int_0"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_wg = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_wg StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %int %var )" +
+ extra_param + R"( %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr(opcode + " reached non-composite type while indexes "
+ "still remain to be traversed"));
+}
+
+TEST_P(ValidateMemoryUntypedAccessChain, TooManyIndices) {
+ const std::string opcode = GetParam();
+ const bool ptr = opcode == "OpUntypedPtrAccessChainKHR" ||
+ opcode == "OpUntypedInBoundsPtrAccessChainKHR";
+ const std::string extra_param = ptr ? "%int_0" : "";
+
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_variable_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpName %int_0 "int_0"
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%ptr_wg = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_wg StorageBuffer
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = )" + opcode + R"( %ptr %block %var )" +
+ extra_param + R"( %int_0 %int_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr(opcode + " reached non-composite type while indexes "
+ "still remain to be traversed"));
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ ValidateUntypedAccessChains, ValidateMemoryUntypedAccessChain,
+ Values("OpUntypedAccessChainKHR", "OpUntypedInBoundsAccessChainKHR",
+ "OpUntypedPtrAccessChainKHR", "OpUntypedInBoundsPtrAccessChainKHR"));
+
+TEST_F(ValidateMemory, LoadUntypedPointerGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%float = OpTypeFloat 32
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%load = OpLoad %float %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, StoreUntypedPointerGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%float = OpTypeFloat 32
+%float_0 = OpConstant %float 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpStore %var %float_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, CopyMemoryUntypedPointerSourceGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var1 %var2
+OpName %var1 "var1"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%ptr_wg = OpTypePointer Workgroup %int
+%var2 = OpVariable %ptr_wg Workgroup
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemory %var2 %var1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, CopyMemoryUntypedPointerTargetGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var1 %var2
+OpName %var1 "var1"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%ptr_wg = OpTypePointer Workgroup %int
+%var2 = OpVariable %ptr_wg Workgroup
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemory %var1 %var2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, CopyMemoryUntypedPointerTargetAndSourceBad) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var1 %var2
+OpName %var1 "var1"
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%var2 = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemory %var1 %var2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("One of Source or Target must be a typed pointer"));
+}
+
+TEST_F(ValidateMemory, CopyMemorySizedUntypedPointersGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %v1 %v2
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%v1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%v2 = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemorySized %v2 %v1 %int_4
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, CopyMemorySizedUntypedPointersSizeBad1) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability StorageBuffer16BitAccess
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var_wg %var_ssbo
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%short = OpTypeInt 16 0
+%int_2 = OpConstant %int 2
+%struct = OpTypeStruct %int
+%ptr_ssbo = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_wg = OpTypeUntypedPointerKHR Workgroup
+%var_ssbo = OpUntypedVariableKHR %ptr_ssbo StorageBuffer %struct
+%var_wg = OpUntypedVariableKHR %ptr_wg Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemorySized %var_ssbo %var_wg %int_2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Size must be a multiple of 4"));
+}
+
+TEST_F(ValidateMemory, CopyMemorySizedUntypedPointersSizeBad2) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability StorageBuffer16BitAccess
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var_ssbo %var_wg
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%short = OpTypeInt 16 0
+%int_2 = OpConstant %int 2
+%struct = OpTypeStruct %int
+%ptr_ssbo = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_wg = OpTypeUntypedPointerKHR Workgroup
+%var_ssbo = OpUntypedVariableKHR %ptr_ssbo StorageBuffer %struct
+%var_wg = OpUntypedVariableKHR %ptr_wg Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemorySized %var_wg %var_ssbo %int_2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Size must be a multiple of 4"));
+}
+
+TEST_F(ValidateMemory, CopyMemorySizedUntypedPointersSizeBad3) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Int16
+OpCapability UntypedPointersKHR
+OpCapability StorageBuffer8BitAccess
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_8bit_storage"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var_ssbo %var_wg
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%short = OpTypeInt 16 0
+%int_1 = OpConstant %int 1
+%struct = OpTypeStruct %int
+%ptr_ssbo = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_wg = OpTypeUntypedPointerKHR Workgroup
+%var_ssbo = OpUntypedVariableKHR %ptr_ssbo StorageBuffer %struct
+%var_wg = OpUntypedVariableKHR %ptr_wg Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemorySized %var_ssbo %var_wg %int_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Size must be a multiple of 2"));
+}
+
+TEST_F(ValidateMemory, CopyMemorySizedUntypedPointersSizeBad4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Int16
+OpCapability UntypedPointersKHR
+OpCapability StorageBuffer8BitAccess
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_8bit_storage"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var_ssbo %var_wg
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%short = OpTypeInt 16 0
+%int_1 = OpConstant %int 1
+%struct = OpTypeStruct %int
+%ptr_ssbo = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_wg = OpTypeUntypedPointerKHR Workgroup
+%var_ssbo = OpUntypedVariableKHR %ptr_ssbo StorageBuffer %struct
+%var_wg = OpUntypedVariableKHR %ptr_wg Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpCopyMemorySized %var_wg %var_ssbo %int_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Size must be a multiple of 2"));
+}
+
+TEST_F(ValidateMemory, PtrEqualUntypedPointersGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %v1 %v2
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%v1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%v2 = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%res = OpPtrEqual %bool %v1 %v2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, PtrNotEqualUntypedPointersGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %v1 %v2
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%bool = OpTypeBool
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%v1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%v2 = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%res = OpPtrNotEqual %bool %v1 %v2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, PtrDiffUntypedPointersGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %v1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%v1 = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%res = OpPtrDiff %int %v1 %v1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateMemory, UntypedVariableVulkanPushConstantGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR PushConstant
+%var = OpUntypedVariableKHR %ptr PushConstant %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateMemory, UntypedVariableVulkanStorageBufferGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateMemory, UntypedVariableVulkanUniformGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Uniform
+%var = OpUntypedVariableKHR %ptr Uniform %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateMemory, UntypedVariableVulkanWorkgroupGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct Block
+OpMemberDecorate %struct 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%struct = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr Workgroup %struct
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+}
+
+TEST_F(ValidateMemory, UntypedPointerAsVariableType) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%priv_ptr = OpTypePointer Private %ptr
+%var = OpVariable %priv_ptr Private
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, UntypedArrayLengthGood) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %array
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%length = OpUntypedArrayLengthKHR %int %block %var 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, UntypedArrayLengthBadResultType) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%float = OpTypeFloat 32
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %array
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%length = OpUntypedArrayLengthKHR %float %block %var 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("must be OpTypeInt with width 32 and signedness 0"));
+}
+
+TEST_F(ValidateMemory, UntypedArrayLengthBadPointer) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %array
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%typed_ptr = OpTypePointer StorageBuffer %block
+%var = OpVariable %typed_ptr StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%length = OpUntypedArrayLengthKHR %int %block %var 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Pointer must be an untyped pointer"));
+}
+
+TEST_F(ValidateMemory, UntypedArrayLengtBadStruct) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %array
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%length = OpUntypedArrayLengthKHR %int %int %var 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("to an OpTypeStruct"));
+}
+
+TEST_F(ValidateMemory, UntypedArrayLengthLastMemberNotArray) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %int
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%length = OpUntypedArrayLengthKHR %int %block %var 0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("must be an OpTypeRuntimeArray"));
+}
+
+TEST_F(ValidateMemory, UntypedArrayLengthBadIndex) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%array = OpTypeRuntimeArray %int
+%block = OpTypeStruct %array
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%length = OpUntypedArrayLengthKHR %int %block %var 1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("must be the last member of the struct"));
+}
+
+TEST_F(ValidateMemory, UntypedCooperativeMatrixLoad) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModel
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_cooperative_matrix"
+OpMemoryModel Logical Vulkan
+OpEntryPoint GLCompute %main "main" %var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%untyped = OpTypeUntypedPointerKHR StorageBuffer
+%float = OpTypeFloat 32
+%array = OpTypeRuntimeArray %float
+%block = OpTypeStruct %array
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%subgroup = OpConstant %int 3
+%rows = OpSpecConstant %int 1
+%cols = OpSpecConstant %int 1
+%matrix_a = OpConstant %int 1
+%stride = OpConstant %int 42
+%matrix = OpTypeCooperativeMatrixKHR %float %subgroup %rows %cols %matrix_a
+%var = OpUntypedVariableKHR %untyped StorageBuffer %block
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%ld = OpCooperativeMatrixLoadKHR %matrix %var %int_0 %stride
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateMemory, UntypedCooperativeMatrixLoad2) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModel
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_cooperative_matrix"
+OpMemoryModel Logical Vulkan
+OpEntryPoint GLCompute %main "main" %var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%untyped = OpTypeUntypedPointerKHR StorageBuffer
+%float = OpTypeFloat 32
+%array = OpTypeRuntimeArray %float
+%block = OpTypeStruct %array
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%subgroup = OpConstant %int 3
+%rows = OpSpecConstant %int 1
+%cols = OpSpecConstant %int 1
+%matrix_a = OpConstant %int 1
+%stride = OpConstant %int 42
+%matrix = OpTypeCooperativeMatrixKHR %float %subgroup %rows %cols %matrix_a
+%var = OpUntypedVariableKHR %untyped StorageBuffer %block
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %untyped %block %var %int_0 %int_0
+%ld = OpCooperativeMatrixLoadKHR %matrix %gep %int_0 %stride
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateMemory, UntypedCooperativeMatrixStore) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModel
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_cooperative_matrix"
+OpMemoryModel Logical Vulkan
+OpEntryPoint GLCompute %main "main" %var1 %var2
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var1 DescriptorSet 0
+OpDecorate %var1 Binding 0
+OpDecorate %var2 DescriptorSet 0
+OpDecorate %var2 Binding 1
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%untyped = OpTypeUntypedPointerKHR StorageBuffer
+%float = OpTypeFloat 32
+%array = OpTypeRuntimeArray %float
+%block = OpTypeStruct %array
+%ptr = OpTypePointer StorageBuffer %block
+%ptr_float = OpTypePointer StorageBuffer %float
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%subgroup = OpConstant %int 3
+%rows = OpSpecConstant %int 1
+%cols = OpSpecConstant %int 1
+%matrix_a = OpConstant %int 1
+%stride = OpConstant %int 42
+%matrix = OpTypeCooperativeMatrixKHR %float %subgroup %rows %cols %matrix_a
+%var1 = OpVariable %ptr StorageBuffer
+%var2 = OpUntypedVariableKHR %untyped StorageBuffer %block
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpAccessChain %ptr_float %var1 %int_0 %int_0
+%ld = OpCooperativeMatrixLoadKHR %matrix %gep %int_0 %stride
+OpCooperativeMatrixStoreKHR %var2 %ld %int_0 %stride
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateMemory, UntypedCooperativeMatrixStore2) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModel
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_cooperative_matrix"
+OpMemoryModel Logical Vulkan
+OpEntryPoint GLCompute %main "main" %var1 %var2
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var1 DescriptorSet 0
+OpDecorate %var1 Binding 0
+OpDecorate %var2 DescriptorSet 0
+OpDecorate %var2 Binding 1
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+OpDecorate %array ArrayStride 4
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%untyped = OpTypeUntypedPointerKHR StorageBuffer
+%float = OpTypeFloat 32
+%array = OpTypeRuntimeArray %float
+%block = OpTypeStruct %array
+%ptr = OpTypePointer StorageBuffer %block
+%ptr_float = OpTypePointer StorageBuffer %float
+%int = OpTypeInt 32 0
+%int_0 = OpConstant %int 0
+%subgroup = OpConstant %int 3
+%rows = OpSpecConstant %int 1
+%cols = OpSpecConstant %int 1
+%matrix_a = OpConstant %int 1
+%stride = OpConstant %int 42
+%matrix = OpTypeCooperativeMatrixKHR %float %subgroup %rows %cols %matrix_a
+%var1 = OpVariable %ptr StorageBuffer
+%var2 = OpUntypedVariableKHR %untyped StorageBuffer %block
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpAccessChain %ptr_float %var1 %int_0 %int_0
+%ld = OpCooperativeMatrixLoadKHR %matrix %gep %int_0 %stride
+%gep2 = OpUntypedAccessChainKHR %untyped %block %var2 %int_0 %int_0
+OpCooperativeMatrixStoreKHR %gep2 %ld %int_0 %stride
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+}
+
+TEST_F(ValidateMemory, PtrAccessChainElementNotInteger) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %ptr_int ArrayStride 4
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%int_0 = OpConstant %int 0
+%float = OpTypeFloat 32
+%float_0 = OpConstant %float 0
+%array = OpTypeArray %int %int_4
+%ptr_array = OpTypePointer Workgroup %array
+%ptr_int = OpTypePointer Workgroup %int
+%var = OpVariable %ptr_array Workgroup
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpAccessChain %ptr_int %var %int_0
+%ptr_gep = OpPtrAccessChain %ptr_int %gep %float_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Element must be an integer"));
+}
+
+TEST_F(ValidateMemory, PtrAccessChainElementNotIntegerUntyped) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %ptr_int ArrayStride 4
+OpDecorate %array ArrayStride 4
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%int_0 = OpConstant %int 0
+%float = OpTypeFloat 32
+%float_0 = OpConstant %float 0
+%array = OpTypeArray %int %int_4
+%block = OpTypeStruct %array
+%ptr_block = OpTypeUntypedPointerKHR Workgroup
+%ptr_int = OpTypeUntypedPointerKHR Workgroup
+%var = OpUntypedVariableKHR %ptr_block Workgroup %block
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %ptr_int %block %var %int_0 %int_0
+%ptr_gep = OpUntypedPtrAccessChainKHR %ptr_int %int %gep %float_0
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("Element must be an integer"));
+}
+
+TEST_F(ValidateMemory, PtrAccessChainElementBlockArrayNonZeroConstant) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%int_1 = OpConstant %int 1
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%array = OpTypeArray %block %int_4
+%ptr_array = OpTypePointer StorageBuffer %array
+%ptr_block = OpTypePointer StorageBuffer %block
+%var = OpVariable %ptr_array StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpAccessChain %ptr_block %var %int_0
+%ptr_gep = OpPtrAccessChain %ptr_block %gep %int_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Element must be 0 if the interpretation type is a "
+ "Block- or BufferBlock-decorated structure"));
+}
+
+TEST_F(ValidateMemory, PtrAccessChainElementBlockArrayNonZeroConstantUntyped) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability VariablePointers
+OpCapability UntypedPointersKHR
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_4 = OpConstant %int 4
+%int_1 = OpConstant %int 1
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%array = OpTypeArray %block %int_4
+%ptr_array = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_block = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr_array StorageBuffer %array
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %ptr_block %array %var %int_0
+%ptr_gep = OpUntypedPtrAccessChainKHR %ptr_block %block %gep %int_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Element must be 0 if the interpretation type is a "
+ "Block- or BufferBlock-decorated structure"));
+}
+
+TEST_F(ValidateMemory, UntypedAccessChainBlockArrayMismatch1) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_4 = OpConstant %int 4
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%array1 = OpTypeArray %block %int_4
+%array2 = OpTypeArray %block %int_4
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %array1
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %ptr %array2 %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("If Base or Base Type is a Block or BufferBlock array, "
+ "the other must also be the same array"));
+}
+
+TEST_F(ValidateMemory, UntypedAccessChainBlockArrayMismatch2) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_4 = OpConstant %int 4
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%array1 = OpTypeArray %block %int_4
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%var = OpUntypedVariableKHR %ptr StorageBuffer %array1
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%gep = OpUntypedAccessChainKHR %ptr %block %var
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Both Base Type and Base must be Block or BufferBlock "
+ "arrays or neither can be"));
+}
+
+TEST_F(ValidateMemory, UntypedAccessChainBlockArrayMismatch3) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_4 = OpConstant %int 4
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%array1 = OpTypeArray %block %int_4
+%array2 = OpTypeArray %block %int_4
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_block_array = OpTypePointer StorageBuffer %array1
+%var = OpVariable %ptr_block_array StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%copy1 = OpCopyObject %ptr_block_array %var
+%copy2 = OpCopyObject %ptr_block_array %copy1
+%gep = OpUntypedAccessChainKHR %ptr %array2 %copy2
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("If Base or Base Type is a Block or BufferBlock array, "
+ "the other must also be the same array"));
+}
+
+TEST_F(ValidateMemory, UntypedAccessChainBlockArrayMismatch4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability UntypedPointersKHR
+OpCapability VariablePointers
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %var DescriptorSet 0
+OpDecorate %var Binding 0
+OpDecorate %block Block
+OpMemberDecorate %block 0 Offset 0
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_4 = OpConstant %int 4
+%int_0 = OpConstant %int 0
+%block = OpTypeStruct %int
+%array1 = OpTypeArray %block %int_4
+%ptr = OpTypeUntypedPointerKHR StorageBuffer
+%ptr_block_array = OpTypePointer StorageBuffer %array1
+%var = OpVariable %ptr_block_array StorageBuffer
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%copy = OpCopyObject %ptr_block_array %var
+%gep = OpUntypedAccessChainKHR %ptr %block %copy
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_1));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Both Base Type and Base must be Block or BufferBlock "
+ "arrays or neither can be"));
+}
+
+std::string GenCoopMat2Shader(const std::string& extra_types,
+ const std::string& main_body,
+ const std::string& after_main = "",
+ const std::string& extra_decorations = "") {
+ const std::string prefix = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability PhysicalStorageBufferAddresses
+OpCapability VulkanMemoryModel
+OpCapability CooperativeMatrixKHR
+OpCapability TensorAddressingNV
+OpCapability CooperativeMatrixTensorAddressingNV
+OpCapability CooperativeMatrixBlockLoadsNV
+OpExtension "SPV_KHR_physical_storage_buffer"
+OpExtension "SPV_KHR_storage_buffer_storage_class"
+OpExtension "SPV_NV_tensor_addressing"
+OpExtension "SPV_NV_cooperative_matrix2"
+OpExtension "SPV_KHR_cooperative_matrix"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical VulkanKHR
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+
+OpDecorate %f16_arr ArrayStride 2
+OpDecorate %46 Block
+OpMemberDecorate %46 0 Offset 0
+OpDecorate %48 Binding 0
+OpDecorate %48 DescriptorSet 0
+OpDecorate %psb Restrict
+)" + extra_decorations + R"(
+%void = OpTypeVoid
+%bool = OpTypeBool
+%func = OpTypeFunction %void
+%f16 = OpTypeFloat 16
+%f32 = OpTypeFloat 32
+%u32 = OpTypeInt 32 0
+%s32 = OpTypeInt 32 1
+
+%s32_0 = OpConstant %s32 0
+%f16_0 = OpConstant %f16 0
+%u32_2 = OpConstant %u32 2
+%u32_8 = OpConstant %u32 8
+%use_A = OpConstant %u32 0
+%workgroup = OpConstant %u32 2
+%subgroup = OpConstant %u32 3
+
+%f16_arr = OpTypeRuntimeArray %f16
+%46 = OpTypeStruct %f16_arr
+%47 = OpTypePointer StorageBuffer %46
+%48 = OpVariable %47 StorageBuffer
+%51 = OpTypePointer StorageBuffer %f16_arr
+%psbptr = OpTypePointer PhysicalStorageBuffer %f16_arr
+
+%f16mat = OpTypeCooperativeMatrixKHR %f16 %workgroup %u32_8 %u32_8 %use_A
+%f32mat = OpTypeCooperativeMatrixKHR %f32 %subgroup %u32_8 %u32_8 %use_A
+
+%arr2 = OpTypeArray %u32 %u32_2
+%functy = OpTypeFunction %f16 %psbptr %arr2 %arr2
+)";
+
+ const std::string decode_func =
+ R"(
+%decodefunc = OpFunction %f16 None %functy
+%psb = OpFunctionParameter %psbptr
+%c0 = OpFunctionParameter %arr2
+%c1 = OpFunctionParameter %arr2
+%entry2 = OpLabel
+OpReturnValue %f16_0
+OpFunctionEnd
+)";
+
+ const std::string func_begin =
+ R"(
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+%array_ptr = OpAccessChain %51 %48 %s32_0
+)";
+
+ const std::string suffix =
+ R"(
+OpReturn
+OpFunctionEnd)";
+
+ return prefix + extra_types + func_begin + main_body + suffix + decode_func +
+ after_main;
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutAndViewSuccess) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutInvalidDimFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 6
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("must be between 1 and 5"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutInvalidClampFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 6
+ %dim = OpConstant %u32 2
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("must be a valid TensorClampMode"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewInvalidDimFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 6
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("must be between 1 and 5"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewInvalidPermutationFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1 %p1
+ )",
+ R"(
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Permutation values don't form a valid permutation"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewInvalidPermutation2Fail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Incorrect number of permutation values."));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutBlockSizePass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetBlockSizeNV %layout %tl %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutBlockSizeFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetBlockSizeNV %layout %tl %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("unexpected number of operands"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutDimensionPass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetDimensionNV %layout %tl %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutDimensionFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetDimensionNV %layout %tl %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("unexpected number of operands"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutStridePass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetStrideNV %layout %tl %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutStrideFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetStrideNV %layout %tl %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("unexpected number of operands"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutSlicePass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSliceNV %layout %tl %b %b %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutSliceFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSliceNV %layout %tl %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("unexpected number of operands"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorLayoutSetClampValuePass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 3
+ %b = OpConstant %u32 1
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ )",
+ R"(
+ %tl = OpCreateTensorLayoutNV %layout
+ %tl2 = OpTensorLayoutSetClampValueNV %layout %tl %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewDimensionPass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %hasdim = OpConstantFalse %bool
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %p2 = OpConstant %u32 2
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1 %p2
+ %b = OpConstant %u32 1
+ )",
+ R"(
+ %tv = OpCreateTensorViewNV %view
+ %tv2 = OpTensorViewSetDimensionNV %view %tv %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewDimensionFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %hasdim = OpConstantFalse %bool
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %p2 = OpConstant %u32 2
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1 %p2
+ %b = OpConstant %u32 1
+ )",
+ R"(
+ %tv = OpCreateTensorViewNV %view
+ %tv2 = OpTensorViewSetDimensionNV %view %tv %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("unexpected number of operands"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewStridePass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %hasdim = OpConstantFalse %bool
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %p2 = OpConstant %u32 2
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1 %p2
+ %b = OpConstant %u32 1
+ )",
+ R"(
+ %tv = OpCreateTensorViewNV %view
+ %tv2 = OpTensorViewSetStrideNV %view %tv %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewStrideFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %hasdim = OpConstantFalse %bool
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %p2 = OpConstant %u32 2
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1 %p2
+ %b = OpConstant %u32 1
+ )",
+ R"(
+ %tv = OpCreateTensorViewNV %view
+ %tv2 = OpTensorViewSetStrideNV %view %tv %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("unexpected number of operands"));
+}
+
+TEST_F(ValidateMemory, CoopMat2TensorViewClipPass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %dim = OpConstant %u32 3
+ %hasdim = OpConstantFalse %bool
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %p2 = OpConstant %u32 2
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1 %p2
+ %b = OpConstant %u32 1
+ )",
+ R"(
+ %tv = OpCreateTensorViewNV %view
+ %tv2 = OpTensorViewSetClipNV %view %tv %b %b %b %b
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2LoadStoreTensorPass) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ %mat = OpUndef %f16mat
+ %tl = OpCreateTensorLayoutNV %layout
+ %tv = OpCreateTensorViewNV %view
+ %mat2 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None None
+ %mat3 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl Aligned 4 None
+ %mat4 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None TensorView %tv
+ %mat5 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None DecodeFunc %decodefunc
+ %mat6 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None TensorView|DecodeFunc %tv %decodefunc
+ %mat7 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl Aligned 4 TensorView|DecodeFunc %tv %decodefunc
+ OpCooperativeMatrixStoreTensorNV %array_ptr %mat %tl None None
+ OpCooperativeMatrixStoreTensorNV %array_ptr %mat %tl Aligned 4 None
+ OpCooperativeMatrixStoreTensorNV %array_ptr %mat %tl None TensorView %tv
+ OpCooperativeMatrixStoreTensorNV %array_ptr %mat %tl Aligned 4 TensorView %tv
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMemory, CoopMat2LoadTensorWrongLayoutTypeFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ %mat = OpUndef %f16mat
+ %tl = OpCreateTensorLayoutNV %layout
+ %tv = OpCreateTensorViewNV %view
+ %mat2 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tv None None
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("does not have a tensor layout type"));
+}
+
+TEST_F(ValidateMemory, CoopMat2LoadTensorWrongObjectTypeFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ %mat = OpUndef %f32mat
+ %tl = OpCreateTensorLayoutNV %layout
+ %tv = OpCreateTensorViewNV %view
+ %mat2 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None None
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("type does not match Result Type"));
+}
+
+TEST_F(ValidateMemory, CoopMat2LoadTensorDecodeFuncTypeFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ )",
+ R"(
+ %mat = OpUndef %f32mat
+ %tl = OpCreateTensorLayoutNV %layout
+ %tv = OpCreateTensorViewNV %view
+ %mat2 = OpCooperativeMatrixLoadTensorNV %f32mat %array_ptr %mat %tl None DecodeFunc %decodefunc
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("return type must match matrix component type"));
+}
+
+TEST_F(ValidateMemory, CoopMat2LoadTensorDecodeFuncArrayTypeFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %u32_3 = OpConstant %u32 3
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ %arr3 = OpTypeArray %u32 %u32_3
+ %functy2 = OpTypeFunction %f16 %psbptr %arr3 %arr3
+ )",
+ R"(
+ %mat = OpUndef %f16mat
+ %tl = OpCreateTensorLayoutNV %layout
+ %tv = OpCreateTensorViewNV %view
+ %mat2 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None DecodeFunc %decodefunc2
+ )",
+ R"(
+ %decodefunc2 = OpFunction %f16 None %functy2
+ %psb2 = OpFunctionParameter %psbptr
+ %c02 = OpFunctionParameter %arr3
+ %c12 = OpFunctionParameter %arr3
+ %entry3 = OpLabel
+ OpReturnValue %f16_0
+ OpFunctionEnd
+ )",
+ R"(
+ OpDecorate %psb2 Restrict
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("dimension equal to the tensor dimension"));
+}
+
+TEST_F(ValidateMemory, CoopMat2LoadTensorDecodeFuncPointerTypeFail) {
+ std::string spirv = GenCoopMat2Shader(
+ R"(
+ %clamp = OpConstant %u32 0
+ %dim = OpConstant %u32 2
+ %p0 = OpConstant %u32 0
+ %p1 = OpConstant %u32 1
+ %hasdim = OpConstantFalse %bool
+ %layout = OpTypeTensorLayoutNV %dim %clamp
+ %view = OpTypeTensorViewNV %dim %hasdim %p0 %p1
+ %sbptr = OpTypePointer StorageBuffer %f16_arr
+ %functy2 = OpTypeFunction %f16 %sbptr %arr2 %arr2
+ )",
+ R"(
+ %mat = OpUndef %f16mat
+ %tl = OpCreateTensorLayoutNV %layout
+ %tv = OpCreateTensorViewNV %view
+ %mat2 = OpCooperativeMatrixLoadTensorNV %f16mat %array_ptr %mat %tl None DecodeFunc %decodefunc2
+ )",
+ R"(
+ %decodefunc2 = OpFunction %f16 None %functy2
+ %sb = OpFunctionParameter %sbptr
+ %c02 = OpFunctionParameter %arr2
+ %c12 = OpFunctionParameter %arr2
+ %entry3 = OpLabel
+ OpReturnValue %f16_0
+ OpFunctionEnd
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("first parameter must be pointer to PhysicalStorageBuffer"));
+}
+
+TEST_F(ValidateMemory, PtrAccessChainNodePayloadArray) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability ShaderEnqueueAMDX
+OpExtension "SPV_AMDX_shader_enqueue"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %input
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%node0 = OpConstantStringAMDX "node0"
+%node1 = OpConstantStringAMDX "node1"
+%node2 = OpConstantStringAMDX "node2"
+%S = OpTypeStruct %uint
+%_payloadarr_S = OpTypeNodePayloadArrayAMDX %S
+%_ptr_NodePayloadAMDX__payloadarr_S = OpTypePointer NodePayloadAMDX %_payloadarr_S
+%_ptr_NodePayloadAMDX_uint = OpTypePointer NodePayloadAMDX %uint
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%input = OpVariable %_ptr_NodePayloadAMDX__payloadarr_S NodePayloadAMDX
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+%x = OpAccessChain %_ptr_NodePayloadAMDX_uint %input %uint_0 %uint_0
+OpReturn
+OpFunctionEnd
+)";
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(env));
+}
+
+std::string GenCoopVecLoadStoreShader(const std::string& storeMemoryAccess,
+ const std::string& loadMemoryAccess) {
+ std::string s = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability StorageBuffer16BitAccess
+OpCapability VulkanMemoryModel
+OpCapability CooperativeVectorNV
+OpCapability ReplicatedCompositesEXT
+OpExtension "SPV_EXT_replicated_composites"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpExtension "SPV_NV_cooperative_vector"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical Vulkan
+OpEntryPoint GLCompute %4 "main" %48 %73
+OpExecutionMode %4 LocalSize 1 1 1
+
+OpDecorate %45 ArrayStride 2
+OpDecorate %46 Block
+OpMemberDecorate %46 0 Offset 0
+OpDecorate %48 Binding 0
+OpDecorate %48 DescriptorSet 0
+
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%6 = OpTypeInt 32 0
+%49 = OpTypeInt 32 1
+%41 = OpTypeFloat 16
+
+%14 = OpConstant %6 1
+%50 = OpConstant %49 0
+%82 = OpConstant %6 5
+
+%42 = OpTypeCooperativeVectorNV %41 %14
+%43 = OpTypePointer Function %42
+
+%45 = OpTypeRuntimeArray %41
+%46 = OpTypeStruct %45
+%47 = OpTypePointer StorageBuffer %46
+%48 = OpVariable %47 StorageBuffer
+%51 = OpTypePointer StorageBuffer %45
+
+%57 = OpTypePointer Private %42
+%73 = OpVariable %57 Private
+
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+%52 = OpAccessChain %51 %48 %50
+%56 = OpCooperativeVectorLoadNV %42 %52 %50 )" +
+ loadMemoryAccess + R"( %82
+%77 = OpLoad %42 %73
+OpCooperativeVectorStoreNV %52 %50 %77 )" +
+ storeMemoryAccess + R"( %82
+OpReturn
+OpFunctionEnd
+)";
+
+ return s;
+}
+
+TEST_F(ValidateMemory, CoopVecLoadStoreSuccess) {
+ std::string spirv =
+ GenCoopVecLoadStoreShader("MakePointerAvailableKHR|NonPrivatePointerKHR",
+ "MakePointerVisibleKHR|NonPrivatePointerKHR");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+}
+
+TEST_F(ValidateMemory, CoopVecStoreMemoryAccessFail) {
+ std::string spirv =
+ GenCoopVecLoadStoreShader("MakePointerVisibleKHR|NonPrivatePointerKHR",
+ "MakePointerVisibleKHR|NonPrivatePointerKHR");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("MakePointerVisibleKHR cannot be used with OpStore"));
+}
+
+TEST_F(ValidateMemory, CoopVecLoadMemoryAccessFail) {
+ std::string spirv =
+ GenCoopVecLoadStoreShader("MakePointerAvailableKHR|NonPrivatePointerKHR",
+ "MakePointerAvailableKHR|NonPrivatePointerKHR");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("MakePointerAvailableKHR cannot be used with OpLoad"));
+}
+
+TEST_F(ValidateMemory, CoopVecInvalidStorageClassFail) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability CooperativeVectorNV
+OpCapability ReplicatedCompositesEXT
+OpExtension "SPV_NV_cooperative_vector"
+OpExtension "SPV_EXT_replicated_composites"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%f16 = OpTypeFloat 16
+%u32 = OpTypeInt 32 0
+
+%u32_8 = OpConstant %u32 8
+%use_A = OpConstant %u32 0
+%subgroup = OpConstant %u32 3
+
+%f16vec = OpTypeCooperativeVectorNV %f16 %u32_8
+
+%str = OpTypeStruct %f16vec
+%str_ptr = OpTypePointer Workgroup %str
+%sh = OpVariable %str_ptr Workgroup
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Cooperative vector types (or types containing them) can only be "
+ "allocated in Function or Private storage classes or as function "
+ "parameters"));
+}
+
+std::string GenCoopVecShader(const std::string& extra_types,
+ const std::string& main_body) {
+ const std::string prefix =
+ R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int64
+OpCapability StorageBuffer16BitAccess
+OpCapability VulkanMemoryModel
+OpCapability CooperativeVectorNV
+OpCapability CooperativeVectorTrainingNV
+OpCapability ReplicatedCompositesEXT
+OpExtension "SPV_EXT_replicated_composites"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpExtension "SPV_NV_cooperative_vector"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical Vulkan
+OpEntryPoint GLCompute %main "main" %48 %73
+OpExecutionMode %main LocalSize 1 1 1
+
+OpDecorate %f16_arr ArrayStride 2
+OpDecorate %46 Block
+OpMemberDecorate %46 0 Offset 0
+OpDecorate %48 Binding 0
+OpDecorate %48 DescriptorSet 0
+
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%u32 = OpTypeInt 32 0
+%s32 = OpTypeInt 32 1
+%f16 = OpTypeFloat 16
+%bool = OpTypeBool
+
+%false = OpConstantFalse %bool
+%u32_4 = OpConstant %u32 4
+%u32_8 = OpConstant %u32 8
+%s32_0 = OpConstant %s32 0
+%f16_0 = OpConstant %f16 0
+
+%f16vec4 = OpTypeCooperativeVectorNV %f16 %u32_4
+%f16vec8 = OpTypeCooperativeVectorNV %f16 %u32_8
+
+%f16_arr = OpTypeRuntimeArray %f16
+%46 = OpTypeStruct %f16_arr
+%47 = OpTypePointer StorageBuffer %46
+%48 = OpVariable %47 StorageBuffer
+%51 = OpTypePointer StorageBuffer %f16_arr
+
+%57 = OpTypePointer Private %f16vec4
+%73 = OpVariable %57 Private
+%u32ptr = OpTypePointer Function %u32
+
+%input4 = OpConstantCompositeReplicateEXT %f16vec4 %f16_0
+%input8 = OpConstantCompositeReplicateEXT %f16vec8 %f16_0
+%interp = OpConstant %u32 0
+%offset = OpConstant %u32 0
+
+)";
+
+ const std::string func_begin =
+ R"(
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+%u32var = OpVariable %u32ptr Function
+%array_ptr = OpAccessChain %51 %48 %s32_0
+)";
+
+ const std::string suffix =
+ R"(
+OpReturn
+OpFunctionEnd)";
+
+ return prefix + extra_types + func_begin + main_body + suffix;
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulSuccess) {
+ std::string spirv = GenCoopVecShader("",
+ R"(
+%result0 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input4 %interp %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+%result1 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input8 %interp %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_8 %s32_0 %false
+%result2 = OpCooperativeVectorMatrixMulAddNV %f16vec8 %input4 %interp %array_ptr %offset %interp %array_ptr %offset %interp %u32_8 %u32_4 %s32_0 %false
+%result3 = OpCooperativeVectorMatrixMulNV %f16vec4 %input4 %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+%result4 = OpCooperativeVectorMatrixMulNV %f16vec4 %input8 %interp %array_ptr %offset %interp %u32_4 %u32_8 %s32_0 %false
+%result5 = OpCooperativeVectorMatrixMulNV %f16vec8 %input4 %interp %array_ptr %offset %interp %u32_8 %u32_4 %s32_0 %false
+
+OpCooperativeVectorReduceSumAccumulateNV %array_ptr %offset %input4
+OpCooperativeVectorOuterProductAccumulateNV %array_ptr %offset %input4 %input8 %interp %interp
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulKMismatchFail) {
+ std::string spirv = GenCoopVecShader(R"()",
+ R"(
+%result1 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input8 %interp %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV input number of "
+ "components 8 does not match K 4"));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulPackedKMismatchPass) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%packed = OpConstant %u32 1000491001
+ )",
+ R"(
+%result1 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input8 %packed %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulMMismatchFail) {
+ std::string spirv = GenCoopVecShader(R"()",
+ R"(
+%result1 = OpCooperativeVectorMatrixMulAddNV %f16vec8 %input8 %interp %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_8 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV result type number "
+ "of components 8 does not match M 4"));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulTransposeTypeFail) {
+ std::string spirv = GenCoopVecShader(R"()",
+ R"(
+%result0 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input4 %interp %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %s32_0
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV Transpose <id> "
+ "'16[%int_0]' is not a scalar boolean"));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulInputInterpretationNotConstantFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+ )",
+ R"(
+%u32val = OpLoad %u32 %u32var
+%result0 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input4 %u32val %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV InputInterpretation "
+ "<id> '31[%31]' is not a constant instruction"));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulMatrixInterpretationNotConstantFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+ )",
+ R"(
+%u32val = OpLoad %u32 %u32var
+%result0 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input4 %interp %array_ptr %offset %u32val %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV MatrixInterpretation <id> "
+ "'31[%31]' is not a constant instruction"));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulBiasInterpretationNotConstantFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+ )",
+ R"(
+%u32val = OpLoad %u32 %u32var
+%result0 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input4 %interp %array_ptr %offset %interp %array_ptr %offset %u32val %u32_4 %u32_4 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV BiasInterpretation "
+ "<id> '31[%31]' is not a constant instruction"));
+}
+
+TEST_F(ValidateMemory, CoopVecMatMulInputInterpretationNotInt32Fail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+ )",
+ R"(
+%result0 = OpCooperativeVectorMatrixMulAddNV %f16vec4 %input4 %false %array_ptr %offset %interp %array_ptr %offset %interp %u32_4 %u32_4 %s32_0 %false
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorMatrixMulAddNV InputInterpretation "
+ "type <id> '12[%bool]' is not a 32 bit integer"));
+}
+
+TEST_F(ValidateMemory, CoopVecOuterProductABMismatchFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%f32 = OpTypeFloat 32
+%f32vec8 = OpTypeCooperativeVectorNV %f32 %u32_8
+%f32_0 = OpConstant %f32 0
+%input8f32 = OpConstantCompositeReplicateEXT %f32vec8 %f32_0
+ )",
+ R"(
+OpCooperativeVectorOuterProductAccumulateNV %array_ptr %offset %input4 %input8f32 %interp %interp
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorOuterProductAccumulateNV A and B component "
+ "types '11[%half]' and '28[%float]' do not match"));
+}
+
+TEST_F(ValidateMemory, CoopVecOuterProductInt32OffsetFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%u64 = OpTypeInt 64 0
+%u64_0 = OpConstant %u64 0
+ )",
+ R"(
+OpCooperativeVectorOuterProductAccumulateNV %array_ptr %u64_0 %input4 %input8 %interp %interp
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorOuterProductAccumulateNV Offset "
+ "type <id> '28[%ulong]' is not a 32 bit integer"));
+}
+
+TEST_F(ValidateMemory, CoopVecOuterProductInt32MatrixStrideFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%u64 = OpTypeInt 64 0
+%u64_0 = OpConstant %u64 0
+ )",
+ R"(
+OpCooperativeVectorOuterProductAccumulateNV %array_ptr %offset %input4 %input8 %interp %interp %u64_0
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorOuterProductAccumulateNV MatrixStride type "
+ "<id> '28[%ulong]' is not a 32 bit integer"));
+}
+
+TEST_F(ValidateMemory, CoopVecOuterProductVectorTypeFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%f16v4 = OpTypeVector %f16 4
+%f16c = OpConstantCompositeReplicateEXT %f16v4 %f16_0
+ )",
+ R"(
+OpCooperativeVectorOuterProductAccumulateNV %array_ptr %offset %f16c %input8 %interp %interp
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorOuterProductAccumulateNV A type "
+ "<id> '28[%v4half]' is not a cooperative vector type"));
+}
+
+TEST_F(ValidateMemory, CoopVecReduceSumInt32OffsetFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%u64 = OpTypeInt 64 0
+%u64_0 = OpConstant %u64 0
+ )",
+ R"(
+OpCooperativeVectorReduceSumAccumulateNV %array_ptr %u64_0 %input4
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorReduceSumAccumulateNV Offset type "
+ "<id> '28[%ulong]' is not a 32 bit integer"));
+}
+
+TEST_F(ValidateMemory, CoopVecReduceSumVectorTypeFail) {
+ std::string spirv = GenCoopVecShader(
+ R"(
+%f16v4 = OpTypeVector %f16 4
+%f16c = OpConstantCompositeReplicateEXT %f16v4 %f16_0
+ )",
+ R"(
+OpCooperativeVectorReduceSumAccumulateNV %array_ptr %offset %f16c
+ )");
+
+ CompileSuccessfully(spirv.c_str(), SPV_ENV_VULKAN_1_1_SPIRV_1_4);
+ ASSERT_EQ(SPV_ERROR_INVALID_ID,
+ ValidateInstructions(SPV_ENV_VULKAN_1_1_SPIRV_1_4));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpCooperativeVectorReduceSumAccumulateNV V type <id> "
+ "'28[%v4half]' is not a cooperative vector type."));
+}
+
+TEST_F(ValidateMemory, CoopMatMatrixBFloatFAdd) {
+ const std::string body =
+ R"(
+ OpCapability Shader
+ OpCapability Float16
+ OpCapability BFloat16TypeKHR
+ OpCapability BFloat16CooperativeMatrixKHR
+ OpCapability VulkanMemoryModel
+ OpCapability CooperativeMatrixKHR
+ OpExtension "SPV_KHR_bfloat16"
+ OpExtension "SPV_KHR_vulkan_memory_model"
+ OpExtension "SPV_KHR_cooperative_matrix"
+ OpMemoryModel Logical Vulkan
+ OpEntryPoint GLCompute %main "main" %_ %__0 %__1
+ OpExecutionMode %main LocalSize 32 1 1
+ OpDecorate %_arr_bfloat16_uint_64 ArrayStride 2
+ OpDecorate %A Block
+ OpMemberDecorate %A 0 Offset 0
+ OpDecorate %_ Binding 0
+ OpDecorate %_ DescriptorSet 0
+ OpDecorate %_arr_bfloat16_uint_64_0 ArrayStride 2
+ OpDecorate %B Block
+ OpMemberDecorate %B 0 Offset 0
+ OpDecorate %__0 Binding 1
+ OpDecorate %__0 DescriptorSet 0
+ OpDecorate %_arr_bfloat16_uint_64_1 ArrayStride 2
+ OpDecorate %R Block
+ OpMemberDecorate %R 0 Offset 0
+ OpDecorate %__1 Binding 2
+ OpDecorate %__1 DescriptorSet 0
+ %void = OpTypeVoid
+ %4 = OpTypeFunction %void
+ %bfloat16 = OpTypeFloat 16 BFloat16KHR
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ %uint_8 = OpConstant %uint 8
+ %uint_0 = OpConstant %uint 0
+ %12 = OpTypeCooperativeMatrixKHR %bfloat16 %uint_3 %uint_8 %uint_8 %uint_0
+%_ptr_Function_12 = OpTypePointer Function %12
+ %uint_64 = OpConstant %uint 64
+%_arr_bfloat16_uint_64 = OpTypeArray %bfloat16 %uint_64
+ %A = OpTypeStruct %_arr_bfloat16_uint_64
+%_ptr_StorageBuffer_A = OpTypePointer StorageBuffer %A
+ %_ = OpVariable %_ptr_StorageBuffer_A StorageBuffer
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_StorageBuffer_bfloat16 = OpTypePointer StorageBuffer %bfloat16
+%_arr_bfloat16_uint_64_0 = OpTypeArray %bfloat16 %uint_64
+ %B = OpTypeStruct %_arr_bfloat16_uint_64_0
+%_ptr_StorageBuffer_B = OpTypePointer StorageBuffer %B
+ %__0 = OpVariable %_ptr_StorageBuffer_B StorageBuffer
+ %v3uint = OpTypeVector %uint 3
+ %uint_32 = OpConstant %uint 32
+ %uint_1 = OpConstant %uint 1
+ %35 = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%_arr_bfloat16_uint_64_1 = OpTypeArray %bfloat16 %uint_64
+ %R = OpTypeStruct %_arr_bfloat16_uint_64_1
+%_ptr_StorageBuffer_R = OpTypePointer StorageBuffer %R
+ %__1 = OpVariable %_ptr_StorageBuffer_R StorageBuffer
+ %main = OpFunction %void None %4
+ %6 = OpLabel
+ %matX = OpVariable %_ptr_Function_12 Function
+ %matY = OpVariable %_ptr_Function_12 Function
+ %23 = OpAccessChain %_ptr_StorageBuffer_bfloat16 %_ %int_0 %uint_0
+ %24 = OpCooperativeMatrixLoadKHR %12 %23 %int_0 %uint_8 None
+ OpStore %matX %24
+ %30 = OpAccessChain %_ptr_StorageBuffer_bfloat16 %__0 %int_0 %uint_0
+ %31 = OpCooperativeMatrixLoadKHR %12 %30 %int_0 %uint_8 None
+ OpStore %matY %31
+ %32 = OpLoad %12 %matX
+ %33 = OpLoad %12 %matY
+ %34 = OpFAdd %12 %32 %33
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("FAdd doesn't support BFloat16 type"));
+}
+
+TEST_F(ValidateMemory, CoopMatMatrixFloat8FAdd) {
+ const std::string body =
+ R"(
+ OpCapability Shader
+ OpCapability Float8EXT
+ OpCapability Float8CooperativeMatrixEXT
+ OpCapability VulkanMemoryModel
+ OpCapability CooperativeMatrixKHR
+ OpExtension "SPV_EXT_float8"
+ OpExtension "SPV_KHR_cooperative_matrix"
+ OpExtension "SPV_KHR_vulkan_memory_model"
+ OpMemoryModel Logical Vulkan
+ OpEntryPoint GLCompute %main "main"
+ OpExecutionMode %main LocalSize 32 1 1
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+ %void = OpTypeVoid
+ %4 = OpTypeFunction %void
+ %fp8e4m3 = OpTypeFloat 8 Float8E4M3EXT
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ %uint_16 = OpConstant %uint 16
+ %uint_0 = OpConstant %uint 0
+ %12 = OpTypeCooperativeMatrixKHR %fp8e4m3 %uint_3 %uint_16 %uint_16 %uint_0
+%_ptr_Function_12 = OpTypePointer Function %12
+ %v3uint = OpTypeVector %uint 3
+ %uint_32 = OpConstant %uint 32
+ %uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+ %main = OpFunction %void None %4
+ %6 = OpLabel
+ %matR = OpVariable %_ptr_Function_12 Function
+ %matX = OpVariable %_ptr_Function_12 Function
+ %matY = OpVariable %_ptr_Function_12 Function
+ %16 = OpLoad %12 %matX
+ %18 = OpLoad %12 %matY
+ %19 = OpFAdd %12 %16 %18
+ OpStore %matR %19
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_VULKAN_1_3);
+ ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("FAdd doesn't support FP8 E4M3/E5M2 types"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_mesh_shading_test.cpp b/third_party/SPIRV-Tools/test/val/val_mesh_shading_test.cpp
index a7b96a4..7593719 100644
--- a/third_party/SPIRV-Tools/test/val/val_mesh_shading_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_mesh_shading_test.cpp
@@ -467,6 +467,79 @@
"TaskEXT and MeshKHR execution model"));
}
+TEST_F(ValidateMeshShading, BadMultipleTaskPayloadWorkgroupEXT) {
+ const std::string body = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TaskEXT %main "main" %payload %payload1
+ %void = OpTypeVoid
+ %func = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_TaskPayloadWorkgroupEXT = OpTypePointer TaskPayloadWorkgroupEXT %uint
+ %payload = OpVariable %_ptr_TaskPayloadWorkgroupEXT TaskPayloadWorkgroupEXT
+ %payload1 = OpVariable %_ptr_TaskPayloadWorkgroupEXT TaskPayloadWorkgroupEXT
+ %main = OpFunction %void None %func
+ %label = OpLabel
+ %load = OpLoad %uint %payload
+ OpReturn
+ OpFunctionEnd
+)";
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("There can be at most one OpVariable with storage "
+ "class TaskPayloadWorkgroupEXT associated with "
+ "an OpEntryPoint"));
+}
+
+TEST_F(ValidateMeshShading, TaskPayloadWorkgroupTaskExtExecutionModel) {
+ const std::string body = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint TaskEXT %main "main" %payload
+ %void = OpTypeVoid
+ %func = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_TaskPayloadWorkgroupEXT = OpTypePointer TaskPayloadWorkgroupEXT %uint
+ %payload = OpVariable %_ptr_TaskPayloadWorkgroupEXT TaskPayloadWorkgroupEXT
+ %main = OpFunction %void None %func
+ %label = OpLabel
+ %load = OpLoad %uint %payload
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+}
+
+TEST_F(ValidateMeshShading, TaskPayloadWorkgroupMeshExtExecutionModel) {
+ const std::string body = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %payload
+ OpExecutionMode %main OutputVertices 1
+ OpExecutionMode %main OutputPrimitivesEXT 1
+ OpExecutionMode %main OutputTrianglesEXT
+ %void = OpTypeVoid
+ %func = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_TaskPayloadWorkgroupEXT = OpTypePointer TaskPayloadWorkgroupEXT %uint
+ %payload = OpVariable %_ptr_TaskPayloadWorkgroupEXT TaskPayloadWorkgroupEXT
+ %main = OpFunction %void None %func
+ %label = OpLabel
+ %load = OpLoad %uint %payload
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+}
+
TEST_F(ValidateMeshShading, OpSetMeshOutputsBadVertexCount) {
const std::string body = R"(
OpCapability MeshShadingEXT
@@ -598,6 +671,317 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
}
+TEST_F(ValidateMeshShading, BadPerPrimitiveEXTStorageClassInMeshEXT) {
+ const std::string body = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationID %blk %triangleNormal
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesNV 32
+ OpExecutionMode %main OutputTrianglesNV
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %iid "iid"
+ OpName %gl_LocalInvocationID "gl_LocalInvocationID"
+ OpName %myblock "myblock"
+ OpMemberName %myblock 0 "f"
+ OpName %blk "blk"
+ OpName %triangleNormal "triangleNormal"
+ OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId
+ OpMemberDecorate %myblock 0 PerPrimitiveEXT
+ OpDecorate %myblock Block
+ OpDecorate %blk Location 0
+ OpDecorate %triangleNormal PerPrimitiveEXT
+ OpDecorate %triangleNormal Location 0
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input
+ %uint_0 = OpConstant %uint 0
+%_ptr_Input_uint = OpTypePointer Input %uint
+ %float = OpTypeFloat 32
+ %myblock = OpTypeStruct %float
+ %uint_32 = OpConstant %uint 32
+%_arr_myblock_uint_32 = OpTypeArray %myblock %uint_32
+%_ptr_Output__arr_myblock_uint_32 = OpTypePointer Output %_arr_myblock_uint_32
+ %blk = OpVariable %_ptr_Output__arr_myblock_uint_32 Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %float_11 = OpConstant %float 11
+%_ptr_Output_float = OpTypePointer Output %float
+ %v3float = OpTypeVector %float 3
+%_arr_v3float_uint_32 = OpTypeArray %v3float %uint_32
+%_ptr_Output__arr_v3float_uint_32 = OpTypePointer Input %_arr_v3float_uint_32
+%triangleNormal = OpVariable %_ptr_Output__arr_v3float_uint_32 Input
+ %33 = OpConstantComposite %v3float %float_11 %float_11 %float_11
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+ %uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %iid = OpVariable %_ptr_Function_uint Function
+ %14 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0
+ %15 = OpLoad %uint %14
+ OpStore %iid %15
+ %22 = OpLoad %uint %iid
+ %27 = OpAccessChain %_ptr_Output_float %blk %22 %int_0
+ OpStore %27 %float_11
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("PerPrimitiveEXT decoration must be applied only to "
+ "variables in the Output Storage Class in the Storage "
+ "Class in the MeshEXT Execution Model."));
+}
+
+TEST_F(ValidateMeshShading, VulkanPerPrimitiveEXTStorageClassInMeshEXT) {
+ const std::string body = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationID %blk %triangleNormal
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesNV 32
+ OpExecutionMode %main OutputTrianglesNV
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %iid "iid"
+ OpName %gl_LocalInvocationID "gl_LocalInvocationID"
+ OpName %myblock "myblock"
+ OpMemberName %myblock 0 "f"
+ OpName %blk "blk"
+ OpName %triangleNormal "triangleNormal"
+ OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId
+ OpMemberDecorate %myblock 0 PerPrimitiveEXT
+ OpDecorate %myblock Block
+ OpDecorate %blk Location 0
+ OpDecorate %triangleNormal PerPrimitiveEXT
+ OpDecorate %triangleNormal Location 0
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+ %3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+%v3uint = OpTypeVector %uint 3
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input
+%uint_0 = OpConstant %uint 0
+%_ptr_Input_uint = OpTypePointer Input %uint
+%float = OpTypeFloat 32
+%myblock = OpTypeStruct %float
+%uint_32 = OpConstant %uint 32
+%_arr_myblock_uint_32 = OpTypeArray %myblock %uint_32
+%_ptr_Output__arr_myblock_uint_32 = OpTypePointer Output %_arr_myblock_uint_32
+%blk = OpVariable %_ptr_Output__arr_myblock_uint_32 Output
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%float_11 = OpConstant %float 11
+%_ptr_Output_float = OpTypePointer Output %float
+%v3float = OpTypeVector %float 3
+%_arr_v3float_uint_32 = OpTypeArray %v3float %uint_32
+%_ptr_Output__arr_v3float_uint_32 = OpTypePointer Input %_arr_v3float_uint_32
+%triangleNormal = OpVariable %_ptr_Output__arr_v3float_uint_32 Input
+%33 = OpConstantComposite %v3float %float_11 %float_11 %float_11
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+%uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+%main = OpFunction %void None %3
+ %5 = OpLabel
+%iid = OpVariable %_ptr_Function_uint Function
+%14 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0
+%15 = OpLoad %uint %14
+ OpStore %iid %15
+%22 = OpLoad %uint %iid
+%27 = OpAccessChain %_ptr_Output_float %blk %22 %int_0
+ OpStore %27 %float_11
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-PrimitiveId-PrimitiveId-04336"));
+}
+
+TEST_F(ValidateMeshShading, BadPerPrimitiveEXTStorageClassInFrag) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %triangleNormal
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %triangleNormal "triangleNormal"
+ OpDecorate %triangleNormal PerPrimitiveNV
+ OpDecorate %triangleNormal Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+%_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+%_ptr_Input__arr_v3float_uint_3 = OpTypePointer Output %_arr_v3float_uint_3
+%triangleNormal = OpVariable %_ptr_Input__arr_v3float_uint_3 Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Input_v3float = OpTypePointer Input %v3float
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %18 = OpAccessChain %_ptr_Input_v3float %triangleNormal %int_0
+ %19 = OpLoad %v3float %18
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA,
+ ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("PerPrimitiveEXT decoration must be applied only to "
+ "variables in the Input Storage Class in the Fragment "
+ "Execution Model."));
+}
+
+TEST_F(ValidateMeshShading, PerPrimitiveEXTStorageClassInFrag) {
+ const std::string body = R"(
+ OpCapability Shader
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main" %res3 %triangleNormal
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %res3 "res3"
+ OpName %triangleNormal "triangleNormal"
+ OpDecorate %res3 Location 0
+ OpDecorate %triangleNormal PerPrimitiveNV
+ OpDecorate %triangleNormal Location 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %_ptr_Output_v3float = OpTypePointer Output %v3float
+ %res3 = OpVariable %_ptr_Output_v3float Output
+ %uint = OpTypeInt 32 0
+ %uint_3 = OpConstant %uint 3
+ %_arr_v3float_uint_3 = OpTypeArray %v3float %uint_3
+ %_ptr_Input__arr_v3float_uint_3 = OpTypePointer Input %_arr_v3float_uint_3
+ %triangleNormal = OpVariable %_ptr_Input__arr_v3float_uint_3 Input
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %_ptr_Input_v3float = OpTypePointer Input %v3float
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %18 = OpAccessChain %_ptr_Input_v3float %triangleNormal %int_0
+ %19 = OpLoad %v3float %18
+ OpStore %res3 %19
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+}
+
+TEST_F(ValidateMeshShading, PerPrimitiveEXTStorageClassInMeshEXT) {
+ const std::string body = R"(
+ OpCapability MeshShadingEXT
+ OpExtension "SPV_EXT_mesh_shader"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint MeshEXT %main "main" %gl_LocalInvocationID %blk %triangleNormal
+ OpExecutionMode %main LocalSize 32 1 1
+ OpExecutionMode %main OutputVertices 81
+ OpExecutionMode %main OutputPrimitivesNV 32
+ OpExecutionMode %main OutputTrianglesNV
+ OpSource GLSL 450
+ OpSourceExtension "GL_EXT_mesh_shader"
+ OpName %main "main"
+ OpName %iid "iid"
+ OpName %gl_LocalInvocationID "gl_LocalInvocationID"
+ OpName %myblock "myblock"
+ OpMemberName %myblock 0 "f"
+ OpName %blk "blk"
+ OpName %triangleNormal "triangleNormal"
+ OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId
+ OpMemberDecorate %myblock 0 PerPrimitiveNV
+ OpDecorate %myblock Block
+ OpDecorate %blk Location 0
+ OpDecorate %triangleNormal PerPrimitiveNV
+ OpDecorate %triangleNormal Location 0
+ OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input
+ %uint_0 = OpConstant %uint 0
+%_ptr_Input_uint = OpTypePointer Input %uint
+ %float = OpTypeFloat 32
+ %myblock = OpTypeStruct %float
+ %uint_32 = OpConstant %uint 32
+%_arr_myblock_uint_32 = OpTypeArray %myblock %uint_32
+%_ptr_Output__arr_myblock_uint_32 = OpTypePointer Output %_arr_myblock_uint_32
+ %blk = OpVariable %_ptr_Output__arr_myblock_uint_32 Output
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+ %float_11 = OpConstant %float 11
+%_ptr_Output_float = OpTypePointer Output %float
+ %v3float = OpTypeVector %float 3
+%_arr_v3float_uint_32 = OpTypeArray %v3float %uint_32
+%_ptr_Output__arr_v3float_uint_32 = OpTypePointer Output %_arr_v3float_uint_32
+%triangleNormal = OpVariable %_ptr_Output__arr_v3float_uint_32 Output
+ %33 = OpConstantComposite %v3float %float_11 %float_11 %float_11
+%_ptr_Output_v3float = OpTypePointer Output %v3float
+ %uint_1 = OpConstant %uint 1
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_32 %uint_1 %uint_1
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %iid = OpVariable %_ptr_Function_uint Function
+ %14 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0
+ %15 = OpLoad %uint %14
+ OpStore %iid %15
+ %22 = OpLoad %uint %iid
+ %27 = OpAccessChain %_ptr_Output_float %blk %22 %int_0
+ OpStore %27 %float_11
+ %32 = OpLoad %uint %iid
+ %35 = OpAccessChain %_ptr_Output_v3float %triangleNormal %32
+ OpStore %35 %33
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(body, SPV_ENV_UNIVERSAL_1_5);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_misc_test.cpp b/third_party/SPIRV-Tools/test/val/val_misc_test.cpp
index b0e46bf..f645512 100644
--- a/third_party/SPIRV-Tools/test/val/val_misc_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_misc_test.cpp
@@ -84,7 +84,28 @@
HasSubstr("Cannot create undefined values with 8- or 16-bit types"));
}
-const std::string ShaderClockSpriv = R"(
+TEST_F(ValidateMisc, SizeOfValid) {
+ const std::string spirv = R"(
+ OpCapability Addresses
+ OpCapability Kernel
+ OpMemoryModel Physical64 OpenCL
+ OpEntryPoint Kernel %f "f"
+ %void = OpTypeVoid
+ %i32 = OpTypeInt 32 0
+ %ptr = OpTypePointer CrossWorkgroup %i32
+ %fnTy = OpTypeFunction %void
+ %f = OpFunction %void None %fnTy
+ %entry = OpLabel
+ %s = OpSizeOf %i32 %ptr
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_1);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1));
+}
+
+const std::string ShaderClockSpirv = R"(
OpCapability Shader
OpCapability Int64
OpCapability ShaderClockKHR
@@ -103,7 +124,7 @@
)";
TEST_F(ValidateMisc, ShaderClockInt64) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
@@ -123,7 +144,7 @@
}
TEST_F(ValidateMisc, ShaderClockVec2) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
%_ptr_Function_ulong = OpTypePointer Function %ulong
@@ -145,7 +166,7 @@
}
TEST_F(ValidateMisc, ShaderClockInvalidScopeValue) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
%uint = OpTypeInt 32 0
@@ -166,7 +187,7 @@
}
TEST_F(ValidateMisc, ShaderClockSubgroupScope) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
%uint = OpTypeInt 32 0
@@ -186,7 +207,7 @@
}
TEST_F(ValidateMisc, ShaderClockDeviceScope) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
%uint = OpTypeInt 32 0
@@ -206,7 +227,7 @@
}
TEST_F(ValidateMisc, ShaderClockWorkgroupScope) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
%uint = OpTypeInt 32 0
@@ -222,13 +243,13 @@
OpFunctionEnd)";
CompileSuccessfully(spirv);
- EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Scope must be Subgroup or Device"));
}
TEST_F(ValidateMisc, VulkanShaderClockWorkgroupScope) {
- const std::string spirv = ShaderClockSpriv + R"(
+ const std::string spirv = ShaderClockSpirv + R"(
%3 = OpTypeFunction %void
%ulong = OpTypeInt 64 0
%uint = OpTypeInt 32 0
@@ -251,6 +272,59 @@
HasSubstr("Scope must be Subgroup or Device"));
}
+std::string GenKernelClockSpirv(const std::string& scope) {
+ const std::string s = R"(
+OpCapability Kernel
+OpCapability Addresses
+OpCapability Int64
+OpCapability ShaderClockKHR
+OpExtension "SPV_KHR_shader_clock"
+OpMemoryModel Physical32 OpenCL
+OpEntryPoint Kernel %main "main"
+OpExecutionMode %main ContractionOff
+OpSource OpenCL_C 200000
+OpName %main "main"
+OpName %time1 "time1"
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%ulong = OpTypeInt 64 0
+%uint = OpTypeInt 32 0
+%_ptr_Function_ulong = OpTypePointer Function %ulong
+%scope = OpConstant %uint )" +
+ scope + R"(
+%main = OpFunction %void None %3
+%5 = OpLabel
+%time1 = OpVariable %_ptr_Function_ulong Function
+%11 = OpReadClockKHR %ulong %scope
+OpStore %time1 %11
+OpReturn
+OpFunctionEnd
+)";
+ return s;
+}
+
+TEST_F(ValidateMisc, KernelClockScopeDevice) {
+ CompileSuccessfully(GenKernelClockSpirv("1"), SPV_ENV_OPENCL_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_1_2));
+}
+
+TEST_F(ValidateMisc, KernelClockScopeWorkgroup) {
+ CompileSuccessfully(GenKernelClockSpirv("2"), SPV_ENV_OPENCL_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_1_2));
+}
+
+TEST_F(ValidateMisc, KernelClockScopeSubgroup) {
+ CompileSuccessfully(GenKernelClockSpirv("3"), SPV_ENV_OPENCL_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_OPENCL_1_2));
+}
+
+TEST_F(ValidateMisc, KernelClockScopeInvalid) {
+ CompileSuccessfully(GenKernelClockSpirv("0"), SPV_ENV_OPENCL_1_2);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_OPENCL_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Scope must be Subgroup, Workgroup, or Device"));
+}
+
TEST_F(ValidateMisc, UndefVoid) {
const std::string spirv = R"(
OpCapability Shader
@@ -297,6 +371,79 @@
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Invalid storage class for target environment"));
}
+
+TEST_F(ValidateMisc, CoopMat2WorkgroupLocalSizeIdPass) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int16
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
+OpExtension "SPV_KHR_cooperative_matrix"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical VulkanKHR
+OpEntryPoint GLCompute %main "main"
+OpExecutionModeId %main LocalSizeId %u32_16 %u32_16 %u32_16
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%u32 = OpTypeInt 32 0
+
+%u32_16 = OpConstant %u32 16
+%use_Acc = OpConstant %u32 2
+%workgroup = OpConstant %u32 2
+
+%f16mat = OpTypeCooperativeMatrixKHR %f16 %workgroup %u32_16 %u32_16 %use_Acc
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+}
+
+TEST_F(ValidateMisc, CoopMat2WorkgroupLocalSizeIdConstantNotDeclaredYetFail) {
+ const std::string body = R"(
+OpCapability Shader
+OpCapability Float16
+OpCapability Int16
+OpCapability CooperativeMatrixKHR
+OpCapability VulkanMemoryModelKHR
+OpExtension "SPV_KHR_cooperative_matrix"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical VulkanKHR
+OpEntryPoint GLCompute %main "main"
+OpExecutionModeId %main LocalSizeId %u32_16 %u32_8 %u32_16
+%void = OpTypeVoid
+%func = OpTypeFunction %void
+%bool = OpTypeBool
+%f16 = OpTypeFloat 16
+%u32 = OpTypeInt 32 0
+
+%u32_16 = OpConstant %u32 16
+%use_Acc = OpConstant %u32 2
+%workgroup = OpConstant %u32 2
+
+%f16mat = OpTypeCooperativeMatrixKHR %f16 %workgroup %u32_16 %u32_16 %use_Acc
+%u32_8 = OpConstant %u32 8
+
+%main = OpFunction %void None %func
+%main_entry = OpLabel
+
+OpReturn
+OpFunctionEnd)";
+
+ CompileSuccessfully(body.c_str(), SPV_ENV_UNIVERSAL_1_3);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_UNIVERSAL_1_3));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OpTypeCooperativeMatrixKHR with ScopeWorkgroup used "
+ "before LocalSizeId constant value"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_modes_test.cpp b/third_party/SPIRV-Tools/test/val/val_modes_test.cpp
index 83a0503..75a956c 100644
--- a/third_party/SPIRV-Tools/test/val/val_modes_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_modes_test.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2018 Google LLC.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -88,6 +90,99 @@
EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(env));
}
+TEST_F(ValidateMode, GLComputeZeroWorkgroupSize) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpDecorate %int3_1 BuiltIn WorkgroupSize
+%int = OpTypeInt 32 0
+%int3 = OpTypeVector %int 3
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%int3_1 = OpConstantComposite %int3 %int_1 %int_0 %int_0
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "WorkgroupSize decorations must not have a static product of zero"));
+}
+
+TEST_F(ValidateMode, GLComputeZeroSpecWorkgroupSize) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpDecorate %int3_1 BuiltIn WorkgroupSize
+%int = OpTypeInt 32 0
+%int3 = OpTypeVector %int 3
+%int_0 = OpSpecConstant %int 0
+%int_1 = OpConstant %int 1
+%int3_1 = OpConstantComposite %int3 %int_1 %int_0 %int_0
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateMode, GLComputeZeroSpecCompositeWorkgroupSize) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpDecorate %int3_1 BuiltIn WorkgroupSize
+%int = OpTypeInt 32 0
+%int3 = OpTypeVector %int 3
+%int_0 = OpSpecConstant %int 0
+%int_1 = OpSpecConstant %int 1
+%int3_1 = OpSpecConstantComposite %int3 %int_1 %int_0 %int_0
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
+TEST_F(ValidateMode, KernelZeroWorkgroupSizeConstant) {
+ const std::string spirv = R"(
+OpCapability Addresses
+OpCapability Linkage
+OpCapability Kernel
+OpMemoryModel Physical32 OpenCL
+OpEntryPoint Kernel %main "main"
+OpDecorate %int3_1 BuiltIn WorkgroupSize
+%int = OpTypeInt 32 0
+%int3 = OpTypeVector %int 3
+%int_0 = OpConstant %int 0
+%int_1 = OpConstant %int 1
+%int3_1 = OpConstantComposite %int3 %int_1 %int_0 %int_0
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions());
+ EXPECT_THAT(getDiagnosticString(), HasSubstr("must be a variable"));
+}
+
+TEST_F(ValidateMode, KernelZeroWorkgroupSizeVariable) {
+ const std::string spirv = R"(
+OpCapability Addresses
+OpCapability Linkage
+OpCapability Kernel
+OpMemoryModel Physical32 OpenCL
+OpEntryPoint Kernel %main "main"
+OpDecorate %var BuiltIn WorkgroupSize
+%int = OpTypeInt 32 0
+%int3 = OpTypeVector %int 3
+%ptr = OpTypePointer Input %int3
+%var = OpVariable %ptr Input
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
TEST_F(ValidateMode, GLComputeVulkanLocalSize) {
const std::string spirv = R"(
OpCapability Shader
@@ -101,6 +196,38 @@
EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(env));
}
+TEST_F(ValidateMode, GLComputeZeroLocalSize) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main LocalSize 1 1 0
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Local Size execution mode must not have a product of zero"));
+}
+
+TEST_F(ValidateMode, KernelZeroLocalSize) {
+ const std::string spirv = R"(
+OpCapability Addresses
+OpCapability Linkage
+OpCapability Kernel
+OpMemoryModel Physical32 OpenCL
+OpEntryPoint Kernel %main "main"
+OpExecutionMode %main LocalSize 1 1 0
+)" + kVoidFunction;
+
+ CompileSuccessfully(spirv);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Local Size execution mode must not have a product of zero"));
+}
+
TEST_F(ValidateMode, GLComputeVulkanLocalSizeIdBad) {
const std::string spirv = R"(
OpCapability Shader
@@ -135,6 +262,95 @@
EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(env));
}
+TEST_F(ValidateMode, GLComputeZeroLocalSizeId) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionModeId %main LocalSizeId %int_1 %int_0 %int_1
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_0 = OpConstant %int 0
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Local Size Id execution mode must not have a product of zero"));
+}
+
+TEST_F(ValidateMode, GLComputeZeroSpecLocalSizeId) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionModeId %main LocalSizeId %int_1 %int_0 %int_1
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_0 = OpSpecConstant %int 0
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(env));
+}
+
+TEST_F(ValidateMode, KernelZeroLocalSizeId) {
+ const std::string spirv = R"(
+OpCapability Addresses
+OpCapability Linkage
+OpCapability Kernel
+OpMemoryModel Physical32 OpenCL
+OpEntryPoint Kernel %main "main"
+OpExecutionModeId %main LocalSizeId %int_1 %int_0 %int_1
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+%int_0 = OpConstant %int 0
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Local Size Id execution mode must not have a product of zero"));
+}
+
+// https://github.com/KhronosGroup/SPIRV-Tools/issues/5939
+TEST_F(ValidateMode, KernelZeroLocalSize64) {
+ const std::string spirv = R"(
+ OpCapability Kernel
+ OpCapability Addresses
+ OpCapability Int64
+ OpCapability Linkage
+ OpMemoryModel Physical64 OpenCL
+ OpEntryPoint Kernel %test "test" %__spirv_BuiltInWorkgroupSize
+ OpExecutionMode %test ContractionOff
+ OpDecorate %__spirv_BuiltInWorkgroupSize Constant
+ OpDecorate %__spirv_BuiltInWorkgroupSize LinkageAttributes "__spirv_BuiltInWorkgroupSize" Import
+ OpDecorate %__spirv_BuiltInWorkgroupSize BuiltIn WorkgroupSize
+ %void = OpTypeVoid
+ %ulong = OpTypeInt 64 0
+ %v3ulong = OpTypeVector %ulong 3
+%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
+ %8 = OpTypeFunction %void
+%__spirv_BuiltInWorkgroupSize = OpVariable %_ptr_Input_v3ulong Input
+ %test = OpFunction %void None %8
+ %entry = OpLabel
+ %11 = OpLoad %v3ulong %__spirv_BuiltInWorkgroupSize Aligned 1
+ %12 = OpCompositeExtract %ulong %11 0
+ OpReturn
+ OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
+}
+
TEST_F(ValidateMode, FragmentOriginLowerLeftVulkan) {
const std::string spirv = R"(
OpCapability Shader
@@ -814,6 +1030,109 @@
EXPECT_THAT(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateModeExecution, MeshEXTOutputVertices) {
+ const std::string spirv = R"(
+OpCapability MeshShadingEXT
+OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint MeshEXT %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpExecutionMode %main OutputVertices 3
+OpExecutionMode %main OutputPrimitivesNV 1
+OpExecutionMode %main OutputTrianglesNV
+OpSource GLSL 460
+OpSourceExtension "GL_EXT_mesh_shader"
+OpName %main "main"
+OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpSetMeshOutputsEXT %uint_3 %uint_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4);
+ EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateModeExecution, VulkanBadMeshEXTOutputVertices) {
+ const std::string spirv = R"(
+OpCapability MeshShadingEXT
+OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint MeshEXT %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpExecutionMode %main OutputVertices 0
+OpExecutionMode %main OutputPrimitivesNV 1
+OpExecutionMode %main OutputTrianglesNV
+OpSource GLSL 460
+OpSourceExtension "GL_EXT_mesh_shader"
+OpName %main "main"
+OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpSetMeshOutputsEXT %uint_3 %uint_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_2);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-MeshEXT-07330"));
+}
+
+TEST_F(ValidateModeExecution, VulkanBadMeshEXTOutputOutputPrimitivesEXT) {
+ const std::string spirv = R"(
+OpCapability MeshShadingEXT
+OpExtension "SPV_EXT_mesh_shader"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint MeshEXT %main "main"
+OpExecutionMode %main LocalSize 1 1 1
+OpExecutionMode %main OutputVertices 1
+OpExecutionMode %main OutputPrimitivesNV 0
+OpExecutionMode %main OutputTrianglesNV
+OpSource GLSL 460
+OpSourceExtension "GL_EXT_mesh_shader"
+OpName %main "main"
+OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
+%void = OpTypeVoid
+%3 = OpTypeFunction %void
+%uint = OpTypeInt 32 0
+%uint_3 = OpConstant %uint 3
+%uint_1 = OpConstant %uint 1
+%v3uint = OpTypeVector %uint 3
+%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%main = OpFunction %void None %3
+%5 = OpLabel
+OpSetMeshOutputsEXT %uint_3 %uint_1
+OpReturn
+OpFunctionEnd
+)";
+
+ CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_2);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-MeshEXT-07331"));
+}
+
TEST_F(ValidateModeExecution, MeshNVOutputVertices) {
const std::string spirv = R"(
OpCapability Shader
@@ -1282,7 +1601,6 @@
EXPECT_THAT(SPV_SUCCESS, ValidateInstructions());
}
-
TEST_F(ValidateMode, FragmentShaderStencilRefFrontTooManyModesBad) {
const std::string spirv = R"(
OpCapability Shader
@@ -2208,6 +2526,397 @@
"Execution mode can only be used with the Fragment execution model"));
}
+const std::string kNodeShaderPrelude = R"(
+OpCapability Shader
+OpCapability ShaderEnqueueAMDX
+OpExtension "SPV_AMDX_shader_enqueue"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpEntryPoint GLCompute %other "other"
+)";
+
+const std::string kNodeShaderPostlude = R"(
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%node0 = OpConstantStringAMDX "node0"
+%node1 = OpConstantStringAMDX "node1"
+%node2 = OpConstantStringAMDX "node2"
+%S = OpTypeStruct
+%_payloadarr_S_0 = OpTypeNodePayloadArrayAMDX %S
+%_payloadarr_S = OpTypeNodePayloadArrayAMDX %S
+%bool = OpTypeBool
+%true = OpConstantTrue %bool
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+%other = OpFunction %void None %void_fn
+%entry0 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+TEST_F(ValidateMode, NodeShader) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_SUCCESS, ValidateInstructions(env));
+}
+
+TEST_F(ValidateMode, NodeShaderModeShaderIndex) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionMode %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionMode %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpExecutionMode is only valid when the Mode operand is an "
+ "execution mode that takes no Extra Operands, or takes Extra "
+ "Operands that are not id operands"));
+}
+
+TEST_F(ValidateMode, NodeShaderModeIsApiEntry) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionMode %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpExecutionMode is only valid when the Mode operand is an "
+ "execution mode that takes no Extra Operands, or takes Extra "
+ "Operands that are not id operands"));
+}
+
+TEST_F(ValidateMode, NodeShaderModeMaxNodeRecursion) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionMode %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpExecutionMode is only valid when the Mode operand is an "
+ "execution mode that takes no Extra Operands, or takes Extra "
+ "Operands that are not id operands"));
+}
+
+TEST_F(ValidateMode, NodeShaderModeMaxNumWorkgroups) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionMode %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpExecutionMode is only valid when the Mode operand is an "
+ "execution mode that takes no Extra Operands, or takes Extra "
+ "Operands that are not id operands"));
+}
+
+TEST_F(ValidateMode, NodeShaderModeStaticNumWorkgroups) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionModeId %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionMode %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpExecutionMode is only valid when the Mode operand is an "
+ "execution mode that takes no Extra Operands, or takes Extra "
+ "Operands that are not id operands"));
+}
+
+TEST_F(ValidateMode, NodeShaderModeSharesInputWith) {
+ const std::string spirv = kNodeShaderPrelude + R"(
+OpExecutionModeId %main ShaderIndexAMDX %uint_0
+OpExecutionModeId %main IsApiEntryAMDX %true
+OpExecutionModeId %main MaxNodeRecursionAMDX %uint_1
+OpExecutionModeId %main MaxNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpExecutionMode %main SharesInputWithAMDX %node0 %uint_0
+OpExecutionModeId %other ShaderIndexAMDX %uint_0
+OpExecutionModeId %other StaticNumWorkgroupsAMDX %uint_1 %uint_1 %uint_1
+OpDecorateId %_payloadarr_S PayloadNodeNameAMDX %node1
+OpDecorateId %_payloadarr_S_0 PayloadNodeNameAMDX %node2
+OpDecorateId %_payloadarr_S PayloadNodeBaseIndexAMDX %uint_0
+OpDecorateId %_payloadarr_S PayloadNodeArraySizeAMDX %uint_1
+OpDecorateId %_payloadarr_S NodeSharesPayloadLimitsWithAMDX %_payloadarr_S_0
+)" + kNodeShaderPostlude;
+
+ spv_target_env env = SPV_ENV_UNIVERSAL_1_3;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("OpExecutionMode is only valid when the Mode operand is an "
+ "execution mode that takes no Extra Operands, or takes Extra "
+ "Operands that are not id operands"));
+}
+
+TEST_F(ValidateMode, GLComputeNoModeVulkanQCOM) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main NonCoherentTileAttachmentReadQCOM
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-None-10685"));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("In the Vulkan environment, GLCompute execution model entry "
+ "points require either the TileShadingRateQCOM, LocalSize or "
+ "LocalSizeId execution mode or an object decorated with "
+ "WorkgroupSize "
+ "must be specified."));
+}
+
+TEST_F(ValidateMode, GLComputeVulkanLocalSizeBadQCOM) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main TileShadingRateQCOM 2 2 3
+OpExecutionMode %main LocalSize 16 16 1
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("If the TileShadingRateQCOM execution mode is used, "
+ "LocalSize and LocalSizeId must not be specified."));
+}
+
+TEST_F(ValidateMode, GLComputeVulkanLocalSizeIdBadQCOM) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main TileShadingRateQCOM 2 2 3
+OpExecutionModeId %main LocalSizeId %int_1 %int_1 %int_1
+%int = OpTypeInt 32 0
+%int_1 = OpConstant %int 1
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("If the TileShadingRateQCOM execution mode is used, "
+ "LocalSize and LocalSizeId must not be specified."));
+}
+
+TEST_F(ValidateMode, NonCoherentTileAttachmentReadQCOMBad1) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main NonCoherentTileAttachmentReadQCOM
+OpExecutionMode %main OriginUpperLeft
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("requires one of these capabilities: TileShadingQCOM"));
+}
+
+TEST_F(ValidateMode, NonCoherentTileAttachmentReadQCOMBad2) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
+OpExecutionMode %main LocalSize 16 16 1
+OpExecutionMode %main NonCoherentTileAttachmentReadQCOM
+OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
+%uint = OpTypeInt 32 0
+%v3uint = OpTypeVector %uint 3
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The NonCoherentTileAttachmentQCOM execution mode must "
+ "not be used in any stage other than fragment"));
+}
+
+TEST_F(ValidateMode, TileShadingRateQCOMBad1) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
+OpExecutionMode %main TileShadingRateQCOM 2 2 3
+OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
+%uint = OpTypeInt 32 0
+%v3uint = OpTypeVector %uint 3
+%_ptr_Input_v3uint = OpTypePointer Input %v3uint
+%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("requires one of these capabilities: TileShadingQCOM"));
+}
+
+TEST_F(ValidateMode, TileShadingRateQCOMBad2) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %main "main"
+OpExecutionMode %main TileShadingRateQCOM 2 2 3
+OpExecutionMode %main OriginUpperLeft
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The TileShadingRateQCOM execution mode must not be "
+ "used in any stage other than compute"));
+}
+
+TEST_F(ValidateMode, TileShadingRateQCOMBad3) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main TileShadingRateQCOM 3 2 3
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The TileShadingRateQCOM execution mode's x and y "
+ "values must be powers of 2"));
+}
+
+TEST_F(ValidateMode, TileShadingRateQCOMBad4) {
+ const std::string spirv = R"(
+OpCapability Shader
+OpCapability TileShadingQCOM
+OpExtension "SPV_QCOM_tile_shading"
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main"
+OpExecutionMode %main TileShadingRateQCOM 2 3 3
+)" + kVoidFunction;
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("The TileShadingRateQCOM execution mode's x and y "
+ "values must be powers of 2"));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_opencl_test.cpp b/third_party/SPIRV-Tools/test/val/val_opencl_test.cpp
index 9dab931..2f7526e 100644
--- a/third_party/SPIRV-Tools/test/val/val_opencl_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_opencl_test.cpp
@@ -43,23 +43,6 @@
"OpenCL\n"));
}
-TEST_F(ValidateOpenCL, NonOpenCLMemoryModelBad) {
- std::string spirv = R"(
- OpCapability Kernel
- OpCapability Addresses
- OpCapability VulkanMemoryModelKHR
- OpExtension "SPV_KHR_vulkan_memory_model"
- OpMemoryModel Physical32 VulkanKHR
-)";
-
- CompileSuccessfully(spirv);
-
- EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_OPENCL_1_2));
- EXPECT_THAT(
- getDiagnosticString(),
- HasSubstr("Memory model must be OpenCL in the OpenCL environment."));
-}
-
TEST_F(ValidateOpenCL, NonVoidSampledTypeImageBad) {
std::string spirv = R"(
OpCapability Addresses
diff --git a/third_party/SPIRV-Tools/test/val/val_ray_query_test.cpp b/third_party/SPIRV-Tools/test/val/val_ray_query_test.cpp
index e0eb067..ed6cce7 100644
--- a/third_party/SPIRV-Tools/test/val/val_ray_query_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_ray_query_test.cpp
@@ -30,20 +30,23 @@
using ValidateRayQuery = spvtest::ValidateBase<bool>;
-std::string GenerateShaderCode(
- const std::string& body,
- const std::string& capabilities_and_extensions = "",
- const std::string& declarations = "") {
+std::string GenerateShaderCode(const std::string& body,
+ const std::string& capabilities = "",
+ const std::string& extensions = "",
+ const std::string& declarations = "") {
std::ostringstream ss;
ss << R"(
OpCapability Shader
OpCapability Int64
OpCapability Float64
OpCapability RayQueryKHR
+ )";
+ ss << capabilities;
+ ss << R"(
OpExtension "SPV_KHR_ray_query"
)";
- ss << capabilities_and_extensions;
+ ss << extensions;
ss << R"(
OpMemoryModel Logical GLSL450
@@ -83,12 +86,15 @@
%u32_0 = OpConstant %u32 0
%u64_0 = OpConstant %u64 0
+%u32_2 = OpConstant %u32 2
+%arr2v3 = OpTypeArray %f32vec3 %u32_2
+%arr2f3 = OpTypeArray %f32 %u32_2
+
%u32vec3_0 = OpConstantComposite %u32vec3 %u32_0 %u32_0 %u32_0
%f32vec3_0 = OpConstantComposite %f32vec3 %f32_0 %f32_0 %f32_0
%f32vec4_0 = OpConstantComposite %f32vec4 %f32_0 %f32_0 %f32_0 %f32_0
-%ptr_rq = OpTypePointer Private %type_rq
-%ray_query = OpVariable %ptr_rq Private
+%ptr_rq = OpTypePointer Function %type_rq
%ptr_as = OpTypePointer UniformConstant %type_as
%top_level_as = OpVariable %ptr_as UniformConstant
@@ -103,6 +109,7 @@
ss << R"(
%main = OpFunction %void None %func
%main_entry = OpLabel
+%ray_query = OpVariable %ptr_rq Function
)";
ss << body;
@@ -398,7 +405,7 @@
OpRayQueryInitializeKHR %rq_param %as_2 %u32_0 %u32_0 %f32vec3_0 %f32_0 %f32vec3_0 %f32_0
)";
- CompileSuccessfully(GenerateShaderCode(body, "", declaration).c_str());
+ CompileSuccessfully(GenerateShaderCode(body, "", "", declaration).c_str());
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
@@ -626,6 +633,78 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions());
}
+TEST_F(ValidateRayQuery, ClusterASNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingClusterAccelerationStructureNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_cluster_acceleration_structure"
+ )";
+
+ const std::string body = R"(
+ %clusterid = OpRayQueryGetClusterIdNV %s32 %ray_query %s32_0
+)";
+
+ CompileSuccessfully(GenerateShaderCode(body, cap, ext).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+using RayQueryLSSNVCommon = spvtest::ValidateBase<std::string>;
+
+std::string RayQueryLSSNVResultType(std::string opcode, bool valid) {
+ if (opcode.compare("OpRayQueryGetIntersectionLSSPositionsNV") == 0)
+ return valid ? "%arr2v3" : "%f64";
+
+ if (opcode.compare("OpRayQueryGetIntersectionLSSRadiiNV") == 0)
+ return valid ? "%arr2f3" : "%f64";
+
+ if (opcode.compare("OpRayQueryGetIntersectionSphereRadiusNV") == 0 ||
+ opcode.compare("OpRayQueryGetIntersectionLSSHitValueNV") == 0) {
+ return valid ? "%f32" : "%f64";
+ }
+
+ if (opcode.compare("OpRayQueryGetIntersectionSpherePositionNV") == 0) {
+ return valid ? "%f32vec3" : "%f64";
+ }
+
+ if (opcode.compare("OpRayQueryIsSphereHitNV") == 0 ||
+ opcode.compare("OpRayQueryIsLSSHitNV") == 0) {
+ return valid ? "%bool" : "%f64";
+ }
+
+ return "";
+}
+
+TEST_P(RayQueryLSSNVCommon, Success) {
+ const std::string cap = R"(
+ OpCapability RayTracingSpheresGeometryNV
+ OpCapability RayTracingLinearSweptSpheresGeometryNV
+ )";
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+ std::string opcode = GetParam();
+ std::ostringstream ss;
+ ss << "%result = ";
+ ss << " " << opcode << " ";
+ ss << RayQueryLSSNVResultType(opcode, true);
+ ss << " %ray_query ";
+ ss << " %s32_0 ";
+ CompileSuccessfully(GenerateShaderCode(ss.str(), cap, ext).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+INSTANTIATE_TEST_SUITE_P(ValidateRayQueryLSSNVCommon, RayQueryLSSNVCommon,
+ Values("OpRayQueryGetIntersectionSpherePositionNV",
+ "OpRayQueryGetIntersectionLSSPositionsNV",
+ "OpRayQueryGetIntersectionSphereRadiusNV",
+ "OpRayQueryGetIntersectionLSSRadiiNV",
+ "OpRayQueryGetIntersectionLSSHitValueNV",
+ "OpRayQueryIsSphereHitNV",
+ "OpRayQueryIsLSSHitNV"));
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_ray_tracing_reorder_test.cpp b/third_party/SPIRV-Tools/test/val/val_ray_tracing_reorder_test.cpp
index 6038c38..a41af80 100644
--- a/third_party/SPIRV-Tools/test/val/val_ray_tracing_reorder_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_ray_tracing_reorder_test.cpp
@@ -30,13 +30,21 @@
using ValidateRayTracingReorderNV = spvtest::ValidateBase<bool>;
std::string GenerateReorderThreadCode(const std::string& body = "",
- const std::string& declarations = "") {
+ const std::string& declarations = "",
+ const std::string& extensions = "",
+ const std::string& capabilities = "") {
std::ostringstream ss;
ss << R"(
OpCapability RayTracingKHR
OpCapability ShaderInvocationReorderNV
+ )";
+ ss << capabilities;
+ ss << R"(
OpExtension "SPV_KHR_ray_tracing"
OpExtension "SPV_NV_shader_invocation_reorder"
+ )";
+ ss << extensions;
+ ss << R"(
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint RayGenerationNV %main "main" %hObj
@@ -593,6 +601,196 @@
EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
}
+TEST_F(ValidateRayTracingReorderNV, ClusterASNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingClusterAccelerationStructureNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_cluster_acceleration_structure"
+ )";
+
+ const std::string declarations = R"(
+ %int = OpTypeInt 32 1
+ %_ptr_Function_int = OpTypePointer Function %int
+ )";
+
+ const std::string body = R"(
+ %id = OpVariable %_ptr_Function_int Function
+ %12 = OpHitObjectGetClusterIdNV %int %hObj
+ OpStore %id %12
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateRayTracingReorderNV, LSSGetSpherePositionNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingSpheresGeometryNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+
+ const std::string declarations = R"(
+ %float = OpTypeFloat 32
+ %v3float = OpTypeVector %float 3
+ %_ptr_Function_v3float = OpTypePointer Function %v3float
+ )";
+
+ const std::string body = R"(
+ %pos = OpVariable %_ptr_Function_v3float Function
+ %result = OpHitObjectGetSpherePositionNV %v3float %hObj
+ OpStore %pos %result
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateRayTracingReorderNV, LSSGetLSSPositionsNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingSpheresGeometryNV
+ OpCapability RayTracingLinearSweptSpheresGeometryNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+
+ const std::string declarations = R"(
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %v3float = OpTypeVector %float 3
+ %uint_2 = OpConstant %uint 2
+ %arr = OpTypeArray %v3float %uint_2
+ %_ptr_Function_v3float = OpTypePointer Function %arr
+ )";
+
+ const std::string body = R"(
+ %lsspos = OpVariable %_ptr_Function_v3float Function
+ %result = OpHitObjectGetLSSPositionsNV %arr %hObj
+ OpStore %lsspos %result
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateRayTracingReorderNV, LSSGetSphereRadiusNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingSpheresGeometryNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+
+ const std::string declarations = R"(
+ %float = OpTypeFloat 32
+ %_ptr_Function_float = OpTypePointer Function %float
+ )";
+
+ const std::string body = R"(
+ %rad = OpVariable %_ptr_Function_float Function
+ %result = OpHitObjectGetSphereRadiusNV %float %hObj
+ OpStore %rad %result
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateRayTracingReorderNV, LSSGetLSSRadiiNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingLinearSweptSpheresGeometryNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+
+ const std::string declarations = R"(
+ %float = OpTypeFloat 32
+ %uint = OpTypeInt 32 0
+ %uint_2 = OpConstant %uint 2
+ %arr = OpTypeArray %float %uint_2
+ %_ptr_Function_float = OpTypePointer Function %arr
+ )";
+
+ const std::string body = R"(
+ %rad = OpVariable %_ptr_Function_float Function
+ %result = OpHitObjectGetLSSRadiiNV %arr %hObj
+ OpStore %rad %result
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateRayTracingReorderNV, LSSIsSphereHitNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingSpheresGeometryNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+
+ const std::string declarations = R"(
+ %bool = OpTypeBool
+ %_ptr_Function_bool = OpTypePointer Function %bool
+ )";
+
+ const std::string body = R"(
+ %ishit = OpVariable %_ptr_Function_bool Function
+ %result = OpHitObjectIsSphereHitNV %bool %hObj
+ OpStore %ishit %result
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
+
+TEST_F(ValidateRayTracingReorderNV, LSSIsLSSHitNV) {
+ const std::string cap = R"(
+ OpCapability RayTracingLinearSweptSpheresGeometryNV
+ )";
+
+ const std::string ext = R"(
+ OpExtension "SPV_NV_linear_swept_spheres"
+ )";
+
+ const std::string declarations = R"(
+ %bool = OpTypeBool
+ %_ptr_Function_bool = OpTypePointer Function %bool
+ )";
+
+ const std::string body = R"(
+ %ishit = OpVariable %_ptr_Function_bool Function
+ %result = OpHitObjectIsLSSHitNV %bool %hObj
+ OpStore %ishit %result
+ )";
+
+ CompileSuccessfully(
+ GenerateReorderThreadCode(body, declarations, ext, cap).c_str(),
+ SPV_ENV_VULKAN_1_2);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_2));
+}
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_storage_test.cpp b/third_party/SPIRV-Tools/test/val/val_storage_test.cpp
index 6a3e4bd..b583fe3 100644
--- a/third_party/SPIRV-Tools/test/val/val_storage_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_storage_test.cpp
@@ -165,7 +165,7 @@
CompileSuccessfully(str);
ASSERT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("OpVariable storage class cannot be Generic"));
+ HasSubstr("Variable storage class cannot be Generic"));
}
TEST_F(ValidateStorage, GenericVariableInsideFunction) {
@@ -187,7 +187,7 @@
CompileSuccessfully(str);
EXPECT_EQ(SPV_ERROR_INVALID_BINARY, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
- HasSubstr("OpVariable storage class cannot be Generic"));
+ HasSubstr("Variable storage class cannot be Generic"));
}
TEST_F(ValidateStorage, RelaxedLogicalPointerFunctionParam) {
@@ -249,6 +249,194 @@
HasSubstr("OpFunctionCall Argument <id> '"));
}
+TEST_F(ValidateStorage, TileAttachmentQCOMBad1) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability TileShadingQCOM
+ OpExtension "SPV_QCOM_tile_shading"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpDecorate %color1 Binding 2
+ OpDecorate %color1 DescriptorSet 0
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ %44 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_TileAttachmentQCOM_44 = OpTypePointer TileAttachmentQCOM %44
+ %color1 = OpVariable %_ptr_TileAttachmentQCOM_44 TileAttachmentQCOM
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Any OpTypeImage variable in the TileAttachmentQCOM "
+ "Storage Class must have 2D as its dimension"));
+}
+
+TEST_F(ValidateStorage, TileAttachmentQCOMBad2) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpCapability TileShadingQCOM
+ OpExtension "SPV_QCOM_tile_shading"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpDecorate %color1 Binding 2
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ %44 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_TileAttachmentQCOM_44 = OpTypePointer TileAttachmentQCOM %44
+ %color1 = OpVariable %_ptr_TileAttachmentQCOM_44 TileAttachmentQCOM
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Any variable in the TileAttachmentQCOM Storage Class "
+ "must be decorated with DescriptorSet and Binding"));
+}
+
+TEST_F(ValidateStorage, TileAttachmentQCOMBad3) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpCapability TileShadingQCOM
+ OpExtension "SPV_QCOM_tile_shading"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpDecorate %color1 DescriptorSet 0
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ %44 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_TileAttachmentQCOM_44 = OpTypePointer TileAttachmentQCOM %44
+ %color1 = OpVariable %_ptr_TileAttachmentQCOM_44 TileAttachmentQCOM
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_ID, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Any variable in the TileAttachmentQCOM Storage Class "
+ "must be decorated with DescriptorSet and Binding"));
+}
+
+TEST_F(ValidateStorage, TileAttachmentQCOMBad4) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpCapability TileShadingQCOM
+ OpExtension "SPV_QCOM_tile_shading"
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpSource GLSL 450
+ OpDecorate %color1 Binding 2
+ OpDecorate %color1 DescriptorSet 0
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ %44 = OpTypeImage %int 2D 0 0 0 0 Rgba32i
+%_ptr_TileAttachmentQCOM_44 = OpTypePointer TileAttachmentQCOM %44
+ %color1 = OpVariable %_ptr_TileAttachmentQCOM_44 TileAttachmentQCOM
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ AnyVUID("VUID-StandaloneSpirv-OpTypeImage-04657"));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Sampled must be 1 or 2 in the Vulkan environment"));
+}
+
+TEST_F(ValidateStorage, TileAttachmentQCOMBad5) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpCapability TileShadingQCOM
+ OpExtension "SPV_QCOM_tile_shading"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpDecorate %color1 Binding 2
+ OpDecorate %color1 DescriptorSet 0
+ %void = OpTypeVoid
+ %3 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_2 = OpConstant %int 2
+ %44 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_TileAttachmentQCOM_44 = OpTypePointer TileAttachmentQCOM %44
+ %color1 = OpVariable %_ptr_TileAttachmentQCOM_44 TileAttachmentQCOM
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ %154 = OpLoad %44 %color1
+ %156 = OpImageQuerySizeLod %v2int %154 %int_2
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_DATA, ValidateInstructions(env));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Any variable in the TileAttachmentQCOM Storage Class "
+ "must not be consumed by an OpImageQuery* instruction"));
+}
+
+TEST_F(ValidateStorage, TileAttachmentQCOMBad6) {
+ const std::string spirv = R"(
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %main "main"
+ OpExecutionMode %main OriginUpperLeft
+ OpDecorate %color1 Binding 2
+ OpDecorate %color1 DescriptorSet 0
+ %void = OpTypeVoid
+ %int = OpTypeInt 32 1
+ %44 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_TileAttachmentQCOM_44 = OpTypePointer TileAttachmentQCOM %44
+ %color1 = OpVariable %_ptr_TileAttachmentQCOM_44 TileAttachmentQCOM
+ %3 = OpTypeFunction %void
+ %main = OpFunction %void None %3
+ %5 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ )";
+
+ spv_target_env env = SPV_ENV_VULKAN_1_4;
+ CompileSuccessfully(spirv, env);
+ EXPECT_THAT(SPV_ERROR_INVALID_CAPABILITY, ValidateInstructions(env));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("requires one of these capabilities: TileShadingQCOM"));
+}
+
std::string GenerateExecutionModelCode(const std::string& execution_model,
const std::string& storage_class,
bool store) {
@@ -265,7 +453,8 @@
OpMemoryModel Logical GLSL450
OpEntryPoint )"
<< execution_model << R"( %func "func" %var
- )" << mode << R"(
+ )"
+ << mode << R"(
OpDecorate %var Location 0
%intt = OpTypeInt 32 0
%int0 = OpConstant %intt 0
@@ -273,10 +462,12 @@
%vfunct = OpTypeFunction %voidt
%ptr = OpTypePointer )"
<< storage_class << R"( %intt
-%var = OpVariable %ptr )" << storage_class << R"(
+%var = OpVariable %ptr )"
+ << storage_class << R"(
%func = OpFunction %voidt None %vfunct
%funcl = OpLabel
- )" << operation << R"(
+ )"
+ << operation << R"(
OpReturn
OpFunctionEnd
)";
diff --git a/third_party/SPIRV-Tools/test/val/val_tensor_test.cpp b/third_party/SPIRV-Tools/test/val/val_tensor_test.cpp
new file mode 100644
index 0000000..19eec4e
--- /dev/null
+++ b/third_party/SPIRV-Tools/test/val/val_tensor_test.cpp
@@ -0,0 +1,1205 @@
+// Copyright (c) 2023-2025 Arm Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "gmock/gmock.h"
+#include "test/unit_spirv.h"
+#include "test/val/val_fixtures.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+using ::testing::ContainsRegex;
+using ::testing::HasSubstr;
+
+using ValidateTensor = spvtest::ValidateBase<std::string>;
+
+constexpr spv_target_env SPVENV = SPV_ENV_VULKAN_1_3;
+
+std::string GenerateModule(const std::string& body) {
+ const std::string header = R"(
+ OpCapability Shader
+ OpCapability VulkanMemoryModel
+ OpCapability Int8
+ OpCapability TensorsARM
+ OpExtension "SPV_ARM_tensors"
+ OpMemoryModel Logical Vulkan
+ OpEntryPoint GLCompute %fnep "main"
+ OpExecutionMode %fnep LocalSize 1 1 1
+ OpDecorate %tensor_var DescriptorSet 0
+ OpDecorate %tensor_var Binding 0
+ OpDecorate %tensor_var_float_unranked DescriptorSet 0
+ OpDecorate %tensor_var_float_unranked Binding 1
+ %void = OpTypeVoid
+ %uint = OpTypeInt 32 0
+ %float = OpTypeFloat 32
+ %fnty = OpTypeFunction %void
+ %uint_vec4 = OpTypeVector %uint 4
+ %uint_0 = OpConstant %uint 0
+ %uint_0_spec = OpSpecConstant %uint 0
+ %uint_1 = OpConstant %uint 1
+ %uint_2 = OpConstant %uint 2
+ %uint_3 = OpConstant %uint 3
+ %uint_4 = OpConstant %uint 4
+ %uint_42 = OpConstant %uint 42
+ %uint_1_bis = OpConstant %uint 1
+ %float_1 = OpConstant %float 1
+%uint_vec4_1_1_1_1 = OpConstantComposite %uint_vec4 %uint_1 %uint_1 %uint_1 %uint_1
+ %uint_arr1 = OpTypeArray %uint %uint_1
+ %uint_arr2 = OpTypeArray %uint %uint_2
+ %uint_arr3 = OpTypeArray %uint %uint_3
+ %uint_arr4 = OpTypeArray %uint %uint_4
+ %float_arr4 = OpTypeArray %float %uint_4
+%uint_arr4_1_1_1_1 = OpConstantComposite %uint_arr4 %uint_1 %uint_1 %uint_1 %uint_1
+%uint_arr4_0_0_0_0_spec = OpSpecConstantComposite %uint_arr4 %uint_0_spec %uint_0_spec %uint_0_spec %uint_0_spec
+ %uint_arr2_1_1 = OpConstantComposite %uint_arr2 %uint_1 %uint_1
+%float_arr4_1_1_1_1 = OpConstantComposite %float_arr4 %float_1 %float_1 %float_1 %float_1
+%uint_arr4_1_1_0_1 = OpConstantComposite %uint_arr4 %uint_1 %uint_1 %uint_0 %uint_1
+ %uint_ptr_Private = OpTypePointer Private %uint
+%uint_arr4_ptr_Private = OpTypePointer Private %uint_arr4
+ %uint_var_1 = OpVariable %uint_ptr_Private Private %uint_1
+%var_uint_arr4_1_1_1_1 = OpVariable %uint_arr4_ptr_Private Private %uint_arr4_1_1_1_1
+ %tensor_uint_4 = OpTypeTensorARM %uint %uint_4
+ %tensor_uint_spec = OpTypeTensorARM %uint %uint_0_spec
+ %tensor_float = OpTypeTensorARM %float
+%tensor_uint_4_ptr_UniformConstant = OpTypePointer UniformConstant %tensor_uint_4
+%tensor_var = OpVariable %tensor_uint_4_ptr_UniformConstant UniformConstant
+%tensor_float_ptr_UniformConstant = OpTypePointer UniformConstant %tensor_float
+%tensor_var_float_unranked = OpVariable %tensor_float_ptr_UniformConstant UniformConstant
+%tensor_uint_spec_ptr_UniformConstant = OpTypePointer UniformConstant %tensor_uint_spec
+%tensor_var_spec_rank = OpVariable %tensor_uint_spec_ptr_UniformConstant UniformConstant
+)";
+ const std::string footer = R"(
+ %fnep = OpFunction %void None %fnty
+ %label = OpLabel
+ OpReturn
+ OpFunctionEnd
+)";
+ return header + body + footer;
+}
+
+//
+// Type tests
+//
+
+TEST_F(ValidateTensor, ValidTypeElementTypeOnly) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTypeTensorElementTypeNotScalar) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %void
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpTypeTensorARM Element Type <id> "
+ "'.*' is not a scalar type.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTypeDuplicateElementTypeTensorType) {
+ const std::string src = R"(
+ %typeA = OpTypeTensorARM %uint
+ %typeB = OpTypeTensorARM %uint
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Duplicate non-aggregate type declarations are not allowed."));
+}
+
+TEST_F(ValidateTensor, ValidTypeElementTypeAndRank) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTypeElementTypeAndRankUsingSpecConstant) {
+ const std::string src = R"(
+ %rank_spec = OpSpecConstant %uint 0
+ %test_type = OpTypeTensorARM %uint %rank_spec
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTypeDuplicateRankedTensorType) {
+ const std::string src = R"(
+ %typeA = OpTypeTensorARM %uint %uint_1
+ %typeB = OpTypeTensorARM %uint %uint_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Duplicate non-aggregate type declarations are not allowed."));
+}
+
+TEST_F(ValidateTensor, ValidTypeEquivalentRankedTensorType) {
+ const std::string src = R"(
+ %typeA = OpTypeTensorARM %uint %uint_1
+ %typeB = OpTypeTensorARM %uint %uint_1_bis
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTypeRankNotConstant) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_var_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpTypeTensorARM Rank <id> '.*' "
+ "is not a constant instruction.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTypeRankConstantButNotIntegerType) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %float_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpTypeTensorARM Rank <id> '.*' "
+ "does not have a scalar integer type.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTypeRankConstantIntegerTypeButNotScalar) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_vec4_1_1_1_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpTypeTensorARM Rank <id> '.*' "
+ "does not have a scalar integer type.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTypeRank0) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_0
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpTypeTensorARM Rank <id> '.*' must "
+ "define a value greater than 0.*"));
+}
+
+TEST_F(ValidateTensor, ValidTypeElementTypeAndRankAndShape) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_4 %uint_arr4_1_1_1_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTypeElementTypeAndRankAndShapeUsingSpecConstant) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_0_spec %uint_arr4_0_0_0_0_spec
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTypeShapeNotConstant) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_4 %var_uint_arr4_1_1_1_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpTypeTensorARM Shape <id> '.*' is not "
+ "a constant instruction.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTypeShapeConstantButNotArrayOfInteger) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_4 %uint_vec4_1_1_1_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex(
+ "OpTypeTensorARM Shape <id> '.*' is not "
+ "an array of integer type whose Length is equal to Rank.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTypeShapeConstantArrayOfIntegerWrongLength) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_1 %uint_arr4_1_1_1_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex(
+ "OpTypeTensorARM Shape <id> '.*' is not "
+ "an array of integer type whose Length is equal to Rank.*"));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTypeShapeConstantArrayOfIntegerWithZeroConstituent) {
+ const std::string src = R"(
+ %test_type = OpTypeTensorARM %uint %uint_4 %uint_arr4_1_1_0_1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ ContainsRegex(
+ "OpTypeTensorARM Shape constituent 2 is not greater than 0.*"));
+}
+
+//
+// Constants tests
+//
+TEST_F(ValidateTensor, ValidNullTensorConstantRank1) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpConstantComposite %uint_arr1 %uint_4
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_4
+ %cst = OpConstantNull %ts_uint_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidNullTensorConstantRank4) {
+ const std::string src = R"(
+%uint_arr4_2_2_2_2 = OpConstantComposite %uint_arr4 %uint_2 %uint_2 %uint_2 %uint_2
+ %ts_uint_r4 = OpTypeTensorARM %uint %uint_4 %uint_arr4_2_2_2_2
+ %cst = OpConstantNull %ts_uint_r4
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidNullTensorConstantRankedButNotShaped) {
+ const std::string src = R"(
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1
+ %cst = OpConstantNull %ts_uint_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpConstantNull Result Type <id> '.*' "
+ "cannot have a null value.*"));
+}
+
+TEST_F(ValidateTensor, InvalidNullTensorConstantNotRanked) {
+ const std::string src = R"(
+ %ts_uint_r1 = OpTypeTensorARM %uint
+ %cst = OpConstantNull %ts_uint_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpConstantNull Result Type <id> '.*' "
+ "cannot have a null value.*"));
+}
+
+TEST_F(ValidateTensor, ValidTensorConstantRank1) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpConstantComposite %uint_arr1 %uint_4
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_4
+ %cst = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42 %uint_42 %uint_42
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorConstantRank1SpecConstant) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpSpecConstantComposite %uint_arr1 %uint_0_spec
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_0_spec %uint_arr1_4
+ %cst = OpSpecConstantComposite %ts_uint_r1 %uint_0_spec %uint_0_spec %uint_0_spec %uint_0_spec
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTensorConstantRank1NotEnoughConstituents) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpConstantComposite %uint_arr1 %uint_4
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_4
+ %cst = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42 %uint_42
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent count does not match the "
+ "shape of Result Type <id> '.*' "
+ "along its outermost dimension, expected 4 but got 3.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorConstantRank1TooManyConstituents) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpConstantComposite %uint_arr1 %uint_4
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_4
+ %cst = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42 %uint_42 %uint_42 %uint_42
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent count does not match the "
+ "shape of Result Type <id> '.*' "
+ "along its outermost dimension, expected 4 but got 5.*"));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorConstantRank1ConstituentNotConstantOrUndef) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpConstantComposite %uint_arr1 %uint_4
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_4
+ %cst = OpConstantComposite %ts_uint_r1 %tensor_var %tensor_var %tensor_var %tensor_var
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent <id> "
+ "'.*' is not a constant or undef.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorConstantRank1WrongConstituentType) {
+ const std::string src = R"(
+ %uint_arr1_4 = OpConstantComposite %uint_arr1 %uint_4
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_4
+ %cst = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42 %float_1 %uint_42
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent <id> '.*' "
+ "type does not match the element type of the tensor "
+ ".*"));
+}
+
+TEST_F(ValidateTensor, ValidTensorConstantRank4) {
+ const std::string src = R"(
+ %uint_arr1_2 = OpConstantComposite %uint_arr1 %uint_2
+ %uint_arr2_2_2 = OpConstantComposite %uint_arr2 %uint_2 %uint_2
+ %uint_arr3_2_2_2 = OpConstantComposite %uint_arr3 %uint_2 %uint_2 %uint_2
+%uint_arr4_2_2_2_2 = OpConstantComposite %uint_arr4 %uint_2 %uint_2 %uint_2 %uint_2
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_2
+ %ts_uint_r2 = OpTypeTensorARM %uint %uint_2 %uint_arr2_2_2
+ %ts_uint_r3 = OpTypeTensorARM %uint %uint_3 %uint_arr3_2_2_2
+ %ts_uint_r4 = OpTypeTensorARM %uint %uint_4 %uint_arr4_2_2_2_2
+ %cst_r1 = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42
+ %cst_r2 = OpConstantComposite %ts_uint_r2 %cst_r1 %cst_r1
+ %cst_r3 = OpConstantComposite %ts_uint_r3 %cst_r2 %cst_r2
+ %cst_r4 = OpConstantComposite %ts_uint_r4 %cst_r3 %cst_r3
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorConstantRank2SpecConstantConstituent) {
+ const std::string src = R"(
+ %uint_arr1_2 = OpSpecConstantComposite %uint_arr1 %uint_0_spec
+ %uint_arr2_2_2 = OpSpecConstantComposite %uint_arr2 %uint_0_spec %uint_0_spec
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_0_spec %uint_arr1_2
+ %ts_uint_r2 = OpTypeTensorARM %uint %uint_2 %uint_arr2_2_2
+ %cst_r1 = OpSpecConstantComposite %ts_uint_r1 %uint_0_spec %uint_0_spec
+ %cst_r2 = OpSpecConstantComposite %ts_uint_r2 %cst_r1 %cst_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTensorConstantRank2ConstituentNotATensor) {
+ const std::string src = R"(
+ %uint_arr1_2 = OpConstantComposite %uint_arr1 %uint_2
+ %uint_arr2_2_2 = OpConstantComposite %uint_arr2 %uint_2 %uint_2
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_2
+ %ts_uint_r2 = OpTypeTensorARM %uint %uint_2 %uint_arr2_2_2
+ %cst_r1 = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42
+ %cst_r2 = OpConstantComposite %ts_uint_r2 %uint_1 %cst_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent <id> "
+ "'.*' must be an OpTypeTensorARM.*"));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorConstantRank2ConstituentTensorWrongElementType) {
+ const std::string src = R"(
+ %uint_arr1_2 = OpConstantComposite %uint_arr1 %uint_2
+ %uint_arr2_2_2 = OpConstantComposite %uint_arr2 %uint_2 %uint_2
+ %ts_float_r1 = OpTypeTensorARM %float %uint_1 %uint_arr1_2
+ %ts_uint_r2 = OpTypeTensorARM %uint %uint_2 %uint_arr2_2_2
+ %cst_r1 = OpConstantComposite %ts_float_r1 %float_1 %float_1
+ %cst_r2 = OpConstantComposite %ts_uint_r2 %cst_r1 %cst_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent <id> "
+ "'.*' must have the same Element Type "
+ "as Result Type <id> .*"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorConstantRank2ConstituentTensorWrongRank) {
+ const std::string src = R"(
+ %uint_arr1_2 = OpConstantComposite %uint_arr1 %uint_2
+ %uint_arr2_2_2 = OpConstantComposite %uint_arr2 %uint_2 %uint_2
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_2
+ %ts_uint_r2 = OpTypeTensorARM %uint %uint_2 %uint_arr2_2_2
+ %cst_r1 = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42
+ %cst_r2 = OpConstantComposite %ts_uint_r2 %cst_r1 %cst_r1
+ %cst = OpConstantComposite %ts_uint_r2 %cst_r1 %cst_r2
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ ContainsRegex("OpConstantComposite Constituent <id> "
+ "'.*' must have a Rank that is "
+ "1 less than the Rank of Result Type <id> "
+ "'.*', expected 1 but got 2.*"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorConstantRank2ConstituentTensorWrongShape) {
+ const std::string src = R"(
+ %uint_arr1_3 = OpConstantComposite %uint_arr1 %uint_3
+ %uint_arr2_2_2 = OpConstantComposite %uint_arr2 %uint_2 %uint_2
+ %ts_uint_r1 = OpTypeTensorARM %uint %uint_1 %uint_arr1_3
+ %ts_uint_r2 = OpTypeTensorARM %uint %uint_2 %uint_arr2_2_2
+ %cst_r1 = OpConstantComposite %ts_uint_r1 %uint_42 %uint_42 %uint_42
+ %cst_r2 = OpConstantComposite %ts_uint_r2 %cst_r1 %cst_r1
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ ContainsRegex(
+ "OpConstantComposite Constituent <id> "
+ "'.*' must have a Shape that matches "
+ "that of Result Type <id> '.*' along "
+ "all inner dimensions of Result Type, expected 2 for dimension 0 of "
+ "Constituent but got 3.*"));
+}
+
+//
+// Read tests
+//
+
+TEST_F(ValidateTensor, ValidTensorReadScalar) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorReadArray) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint_arr2 %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorReadSpecConstantRank) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_spec %tensor_var_spec_rank
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTensorReadResultTypeVoid) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %void %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Result Type to be a scalar type or array of scalar type"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorReadResultTypeVector) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint_vec4 %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Result Type to be a scalar type or array of scalar type"));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorReadResultTypeDoesNotMatchTensorElementType) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %float %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Result Type to be the same as the Element Type of Tensor"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorReadTensorNotRanked) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_float %tensor_var_float_unranked
+ %val = OpTensorReadARM %float %tensor %uint_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Tensor to be an OpTypeTensorARM whose Rank is specified"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorReadCoordinatesNotArray) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorReadCoordinatesArrayNotInteger) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %float_arr4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorReadCoordinatesArrayIntegerWrongLength) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr2_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor."));
+}
+
+TEST_F(ValidateTensor, ValidTensorReadScalarWithNoneTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 NoneARM
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorReadScalarWithNontemporalTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 NontemporalARM
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorReadScalarOutOfBoundsValueTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 OutOfBoundsValueARM %uint_42
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorReadScalarOutOfBoundsValueTensorOperandsValueWrongType) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 OutOfBoundsValueARM %float_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected the type of the OutOfBoundsValueARM value to be the same "
+ "as the Element Type of Tensor."));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorReadScalarMakeElementAvailableTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 MakeElementAvailableARM %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "MakeElementAvailableARM cannot be used with OpTensorReadARM."));
+}
+
+TEST_F(ValidateTensor,
+ ValidTensorReadScalarWithMakeElementVisibleTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 MakeElementVisibleARM|NonPrivateElementARM %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(
+ ValidateTensor,
+ InvalidTensorReadScalarMakeElementVisibleTensorOperandsWithoutNonPrivateElement) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %val = OpTensorReadARM %uint %tensor %uint_arr4_1_1_1_1 MakeElementVisibleARM %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("MakeElementAvailableARM requires NonPrivateElementARM"));
+}
+
+//
+// Write tests
+//
+
+TEST_F(ValidateTensor, ValidTensorWriteScalar) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorWriteArray) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_arr2_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorWriteSpecConstantRank) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_spec %tensor_var_spec_rank
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTensorWriteObjectNotScalarOrArrayOfScalar) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_vec4_1_1_1_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Expected Object to be a scalar type or array of scalar type "
+ "that is the same as the Element Type of Tensor."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorWriteObjectDoesNotMatchTensorElementType) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %float_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Expected Object to be a scalar type or array of scalar type "
+ "that is the same as the Element Type of Tensor."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorWriteTensorNotRanked) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_float %tensor_var_float_unranked
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %float_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Tensor to be an OpTypeTensorARM whose Rank is specified"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorWriteCoordinatesNotArray) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorWriteCoordinatesArrayNotInteger) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %float_arr4_1_1_1_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorWriteCoordinatesArrayIntegerWrongLength) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr2_1_1 %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Coordinates to be an array whose Element Type is an "
+ "integer type and whose Length is equal to the Rank of Tensor."));
+}
+
+TEST_F(ValidateTensor, ValidTensorWriteScalarWithNoneTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1 NoneARM
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorWriteScalarWithNontemporalTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1 NontemporalARM
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor,
+ ValidTensorWriteScalarWithMakeElementAvailableTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1 MakeElementAvailableARM|NonPrivateElementARM %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorWriteScalarWithOutOfVoundsValueTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1 OutOfBoundsValueARM %uint_42
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("OutOfBoundsValue Tensor Operand not allowed with "
+ "OpTensorWriteARM."));
+}
+
+TEST_F(ValidateTensor,
+ InvalidTensorWriteScalarWithMakeElementVisibleTensorOperands) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1 MakeElementVisibleARM %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("MakeElementVisibleARM not allowed with OpTensorWriteARM."));
+}
+
+TEST_F(
+ ValidateTensor,
+ InvalidTensorWriteScalarWithMakeElementAvailableTensorOperandsWithoutNonPrivateElement) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ OpTensorWriteARM %tensor %uint_arr4_1_1_1_1 %uint_1 MakeElementAvailableARM %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("MakeElementAvailableARM requires NonPrivateElementARM."));
+}
+
+//
+// Query Size tests
+//
+
+TEST_F(ValidateTensor, ValidTensorQuerySize) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %size = OpTensorQuerySizeARM %uint %tensor %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, ValidTensorQuerySizeSpecConstant) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_spec %tensor_var_spec_rank
+ %size = OpTensorQuerySizeARM %uint %tensor %uint_0_spec
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPVENV));
+}
+
+TEST_F(ValidateTensor, InvalidTensorQuerySizeTensorNotRanked) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_float %tensor_var_float_unranked
+ %size = OpTensorQuerySizeARM %uint %tensor %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr(
+ "Expected Tensor to be an OpTypeTensorARM whose Rank is specified"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorQuerySizeResultNotIntegerScalarType) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_float %tensor_var_float_unranked
+ %size = OpTensorQuerySizeARM %float %tensor %uint_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Expected Result Type to be an integer type scalar"));
+}
+
+TEST_F(ValidateTensor, InvalidTensorQuerySizeDimensionNotIntegerType) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %size = OpTensorQuerySizeARM %uint %tensor %float_1
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Dimension must come from a constant instruction of "
+ "scalar integer type."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorQuerySizeDimensionNotConstant) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %dims = OpLoad %uint_arr4 %var_uint_arr4_1_1_1_1
+ %dim = OpCompositeExtract %uint %dims 0
+ %size = OpTensorQuerySizeARM %uint %tensor %dim
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(getDiagnosticString(),
+ HasSubstr("Dimension must come from a constant instruction of "
+ "scalar integer type."));
+}
+
+TEST_F(ValidateTensor, InvalidTensorQuerySizeDimension) {
+ const std::string src = R"(
+ %fn = OpFunction %void None %fnty
+ %label1 = OpLabel
+ %tensor = OpLoad %tensor_uint_4 %tensor_var
+ %size = OpTensorQuerySizeARM %uint %tensor %uint_42
+ OpReturn
+ OpFunctionEnd
+)";
+ std::string spvasm = GenerateModule(src);
+ CompileSuccessfully(spvasm, SPVENV);
+ EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPVENV));
+ EXPECT_THAT(
+ getDiagnosticString(),
+ HasSubstr("Dimension (42) must be less than the Rank of Tensor (4)"));
+}
+
+} // namespace
+} // namespace val
+} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_type_unique_test.cpp b/third_party/SPIRV-Tools/test/val/val_type_unique_test.cpp
index 31ad3a6..289e341 100644
--- a/third_party/SPIRV-Tools/test/val/val_type_unique_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_type_unique_test.cpp
@@ -1,4 +1,6 @@
// Copyright (c) 2017 Google Inc.
+// Modifications Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
+// reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -270,6 +272,46 @@
Not(HasSubstr(GetErrorString(spv::Op::OpTypePointer))));
}
+TEST_F(ValidateTypeUnique, DuplicateUntypedPointer) {
+ std::string str = R"(
+OpCapability Shader
+OpCapability Linkage
+OpCapability UntypedPointersKHR
+OpCapability WorkgroupMemoryExplicitLayoutKHR
+OpExtension "SPV_KHR_workgroup_memory_explicit_layout"
+OpExtension "SPV_KHR_untyped_pointers"
+OpMemoryModel Logical GLSL450
+%u32 = OpTypeInt 32 0
+%ptr1 = OpTypeUntypedPointerKHR Workgroup
+%ptr2 = OpTypeUntypedPointerKHR Workgroup
+)";
+
+ CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_4);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
+TEST_F(ValidateTypeUnique, DuplicateNodePayloadArrayType) {
+ std::string str = R"(
+OpCapability Shader
+OpCapability ShaderEnqueueAMDX
+OpCapability Linkage
+OpExtension "SPV_AMDX_shader_enqueue"
+OpMemoryModel Logical GLSL450
+%floatt = OpTypeFloat 32
+%struct = OpTypeStruct %floatt
+%npat1 = OpTypeNodePayloadArrayAMDX %struct
+%npat2 = OpTypeNodePayloadArrayAMDX %struct
+%void = OpTypeVoid
+%void_fn = OpTypeFunction %void
+%main = OpFunction %void None %void_fn
+%entry = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+ CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_4);
+ ASSERT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
+}
+
} // namespace
} // namespace val
} // namespace spvtools
diff --git a/third_party/SPIRV-Tools/test/val/val_version_test.cpp b/third_party/SPIRV-Tools/test/val/val_version_test.cpp
index 6b7c4fe..743567c 100644
--- a/third_party/SPIRV-Tools/test/val/val_version_test.cpp
+++ b/third_party/SPIRV-Tools/test/val/val_version_test.cpp
@@ -79,6 +79,7 @@
return "1.5";
case SPV_ENV_UNIVERSAL_1_6:
case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_VULKAN_1_4:
return "1.6";
default:
return "0";
@@ -117,6 +118,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_1_SPIRV_1_4,vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_OPENGL_4_0, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_OPENGL_4_1, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_OPENGL_4_2, vulkan_spirv, true),
@@ -135,6 +137,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_1, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -153,6 +156,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_2, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -171,6 +175,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -189,6 +194,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_4, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -207,6 +213,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_5, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -225,6 +232,7 @@
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_UNIVERSAL_1_6, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -248,6 +256,7 @@
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_0, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_1, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_0, SPV_ENV_OPENGL_4_2, vulkan_spirv, true),
@@ -266,6 +275,7 @@
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -284,6 +294,7 @@
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_1_SPIRV_1_4, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -302,6 +313,7 @@
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_2, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_2, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
@@ -320,11 +332,33 @@
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_3, vulkan_spirv, false),
- std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_5, vulkan_spirv, false)
+ std::make_tuple(SPV_ENV_VULKAN_1_3, SPV_ENV_OPENGL_4_5, vulkan_spirv, false),
+
+ // Assembling for Vulkan 1.4 produces SPIR-V 1.6
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_0, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_1, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_2, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_3, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_4, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_5, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_UNIVERSAL_1_6, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_0, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_1, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_1_SPIRV_1_4, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_2, vulkan_spirv, false),
+ // Vulkan 1.3 accepts SPIR-V 1.6
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_3, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_VULKAN_1_4, vulkan_spirv, true),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_0, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_1, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_2, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_3, vulkan_spirv, false),
+ std::make_tuple(SPV_ENV_VULKAN_1_4, SPV_ENV_OPENGL_4_5, vulkan_spirv, false)
)
);
diff --git a/third_party/SPIRV-Tools/tools/CMakeLists.txt b/third_party/SPIRV-Tools/tools/CMakeLists.txt
index a93f640..f5e830f 100644
--- a/third_party/SPIRV-Tools/tools/CMakeLists.txt
+++ b/third_party/SPIRV-Tools/tools/CMakeLists.txt
@@ -24,12 +24,21 @@
# LIBS lib_target1 lib_target2
# )
function(add_spvtools_tool)
+ if (SPIRV_TOOLS_USE_MIMALLOC)
+ list(APPEND SRCS mimalloc.cpp)
+ endif()
+
set(one_value_args TARGET)
set(multi_value_args SRCS LIBS)
cmake_parse_arguments(
ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN})
add_executable(${ARG_TARGET} ${ARG_SRCS})
+
+ if (SPIRV_TOOLS_USE_MIMALLOC)
+ target_link_libraries(${ARG_TARGET} PRIVATE mimalloc-static)
+ endif()
+
spvtools_default_compile_options(${ARG_TARGET})
target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS})
target_include_directories(${ARG_TARGET} PRIVATE
@@ -42,17 +51,18 @@
set(COMMON_TOOLS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/util/flags.cpp")
if (NOT ${SPIRV_SKIP_EXECUTABLES})
- add_spvtools_tool(TARGET spirv-diff SRCS ${COMMON_TOOLS_SRCS} diff/diff.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-diff SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY})
- add_spvtools_tool(TARGET spirv-dis SRCS ${COMMON_TOOLS_SRCS} dis/dis.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
- add_spvtools_tool(TARGET spirv-val SRCS ${COMMON_TOOLS_SRCS} val/val.cpp util/cli_consumer.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
- add_spvtools_tool(TARGET spirv-opt SRCS ${COMMON_TOOLS_SRCS} opt/opt.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-diff SRCS ${COMMON_TOOLS_SRCS} diff/diff.cpp util/cli_consumer.cpp io.cpp LIBS SPIRV-Tools-diff SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-dis SRCS ${COMMON_TOOLS_SRCS} dis/dis.cpp io.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-val SRCS ${COMMON_TOOLS_SRCS} val/val.cpp util/cli_consumer.cpp io.cpp LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-opt SRCS ${COMMON_TOOLS_SRCS} opt/opt.cpp util/cli_consumer.cpp io.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY})
if(NOT (${CMAKE_SYSTEM_NAME} STREQUAL "iOS")) # iOS does not allow std::system calls which spirv-reduce requires
- add_spvtools_tool(TARGET spirv-reduce SRCS ${COMMON_TOOLS_SRCS} reduce/reduce.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-reduce ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-reduce SRCS ${COMMON_TOOLS_SRCS} reduce/reduce.cpp util/cli_consumer.cpp io.cpp LIBS SPIRV-Tools-reduce ${SPIRV_TOOLS_FULL_VISIBILITY})
endif()
- add_spvtools_tool(TARGET spirv-link SRCS ${COMMON_TOOLS_SRCS} link/linker.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS_FULL_VISIBILITY})
- add_spvtools_tool(TARGET spirv-lint SRCS ${COMMON_TOOLS_SRCS} lint/lint.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-lint SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-link SRCS ${COMMON_TOOLS_SRCS} link/linker.cpp io.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-lint SRCS ${COMMON_TOOLS_SRCS} lint/lint.cpp util/cli_consumer.cpp io.cpp LIBS SPIRV-Tools-lint SPIRV-Tools-opt ${SPIRV_TOOLS_FULL_VISIBILITY})
add_spvtools_tool(TARGET spirv-as
SRCS as/as.cpp
+ io.cpp
${COMMON_TOOLS_SRCS}
LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
target_include_directories(spirv-as PRIVATE ${spirv-tools_SOURCE_DIR}
@@ -61,6 +71,7 @@
SRCS cfg/cfg.cpp
cfg/bin_to_dot.h
cfg/bin_to_dot.cpp
+ io.cpp
${COMMON_TOOLS_SRCS}
LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
target_include_directories(spirv-cfg PRIVATE ${spirv-tools_SOURCE_DIR}
@@ -73,6 +84,7 @@
SRCS objdump/objdump.cpp
objdump/extract_source.cpp
util/cli_consumer.cpp
+ io.cpp
${COMMON_TOOLS_SRCS}
LIBS ${SPIRV_TOOLS_FULL_VISIBILITY})
target_include_directories(spirv-objdump PRIVATE ${spirv-tools_SOURCE_DIR}
@@ -85,7 +97,7 @@
endif()
if(SPIRV_BUILD_FUZZER)
- add_spvtools_tool(TARGET spirv-fuzz SRCS fuzz/fuzz.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-fuzz ${SPIRV_TOOLS_FULL_VISIBILITY})
+ add_spvtools_tool(TARGET spirv-fuzz SRCS fuzz/fuzz.cpp util/cli_consumer.cpp io.cpp LIBS SPIRV-Tools-fuzz ${SPIRV_TOOLS_FULL_VISIBILITY})
set(SPIRV_INSTALL_TARGETS ${SPIRV_INSTALL_TARGETS} spirv-fuzz)
endif(SPIRV_BUILD_FUZZER)
diff --git a/third_party/SPIRV-Tools/tools/as/as.cpp b/third_party/SPIRV-Tools/tools/as/as.cpp
index 2a000cf..f857bac 100644
--- a/third_party/SPIRV-Tools/tools/as/as.cpp
+++ b/third_party/SPIRV-Tools/tools/as/as.cpp
@@ -22,14 +22,16 @@
#include "tools/io.h"
#include "tools/util/flags.h"
-static const auto kDefaultEnvironment = "spv1.6";
+constexpr auto kDefaultTarget = SPV_ENV_UNIVERSAL_1_6;
static const std::string kHelpText =
R"(%s - Create a SPIR-V binary module from SPIR-V assembly text
Usage: %s [options] [<filename>]
-The SPIR-V assembly text is read from <filename>. If no file is specified,
-or if the filename is "-", then the assembly text is read from standard input.
+The SPIR-V assembly text is read from <filename>.
+Use "-" as the filename to read from standard input.
+Use "./-" to read from the file named "-".
+
The SPIR-V binary module is written to file "out.spv", unless the -o option
is used.
@@ -48,12 +50,13 @@
)";
// clang-format off
-FLAG_SHORT_bool( h, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool( help, /* default_value= */ false, /* required= */false);
-FLAG_LONG_bool( version, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool( preserve_numeric_ids, /* default_value= */ false, /* required= */ false);
-FLAG_SHORT_string(o, /* default_value= */ "", /* required= */ false);
-FLAG_LONG_string( target_env, /* default_value= */ kDefaultEnvironment, /* required= */ false);
+// flag name= default_value= required=
+FLAG_SHORT_bool( h, false, false);
+FLAG_LONG_bool( help, false, false);
+FLAG_LONG_bool( version, false, false);
+FLAG_LONG_bool( preserve_numeric_ids, false, false);
+FLAG_SHORT_string(o, "", false);
+FLAG_LONG_string( target_env, "", false);
// clang-format on
int main(int, const char** argv) {
@@ -68,17 +71,8 @@
}
if (flags::version.value()) {
- spv_target_env target_env;
- bool success = spvParseTargetEnv(kDefaultEnvironment, &target_env);
- assert(success && "Default environment should always parse.");
- if (!success) {
- fprintf(stderr,
- "error: invalid default target environment. Please report this "
- "issue.");
- return 1;
- }
printf("%s\n", spvSoftwareVersionDetailsString());
- printf("Target: %s\n", spvTargetEnvDescription(target_env));
+ printf("Target: %s\n", spvTargetEnvDescription(kDefaultTarget));
return 0;
}
@@ -92,13 +86,6 @@
options |= SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS;
}
- spv_target_env target_env;
- if (!spvParseTargetEnv(flags::target_env.value().c_str(), &target_env)) {
- fprintf(stderr, "error: Unrecognized target env: %s\n",
- flags::target_env.value().c_str());
- return 1;
- }
-
if (flags::positional_arguments.size() != 1) {
fprintf(stderr, "error: exactly one input file must be specified.\n");
return 1;
@@ -106,7 +93,21 @@
std::string inFile = flags::positional_arguments[0];
std::vector<char> contents;
- if (!ReadTextFile<char>(inFile.c_str(), &contents)) return 1;
+ if (!ReadTextFile(inFile.c_str(), &contents)) return 1;
+
+ // Can only deduce target after the file has been read
+ spv_target_env target_env;
+ if (flags::target_env.value().empty()) {
+ if (!spvReadEnvironmentFromText(contents, &target_env)) {
+ // Revert to default version since deduction failed
+ target_env = kDefaultTarget;
+ }
+ } else if (!spvParseTargetEnv(flags::target_env.value().c_str(),
+ &target_env)) {
+ fprintf(stderr, "error: Unrecognized target env: %s\n",
+ flags::target_env.value().c_str());
+ return 1;
+ }
spv_binary binary;
spv_diagnostic diagnostic = nullptr;
diff --git a/third_party/SPIRV-Tools/tools/cfg/bin_to_dot.cpp b/third_party/SPIRV-Tools/tools/cfg/bin_to_dot.cpp
index 40a7dc4..85fa1e6 100644
--- a/third_party/SPIRV-Tools/tools/cfg/bin_to_dot.cpp
+++ b/third_party/SPIRV-Tools/tools/cfg/bin_to_dot.cpp
@@ -172,7 +172,6 @@
// diagnostics. These are programmer errors, not user errors.
if (!diagnostic) return SPV_ERROR_INVALID_DIAGNOSTIC;
const spvtools::AssemblyGrammar grammar(context);
- if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE;
spvtools::FriendlyNameMapper friendly_mapper(context, words, num_words);
DotConverter converter(friendly_mapper.GetNameMapper(), out);
diff --git a/third_party/SPIRV-Tools/tools/cfg/cfg.cpp b/third_party/SPIRV-Tools/tools/cfg/cfg.cpp
index 2d11e6f..2c68904 100644
--- a/third_party/SPIRV-Tools/tools/cfg/cfg.cpp
+++ b/third_party/SPIRV-Tools/tools/cfg/cfg.cpp
@@ -75,7 +75,7 @@
// Read the input binary.
std::vector<uint32_t> contents;
- if (!ReadBinaryFile<uint32_t>(inFile.c_str(), &contents)) return 1;
+ if (!ReadBinaryFile(inFile.c_str(), &contents)) return 1;
spv_context context = spvContextCreate(kDefaultEnvironment);
spv_diagnostic diagnostic = nullptr;
diff --git a/third_party/SPIRV-Tools/tools/diff/diff.cpp b/third_party/SPIRV-Tools/tools/diff/diff.cpp
index 2217896..349ec09 100644
--- a/third_party/SPIRV-Tools/tools/diff/diff.cpp
+++ b/third_party/SPIRV-Tools/tools/diff/diff.cpp
@@ -82,17 +82,18 @@
std::unique_ptr<spvtools::opt::IRContext> load_module(const char* path) {
if (is_assembly(path)) {
std::vector<char> contents;
- if (!ReadTextFile<char>(path, &contents)) return {};
+ if (!ReadTextFile(path, &contents)) return {};
return spvtools::BuildModule(
kDefaultEnvironment, spvtools::utils::CLIMessageConsumer,
std::string(contents.begin(), contents.end()),
- spvtools::SpirvTools::kDefaultAssembleOption |
+ static_cast<spv_text_to_binary_options_t>(
+ spvtools::SpirvTools::kDefaultAssembleOption) |
SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
}
std::vector<uint32_t> contents;
- if (!ReadBinaryFile<uint32_t>(path, &contents)) return {};
+ if (!ReadBinaryFile(path, &contents)) return {};
return spvtools::BuildModule(kDefaultEnvironment,
spvtools::utils::CLIMessageConsumer,
diff --git a/third_party/SPIRV-Tools/tools/dis/dis.cpp b/third_party/SPIRV-Tools/tools/dis/dis.cpp
index aacd37f..c294d03 100644
--- a/third_party/SPIRV-Tools/tools/dis/dis.cpp
+++ b/third_party/SPIRV-Tools/tools/dis/dis.cpp
@@ -33,44 +33,57 @@
The SPIR-V binary is read from <filename>. If no file is specified,
or if the filename is "-", then the binary is read from standard input.
+A text-based hex stream is also accepted as binary input, which should either
+consist of 32-bit words or 8-bit bytes. The 0x or x prefix is optional, but
+should be consistently present in the stream.
+
Options:
- -h, --help Print this help.
- --version Display disassembler version information.
+ -h, --help Print this help.
+ --version Display disassembler version information.
- -o <filename> Set the output filename.
- Output goes to standard output if this option is
- not specified, or if the filename is "-".
+ -o <filename> Set the output filename.
+ Output goes to standard output if this option is
+ not specified, or if the filename is "-".
- --color Force color output. The default when printing to a terminal.
- Overrides a previous --no-color option.
- --no-color Don't print in color. Overrides a previous --color option.
- The default when output goes to something other than a
- terminal (e.g. a file, a pipe, or a shell redirection).
+ --color Force color output. The default when printing to a terminal.
+ Overrides a previous --no-color option.
+ --no-color Don't print in color. Overrides a previous --color option.
+ The default when output goes to something other than a
+ terminal (e.g. a file, a pipe, or a shell redirection).
- --no-indent Don't indent instructions.
+ --no-indent Don't indent instructions.
- --no-header Don't output the header as leading comments.
+ --no-header Don't output the header as leading comments.
- --raw-id Show raw Id values instead of friendly names.
+ --raw-id Show raw Id values instead of friendly names.
- --offsets Show byte offsets for each instruction.
+ --nested-indent Indentation is adjusted to indicate nesting in structured
+ control flow.
- --comment Add comments to make reading easier
+ --reorder-blocks Reorder blocks to match the structured control flow of SPIR-V.
+ With this option, the order of instructions will no longer
+ match the input binary, but the result will be more readable.
+
+ --offsets Show byte offsets for each instruction.
+
+ --comment Add comments to make reading easier
)";
// clang-format off
-FLAG_SHORT_bool (h, /* default_value= */ false, /* required= */ false);
-FLAG_SHORT_string(o, /* default_value= */ "-", /* required= */ false);
-FLAG_LONG_bool (help, /* default_value= */ false, /* required= */false);
-FLAG_LONG_bool (version, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (color, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (no_color, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (no_indent, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (no_header, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (raw_id, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (offsets, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool (comment, /* default_value= */ false, /* required= */ false);
+FLAG_SHORT_bool (h, /* default_value= */ false, /* required= */ false);
+FLAG_SHORT_string(o, /* default_value= */ "-", /* required= */ false);
+FLAG_LONG_bool (help, /* default_value= */ false, /* required= */false);
+FLAG_LONG_bool (version, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (color, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (no_color, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (no_indent, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (no_header, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (raw_id, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (nested_indent, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (reorder_blocks, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (offsets, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool (comment, /* default_value= */ false, /* required= */ false);
// clang-format on
static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5;
@@ -120,6 +133,12 @@
if (!flags::raw_id.value())
options |= SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES;
+ if (flags::nested_indent.value())
+ options |= SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT;
+
+ if (flags::reorder_blocks.value())
+ options |= SPV_BINARY_TO_TEXT_OPTION_REORDER_BLOCKS;
+
if (flags::comment.value()) options |= SPV_BINARY_TO_TEXT_OPTION_COMMENT;
if (flags::o.value() == "-") {
@@ -138,7 +157,7 @@
// Read the input binary.
std::vector<uint32_t> contents;
- if (!ReadBinaryFile<uint32_t>(inFile.c_str(), &contents)) return 1;
+ if (!ReadBinaryFile(inFile.c_str(), &contents)) return 1;
// If printing to standard output, then spvBinaryToText should
// do the printing. In particular, colour printing on Windows is
diff --git a/third_party/SPIRV-Tools/tools/fuzz/fuzz.cpp b/third_party/SPIRV-Tools/tools/fuzz/fuzz.cpp
index 5f2a008..391d338 100644
--- a/third_party/SPIRV-Tools/tools/fuzz/fuzz.cpp
+++ b/third_party/SPIRV-Tools/tools/fuzz/fuzz.cpp
@@ -584,8 +584,7 @@
[donor_filename, message_consumer,
target_env]() -> std::unique_ptr<spvtools::opt::IRContext> {
std::vector<uint32_t> donor_binary;
- if (!ReadBinaryFile<uint32_t>(donor_filename.c_str(),
- &donor_binary)) {
+ if (!ReadBinaryFile(donor_filename.c_str(), &donor_binary)) {
return nullptr;
}
return spvtools::BuildModule(target_env, message_consumer,
@@ -673,7 +672,7 @@
const spvtools::fuzz::protobufs::TransformationSequence& transformations,
const char* filename) {
std::string json_string;
- auto json_options = google::protobuf::util::JsonOptions();
+ auto json_options = google::protobuf::util::JsonPrintOptions();
json_options.add_whitespace = true;
auto json_generation_status = google::protobuf::util::MessageToJsonString(
transformations, &json_string, json_options);
@@ -712,7 +711,7 @@
}
std::vector<uint32_t> binary_in;
- if (!ReadBinaryFile<uint32_t>(in_binary_file.c_str(), &binary_in)) {
+ if (!ReadBinaryFile(in_binary_file.c_str(), &binary_in)) {
return 1;
}
@@ -801,7 +800,7 @@
}
std::string json_string;
- auto json_options = google::protobuf::util::JsonOptions();
+ auto json_options = google::protobuf::util::JsonPrintOptions();
json_options.add_whitespace = true;
auto json_generation_status = google::protobuf::util::MessageToJsonString(
transformations_applied, &json_string, json_options);
diff --git a/third_party/SPIRV-Tools/tools/io.cpp b/third_party/SPIRV-Tools/tools/io.cpp
new file mode 100644
index 0000000..9c7d21f
--- /dev/null
+++ b/third_party/SPIRV-Tools/tools/io.cpp
@@ -0,0 +1,476 @@
+// Copyright (c) 2024 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "io.h"
+
+#include <assert.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#if defined(SPIRV_WINDOWS)
+#include <fcntl.h>
+#include <io.h>
+
+#define SET_STDIN_TO_BINARY_MODE() _setmode(_fileno(stdin), O_BINARY);
+#define SET_STDIN_TO_TEXT_MODE() _setmode(_fileno(stdin), O_TEXT);
+#define SET_STDOUT_TO_BINARY_MODE() _setmode(_fileno(stdout), O_BINARY);
+#define SET_STDOUT_TO_TEXT_MODE() _setmode(_fileno(stdout), O_TEXT);
+#define SET_STDOUT_MODE(mode) _setmode(_fileno(stdout), mode);
+#else
+#define SET_STDIN_TO_BINARY_MODE()
+#define SET_STDIN_TO_TEXT_MODE()
+#define SET_STDOUT_TO_BINARY_MODE() 0
+#define SET_STDOUT_TO_TEXT_MODE() 0
+#define SET_STDOUT_MODE(mode)
+#endif
+
+namespace {
+// Appends the contents of the |file| to |data|, assuming each element in the
+// file is of type |T|.
+template <typename T>
+void ReadFile(FILE* file, std::vector<T>* data) {
+ if (file == nullptr) return;
+
+ const int buf_size = 4096 / sizeof(T);
+ T buf[buf_size];
+ while (size_t len = fread(buf, sizeof(T), buf_size, file)) {
+ data->insert(data->end(), buf, buf + len);
+ }
+}
+
+// Returns true if |file| has encountered an error opening the file or reading
+// from it. If there was an error, writes an error message to standard error.
+bool WasFileCorrectlyRead(FILE* file, const char* filename) {
+ if (file == nullptr) {
+ fprintf(stderr, "error: file does not exist '%s'\n", filename);
+ return false;
+ }
+
+ if (ftell(file) == -1L) {
+ if (ferror(file)) {
+ fprintf(stderr, "error: error reading file '%s'\n", filename);
+ return false;
+ }
+ }
+ return true;
+}
+
+// Ensure the file contained an exact number of elements, whose size is given in
+// |alignment|.
+bool WasFileSizeAligned(const char* filename, size_t read_size,
+ size_t alignment) {
+ assert(alignment != 1);
+ if ((read_size % alignment) != 0) {
+ fprintf(stderr,
+ "error: file size should be a multiple of %zd; file '%s' corrupt\n",
+ alignment, filename);
+ return false;
+ }
+ return true;
+}
+
+// Different formats the hex is expected to be in.
+enum class HexMode {
+ // 0x07230203, ...
+ Words,
+ // 0x07, 0x23, 0x02, 0x03, ...
+ BytesBigEndian,
+ // 0x03, 0x02, 0x23, 0x07, ...
+ BytesLittleEndian,
+ // 07 23 02 03 ...
+ StreamBigEndian,
+ // 03 02 23 07 ...
+ StreamLittleEndian,
+};
+
+// Whether a character should be skipped as whitespace / separator /
+// end-of-file.
+bool IsSpace(char c) { return isspace(c) || c == ',' || c == '\0'; }
+
+bool IsHexStream(const std::vector<char>& stream) {
+ for (char c : stream) {
+ if (IsSpace(c)) {
+ continue;
+ }
+
+ // Every possible case of a SPIR-V hex stream starts with either '0' or 'x'
+ // (see |HexMode| values). Make a decision upon inspecting the first
+ // non-space character.
+ return c == '0' || c == 'x' || c == 'X';
+ }
+
+ return false;
+}
+
+bool MatchIgnoreCase(const char* token, const char* expect, size_t len) {
+ for (size_t i = 0; i < len; ++i) {
+ if (tolower(token[i]) != tolower(expect[i])) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+// Helper class to tokenize a hex stream
+class HexTokenizer {
+ public:
+ HexTokenizer(const char* filename, const std::vector<char>& stream,
+ std::vector<uint32_t>* data)
+ : filename_(filename), stream_(stream), data_(data) {
+ DetermineMode();
+ }
+
+ bool Parse() {
+ while (current_ < stream_.size() && !encountered_error_) {
+ data_->push_back(GetNextWord());
+
+ // Make sure trailing space does not lead to parse error by skipping it
+ // and exiting the loop.
+ SkipSpace();
+ }
+
+ return !encountered_error_;
+ }
+
+ private:
+ void ParseError(const char* reason) {
+ if (!encountered_error_) {
+ fprintf(stderr,
+ "error: hex stream parse error at character %zu: %s in '%s'\n",
+ current_, reason, filename_);
+ encountered_error_ = true;
+ }
+ }
+
+ // Skip whitespace until the next non-whitespace non-comma character.
+ void SkipSpace() {
+ while (current_ < stream_.size()) {
+ char c = stream_[current_];
+ if (!IsSpace(c)) {
+ return;
+ }
+
+ ++current_;
+ }
+ }
+
+ // Skip the 0x or x at the beginning of a hex value.
+ void Skip0x() {
+ // The first character must be 0 or x.
+ const char first = Next();
+ if (first != '0' && first != 'x' && first != 'X') {
+ ParseError("expected 0x or x");
+ } else if (first == '0') {
+ const char second = Next();
+ if (second != 'x' && second != 'X') {
+ ParseError("expected 0x");
+ }
+ }
+ }
+
+ // Consume the next character.
+ char Next() { return current_ < stream_.size() ? stream_[current_++] : '\0'; }
+
+ // Determine how to read the hex stream based on the first token.
+ void DetermineMode() {
+ SkipSpace();
+
+ // Read 11 bytes, that is the size of the biggest token (10) + one more.
+ char first_token[11];
+ for (uint32_t i = 0; i < 11; ++i) {
+ first_token[i] = Next();
+ }
+
+ // Table of how to match the first token with a mode.
+ struct {
+ const char* expect;
+ bool must_have_delimiter;
+ HexMode mode;
+ } parse_info[] = {
+ {"0x07230203", true, HexMode::Words},
+ {"0x7230203", true, HexMode::Words},
+ {"x07230203", true, HexMode::Words},
+ {"x7230203", true, HexMode::Words},
+
+ {"0x07", true, HexMode::BytesBigEndian},
+ {"0x7", true, HexMode::BytesBigEndian},
+ {"x07", true, HexMode::BytesBigEndian},
+ {"x7", true, HexMode::BytesBigEndian},
+
+ {"0x03", true, HexMode::BytesLittleEndian},
+ {"0x3", true, HexMode::BytesLittleEndian},
+ {"x03", true, HexMode::BytesLittleEndian},
+ {"x3", true, HexMode::BytesLittleEndian},
+
+ {"07", false, HexMode::StreamBigEndian},
+ {"03", false, HexMode::StreamLittleEndian},
+ };
+
+ // Check to see if any of the possible first tokens are matched. If not,
+ // this is not a recognized hex stream.
+ encountered_error_ = true;
+ for (const auto& info : parse_info) {
+ const size_t expect_len = strlen(info.expect);
+ const bool matches_expect =
+ MatchIgnoreCase(first_token, info.expect, expect_len);
+ const bool satisfies_delimeter =
+ !info.must_have_delimiter || IsSpace(first_token[expect_len]);
+ if (matches_expect && satisfies_delimeter) {
+ mode_ = info.mode;
+ encountered_error_ = false;
+ break;
+ }
+ }
+
+ if (encountered_error_) {
+ fprintf(stderr,
+ "error: hex format detected, but pattern '%.11s' is not "
+ "recognized '%s'\n",
+ first_token, filename_);
+ }
+
+ // Reset the position to restart parsing with the determined mode.
+ current_ = 0;
+ }
+
+ // Consume up to |max_len| characters and put them in |token_chars|. A
+ // delimiter is expected. The resulting string is NUL-terminated.
+ void NextN(char token_chars[9], size_t max_len) {
+ assert(max_len < 9);
+
+ for (size_t i = 0; i <= max_len; ++i) {
+ char c = Next();
+ if (IsSpace(c)) {
+ token_chars[i] = '\0';
+ return;
+ }
+
+ token_chars[i] = c;
+ if (!isxdigit(c)) {
+ ParseError("encountered non-hex character");
+ }
+ }
+
+ // If space is not reached before the maximum number of characters where
+ // consumed, that's an error.
+ ParseError("expected delimiter (space or comma)");
+ token_chars[max_len] = '\0';
+ }
+
+ // Consume one hex digit.
+ char NextHexDigit() {
+ char c = Next();
+ if (!isxdigit(c)) {
+ ParseError("encountered non-hex character");
+ }
+ return c;
+ }
+
+ // Extract a token out of the stream. It could be either a word or a byte,
+ // based on |mode_|.
+ uint32_t GetNextToken() {
+ SkipSpace();
+
+ // The longest token can be 8 chars (for |HexMode::Words|), add one for
+ // '\0'.
+ char token_chars[9];
+
+ switch (mode_) {
+ case HexMode::Words:
+ case HexMode::BytesBigEndian:
+ case HexMode::BytesLittleEndian:
+ // Start with 0x, followed by up to 8 (for Word) or 2 (for Byte*)
+ // digits.
+ Skip0x();
+ NextN(token_chars, mode_ == HexMode::Words ? 8 : 2);
+ break;
+ case HexMode::StreamBigEndian:
+ case HexMode::StreamLittleEndian:
+ // Always expected to see two consecutive hex digits.
+ token_chars[0] = NextHexDigit();
+ token_chars[1] = NextHexDigit();
+ token_chars[2] = '\0';
+ break;
+ }
+
+ if (encountered_error_) {
+ return 0;
+ }
+
+ // Parse the hex value that was just read.
+ return static_cast<uint32_t>(strtol(token_chars, nullptr, 16));
+ }
+
+ // Construct a word out of tokens
+ uint32_t GetNextWord() {
+ if (mode_ == HexMode::Words) {
+ return GetNextToken();
+ }
+
+ uint32_t tokens[4] = {
+ GetNextToken(),
+ GetNextToken(),
+ GetNextToken(),
+ GetNextToken(),
+ };
+
+ switch (mode_) {
+ case HexMode::BytesBigEndian:
+ case HexMode::StreamBigEndian:
+ return tokens[0] << 24 | tokens[1] << 16 | tokens[2] << 8 | tokens[3];
+ case HexMode::BytesLittleEndian:
+ case HexMode::StreamLittleEndian:
+ return tokens[3] << 24 | tokens[2] << 16 | tokens[1] << 8 | tokens[0];
+ default:
+ assert(false);
+ return 0;
+ }
+ }
+
+ const char* filename_;
+ const std::vector<char>& stream_;
+ std::vector<uint32_t>* data_;
+
+ HexMode mode_ = HexMode::Words;
+ size_t current_ = 0;
+ bool encountered_error_ = false;
+};
+} // namespace
+
+bool ReadBinaryFile(const char* filename, std::vector<uint32_t>* data) {
+ assert(data->empty());
+
+ const bool use_file = filename && strcmp("-", filename);
+ FILE* fp = nullptr;
+ if (use_file) {
+ fp = fopen(filename, "rb");
+ } else {
+ SET_STDIN_TO_BINARY_MODE();
+ fp = stdin;
+ }
+
+ // Read into a char vector first. If this is a hex stream, it needs to be
+ // processed as such.
+ std::vector<char> data_raw;
+ ReadFile(fp, &data_raw);
+ bool succeeded = WasFileCorrectlyRead(fp, filename);
+ if (use_file && fp) fclose(fp);
+
+ if (!succeeded) {
+ return false;
+ }
+
+ if (IsHexStream(data_raw)) {
+ // If a hex stream, parse it and fill |data|.
+ HexTokenizer tokenizer(filename, data_raw, data);
+ succeeded = tokenizer.Parse();
+ } else {
+ // If not a hex stream, convert it to uint32_t via memcpy.
+ succeeded = WasFileSizeAligned(filename, data_raw.size(), sizeof(uint32_t));
+ if (succeeded) {
+ data->resize(data_raw.size() / sizeof(uint32_t), 0);
+ memcpy(data->data(), data_raw.data(), data_raw.size());
+ }
+ }
+
+ return succeeded;
+}
+
+bool ConvertHexToBinary(const std::vector<char>& stream,
+ std::vector<uint32_t>* data) {
+ HexTokenizer tokenizer("<input string>", stream, data);
+ return tokenizer.Parse();
+}
+
+bool ReadTextFile(const char* filename, std::vector<char>* data) {
+ assert(data->empty());
+
+ const bool use_file = filename && strcmp("-", filename);
+ FILE* fp = nullptr;
+ if (use_file) {
+ fp = fopen(filename, "r");
+ } else {
+ SET_STDIN_TO_TEXT_MODE();
+ fp = stdin;
+ }
+
+ ReadFile(fp, data);
+ bool succeeded = WasFileCorrectlyRead(fp, filename);
+ if (use_file && fp) fclose(fp);
+ return succeeded;
+}
+
+namespace {
+// A class to create and manage a file for outputting data.
+class OutputFile {
+ public:
+ // Opens |filename| in the given mode. If |filename| is nullptr, the empty
+ // string or "-", stdout will be set to the given mode.
+ OutputFile(const char* filename, const char* mode) : old_mode_(0) {
+ const bool use_stdout =
+ !filename || (filename[0] == '-' && filename[1] == '\0');
+ if (use_stdout) {
+ if (strchr(mode, 'b')) {
+ old_mode_ = SET_STDOUT_TO_BINARY_MODE();
+ } else {
+ old_mode_ = SET_STDOUT_TO_TEXT_MODE();
+ }
+ fp_ = stdout;
+ } else {
+ fp_ = fopen(filename, mode);
+ }
+ }
+
+ ~OutputFile() {
+ if (fp_ == stdout) {
+ fflush(stdout);
+ SET_STDOUT_MODE(old_mode_);
+ } else if (fp_ != nullptr) {
+ fclose(fp_);
+ }
+ }
+
+ // Returns a file handle to the file.
+ FILE* GetFileHandle() const { return fp_; }
+
+ private:
+ FILE* fp_;
+ int old_mode_;
+};
+} // namespace
+
+template <typename T>
+bool WriteFile(const char* filename, const char* mode, const T* data,
+ size_t count) {
+ OutputFile file(filename, mode);
+ FILE* fp = file.GetFileHandle();
+ if (fp == nullptr) {
+ fprintf(stderr, "error: could not open file '%s'\n", filename);
+ return false;
+ }
+
+ size_t written = fwrite(data, sizeof(T), count, fp);
+ if (count != written) {
+ fprintf(stderr, "error: could not write to file '%s'\n", filename);
+ return false;
+ }
+
+ return true;
+}
+
+template bool WriteFile<uint32_t>(const char* filename, const char* mode,
+ const uint32_t* data, size_t count);
+template bool WriteFile<char>(const char* filename, const char* mode,
+ const char* data, size_t count);
diff --git a/third_party/SPIRV-Tools/tools/io.h b/third_party/SPIRV-Tools/tools/io.h
index a48e3c3..536009d 100644
--- a/third_party/SPIRV-Tools/tools/io.h
+++ b/third_party/SPIRV-Tools/tools/io.h
@@ -20,145 +20,39 @@
#include <cstring>
#include <vector>
-#if defined(SPIRV_WINDOWS)
-#include <fcntl.h>
-#include <io.h>
-
-#define SET_STDIN_TO_BINARY_MODE() _setmode(_fileno(stdin), O_BINARY);
-#define SET_STDIN_TO_TEXT_MODE() _setmode(_fileno(stdin), O_TEXT);
-#define SET_STDOUT_TO_BINARY_MODE() _setmode(_fileno(stdout), O_BINARY);
-#define SET_STDOUT_TO_TEXT_MODE() _setmode(_fileno(stdout), O_TEXT);
-#define SET_STDOUT_MODE(mode) _setmode(_fileno(stdout), mode);
-#else
-#define SET_STDIN_TO_BINARY_MODE()
-#define SET_STDIN_TO_TEXT_MODE()
-#define SET_STDOUT_TO_BINARY_MODE() 0
-#define SET_STDOUT_TO_TEXT_MODE() 0
-#define SET_STDOUT_MODE(mode)
-#endif
-
-// Appends the contents of the |file| to |data|, assuming each element in the
-// file is of type |T|.
-template <typename T>
-void ReadFile(FILE* file, std::vector<T>* data) {
- if (file == nullptr) return;
-
- const int buf_size = 1024;
- T buf[buf_size];
- while (size_t len = fread(buf, sizeof(T), buf_size, file)) {
- data->insert(data->end(), buf, buf + len);
- }
-}
-
-// Returns true if |file| has encountered an error opening the file or reading
-// the file as a series of element of type |T|. If there was an error, writes an
-// error message to standard error.
-template <class T>
-bool WasFileCorrectlyRead(FILE* file, const char* filename) {
- if (file == nullptr) {
- fprintf(stderr, "error: file does not exist '%s'\n", filename);
- return false;
- }
-
- if (ftell(file) == -1L) {
- if (ferror(file)) {
- fprintf(stderr, "error: error reading file '%s'\n", filename);
- return false;
- }
- } else {
- if (sizeof(T) != 1 && (ftell(file) % sizeof(T))) {
- fprintf(
- stderr,
- "error: file size should be a multiple of %zd; file '%s' corrupt\n",
- sizeof(T), filename);
- return false;
- }
- }
- return true;
-}
-
-// Appends the contents of the file named |filename| to |data|, assuming
-// each element in the file is of type |T|. The file is opened as a binary file
-// If |filename| is nullptr or "-", reads from the standard input, but
+// Sets the contents of the file named |filename| in |data|, assuming each
+// element in the file is of type |uint32_t|. The file is opened as a binary
+// file. If |filename| is nullptr or "-", reads from the standard input, but
// reopened as a binary file. If any error occurs, writes error messages to
// standard error and returns false.
-template <typename T>
-bool ReadBinaryFile(const char* filename, std::vector<T>* data) {
- const bool use_file = filename && strcmp("-", filename);
- FILE* fp = nullptr;
- if (use_file) {
- fp = fopen(filename, "rb");
- } else {
- SET_STDIN_TO_BINARY_MODE();
- fp = stdin;
- }
+//
+// If the given input is detected to be in ascii hex, it is converted to binary
+// automatically. In that case, the shape of the input data is determined based
+// on the representation of the magic number:
+//
+// * "[0]x[0]7230203": Every following "0x..." represents a word.
+// * "[0]x[0]7[,] [0]x23...": Every following "0x..." represents a byte, stored
+// in big-endian order
+// * "[0]x[0]3[,] [0]x[0]2...": Every following "0x..." represents a byte,
+// stored in little-endian order
+// * "07[, ]23...": Every following "XY" represents a byte, stored in
+// big-endian order
+// * "03[, ]02...": Every following "XY" represents a byte, stored in
+// little-endian order
+bool ReadBinaryFile(const char* filename, std::vector<uint32_t>* data);
- ReadFile(fp, data);
- bool succeeded = WasFileCorrectlyRead<T>(fp, filename);
- if (use_file && fp) fclose(fp);
- return succeeded;
-}
+// The hex->binary logic of |ReadBinaryFile| applied to a pre-loaded stream of
+// bytes. Used by tests to avoid having to call |ReadBinaryFile| with temp
+// files. Returns false in case of parse errors.
+bool ConvertHexToBinary(const std::vector<char>& stream,
+ std::vector<uint32_t>* data);
-// Appends the contents of the file named |filename| to |data|, assuming
-// each element in the file is of type |T|. The file is opened as a text file
-// If |filename| is nullptr or "-", reads from the standard input, but
-// reopened as a text file. If any error occurs, writes error messages to
-// standard error and returns false.
-template <typename T>
-bool ReadTextFile(const char* filename, std::vector<T>* data) {
- const bool use_file = filename && strcmp("-", filename);
- FILE* fp = nullptr;
- if (use_file) {
- fp = fopen(filename, "r");
- } else {
- SET_STDIN_TO_TEXT_MODE();
- fp = stdin;
- }
-
- ReadFile(fp, data);
- bool succeeded = WasFileCorrectlyRead<T>(fp, filename);
- if (use_file && fp) fclose(fp);
- return succeeded;
-}
-
-namespace {
-// A class to create and manage a file for outputting data.
-class OutputFile {
- public:
- // Opens |filename| in the given mode. If |filename| is nullptr, the empty
- // string or "-", stdout will be set to the given mode.
- OutputFile(const char* filename, const char* mode) : old_mode_(0) {
- const bool use_stdout =
- !filename || (filename[0] == '-' && filename[1] == '\0');
- if (use_stdout) {
- if (strchr(mode, 'b')) {
- old_mode_ = SET_STDOUT_TO_BINARY_MODE();
- } else {
- old_mode_ = SET_STDOUT_TO_TEXT_MODE();
- }
- fp_ = stdout;
- } else {
- fp_ = fopen(filename, mode);
- }
- }
-
- ~OutputFile() {
- if (fp_ == stdout) {
- fflush(stdout);
- SET_STDOUT_MODE(old_mode_);
- } else if (fp_ != nullptr) {
- fclose(fp_);
- }
- }
-
- // Returns a file handle to the file.
- FILE* GetFileHandle() const { return fp_; }
-
- private:
- FILE* fp_;
- int old_mode_;
-};
-} // namespace
+// Sets the contents of the file named |filename| in |data|, assuming each
+// element in the file is of type |char|. The file is opened as a text file. If
+// |filename| is nullptr or "-", reads from the standard input, but reopened as
+// a text file. If any error occurs, writes error messages to standard error and
+// returns false.
+bool ReadTextFile(const char* filename, std::vector<char>* data);
// Writes the given |data| into the file named as |filename| using the given
// |mode|, assuming |data| is an array of |count| elements of type |T|. If
@@ -166,21 +60,6 @@
// returns false and outputs error message to standard error.
template <typename T>
bool WriteFile(const char* filename, const char* mode, const T* data,
- size_t count) {
- OutputFile file(filename, mode);
- FILE* fp = file.GetFileHandle();
- if (fp == nullptr) {
- fprintf(stderr, "error: could not open file '%s'\n", filename);
- return false;
- }
-
- size_t written = fwrite(data, sizeof(T), count, fp);
- if (count != written) {
- fprintf(stderr, "error: could not write to file '%s'\n", filename);
- return false;
- }
-
- return true;
-}
+ size_t count);
#endif // TOOLS_IO_H_
diff --git a/third_party/SPIRV-Tools/tools/link/linker.cpp b/third_party/SPIRV-Tools/tools/link/linker.cpp
index f3898aa..2f47dd4 100644
--- a/third_party/SPIRV-Tools/tools/link/linker.cpp
+++ b/third_party/SPIRV-Tools/tools/link/linker.cpp
@@ -48,6 +48,10 @@
--allow-partial-linkage
Allow partial linkage by accepting imported symbols to be
unresolved.
+ --allow-pointer-mismatch
+ Allow pointer function parameters to mismatch the target link
+ target. This is useful to workaround lost correct parameter type
+ information due to LLVM's opaque pointers.
--create-library
Link the binaries into a library, keeping all exported symbols.
-h, --help
@@ -77,15 +81,16 @@
} // namespace
// clang-format off
-FLAG_SHORT_bool( h, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool( help, /* default_value= */ false, /* required= */false);
-FLAG_LONG_bool( version, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool( verify_ids, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool( create_library, /* default_value= */ false, /* required= */ false);
-FLAG_LONG_bool( allow_partial_linkage, /* default_value= */ false, /* required= */ false);
-FLAG_SHORT_string(o, /* default_value= */ "", /* required= */ false);
-FLAG_LONG_string( target_env, /* default_value= */ kDefaultEnvironment, /* required= */ false);
-FLAG_LONG_bool( use_highest_version, /* default_value= */ false, /* required= */ false);
+FLAG_SHORT_bool( h, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool( help, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool( version, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool( verify_ids, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool( create_library, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool( allow_partial_linkage, /* default_value= */ false, /* required= */ false);
+FLAG_LONG_bool( allow_pointer_mismatch, /* default_value= */ false, /* required= */ false);
+FLAG_SHORT_string(o, /* default_value= */ "", /* required= */ false);
+FLAG_LONG_string( target_env, /* default_value= */ kDefaultEnvironment, /* required= */ false);
+FLAG_LONG_bool( use_highest_version, /* default_value= */ false, /* required= */ false);
// clang-format on
int main(int, const char* argv[]) {
@@ -126,6 +131,7 @@
spvtools::LinkerOptions options;
options.SetAllowPartialLinkage(flags::allow_partial_linkage.value());
+ options.SetAllowPtrTypeMismatch(flags::allow_pointer_mismatch.value());
options.SetCreateLibrary(flags::create_library.value());
options.SetVerifyIds(flags::verify_ids.value());
options.SetUseHighestVersion(flags::use_highest_version.value());
@@ -137,7 +143,7 @@
std::vector<std::vector<uint32_t>> contents(inFiles.size());
for (size_t i = 0u; i < inFiles.size(); ++i) {
- if (!ReadBinaryFile<uint32_t>(inFiles[i].c_str(), &contents[i])) return 1;
+ if (!ReadBinaryFile(inFiles[i].c_str(), &contents[i])) return 1;
}
const spvtools::MessageConsumer consumer = [](spv_message_level_t level,
diff --git a/third_party/SPIRV-Tools/tools/objdump/extract_source.cpp b/third_party/SPIRV-Tools/tools/objdump/extract_source.cpp
index 0295952..d6d49d9 100644
--- a/third_party/SPIRV-Tools/tools/objdump/extract_source.cpp
+++ b/third_party/SPIRV-Tools/tools/objdump/extract_source.cpp
@@ -19,9 +19,9 @@
#include <unordered_map>
#include <vector>
+#include "source/latest_version_spirv_header.h"
#include "source/opt/log.h"
#include "spirv-tools/libspirv.hpp"
-#include "spirv/unified1/spirv.hpp"
#include "tools/util/cli_consumer.h"
namespace {
@@ -66,7 +66,7 @@
const spv_parsed_instruction_t& instruction,
std::string* output) {
assert(output != nullptr);
- assert(instruction.opcode == spv::Op::OpString);
+ assert(instruction.opcode == static_cast<unsigned>(spv::Op::OpString));
if (instruction.num_operands != 2) {
spvtools::Error(spvtools::utils::CLIMessageConsumer, "", loc,
"Missing operands for OpString.");
@@ -85,7 +85,8 @@
const spv_position_t& loc, const spv_parsed_instruction_t& instruction,
std::string* output) {
assert(output != nullptr);
- assert(instruction.opcode == spv::Op::OpSourceContinued);
+ assert(instruction.opcode ==
+ static_cast<unsigned>(spv::Op::OpSourceContinued));
if (instruction.num_operands != 1) {
spvtools::Error(spvtools::utils::CLIMessageConsumer, "", loc,
"Missing operands for OpSourceContinued.");
@@ -104,7 +105,7 @@
const spv_parsed_instruction_t& instruction,
spv::Id* filename, std::string* code) {
assert(filename != nullptr && code != nullptr);
- assert(instruction.opcode == spv::Op::OpSource);
+ assert(instruction.opcode == static_cast<unsigned>(spv::Op::OpSource));
// OpCode [ Source Language | Version | File (optional) | Source (optional) ]
if (instruction.num_words < 3) {
spvtools::Error(spvtools::utils::CLIMessageConsumer, "", loc,
@@ -146,7 +147,7 @@
std::unordered_map<uint32_t, std::string> stringMap;
std::vector<std::pair<spv::Id, std::string>> sources;
- spv::Op lastOpcode = spv::Op::OpMax;
+ spv::Op lastOpcode = spv::Op::Max;
size_t instructionIndex = 0;
spvtools::InstructionParser instructionParser =
@@ -155,20 +156,22 @@
const spv_position_t loc = {0, 0, instructionIndex + 1};
spv_result_t result = SPV_SUCCESS;
- if (instruction.opcode == spv::Op::OpString) {
+ if (instruction.opcode == static_cast<unsigned>(spv::Op::OpString)) {
std::string content;
result = extractOpString(loc, instruction, &content);
if (result == SPV_SUCCESS) {
stringMap.emplace(instruction.result_id, std::move(content));
}
- } else if (instruction.opcode == spv::Op::OpSource) {
+ } else if (instruction.opcode ==
+ static_cast<unsigned>(spv::Op::OpSource)) {
spv::Id filenameId;
std::string code;
result = extractOpSource(loc, instruction, &filenameId, &code);
if (result == SPV_SUCCESS) {
sources.emplace_back(std::make_pair(filenameId, std::move(code)));
}
- } else if (instruction.opcode == spv::Op::OpSourceContinued) {
+ } else if (instruction.opcode ==
+ static_cast<unsigned>(spv::Op::OpSourceContinued)) {
if (lastOpcode != spv::Op::OpSource) {
spvtools::Error(spvtools::utils::CLIMessageConsumer, "", loc,
"OpSourceContinued MUST follow an OpSource.");
diff --git a/third_party/SPIRV-Tools/tools/opt/opt.cpp b/third_party/SPIRV-Tools/tools/opt/opt.cpp
index f8456d7..37d8646 100644
--- a/third_party/SPIRV-Tools/tools/opt/opt.cpp
+++ b/third_party/SPIRV-Tools/tools/opt/opt.cpp
@@ -181,6 +181,14 @@
must be in OpAccessChain instructions with a literal index for
the first index.)");
printf(R"(
+ --descriptor-composite-scalar-replacement
+ Same as descriptor-scalar-replacement, but only impacts composite/structs.
+ For details, see --descriptor-scalar-replacement help.)");
+ printf(R"(
+ --descriptor-array-scalar-replacement
+ Same as descriptor-scalar-replacement, but only impacts arrays.
+ For details, see --descriptor-scalar-replacement help.)");
+ printf(R"(
--eliminate-dead-branches
Convert conditional branches with constant condition to the
indicated unconditional branch. Delete all resulting dead
@@ -438,6 +446,15 @@
Forwards this option to the validator. See the validator help
for details.)");
printf(R"(
+ --canonicalize-ids
+ Canonicalize IDs to improve compression of SPIR-V binary files. The resulting
+ modules have an increased ID range (IDs are not as tightly packed
+ around zero), but will compress better when multiple modules are
+ compressed together, since the compressor's dictionary can find better
+ cross module commonality. This pass should be run after most optimization
+ passes except for --strip-debug because this pass will use OpName to
+ canonicalize IDs. i.e. Run --strip-debug after this pass.)");
+ printf(R"(
--relax-struct-store
Forwards this option to the validator. See the validator help
for details.)");
@@ -447,9 +464,9 @@
instructions.)");
printf(R"(
--remove-unused-interface-variables
- Removes variables referenced on the |OpEntryPoint| instruction
- that are not referenced in the entry point function or any function
- in its call tree. Note that this could cause the shader interface
+ Removes variables referenced on the |OpEntryPoint| instruction
+ that are not referenced in the entry point function or any function
+ in its call tree. Note that this could cause the shader interface
to no longer match other shader stages.)");
printf(R"(
--replace-invalid-opcode
@@ -457,6 +474,12 @@
but not for the current shader stage. To have an effect, all
entry points must have the same execution model.)");
printf(R"(
+ --resolve-binding-conflicts
+ Renumber bindings to avoid conflicts.
+ When an image and sampler share the same desriptor set and binding,
+ increment the binding number of the sampler. Recursively ripple
+ to higher-numbered bindings until all conflicts resolved resolved.)");
+ printf(R"(
--ssa-rewrite
Replace loads and stores to function local variables with
operations on SSA IDs.)");
@@ -493,6 +516,11 @@
is invalid, the optimizer may fail or generate incorrect code.
This options should be used rarely, and with caution.)");
printf(R"(
+ --split-combined-image-sampler
+ Replace combined image sampler variables and parameters into
+ pairs of images and samplers. New variables have the same
+ bindings as the original variable.)");
+ printf(R"(
--strength-reduction
Replaces instructions with equivalent and less expensive ones.)");
printf(R"(
@@ -507,6 +535,10 @@
covers reflection information defined by
SPV_GOOGLE_hlsl_functionality1 and SPV_KHR_non_semantic_info)");
printf(R"(
+ --struct-packing=name:rule
+ Re-assign layout offsets to a given struct according to
+ its packing rules.)");
+ printf(R"(
--switch-descriptorset=<from>:<to>
Switch any DescriptoSet decorations using the value <from> to
the new value <to>.)");
@@ -864,7 +896,7 @@
}
std::vector<uint32_t> binary;
- if (!ReadBinaryFile<uint32_t>(in_file, &binary)) {
+ if (!ReadBinaryFile(in_file, &binary)) {
return 1;
}
diff --git a/third_party/SPIRV-Tools/tools/reduce/reduce.cpp b/third_party/SPIRV-Tools/tools/reduce/reduce.cpp
index 959f5a2..1437799 100644
--- a/third_party/SPIRV-Tools/tools/reduce/reduce.cpp
+++ b/third_party/SPIRV-Tools/tools/reduce/reduce.cpp
@@ -307,7 +307,7 @@
reducer.SetMessageConsumer(spvtools::utils::CLIMessageConsumer);
std::vector<uint32_t> binary_in;
- if (!ReadBinaryFile<uint32_t>(in_binary_file.c_str(), &binary_in)) {
+ if (!ReadBinaryFile(in_binary_file.c_str(), &binary_in)) {
return 1;
}
diff --git a/third_party/SPIRV-Tools/tools/sva/package.json b/third_party/SPIRV-Tools/tools/sva/package.json
index 15feaca..cd6ea67 100644
--- a/third_party/SPIRV-Tools/tools/sva/package.json
+++ b/third_party/SPIRV-Tools/tools/sva/package.json
@@ -19,7 +19,7 @@
"eslint": "^8.41.0",
"esm": "^3.2.25",
"mocha": "^10.2.0",
- "rollup": "^3.23.0",
+ "rollup": "^3.29.5",
"serve": "^14.2.0"
}
}
diff --git a/third_party/SPIRV-Tools/tools/sva/yarn.lock b/third_party/SPIRV-Tools/tools/sva/yarn.lock
index eed94ce..38788e2 100644
--- a/third_party/SPIRV-Tools/tools/sva/yarn.lock
+++ b/third_party/SPIRV-Tools/tools/sva/yarn.lock
@@ -219,11 +219,11 @@
balanced-match "^1.0.0"
braces@~3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
- integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
+ integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
- fill-range "^7.0.1"
+ fill-range "^7.1.1"
browser-stdout@1.3.1:
version "1.3.1"
@@ -602,10 +602,10 @@
dependencies:
flat-cache "^3.0.4"
-fill-range@^7.0.1:
- version "7.0.1"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
- integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
+fill-range@^7.1.1:
+ version "7.1.1"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
+ integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
dependencies:
to-regex-range "^5.0.1"
@@ -1083,10 +1083,10 @@
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
-path-to-regexp@2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45"
- integrity sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==
+path-to-regexp@3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-3.3.0.tgz#f7f31d32e8518c2660862b644414b6d5c63a611b"
+ integrity sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==
pathval@^1.1.1:
version "1.1.1"
@@ -1189,10 +1189,10 @@
dependencies:
glob "^7.1.3"
-rollup@^3.23.0:
- version "3.23.0"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.23.0.tgz#b8d6146dac4bf058ee817f92820988e9b358b564"
- integrity sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==
+rollup@^3.29.5:
+ version "3.29.5"
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.5.tgz#8a2e477a758b520fb78daf04bca4c522c1da8a54"
+ integrity sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==
optionalDependencies:
fsevents "~2.3.2"
@@ -1231,7 +1231,7 @@
mime-types "2.1.18"
minimatch "3.1.2"
path-is-inside "1.0.2"
- path-to-regexp "2.2.1"
+ path-to-regexp "3.3.0"
range-parser "1.2.0"
serve@^14.2.0:
diff --git a/third_party/SPIRV-Tools/tools/val/val.cpp b/third_party/SPIRV-Tools/tools/val/val.cpp
index 880ce46..dddfeae 100644
--- a/third_party/SPIRV-Tools/tools/val/val.cpp
+++ b/third_party/SPIRV-Tools/tools/val/val.cpp
@@ -66,6 +66,10 @@
members.
--allow-localsizeid Allow use of the LocalSizeId decoration where it would otherwise not
be allowed by the target environment.
+ --allow-offset-texture-operand Allow use of the Offset texture operands where it would otherwise not
+ be allowed by the target environment.
+ --allow-vulkan-32-bit-bitwise Allow use of non-32 bit for the Base operand where it would otherwise
+ not be allowed by the target environment.
--before-hlsl-legalization Allows code patterns that are intended to be
fixed by spirv-opt's legalization passes.
--version Display validator version information.
@@ -111,7 +115,7 @@
printf("%s\n", spvSoftwareVersionDetailsString());
printf(
"Targets:\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n %s\n "
- "%s\n %s\n %s\n %s\n",
+ "%s\n %s\n %s\n %s %s\n",
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0),
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1),
spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2),
@@ -124,7 +128,8 @@
spvTargetEnvDescription(SPV_ENV_VULKAN_1_1),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_1_SPIRV_1_4),
spvTargetEnvDescription(SPV_ENV_VULKAN_1_2),
- spvTargetEnvDescription(SPV_ENV_VULKAN_1_3));
+ spvTargetEnvDescription(SPV_ENV_VULKAN_1_3),
+ spvTargetEnvDescription(SPV_ENV_VULKAN_1_4));
continue_processing = false;
return_code = 0;
} else if (0 == strcmp(cur_arg, "--help") || 0 == strcmp(cur_arg, "-h")) {
@@ -160,6 +165,10 @@
options.SetSkipBlockLayout(true);
} else if (0 == strcmp(cur_arg, "--allow-localsizeid")) {
options.SetAllowLocalSizeId(true);
+ } else if (0 == strcmp(cur_arg, "--allow-offset-texture-operand")) {
+ options.SetAllowOffsetTextureOperand(true);
+ } else if (0 == strcmp(cur_arg, "--allow-vulkan-32-bit-bitwise")) {
+ options.SetAllowVulkan32BitBitwise(true);
} else if (0 == strcmp(cur_arg, "--relax-struct-store")) {
options.SetRelaxStructStore(true);
} else if (0 == cur_arg[1]) {
@@ -193,7 +202,7 @@
}
std::vector<uint32_t> contents;
- if (!ReadBinaryFile<uint32_t>(inFile, &contents)) return 1;
+ if (!ReadBinaryFile(inFile, &contents)) return 1;
spvtools::SpirvTools tools(target_env);
tools.SetMessageConsumer(spvtools::utils::CLIMessageConsumer);
diff --git a/third_party/SPIRV-Tools/utils/Table/Context.py b/third_party/SPIRV-Tools/utils/Table/Context.py
new file mode 100755
index 0000000..086ab8d
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/Context.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+#from typing import *
+from enum import IntEnum
+from typing import Dict, List
+from . IndexRange import *
+from . StringList import *
+
+
+class Context():
+ """
+ Contains global tables for strings, and lists-of-strings.
+ It contains:
+
+ - string_buffer: A list of null-terminated strings. The list is
+ partitioned into contiguous segments dedicated to a specific
+ kind of string, e.g.:
+ - all instruction opcodes
+ - all extension names
+ - all aliases for a given enum
+ - all enum names for a first operand type
+ - all enum names for a second operand type, etc.
+ Strings are sorted within each segment.
+
+ - string_total_len: The sum of lengths of strings in string_buffer.
+
+ - strings: Maps a string to an IndexRange indicating where the string
+ can be found in the (future) concatenation of all strings in the
+ string_buffer.
+
+ - range_buffer: A dictionary mapping a string kind to a list IndexRange
+ objects R. Each R is one of:
+
+ - An index range referencing one string as it appears in the
+ (future) concatenation of all strings in the string_buffer.
+ In this case R represents a single string.
+
+ - An index range referencing earlier elements in range_buffer[kind]
+ itself. In this case R represents a list of strings.
+
+ - ranges: A dictionary mapping a string kind and lists-of-strings
+ to its encoding in the range_buffer array.
+
+ It is a two-level mapping of Python type:
+
+ Dict[str,dict[StringList,IndexRange]]
+
+ where
+
+ ranges[kind][list of strings] = an IndexRange
+
+ The 'kind' string encodes a purpose including:
+ - opcodes: the list of instruction opcode strings.
+ - the list of aliases for an opcode, or an enum
+ - an operand type such as 'SPV_OPERAND_TYPE_DIMENSIONALITY':
+ the list of operand type names, e.g. '2D', '3D', 'Cube',
+ 'Rect', etc. in the case of SPV_OPERAND_TYPE_DIMENSIONALITY.
+ By convention, the 'kind' string should be a singular noun for
+ the type of object named by each member of the list.
+
+ The IndexRange leaf value encodes a list of strings as in the
+ second case described for 'range_buffer'.
+
+ """
+ def __init__(self) -> None:
+ self.string_total_len: int = 0 # Sum of lengths of all strings in string_buffer
+ self.string_buffer: List[str] = []
+ self.strings: Dict[str, IndexRange] = {}
+ self.ir_to_string: Dict[IndexRange, str] = {} # Inverse of self.strings
+
+ self.range_buffer: Dict[str,List[IndexRange]] = {}
+ # We need StringList here because it's hashable, and so it
+ # can be used as the key for a dict.
+ self.ranges: Dict[str,Dict[StringList,IndexRange]] = {}
+
+ def GetString(self, ir: IndexRange) -> str:
+ if ir in self.ir_to_string:
+ return self.ir_to_string[ir]
+ raise Exception("unregistered index range {}".format(str(ir)))
+
+ def AddString(self, s: str) -> IndexRange:
+ """
+ Adds or finds a string in the string_buffer.
+ Returns its IndexRange.
+ """
+ if s in self.strings:
+ return self.strings[s]
+ # Allocate space, including for the terminating null.
+ s_space: int = len(s) + 1
+ ir = IndexRange(self.string_total_len, s_space)
+ self.strings[s] = ir
+ self.ir_to_string[ir] = s
+ self.string_total_len += s_space
+ self.string_buffer.append(s)
+ return ir
+
+ def AddStringList(self, kind: str, words: List[str]) -> IndexRange:
+ """
+ Ensures a list of strings is recorded in range_buffer[kind], and
+ returns its location in the range_buffer[kind].
+ As a side effect, also ensures each string in the list is in
+ the string_buffer.
+ """
+ l = StringList(words)
+
+ entry: Dict[StringList, IndexRange] = self.ranges.get(kind, {})
+ if kind not in self.ranges:
+ self.ranges[kind] = entry
+ self.range_buffer[kind] = []
+
+ if l in entry:
+ return entry[l]
+ new_ranges = [self.AddString(s) for s in l]
+ ir = IndexRange(len(self.range_buffer[kind]), len(new_ranges))
+ self.range_buffer[kind].extend(new_ranges)
+ entry[l] = ir
+ return ir
+
+ def dump(self) -> None:
+ print("string_total_len: {}".format(self.string_total_len))
+
+ sbi = 0
+ print("string_buffer:")
+ for sb in self.string_buffer:
+ print(" {}: '{}'".format(sbi, sb))
+ sbi += len(sb) + 1
+ print("")
+
+ s = []
+ for k,v in self.strings.items():
+ s.append("'{}': {}".format(k,str(v)))
+ print("strings:\n {}\n".format('\n '.join(s)))
+
+ for rbk, rbv in self.range_buffer.items():
+ print("range_buffer[{}]:".format(rbk))
+ i: int = 0
+ for r in rbv:
+ print(" {} {}: {}".format(rbk, i, str(r)))
+ i += 1
+ print("")
+
+ for rk, rv in self.ranges.items():
+ for key,val in rv.items():
+ print("ranges[{}][{}]: {}".format(str(rk),str(key), str(val)))
+ print("")
+
+
diff --git a/third_party/SPIRV-Tools/utils/Table/Context_test.py b/third_party/SPIRV-Tools/utils/Table/Context_test.py
new file mode 100755
index 0000000..a168bf7
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/Context_test.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+import unittest
+from . Context import Context
+from . IndexRange import IndexRange
+from . StringList import StringList
+
+class TestCreate(unittest.TestCase):
+ def test_creation(self) -> None:
+ x = Context()
+ self.assertIsInstance(x.string_total_len, int)
+ self.assertIsInstance(x.string_buffer, list)
+ self.assertIsInstance(x.strings, dict)
+ self.assertEqual(x.string_total_len, 0)
+ self.assertEqual(x.string_buffer, [])
+ self.assertEqual(x.strings, {})
+
+class TestString(unittest.TestCase):
+ def test_AddString_new(self) -> None:
+ x = Context()
+ abc_ir = x.AddString("abc")
+ self.assertEqual(abc_ir, IndexRange(0,4))
+ self.assertEqual(x.string_total_len, 4)
+ self.assertEqual(x.string_buffer, ["abc"])
+ self.assertEqual(x.strings, {"abc": IndexRange(0,4)})
+
+ qz_ir = x.AddString("qz")
+ self.assertEqual(qz_ir, IndexRange(4,3))
+ self.assertEqual(x.string_total_len, 7)
+ self.assertEqual(x.string_buffer, ["abc", "qz"])
+ self.assertEqual(x.strings, {"abc": IndexRange(0,4), "qz": IndexRange(4,3)})
+
+ empty_ir = x.AddString("")
+ self.assertEqual(empty_ir, IndexRange(7,1))
+ self.assertEqual(x.string_total_len, 8)
+ self.assertEqual(x.string_buffer, ["abc", "qz", ""])
+ self.assertEqual(x.strings, {"abc": IndexRange(0,4), "qz": IndexRange(4,3), "": IndexRange(7,1)})
+
+ def test_AddString_idempotent(self) -> None:
+ x = Context()
+ abc_ir = x.AddString("abc")
+ self.assertEqual(abc_ir, IndexRange(0,4))
+ self.assertEqual(x.string_total_len, 4)
+ self.assertEqual(x.string_buffer, ["abc"])
+ self.assertEqual(x.strings, {"abc": IndexRange(0,4)})
+
+ abc_ir = x.AddString("abc")
+ self.assertEqual(abc_ir, IndexRange(0,4))
+ self.assertEqual(x.string_total_len, 4)
+ self.assertEqual(x.string_buffer, ["abc"])
+ self.assertEqual(x.strings, {"abc": IndexRange(0,4)})
+
+class TestStringList(unittest.TestCase):
+ def test_AddStringList_empty(self) -> None:
+ x = Context()
+ x_ir = x.AddStringList('x', [])
+ self.assertEqual(x_ir, IndexRange(0,0))
+ self.assertEqual(x.string_buffer, [])
+ self.assertEqual(x.range_buffer, { 'x': [] })
+ self.assertEqual(x.ranges, {'x': {StringList([]): IndexRange(0,0)}})
+
+ def test_AddgStringList_nonempty(self) -> None:
+ x = Context()
+ x_ir = x.AddStringList('x', ["abc", "def"])
+
+ self.assertEqual(x_ir, IndexRange(0,2))
+ self.assertEqual(x.range_buffer, {'x': [IndexRange(0,4), IndexRange(4,4)]})
+ self.assertEqual(x.ranges, {'x': {StringList(['abc','def']): IndexRange(0,2)}})
+
+ def test_AddgStringList_nonempty_idempotent(self) -> None:
+ x = Context()
+ x_ir = x.AddStringList('x', ["abc", "def"])
+ y_ir = x.AddStringList('x', ["abc", "def"])
+
+ self.assertEqual(x_ir, IndexRange(0,2))
+ self.assertEqual(y_ir, IndexRange(0,2))
+ self.assertEqual(x.range_buffer, {'x': [IndexRange(0,4), IndexRange(4,4)]})
+ self.assertEqual(x.ranges, {'x': {StringList(['abc','def']): IndexRange(0,2)}})
+
+ def test_AddgStringList_nonempty_does_not_sort(self) -> None:
+ x = Context()
+ x_ir = x.AddStringList('x', ["abc", "def"])
+ y_ir = x.AddStringList('x', ["def", "abc"])
+
+ self.assertEqual(x_ir, IndexRange(0,2))
+ self.assertEqual(y_ir, IndexRange(2,2))
+ self.assertEqual(x.range_buffer, {'x': [IndexRange(0,4),
+ IndexRange(4,4),
+ IndexRange(4,4),
+ IndexRange(0,4)]})
+ self.assertEqual(x.ranges, {'x':{StringList(['abc','def']): IndexRange(0,2),
+ StringList(['def','abc']): IndexRange(2,2)}})
+
+ def test_AddgStringList_separate_by_kind(self) -> None:
+ x = Context()
+ x_ir = x.AddStringList('x', ["abc", "def"])
+ y_ir = x.AddStringList('y', ["ghi", "abc"])
+
+ self.assertEqual(x_ir, IndexRange(0,2))
+ self.assertEqual(y_ir, IndexRange(0,2))
+ self.assertEqual(x.range_buffer,
+ {'x': [IndexRange(0,4), IndexRange(4,4)],
+ 'y': [IndexRange(8,4), IndexRange(0,4)]})
+ self.assertEqual(x.ranges, {'x': {StringList(['abc','def']): IndexRange(0,2)},
+ 'y': {StringList(['ghi','abc']): IndexRange(0,2)}})
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/third_party/SPIRV-Tools/utils/Table/IndexRange.py b/third_party/SPIRV-Tools/utils/Table/IndexRange.py
new file mode 100755
index 0000000..ba29ee2
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/IndexRange.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+from typing import Any
+
+class IndexRange():
+ def __init__(self, first: int, count: int) -> None:
+ self.first = first
+ self.count = count
+ if first < 0:
+ raise Exception("invalid arg: first {} must be non-negative".format(first))
+ if count < 0:
+ raise Exception("invalid arg: count {} must be non-negative".format(count))
+
+ def __eq__(self, other: Any) -> bool:
+ return isinstance(other, IndexRange) and self.first == other.first and self.count == other.count
+
+ def __hash__(self) -> int:
+ return hash("{} {}".format(self.first, self.count))
+
+ def __str__(self) -> str:
+ return "IR({}, {})".format(self.first, self.count)
diff --git a/third_party/SPIRV-Tools/utils/Table/IndexRange_test.py b/third_party/SPIRV-Tools/utils/Table/IndexRange_test.py
new file mode 100755
index 0000000..16f38e4
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/IndexRange_test.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+import unittest
+from . IndexRange import IndexRange
+
+class TestIndexRange(unittest.TestCase):
+ def test_creation(self) -> None:
+ x: IndexRange = IndexRange(4,5);
+ self.assertEqual(x.first, 4)
+ self.assertEqual(x.count, 5)
+
+ def test_creation_bad_first(self) -> None:
+ self.assertRaises(Exception, IndexRange, -1, 5)
+
+ def test_creation_bad_count(self) -> None:
+ self.assertRaises(Exception, IndexRange, 1, -5)
+
+ def test_distinct(self) -> None:
+ x = IndexRange(4, 5);
+ y = IndexRange(6, 7);
+ self.assertNotEqual(x.first, y.first)
+ self.assertNotEqual(x.count, y.count)
+
+ def test_equality(self) -> None:
+ self.assertEqual(IndexRange(4,5), IndexRange(4,5))
+ self.assertNotEqual(IndexRange(4,5), IndexRange(4,7))
+ self.assertNotEqual(IndexRange(7,5), IndexRange(4,5))
+
+ def test_hash_heuristic(self) -> None:
+ x = hash(IndexRange(4,5))
+ y = hash(IndexRange(4,5))
+ z = hash(IndexRange(6,7))
+ self.assertEqual(x, y)
+ self.assertNotEqual(x, z)
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/third_party/SPIRV-Tools/utils/Table/Operand.py b/third_party/SPIRV-Tools/utils/Table/Operand.py
new file mode 100755
index 0000000..8f5fc49
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/Operand.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+from typing import List
+
+class Operand():
+ def __init__(self, json: dict) -> None:
+ val = json.get('value',None)
+
+ self._obj = json
+
+ @property
+ def enumerant(self) -> str:
+ result = self._obj.get('enumerant', None)
+ if result is None:
+ raise Exception("operand needs an enumerant string")
+ return result
+
+ @property
+ def value(self) -> int:
+ val: str|int = self._obj['value']
+ if isinstance(val, int):
+ return val
+ elif isinstance(val,str):
+ if val.startswith("0x"):
+ return int(val, 16)
+ else:
+ return int(val, 10)
+ else:
+ raise Exception("operand needs a value integer or string")
+
+ @property
+ def capabilities(self) -> List[str]:
+ return self._obj.get('capabilities',[])
+
+ @property
+ def extensions(self) -> List[str]:
+ return self._obj.get('extensions',[])
+
+ @property
+ def aliases(self) -> List[str]:
+ return self._obj.get('aliases',[])
+
+ @property
+ def parameters(self) -> List[dict]:
+ return self._obj.get('parameters',[])
+
+ @property
+ def version(self): # -> str | None # Invald in Python 3.8
+ return self._obj.get('version',None)
+
+ @property
+ def lastVersion(self): # -> str | None # Invalid in Python 3.8
+ return self._obj.get('lastVersion',None)
diff --git a/third_party/SPIRV-Tools/utils/Table/Operand_test.py b/third_party/SPIRV-Tools/utils/Table/Operand_test.py
new file mode 100755
index 0000000..30a197c
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/Operand_test.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+import unittest
+from . Operand import *
+
+class TestOperand(unittest.TestCase):
+ def test_enumerant(self) -> None:
+ x = Operand({'enumerant': 'abc'});
+ self.assertEqual(x.enumerant, 'abc');
+
+ def test_value_decimal(self) -> None:
+ x = Operand({'value': 123});
+ self.assertEqual(x.value, 123);
+
+ def test_value_str_hex(self) -> None:
+ x = Operand({'value': "0x0101"});
+ self.assertEqual(x.value, 257);
+
+ def test_value_str_dec(self) -> None:
+ x = Operand({'value': "0101"});
+ self.assertEqual(x.value, 101);
+
+ def test_value_str_invalid_dec(self) -> None:
+ x = Operand({'value': "01ab"});
+ self.assertRaises(Exception, lambda y: x.value, 0);
+
+ def test_value_str_invalid_hex(self) -> None:
+ x = Operand({'value': "0x010j"});
+ self.assertRaises(Exception, lambda y: x.value, 0);
+
+ def test_capabilities_absent(self) -> None:
+ x = Operand({});
+ self.assertEqual(x.capabilities, []);
+
+ def test_capabilities_present(self) -> None:
+ x = Operand({'capabilities': ['abc', 'def']});
+ self.assertEqual(x.capabilities, ['abc', 'def']);
+
+ def test_extensions_absent(self) -> None:
+ x = Operand({});
+ self.assertEqual(x.extensions, []);
+
+ def test_extensions_present(self) -> None:
+ x = Operand({'extensions': ['abc', 'def']});
+ self.assertEqual(x.extensions, ['abc', 'def']);
+
+ def test_aliases_absent(self) -> None:
+ x = Operand({});
+ self.assertEqual(x.aliases, []);
+
+ def test_aliases_present(self) -> None:
+ x = Operand({'aliases': ['abc', 'def']});
+ self.assertEqual(x.aliases, ['abc', 'def']);
+
+ def test_parameters_absent(self) -> None:
+ x = Operand({});
+ self.assertEqual(x.parameters, []);
+
+ def test_parameters_present(self) -> None:
+ x = Operand({'parameters': ['abc', 'def']});
+ self.assertEqual(x.parameters, ['abc', 'def']);
+
+ def test_version_absent(self) -> None:
+ x = Operand({});
+ self.assertEqual(x.version, None);
+
+ def test_version_present(self) -> None:
+ x = Operand({'version': '1.0'});
+ self.assertEqual(x.version, '1.0');
+
+ def test_lastVersion_absent(self) -> None:
+ x = Operand({});
+ self.assertEqual(x.lastVersion, None);
+
+ def test_lastVersion_present(self) -> None:
+ x = Operand({'lastVersion': '1.3'});
+ self.assertEqual(x.lastVersion, '1.3');
+
+ def test_all_propertites(self) -> None:
+ x = Operand({'enumerant': 'Foobar',
+ 'value': 12,
+ 'capabilities': ["yes"],
+ 'extensions': ["SPV_FOOBAR_baz_bat"],
+ 'version': "1.0",
+ 'lastVersion': "1.3",
+ });
+ self.assertEqual(x.enumerant, 'Foobar');
+ self.assertEqual(x.value, 12);
+ self.assertEqual(x.capabilities, ["yes"]);
+ self.assertEqual(x.extensions, ["SPV_FOOBAR_baz_bat"]);
+ self.assertEqual(x.version, '1.0');
+ self.assertEqual(x.lastVersion, '1.3');
diff --git a/third_party/SPIRV-Tools/utils/Table/StringList.py b/third_party/SPIRV-Tools/utils/Table/StringList.py
new file mode 100755
index 0000000..0ba166b
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/StringList.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+import functools
+from typing import List
+
+class StringList(list):
+ """
+ A hashable ordered list of strings.
+ This can be used as the key for a dictionary.
+ """
+ def __init__(self, strs: List[str]) -> None:
+ super().__init__(strs)
+
+ def __hash__(self) -> int: # type: ignore[override]
+ return functools.reduce(lambda h, ir: hash((h, hash(ir))), self, 0)
diff --git a/third_party/SPIRV-Tools/utils/Table/StringList_test.py b/third_party/SPIRV-Tools/utils/Table/StringList_test.py
new file mode 100755
index 0000000..d3cd1ed
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/Table/StringList_test.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+# Copyright 2025 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.
+
+import unittest
+from . StringList import *
+
+class TestStringList(unittest.TestCase):
+ def test_creation_empty(self) -> None:
+ x = StringList([])
+ self.assertEqual(len(x), 0)
+ self.assertEqual(x, [])
+
+ def test_creation_nonempty(self) -> None:
+ x = StringList(["abc", "def"])
+ self.assertEqual(len(x), 2)
+ self.assertEqual(x, ["abc", "def"])
+
+ def test_creation_does_not_sort(self) -> None:
+ x = StringList(["abc", "def"])
+ self.assertEqual(x, ["abc", "def"])
+ self.assertNotEqual(x, ["def", "abc"])
+
+ def test_equality(self) -> None:
+ x = StringList(["abc", "def"])
+ y = StringList(["abc", "def"])
+ z = StringList(["abc", "ef"])
+ self.assertEqual(x, x)
+ self.assertEqual(x, y)
+ self.assertNotEqual(x, z)
+
+ def test_hash_heuristic(self) -> None:
+ x = StringList(["abc", "def"])
+ y = StringList(["abc", "def"])
+ z = StringList(["abc", "df"])
+ self.assertEqual(hash(x), hash(x))
+ self.assertEqual(hash(x), hash(y))
+ self.assertNotEqual(hash(x), hash(z))
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/presubmit.cfg b/third_party/SPIRV-Tools/utils/Table/__init__.py
similarity index 72%
copy from third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/presubmit.cfg
copy to third_party/SPIRV-Tools/utils/Table/__init__.py
index 0ed3594..2210b4e 100644
--- a/third_party/SPIRV-Tools/kokoro/windows-msvc-2019-debug/presubmit.cfg
+++ b/third_party/SPIRV-Tools/utils/Table/__init__.py
@@ -1,16 +1,18 @@
-# Copyright (c) 2023 Google LLC
-#
+#!/usr/bin/env python3
+# Copyright 2025 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
+# 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-2019-debug/build.bat"
+__all__ = [
+ "Context",
+ "IndexRange",
+]
diff --git a/third_party/SPIRV-Tools/utils/check_code_format.sh b/third_party/SPIRV-Tools/utils/check_code_format.sh
index da5e019..96db03f 100755
--- a/third_party/SPIRV-Tools/utils/check_code_format.sh
+++ b/third_party/SPIRV-Tools/utils/check_code_format.sh
@@ -12,13 +12,33 @@
# 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.
-#
-# Script to determine if source code in Pull Request is properly formatted.
-# Exits with non 0 exit code if formatting is needed.
-#
-# This script assumes to be invoked at the project root directory.
-BASE_BRANCH=${1:-main}
+# This script determines if the source code in a Pull Request is properly formatted.
+# Exits with non 0 exit code if formatting is needed.
+# Assumptions:
+# - git and python3 are on the path
+# - Runs from the project root diretory.
+# - 'clang-format' is on the path, or env var CLANG_FORMAT points to it.
+# - 'clang-format-diff.py' is in the utils directory, or env var
+# points to it.CLANG_FORMAT_DIFF
+
+BASE_BRANCH=$(git merge-base main HEAD)
+
+CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
+if [ ! -f "$CLANG_FORMAT" ]; then
+ echo missing clang-format: set CLANG_FORMAT or put clang-format in the PATH
+ exit 1
+fi
+
+# Find clang-format-diff.py from an environment variable, or use a default
+CLANG_FORMAT_DIFF=${CLANG_FORMAT_DIFF:-./utils/clang-format-diff.py}
+if [ ! -f "$CLANG_FORMAT_DIFF" ]; then
+ echo missing clang-format-diffy.py: set CLANG_FORMAT_DIFF or put it in ./utils/clang-format-diff.py
+ exit 1
+fi
+
+echo "Comparing "$(git rev-parse HEAD)" against $BASE_BRANCH"
+echo Using $("$CLANG_FORMAT" --version)
FILES_TO_CHECK=$(git diff --name-only ${BASE_BRANCH} | grep -E ".*\.(cpp|cc|c\+\+|cxx|c|h|hpp)$")
@@ -26,8 +46,11 @@
echo "No source code to check for formatting."
exit 0
fi
+echo "Checking Formatting for the following files"
+echo "${FILES_TO_CHECK}"
+echo
-FORMAT_DIFF=$(git diff -U0 ${BASE_BRANCH} -- ${FILES_TO_CHECK} | python ./utils/clang-format-diff.py -p1 -style=file)
+FORMAT_DIFF=$(git diff -U0 ${BASE_BRANCH} -- ${FILES_TO_CHECK} | python3 "${CLANG_FORMAT_DIFF}" -p1 -style=file -binary "$CLANG_FORMAT")
if [ -z "${FORMAT_DIFF}" ]; then
echo "All source code in PR properly formatted."
diff --git a/third_party/SPIRV-Tools/utils/check_copyright.py b/third_party/SPIRV-Tools/utils/check_copyright.py
index a849d04..ca4a218 100755
--- a/third_party/SPIRV-Tools/utils/check_copyright.py
+++ b/third_party/SPIRV-Tools/utils/check_copyright.py
@@ -37,13 +37,16 @@
'André Perez Maselco',
'Vasyl Teliman',
'Advanced Micro Devices, Inc.',
+ 'Arm Ltd.',
'Stefano Milizia',
'Alastair F. Donaldson',
'Mostafa Ashraf',
'Shiyu Liu',
'ZHOU He',
- 'Nintendo']
-CURRENT_YEAR = 2023
+ 'Nintendo',
+ 'Epic Games, Inc.',
+ 'NVIDIA Corporation']
+CURRENT_YEAR = 2025
FIRST_YEAR = 2014
FINAL_YEAR = CURRENT_YEAR + 5
@@ -63,7 +66,7 @@
YEAR_OR_RANGE_REGEX = '(' + YEAR_REGEX + '|' + YEAR_RANGE_REGEX + ')'
# The final regular expression to match a valid copyright line.
-COPYRIGHT_RE = re.compile('Copyright \(c\) {} ({})'.format(
+COPYRIGHT_RE = re.compile('Copyright( \\(c\\))? {} ({})'.format(
YEAR_OR_RANGE_REGEX, '|'.join(AUTHORS)))
MIT_BEGIN_RE = re.compile('Permission is hereby granted, '
@@ -71,7 +74,7 @@
MIT_END_RE = re.compile('MATERIALS OR THE USE OR OTHER DEALINGS IN '
'THE MATERIALS.')
APACHE2_BEGIN_RE = re.compile('Licensed under the Apache License, '
- 'Version 2.0 \(the "License"\);')
+ 'Version 2.0 \\(the "License"\\);')
APACHE2_END_RE = re.compile('limitations under the License.')
LICENSED = """Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/third_party/SPIRV-Tools/utils/generate_grammar_tables.py b/third_party/SPIRV-Tools/utils/generate_grammar_tables.py
deleted file mode 100755
index 88534ff..0000000
--- a/third_party/SPIRV-Tools/utils/generate_grammar_tables.py
+++ /dev/null
@@ -1,903 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2016 Google Inc.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Generates various info tables from SPIR-V JSON grammar."""
-
-import errno
-import json
-import os.path
-import re
-
-# Prefix for all C variables generated by this script.
-PYGEN_VARIABLE_PREFIX = 'pygen_variable'
-
-# Extensions to recognize, but which don't necessarily come from the SPIR-V
-# core or KHR grammar files. Get this list from the SPIR-V registry web page.
-# NOTE: Only put things on this list if it is not in those grammar files.
-EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS = """
-SPV_AMD_gcn_shader
-SPV_AMD_gpu_shader_half_float
-SPV_AMD_gpu_shader_int16
-SPV_AMD_shader_trinary_minmax
-SPV_KHR_non_semantic_info
-"""
-
-OUTPUT_LANGUAGE = 'c'
-
-def make_path_to_file(f):
- """Makes all ancestor directories to the given file, if they don't yet
- exist.
-
- Arguments:
- f: The file whose ancestor directories are to be created.
- """
- dir = os.path.dirname(os.path.abspath(f))
- try:
- os.makedirs(dir)
- except OSError as e:
- if e.errno == errno.EEXIST and os.path.isdir(dir):
- pass
- else:
- raise
-
-
-def convert_min_required_version(version):
- """Converts the minimal required SPIR-V version encoded in the grammar to
- the symbol in SPIRV-Tools."""
- if version is None:
- return 'SPV_SPIRV_VERSION_WORD(1, 0)'
- if version == 'None':
- return '0xffffffffu'
- return 'SPV_SPIRV_VERSION_WORD({})'.format(version.replace('.', ','))
-
-
-def convert_max_required_version(version):
- """Converts the maximum required SPIR-V version encoded in the grammar to
- the symbol in SPIRV-Tools."""
- if version is None:
- return '0xffffffffu'
- return 'SPV_SPIRV_VERSION_WORD({})'.format(version.replace('.', ','))
-
-
-def compose_capability_list(caps):
- """Returns a string containing a braced list of capabilities as enums.
-
- Arguments:
- - caps: a sequence of capability names
-
- Returns:
- a string containing the braced list of SpvCapability* or spv::Capability:: enums named by caps.
- """
- base_string = 'SpvCapability'
- global OUTPUT_LANGUAGE
- if OUTPUT_LANGUAGE == 'c++':
- base_string = 'spv::Capability::'
-
- return '{' + ', '.join([(base_string + '{}').format(c) for c in caps]) + '}'
-
-
-def get_capability_array_name(caps):
- """Returns the name of the array containing all the given capabilities.
-
- Args:
- - caps: a sequence of capability names
- """
- if not caps:
- return 'nullptr'
- return '{}_caps_{}'.format(PYGEN_VARIABLE_PREFIX, ''.join(caps))
-
-
-def generate_capability_arrays(caps):
- """Returns the arrays of capabilities.
-
- Arguments:
- - caps: a sequence of sequence of capability names
- """
- caps = sorted(set([tuple(c) for c in caps if c]))
- cap_str = 'SpvCapability'
- global OUTPUT_LANGUAGE
- if OUTPUT_LANGUAGE == 'c++':
- cap_str = 'spv::Capability'
- arrays = [
- 'static const ' + cap_str + ' {}[] = {};'.format(
- get_capability_array_name(c), compose_capability_list(c))
- for c in caps]
- return '\n'.join(arrays)
-
-
-def compose_extension_list(exts):
- """Returns a string containing a braced list of extensions as enums.
-
- Arguments:
- - exts: a sequence of extension names
-
- Returns:
- a string containing the braced list of extensions named by exts.
- """
- return '{' + ', '.join(
- ['spvtools::Extension::k{}'.format(e) for e in exts]) + '}'
-
-
-def get_extension_array_name(extensions):
- """Returns the name of the array containing all the given extensions.
-
- Args:
- - extensions: a sequence of extension names
- """
- if not extensions:
- return 'nullptr'
- else:
- return '{}_exts_{}'.format(
- PYGEN_VARIABLE_PREFIX, ''.join(extensions))
-
-
-def generate_extension_arrays(extensions):
- """Returns the arrays of extensions.
-
- Arguments:
- - caps: a sequence of sequence of extension names
- """
- extensions = sorted(set([tuple(e) for e in extensions if e]))
- arrays = [
- 'static const spvtools::Extension {}[] = {};'.format(
- get_extension_array_name(e), compose_extension_list(e))
- for e in extensions]
- return '\n'.join(arrays)
-
-
-def convert_operand_kind(operand_tuple):
- """Returns the corresponding operand type used in spirv-tools for the given
- operand kind and quantifier used in the JSON grammar.
-
- Arguments:
- - operand_tuple: a tuple of two elements:
- - operand kind: used in the JSON grammar
- - quantifier: '', '?', or '*'
-
- Returns:
- a string of the enumerant name in spv_operand_type_t
- """
- kind, quantifier = operand_tuple
- # The following cases are where we differ between the JSON grammar and
- # spirv-tools.
- if kind == 'IdResultType':
- kind = 'TypeId'
- elif kind == 'IdResult':
- kind = 'ResultId'
- elif kind == 'IdMemorySemantics' or kind == 'MemorySemantics':
- kind = 'MemorySemanticsId'
- elif kind == 'IdScope' or kind == 'Scope':
- kind = 'ScopeId'
- elif kind == 'IdRef':
- kind = 'Id'
-
- elif kind == 'ImageOperands':
- kind = 'Image'
- elif kind == 'Dim':
- kind = 'Dimensionality'
- elif kind == 'ImageFormat':
- kind = 'SamplerImageFormat'
- elif kind == 'KernelEnqueueFlags':
- kind = 'KernelEnqFlags'
-
- elif kind == 'LiteralExtInstInteger':
- kind = 'ExtensionInstructionNumber'
- elif kind == 'LiteralSpecConstantOpInteger':
- kind = 'SpecConstantOpNumber'
- elif kind == 'LiteralContextDependentNumber':
- kind = 'TypedLiteralNumber'
-
- elif kind == 'PairLiteralIntegerIdRef':
- kind = 'LiteralIntegerId'
- elif kind == 'PairIdRefLiteralInteger':
- kind = 'IdLiteralInteger'
- elif kind == 'PairIdRefIdRef': # Used by OpPhi in the grammar
- kind = 'Id'
-
- if kind == 'FPRoundingMode':
- kind = 'FpRoundingMode'
- elif kind == 'FPFastMathMode':
- kind = 'FpFastMathMode'
-
- if quantifier == '?':
- kind = 'Optional{}'.format(kind)
- elif quantifier == '*':
- kind = 'Variable{}'.format(kind)
-
- return 'SPV_OPERAND_TYPE_{}'.format(
- re.sub(r'([a-z])([A-Z])', r'\1_\2', kind).upper())
-
-
-class InstInitializer(object):
- """Instances holds a SPIR-V instruction suitable for printing as the
- initializer for spv_opcode_desc_t."""
-
- def __init__(self, opname, caps, exts, operands, version, lastVersion):
- """Initialization.
-
- Arguments:
- - opname: opcode name (with the 'Op' prefix)
- - caps: a sequence of capability names required by this opcode
- - exts: a sequence of names of extensions enabling this enumerant
- - operands: a sequence of (operand-kind, operand-quantifier) tuples
- - version: minimal SPIR-V version required for this opcode
- - lastVersion: last version of SPIR-V that includes this opcode
- """
-
- assert opname.startswith('Op')
- self.opname = opname[2:] # Remove the "Op" prefix.
- self.num_caps = len(caps)
- self.caps_mask = get_capability_array_name(caps)
- self.num_exts = len(exts)
- self.exts = get_extension_array_name(exts)
- self.operands = [convert_operand_kind(o) for o in operands]
-
- self.fix_syntax()
-
- operands = [o[0] for o in operands]
- self.ref_type_id = 'IdResultType' in operands
- self.def_result_id = 'IdResult' in operands
-
- self.version = convert_min_required_version(version)
- self.lastVersion = convert_max_required_version(lastVersion)
-
- def fix_syntax(self):
- """Fix an instruction's syntax, adjusting for differences between the
- officially released grammar and how SPIRV-Tools uses the grammar.
-
- Fixes:
- - ExtInst should not end with SPV_OPERAND_VARIABLE_ID.
- https://github.com/KhronosGroup/SPIRV-Tools/issues/233
- """
- if (self.opname == 'ExtInst'
- and self.operands[-1] == 'SPV_OPERAND_TYPE_VARIABLE_ID'):
- self.operands.pop()
-
- def __str__(self):
- global OUTPUT_LANGUAGE
- base_str = 'SpvOp'
- if OUTPUT_LANGUAGE == 'c++':
- base_str = 'spv::Op::Op'
-
- template = ['{{"{opname}"', base_str + '{opname}',
- '{num_caps}', '{caps_mask}',
- '{num_operands}', '{{{operands}}}',
- '{def_result_id}', '{ref_type_id}',
- '{num_exts}', '{exts}',
- '{min_version}', '{max_version}}}']
- return ', '.join(template).format(
- opname=self.opname,
- num_caps=self.num_caps,
- caps_mask=self.caps_mask,
- num_operands=len(self.operands),
- operands=', '.join(self.operands),
- def_result_id=(1 if self.def_result_id else 0),
- ref_type_id=(1 if self.ref_type_id else 0),
- num_exts=self.num_exts,
- exts=self.exts,
- min_version=self.version,
- max_version=self.lastVersion)
-
-
-class ExtInstInitializer(object):
- """Instances holds a SPIR-V extended instruction suitable for printing as
- the initializer for spv_ext_inst_desc_t."""
-
- def __init__(self, opname, opcode, caps, operands):
- """Initialization.
-
- Arguments:
- - opname: opcode name
- - opcode: enumerant value for this opcode
- - caps: a sequence of capability names required by this opcode
- - operands: a sequence of (operand-kind, operand-quantifier) tuples
- """
- self.opname = opname
- self.opcode = opcode
- self.num_caps = len(caps)
- self.caps_mask = get_capability_array_name(caps)
- self.operands = [convert_operand_kind(o) for o in operands]
- self.operands.append('SPV_OPERAND_TYPE_NONE')
-
- def __str__(self):
- template = ['{{"{opname}"', '{opcode}', '{num_caps}', '{caps_mask}',
- '{{{operands}}}}}']
- return ', '.join(template).format(
- opname=self.opname,
- opcode=self.opcode,
- num_caps=self.num_caps,
- caps_mask=self.caps_mask,
- operands=', '.join(self.operands))
-
-
-def generate_instruction(inst, is_ext_inst):
- """Returns the C initializer for the given SPIR-V instruction.
-
- Arguments:
- - inst: a dict containing information about a SPIR-V instruction
- - is_ext_inst: a bool indicating whether |inst| is an extended
- instruction.
-
- Returns:
- a string containing the C initializer for spv_opcode_desc_t or
- spv_ext_inst_desc_t
- """
- opname = inst.get('opname')
- opcode = inst.get('opcode')
- caps = inst.get('capabilities', [])
- exts = inst.get('extensions', [])
- operands = inst.get('operands', {})
- operands = [(o['kind'], o.get('quantifier', '')) for o in operands]
- min_version = inst.get('version', None)
- max_version = inst.get('lastVersion', None)
-
- assert opname is not None
-
- if is_ext_inst:
- return str(ExtInstInitializer(opname, opcode, caps, operands))
- else:
- return str(InstInitializer(opname, caps, exts, operands, min_version, max_version))
-
-
-def generate_instruction_table(inst_table):
- """Returns the info table containing all SPIR-V instructions, sorted by
- opcode, and prefixed by capability arrays.
-
- Note:
- - the built-in sorted() function is guaranteed to be stable.
- https://docs.python.org/3/library/functions.html#sorted
-
- Arguments:
- - inst_table: a list containing all SPIR-V instructions.
- """
- inst_table = sorted(inst_table, key=lambda k: (k['opcode'], k['opname']))
-
- caps_arrays = generate_capability_arrays(
- [inst.get('capabilities', []) for inst in inst_table])
- exts_arrays = generate_extension_arrays(
- [inst.get('extensions', []) for inst in inst_table])
-
- insts = [generate_instruction(inst, False) for inst in inst_table]
- insts = ['static const spv_opcode_desc_t kOpcodeTableEntries[] = {{\n'
- ' {}\n}};'.format(',\n '.join(insts))]
-
- return '{}\n\n{}\n\n{}'.format(caps_arrays, exts_arrays, '\n'.join(insts))
-
-
-def generate_extended_instruction_table(json_grammar, set_name, operand_kind_prefix=""):
- """Returns the info table containing all SPIR-V extended instructions,
- sorted by opcode, and prefixed by capability arrays.
-
- Arguments:
- - inst_table: a list containing all SPIR-V instructions.
- - set_name: the name of the extended instruction set.
- - operand_kind_prefix: the prefix, if any, to add to the front
- of operand kind names.
- """
- if operand_kind_prefix:
- prefix_operand_kind_names(operand_kind_prefix, json_grammar)
-
- inst_table = json_grammar["instructions"]
- set_name = set_name.replace(".", "_")
-
- inst_table = sorted(inst_table, key=lambda k: k['opcode'])
- caps = [inst.get('capabilities', []) for inst in inst_table]
- caps_arrays = generate_capability_arrays(caps)
- insts = [generate_instruction(inst, True) for inst in inst_table]
- insts = ['static const spv_ext_inst_desc_t {}_entries[] = {{\n'
- ' {}\n}};'.format(set_name, ',\n '.join(insts))]
-
- return '{}\n\n{}'.format(caps_arrays, '\n'.join(insts))
-
-
-class EnumerantInitializer(object):
- """Prints an enumerant as the initializer for spv_operand_desc_t."""
-
- def __init__(self, enumerant, value, caps, exts, parameters, version, lastVersion):
- """Initialization.
-
- Arguments:
- - enumerant: enumerant name
- - value: enumerant value
- - caps: a sequence of capability names required by this enumerant
- - exts: a sequence of names of extensions enabling this enumerant
- - parameters: a sequence of (operand-kind, operand-quantifier) tuples
- - version: minimal SPIR-V version required for this opcode
- - lastVersion: last SPIR-V version this opode appears
- """
- self.enumerant = enumerant
- self.value = value
- self.num_caps = len(caps)
- self.caps = get_capability_array_name(caps)
- self.num_exts = len(exts)
- self.exts = get_extension_array_name(exts)
- self.parameters = [convert_operand_kind(p) for p in parameters]
- self.version = convert_min_required_version(version)
- self.lastVersion = convert_max_required_version(lastVersion)
-
- def __str__(self):
- template = ['{{"{enumerant}"', '{value}', '{num_caps}',
- '{caps}', '{num_exts}', '{exts}',
- '{{{parameters}}}', '{min_version}',
- '{max_version}}}']
- return ', '.join(template).format(
- enumerant=self.enumerant,
- value=self.value,
- num_caps=self.num_caps,
- caps=self.caps,
- num_exts=self.num_exts,
- exts=self.exts,
- parameters=', '.join(self.parameters),
- min_version=self.version,
- max_version=self.lastVersion)
-
-
-def generate_enum_operand_kind_entry(entry, extension_map):
- """Returns the C initializer for the given operand enum entry.
-
- Arguments:
- - entry: a dict containing information about an enum entry
- - extension_map: a dict mapping enum value to list of extensions
-
- Returns:
- a string containing the C initializer for spv_operand_desc_t
- """
- enumerant = entry.get('enumerant')
- value = entry.get('value')
- caps = entry.get('capabilities', [])
- if value in extension_map:
- exts = extension_map[value]
- else:
- exts = []
- params = entry.get('parameters', [])
- params = [p.get('kind') for p in params]
- params = zip(params, [''] * len(params))
- version = entry.get('version', None)
- max_version = entry.get('lastVersion', None)
-
- assert enumerant is not None
- assert value is not None
-
- return str(EnumerantInitializer(
- enumerant, value, caps, exts, params, version, max_version))
-
-
-def generate_enum_operand_kind(enum, synthetic_exts_list):
- """Returns the C definition for the given operand kind.
- It's a static const named array of spv_operand_desc_t.
-
- Also appends to |synthetic_exts_list| a list of extension lists
- used.
- """
- kind = enum.get('kind')
- assert kind is not None
-
- # Sort all enumerants according to their values, but otherwise
- # preserve their order so the first name listed in the grammar
- # as the preferred name for disassembly.
- if enum.get('category') == 'ValueEnum':
- def functor(k): return (k['value'])
- else:
- def functor(k): return (int(k['value'], 16))
- entries = sorted(enum.get('enumerants', []), key=functor)
-
- # SubgroupEqMask and SubgroupEqMaskKHR are the same number with
- # same semantics, but one has no extension list while the other
- # does. Both should have the extension list.
- # So create a mapping from enum value to the union of the extensions
- # across all those grammar entries. Preserve order.
- extension_map = {}
- for e in entries:
- value = e.get('value')
- extension_map[value] = []
- for e in entries:
- value = e.get('value')
- exts = e.get('extensions', [])
- for ext in exts:
- if ext not in extension_map[value]:
- extension_map[value].append(ext)
- synthetic_exts_list.extend(extension_map.values())
-
- name = '{}_{}Entries'.format(PYGEN_VARIABLE_PREFIX, kind)
- entries = [' {}'.format(generate_enum_operand_kind_entry(e, extension_map))
- for e in entries]
-
- template = ['static const spv_operand_desc_t {name}[] = {{',
- '{entries}', '}};']
- entries = '\n'.join(template).format(
- name=name,
- entries=',\n'.join(entries))
-
- return kind, name, entries
-
-
-def generate_operand_kind_table(enums):
- """Returns the info table containing all SPIR-V operand kinds."""
- # We only need to output info tables for those operand kinds that are enums.
- enums = [e for e in enums if e.get('category') in ['ValueEnum', 'BitEnum']]
-
- caps = [entry.get('capabilities', [])
- for enum in enums
- for entry in enum.get('enumerants', [])]
- caps_arrays = generate_capability_arrays(caps)
-
- exts = [entry.get('extensions', [])
- for enum in enums
- for entry in enum.get('enumerants', [])]
- enums = [generate_enum_operand_kind(e, exts) for e in enums]
- exts_arrays = generate_extension_arrays(exts)
-
- # We have a few operand kinds that require their optional counterpart to
- # exist in the operand info table.
- optional_enums = ['ImageOperands', 'AccessQualifier', 'MemoryAccess', 'PackedVectorFormat', 'CooperativeMatrixOperands', 'RawAccessChainOperands']
- optional_enums = [e for e in enums if e[0] in optional_enums]
- enums.extend(optional_enums)
-
- enum_kinds, enum_names, enum_entries = zip(*enums)
- # Mark the last few as optional ones.
- enum_quantifiers = [''] * (len(enums) - len(optional_enums)) + ['?'] * len(optional_enums)
- # And we don't want redefinition of them.
- enum_entries = enum_entries[:-len(optional_enums)]
- enum_kinds = [convert_operand_kind(e)
- for e in zip(enum_kinds, enum_quantifiers)]
- table_entries = zip(enum_kinds, enum_names, enum_names)
- table_entries = [' {{{}, ARRAY_SIZE({}), {}}}'.format(*e)
- for e in table_entries]
-
- template = [
- 'static const spv_operand_desc_group_t {p}_OperandInfoTable[] = {{',
- '{enums}', '}};']
- table = '\n'.join(template).format(
- p=PYGEN_VARIABLE_PREFIX, enums=',\n'.join(table_entries))
-
- return '\n\n'.join((caps_arrays,) + (exts_arrays,) + enum_entries + (table,))
-
-
-def get_extension_list(instructions, operand_kinds):
- """Returns extensions as an alphabetically sorted list of strings."""
-
- things_with_an_extensions_field = [item for item in instructions]
-
- enumerants = sum([item.get('enumerants', [])
- for item in operand_kinds], [])
-
- things_with_an_extensions_field.extend(enumerants)
-
- extensions = sum([item.get('extensions', [])
- for item in things_with_an_extensions_field
- if item.get('extensions')], [])
-
- for item in EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS.split():
- # If it's already listed in a grammar, then don't put it in the
- # special exceptions list.
- assert item not in extensions, 'Extension %s is already in a grammar file' % item
-
- extensions.extend(
- EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS.split())
-
- # Validator would ignore type declaration unique check. Should only be used
- # for legacy autogenerated test files containing multiple instances of the
- # same type declaration, if fixing the test by other methods is too
- # difficult. Shouldn't be used for any other reasons.
- extensions.append('SPV_VALIDATOR_ignore_type_decl_unique')
-
- return sorted(set(extensions))
-
-
-def get_capabilities(operand_kinds):
- """Returns capabilities as a list of JSON objects, in order of
- appearance."""
- enumerants = sum([item.get('enumerants', []) for item in operand_kinds
- if item.get('kind') in ['Capability']], [])
- return enumerants
-
-
-def generate_extension_enum(extensions):
- """Returns enumeration containing extensions declared in the grammar."""
- return ',\n'.join(['k' + extension for extension in extensions])
-
-
-def generate_extension_to_string_mapping(extensions):
- """Returns mapping function from extensions to corresponding strings."""
- function = 'const char* ExtensionToString(Extension extension) {\n'
- function += ' switch (extension) {\n'
- template = ' case Extension::k{extension}:\n' \
- ' return "{extension}";\n'
- function += ''.join([template.format(extension=extension)
- for extension in extensions])
- function += ' }\n\n return "";\n}'
- return function
-
-
-def generate_string_to_extension_mapping(extensions):
- """Returns mapping function from strings to corresponding extensions."""
-
- function = '''
- bool GetExtensionFromString(const char* str, Extension* extension) {{
- static const char* known_ext_strs[] = {{ {strs} }};
- static const Extension known_ext_ids[] = {{ {ids} }};
- const auto b = std::begin(known_ext_strs);
- const auto e = std::end(known_ext_strs);
- const auto found = std::equal_range(
- b, e, str, [](const char* str1, const char* str2) {{
- return std::strcmp(str1, str2) < 0;
- }});
- if (found.first == e || found.first == found.second) return false;
-
- *extension = known_ext_ids[found.first - b];
- return true;
- }}
- '''.format(strs=', '.join(['"{}"'.format(e) for e in extensions]),
- ids=', '.join(['Extension::k{}'.format(e) for e in extensions]))
-
- return function
-
-
-def generate_capability_to_string_mapping(operand_kinds):
- """Returns mapping function from capabilities to corresponding strings.
-
- We take care to avoid emitting duplicate values.
- """
- cap_str = 'SpvCapability'
- cap_join = ''
- global OUTPUT_LANGUAGE
- if OUTPUT_LANGUAGE == 'c++':
- cap_str = 'spv::Capability'
- cap_join = '::'
-
- function = 'const char* CapabilityToString(' + cap_str + ' capability) {\n'
- function += ' switch (capability) {\n'
- template = ' case ' + cap_str + cap_join + '{capability}:\n' \
- ' return "{capability}";\n'
- emitted = set() # The values of capabilities we already have emitted
- for capability in get_capabilities(operand_kinds):
- value = capability.get('value')
- if value not in emitted:
- emitted.add(value)
- function += template.format(capability=capability.get('enumerant'))
- function += ' case ' + cap_str + cap_join + 'Max:\n' \
- ' assert(0 && "Attempting to convert ' + cap_str + cap_join + 'Max to string");\n' \
- ' return "";\n'
- function += ' }\n\n return "";\n}'
- return function
-
-
-def generate_all_string_enum_mappings(extensions, operand_kinds):
- """Returns all string-to-enum / enum-to-string mapping tables."""
- tables = []
- tables.append(generate_extension_to_string_mapping(extensions))
- tables.append(generate_string_to_extension_mapping(extensions))
- tables.append(generate_capability_to_string_mapping(operand_kinds))
- return '\n\n'.join(tables)
-
-
-def precondition_operand_kinds(operand_kinds):
- """For operand kinds that have the same number, make sure they all have the
- same extension list."""
-
- # Map operand kind and value to list of the union of extensions
- # for same-valued enumerants.
- exts = {}
- for kind_entry in operand_kinds:
- kind = kind_entry.get('kind')
- for enum_entry in kind_entry.get('enumerants', []):
- value = enum_entry.get('value')
- key = kind + '.' + str(value)
- if key in exts:
- exts[key].extend(enum_entry.get('extensions', []))
- else:
- exts[key] = enum_entry.get('extensions', [])
- exts[key] = sorted(set(exts[key]))
-
- # Now make each entry the same list.
- for kind_entry in operand_kinds:
- kind = kind_entry.get('kind')
- for enum_entry in kind_entry.get('enumerants', []):
- value = enum_entry.get('value')
- key = kind + '.' + str(value)
- if len(exts[key]) > 0:
- enum_entry['extensions'] = exts[key]
-
- return operand_kinds
-
-
-def prefix_operand_kind_names(prefix, json_dict):
- """Modifies json_dict, by prefixing all the operand kind names
- with the given prefix. Also modifies their uses in the instructions
- to match.
- """
-
- old_to_new = {}
- for operand_kind in json_dict["operand_kinds"]:
- old_name = operand_kind["kind"]
- new_name = prefix + old_name
- operand_kind["kind"] = new_name
- old_to_new[old_name] = new_name
-
- for instruction in json_dict["instructions"]:
- for operand in instruction.get("operands", []):
- replacement = old_to_new.get(operand["kind"])
- if replacement is not None:
- operand["kind"] = replacement
-
-
-def main():
- import argparse
- parser = argparse.ArgumentParser(description='Generate SPIR-V info tables')
-
- parser.add_argument('--spirv-core-grammar', metavar='<path>',
- type=str, required=False,
- help='input JSON grammar file for core SPIR-V '
- 'instructions')
- parser.add_argument('--extinst-debuginfo-grammar', metavar='<path>',
- type=str, required=False, default=None,
- help='input JSON grammar file for DebugInfo extended '
- 'instruction set')
- parser.add_argument('--extinst-cldebuginfo100-grammar', metavar='<path>',
- type=str, required=False, default=None,
- help='input JSON grammar file for OpenCL.DebugInfo.100 '
- 'extended instruction set')
- parser.add_argument('--extinst-glsl-grammar', metavar='<path>',
- type=str, required=False, default=None,
- help='input JSON grammar file for GLSL extended '
- 'instruction set')
- parser.add_argument('--extinst-opencl-grammar', metavar='<path>',
- type=str, required=False, default=None,
- help='input JSON grammar file for OpenCL extended '
- 'instruction set')
- parser.add_argument('--output-language',
- type=str, required=False, default='c',
- choices=['c','c++'],
- help='specify output language type')
-
- parser.add_argument('--core-insts-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for core SPIR-V instructions')
- parser.add_argument('--glsl-insts-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for GLSL extended instruction set')
- parser.add_argument('--opencl-insts-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for OpenCL extended instruction set')
- parser.add_argument('--operand-kinds-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for operand kinds')
- parser.add_argument('--extension-enum-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for extension enumeration')
- parser.add_argument('--enum-string-mapping-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for enum-string mappings')
- parser.add_argument('--extinst-vendor-grammar', metavar='<path>',
- type=str, required=False, default=None,
- help='input JSON grammar file for vendor extended '
- 'instruction set'),
- parser.add_argument('--vendor-insts-output', metavar='<path>',
- type=str, required=False, default=None,
- help='output file for vendor extended instruction set')
- parser.add_argument('--vendor-operand-kind-prefix', metavar='<string>',
- type=str, required=False, default=None,
- help='prefix for operand kinds (to disambiguate operand type enums)')
- args = parser.parse_args()
-
- global OUTPUT_LANGUAGE
- OUTPUT_LANGUAGE = args.output_language
-
- # The GN build system needs this because it doesn't handle quoting
- # empty string arguments well.
- if args.vendor_operand_kind_prefix == "...nil...":
- args.vendor_operand_kind_prefix = ""
-
- if (args.core_insts_output is None) != \
- (args.operand_kinds_output is None):
- print('error: --core-insts-output and --operand-kinds-output '
- 'should be specified together.')
- exit(1)
- if args.operand_kinds_output and not (args.spirv_core_grammar and
- args.extinst_debuginfo_grammar and
- args.extinst_cldebuginfo100_grammar):
- print('error: --operand-kinds-output requires --spirv-core-grammar '
- 'and --extinst-debuginfo-grammar '
- 'and --extinst-cldebuginfo100-grammar')
- exit(1)
- if (args.glsl_insts_output is None) != \
- (args.extinst_glsl_grammar is None):
- print('error: --glsl-insts-output and --extinst-glsl-grammar '
- 'should be specified together.')
- exit(1)
- if (args.opencl_insts_output is None) != \
- (args.extinst_opencl_grammar is None):
- print('error: --opencl-insts-output and --extinst-opencl-grammar '
- 'should be specified together.')
- exit(1)
- if (args.vendor_insts_output is None) != \
- (args.extinst_vendor_grammar is None):
- print('error: --vendor-insts-output and '
- '--extinst-vendor-grammar should be specified together.')
- exit(1)
- if all([args.core_insts_output is None,
- args.glsl_insts_output is None,
- args.opencl_insts_output is None,
- args.vendor_insts_output is None,
- args.extension_enum_output is None,
- args.enum_string_mapping_output is None]):
- print('error: at least one output should be specified.')
- exit(1)
-
- if args.spirv_core_grammar is not None:
- with open(args.spirv_core_grammar) as json_file:
- core_grammar = json.loads(json_file.read())
- with open(args.extinst_debuginfo_grammar) as debuginfo_json_file:
- debuginfo_grammar = json.loads(debuginfo_json_file.read())
- with open(args.extinst_cldebuginfo100_grammar) as cldebuginfo100_json_file:
- cldebuginfo100_grammar = json.loads(cldebuginfo100_json_file.read())
- prefix_operand_kind_names("CLDEBUG100_", cldebuginfo100_grammar)
- instructions = []
- instructions.extend(core_grammar['instructions'])
- instructions.extend(debuginfo_grammar['instructions'])
- instructions.extend(cldebuginfo100_grammar['instructions'])
- operand_kinds = []
- operand_kinds.extend(core_grammar['operand_kinds'])
- operand_kinds.extend(debuginfo_grammar['operand_kinds'])
- operand_kinds.extend(cldebuginfo100_grammar['operand_kinds'])
- extensions = get_extension_list(instructions, operand_kinds)
- operand_kinds = precondition_operand_kinds(operand_kinds)
- if args.core_insts_output is not None:
- make_path_to_file(args.core_insts_output)
- make_path_to_file(args.operand_kinds_output)
- with open(args.core_insts_output, 'w') as f:
- f.write(generate_instruction_table(
- core_grammar['instructions']))
- with open(args.operand_kinds_output, 'w') as f:
- f.write(generate_operand_kind_table(operand_kinds))
- if args.extension_enum_output is not None:
- make_path_to_file(args.extension_enum_output)
- with open(args.extension_enum_output, 'w') as f:
- f.write(generate_extension_enum(extensions))
- if args.enum_string_mapping_output is not None:
- make_path_to_file(args.enum_string_mapping_output)
- with open(args.enum_string_mapping_output, 'w') as f:
- f.write(generate_all_string_enum_mappings(
- extensions, operand_kinds))
-
- if args.extinst_glsl_grammar is not None:
- with open(args.extinst_glsl_grammar) as json_file:
- grammar = json.loads(json_file.read())
- make_path_to_file(args.glsl_insts_output)
- with open(args.glsl_insts_output, 'w') as f:
- f.write(generate_extended_instruction_table(
- grammar, 'glsl'))
-
- if args.extinst_opencl_grammar is not None:
- with open(args.extinst_opencl_grammar) as json_file:
- grammar = json.loads(json_file.read())
- make_path_to_file(args.opencl_insts_output)
- with open(args.opencl_insts_output, 'w') as f:
- f.write(generate_extended_instruction_table(
- grammar, 'opencl'))
-
- if args.extinst_vendor_grammar is not None:
- with open(args.extinst_vendor_grammar) as json_file:
- grammar = json.loads(json_file.read())
- make_path_to_file(args.vendor_insts_output)
- name = args.extinst_vendor_grammar
- start = name.find('extinst.') + len('extinst.')
- name = name[start:-len('.grammar.json')].replace('-', '_')
- with open(args.vendor_insts_output, 'w') as f:
- f.write(generate_extended_instruction_table(
- grammar, name, args.vendor_operand_kind_prefix))
-
-
-if __name__ == '__main__':
- main()
diff --git a/third_party/SPIRV-Tools/utils/generate_registry_tables.py b/third_party/SPIRV-Tools/utils/generate_registry_tables.py
index 69628fa..2564f35 100755
--- a/third_party/SPIRV-Tools/utils/generate_registry_tables.py
+++ b/third_party/SPIRV-Tools/utils/generate_registry_tables.py
@@ -17,6 +17,7 @@
import errno
import io
import os.path
+import platform
from xml.etree.ElementTree import XML, XMLParser, TreeBuilder
@@ -80,8 +81,15 @@
args = parser.parse_args()
with io.open(args.xml, encoding='utf-8') as xml_in:
+ # Python3 default str to UTF-8. But Python2.7 (in case of NDK build,
+ # don't be fooled by the shebang) is returning a unicode string.
+ # So depending of the version, we need to make sure the correct
+ # encoding is used.
+ content = xml_in.read()
+ if platform.python_version_tuple()[0] == '2':
+ content = content.encode('utf-8')
parser = XMLParser(target=TreeBuilder(), encoding='utf-8')
- registry = XML(xml_in.read(), parser=parser)
+ registry = XML(content, parser=parser)
mkdir_p(os.path.dirname(args.generator_output))
with open(args.generator_output, 'w') as f:
diff --git a/third_party/SPIRV-Tools/utils/ggt.py b/third_party/SPIRV-Tools/utils/ggt.py
new file mode 100755
index 0000000..45262ba
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/ggt.py
@@ -0,0 +1,973 @@
+#!/usr/bin/env python3
+# Copyright (c) 2016 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Generates compressed grammar tables from SPIR-V JSON grammar."""
+
+import errno
+import json
+import os.path
+import re
+import sys
+from typing import Dict, List, Tuple, Any
+
+# Find modules relative to the directory containing this script.
+# This is needed for hermetic Bazel builds, where the Table files are bundled
+# together with this script, while keeping their relative locations.
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+
+from Table.Context import Context
+from Table.IndexRange import IndexRange
+from Table.Operand import Operand
+
+class GrammarError(Exception):
+ pass
+
+# Extensions to recognize, but which don't necessarily come from the SPIR-V
+# core or KHR grammar files. Get this list from the SPIR-V registry web page.
+# NOTE: Only put things on this list if it is not in those grammar files.
+EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS = """
+SPV_AMD_gpu_shader_half_float
+SPV_AMD_gpu_shader_int16
+SPV_KHR_non_semantic_info
+SPV_EXT_relaxed_printf_string_address_space
+"""
+
+class ExtInst():
+ """
+ An extended instruction set.
+
+ Properties:
+ prefix: the string prefix for operand enums. Often an empty string.
+ file: the location of the JSON grammar file
+ name: the name, can be used as an identifier
+ enum_name: the enum name, e.g. SPV_EXT_INST_OPENCL_STD
+ grammar: the JSON object for the grammar, loaded from the file.
+ """
+ def __init__(self,spec: str):
+ matches = re.fullmatch('^([^,]*),(.*)',spec)
+ if matches is None:
+ raise Exception("Invalid prefix and path: {}".format(spec))
+ self.prefix = matches[1]
+ if self.prefix is None:
+ self.prefix = ""
+ self.file = matches[2]
+ matches = re.match('.*extinst\\.(.*)\\.grammar.json', self.file)
+ if matches is None:
+ raise Exception("Invalid grammar file name: {}".format(self.file))
+ self.name = matches[1].replace('-','_').replace('.','_')
+
+ self.enum_name = 'SPV_EXT_INST_TYPE_{}'.format(self.name).upper()
+ if self.enum_name == "SPV_EXT_INST_TYPE_OPENCL_STD_100":
+ # Live with an old decision, by adjusting this name.
+ self.enum_name = "SPV_EXT_INST_TYPE_OPENCL_STD"
+
+ self.load()
+
+ def load(self):
+ """
+ Populates self.grammar from the file.
+ Applies the self.prefix to operand enums
+ """
+ with open(self.file) as json_file:
+ self.grammar = json.loads(json_file.read())
+ if len(self.prefix) > 0:
+ prefix_operand_kind_names(self.prefix, self.grammar)
+
+
+def convert_min_required_version(version): # (version: str | None) -> str
+ """Converts the minimal required SPIR-V version encoded in the grammar to
+ the symbol in SPIRV-Tools."""
+ if version is None:
+ return 'SPV_SPIRV_VERSION_WORD(1, 0)'
+ if version == 'None':
+ return '0xffffffffu'
+ return 'SPV_SPIRV_VERSION_WORD({})'.format(version.replace('.', ','))
+
+
+def convert_max_required_version(version): # (version: str | None) -> str
+ """Converts the maximum required SPIR-V version encoded in the grammar to
+ the symbol in SPIRV-Tools."""
+ if version is None:
+ return '0xffffffffu'
+ return 'SPV_SPIRV_VERSION_WORD({})'.format(version.replace('.', ','))
+
+
+def c_bool(b: bool) -> str:
+ return 'true' if b else 'false'
+
+
+def ctype(kind: str, quantifier: str) -> str:
+ """Returns the corresponding operand type used in spirv-tools for the given
+ operand kind and quantifier used in the JSON grammar.
+
+ Arguments:
+ - kind, e.g. 'IdRef'
+ - quantifier, e.g. '', '?', '*'
+
+ Returns:
+ a string of the enumerant name in spv_operand_type_t
+ """
+ if kind == '':
+ raise Error("operand JSON object missing a 'kind' field")
+ # The following cases are where we differ between the JSON grammar and
+ # spirv-tools.
+ if kind == 'IdResultType':
+ kind = 'TypeId'
+ elif kind == 'IdResult':
+ kind = 'ResultId'
+ elif kind == 'IdMemorySemantics' or kind == 'MemorySemantics':
+ kind = 'MemorySemanticsId'
+ elif kind == 'IdScope' or kind == 'Scope':
+ kind = 'ScopeId'
+ elif kind == 'IdRef':
+ kind = 'Id'
+
+ elif kind == 'ImageOperands':
+ kind = 'Image'
+ elif kind == 'Dim':
+ kind = 'Dimensionality'
+ elif kind == 'ImageFormat':
+ kind = 'SamplerImageFormat'
+ elif kind == 'KernelEnqueueFlags':
+ kind = 'KernelEnqFlags'
+
+ elif kind == 'LiteralExtInstInteger':
+ kind = 'ExtensionInstructionNumber'
+ elif kind == 'LiteralSpecConstantOpInteger':
+ kind = 'SpecConstantOpNumber'
+ elif kind == 'LiteralContextDependentNumber':
+ kind = 'TypedLiteralNumber'
+
+ elif kind == 'PairLiteralIntegerIdRef':
+ kind = 'LiteralIntegerId'
+ elif kind == 'PairIdRefLiteralInteger':
+ kind = 'IdLiteralInteger'
+ elif kind == 'PairIdRefIdRef': # Used by OpPhi in the grammar
+ kind = 'Id'
+
+ if kind == 'FPRoundingMode':
+ kind = 'FpRoundingMode'
+ elif kind == 'FPFastMathMode':
+ kind = 'FpFastMathMode'
+
+ if quantifier == '?':
+ kind = 'Optional{}'.format(kind)
+ elif quantifier == '*':
+ kind = 'Variable{}'.format(kind)
+
+ return 'SPV_OPERAND_TYPE_{}'.format(
+ re.sub(r'([a-z])([A-Z])', r'\1_\2', kind).upper())
+
+
+def convert_operand_kind(obj: Dict[str, str]) -> str:
+ """Returns the corresponding operand type used in spirv-tools for the given
+ operand kind and quantifier used in the JSON grammar.
+
+ Arguments:
+ - obj: an instruction operand, having keys:
+ - 'kind', e.g. 'IdRef'
+ - optionally, a quantifier: '?' or '*'
+
+ Returns:
+ a string of the enumerant name in spv_operand_type_t
+ """
+ kind = obj.get('kind', '')
+ quantifier = obj.get('quantifier', '')
+ return ctype(kind, quantifier)
+
+
+def to_safe_identifier(s: str) -> str:
+ """
+ Returns a new string with all non-letters converted to underscores,
+ and prepending 'k'.
+ The result should be safe to use as a C identifier.
+ """
+ return 'k' + re.sub(r'[^a-zA-Z0-9]', '_', s)
+
+
+class Grammar():
+ """
+ Accumulates string and enum tables.
+ The extensions and operand kinds lists are fixed at creation time.
+ Prints tables for instructions, operand kinds, and underlying string
+ and enum tables.
+ Assumes an index range is emitted by printing an IndexRange object.
+ """
+ def __init__(self, extensions: List[str], operand_kinds:List[dict], printing_classes: List[str]) -> None:
+ self.context = Context()
+ self.extensions = sorted(extensions)
+ self.operand_kinds = sorted(operand_kinds, key = lambda ok: convert_operand_kind(ok))
+ self.printing_classes = sorted([to_safe_identifier(x) for x in printing_classes])
+
+ # The self.header_ignore_decls are only used to debug the flow.
+ # They are copied into the C++ source code where they are more likely
+ # to be seen by humans.
+ self.header_ignore_decls: List[str] = [self.IndexRangeDecls()]
+
+ # The self.header_decls content goes into core_tables_header.inc to be
+ # included in a .h file.
+ self.header_decls: List[str] = []
+ # The self.body_decls content goes into core_tables_body.inc to be included
+ # in a .cpp file. It includes definitions of static variables and
+ # hidden functions.
+ self.body_decls: List[str] = []
+
+ if len(self.operand_kinds) == 0:
+ raise Exception("operand_kinds should be a non-empty list")
+ if len(self.extensions) == 0:
+ raise Exception("extensions should be a non-empty list")
+
+ self.ComputePrintingClassDecls()
+ self.ComputeExtensionDecls()
+
+ # These operand kinds need to have their optional counterpart to also
+ # be represented in the lookup tables, with the same content.
+ self.operand_kinds_needing_optional_variant = [
+ 'ImageOperands',
+ 'AccessQualifier',
+ 'MemoryAccess',
+ 'PackedVectorFormat',
+ 'CooperativeMatrixOperands',
+ 'MatrixMultiplyAccumulateOperands',
+ 'RawAccessChainOperands',
+ 'FPEncoding',
+ 'TensorOperands',
+ 'Capability']
+
+ def dump(self) -> None:
+ self.context.dump()
+
+ def IndexRangeDecls(self) -> str:
+ return """
+struct IndexRange {
+ uint32_t first = 0; // index of the first element in the range
+ uint32_t count = 0; // number of elements in the range
+};
+constexpr inline IndexRange IR(uint32_t first, uint32_t count) {
+ return {first, count};
+}
+"""
+
+ def ComputePrintingClassDecls(self) -> str:
+ parts: List[str] = []
+ parts.append("enum class PrintingClass : uint32_t {");
+ parts.extend([" {},".format(x) for x in self.printing_classes])
+ parts.append("};\n")
+ self.header_decls.extend(parts)
+
+ def ComputeExtensionDecls(self) -> None:
+ parts: List[str] = []
+ parts.append("enum Extension : uint32_t {");
+ parts.extend([" {},".format(to_safe_identifier(x)) for x in self.extensions])
+ parts.append("};\n")
+ self.header_decls.extend(parts)
+
+ parts = []
+ parts.append("// Returns the name of an extension, as an index into kStrings")
+ parts.append("IndexRange ExtensionToIndexRange(Extension extension) {\n switch(extension) {")
+ for e in self.extensions:
+ parts.append(' case Extension::k{}: return {};'.format(e,self.context.AddString(e)))
+ parts.append(" default: break;");
+ parts.append(' }\n return {};\n}\n');
+ self.body_decls.extend(parts)
+
+ parts = []
+ parts.append("""// Extension names and values, ordered by name
+// The fields in order are:
+// name, indexing into kStrings
+// enum value""")
+ parts.append("static const std::array<NameValue,{}> kExtensionNames{{{{".format(len(self.extensions)))
+ for e in self.extensions:
+ parts.append(' {{{}, static_cast<uint32_t>({})}},'.format(self.context.AddString(e), to_safe_identifier(e)))
+ parts.append("}};\n")
+ self.body_decls.extend(parts)
+
+ def ComputeOperandTables(self) -> None:
+ """
+ Returns the string for the C definitions of the operand kind tables.
+
+ An operand kind such as ImageOperands also has an associated
+ operand kind that is an 'optional' variant.
+ These are represented as two distinct operand kinds in spv_operand_type_t.
+ For example, ImageOperands maps to both SPV_OPERAND_TYPE_IMAGE, and also
+ to SPV_OPERAND_TYPE_OPTIONAL_IMAGE.
+
+ The definitions are:
+ - kOperandsByValue: a 1-dimensional array of all operand descriptions
+ sorted first by operand kind, then by operand value.
+ Only non-optional operand kinds are represented here.
+
+ - kOperandsByValueRangeByKind: a function mapping from operand kind to
+ the index range into kOperandByValue.
+ This has mappings for both concrete and corresponding optional operand kinds.
+
+ - kOperandNames: a 1-dimensional array of all operand NameIndex
+ entries, sorted first by operand kinds, then by operand name.
+ The name part is represented by an index range into the string table.
+ The index part is the index of this name's entry into the by-value array.
+ This can have more entries than the by-value array, because names
+ can have string aliases. For example,the MemorySemantics value 0
+ is named both "Relaxed" and "None".
+ Only non-optional operand kinds are represented here.
+
+ - kOperandNamesRangeByKind: a mapping from operand kind to the index
+ range into kOperandNames.
+ This has mappings for both concrete and corresponding optional operand kinds.
+ """
+
+ self.header_ignore_decls.append(
+"""
+struct NameIndex {
+ // Location of the null-terminated name in the global string table.
+ IndexRange name;
+ // Index of this name's entry in in the associated by-value table.
+ uint32_t index;
+};
+struct NameValue {
+ // Location of the null-terminated name in the global string table.
+ IndexRange name;
+ // Enum value in the binary format.
+ uint32_t value;
+};
+// Describes a SPIR-V operand.
+struct OperandDesc {
+ uint32_t value;
+ IndexRange operands_range; // Indexes kOperandSpans
+ IndexRange name_range; // Indexes kStrings
+ IndexRange aliases_range; // Indexes kAliasSpans
+ IndexRange capabilities_range; // Indexes kCapabilitySpans
+ // A set of extensions that enable this feature. If empty then this operand
+ // value is in core and its availability is subject to minVersion. The
+ // assembler, binary parser, and disassembler ignore this rule, so you can
+ // freely process invalid modules.
+ IndexRange extensions_range; // Indexes kExtensionSpans
+ // Minimal core SPIR-V version required for this feature, if without
+ // extensions. ~0u means reserved for future use. ~0u and non-empty
+ // extension lists means only available in extensions.
+ uint32_t minVersion;
+ uint32_t lastVersion;
+ utils::Span<spv_operand_type_t> operands() const;
+ utils::Span<char> name() const;
+ utils::Span<IndexRange> aliases() const;
+ utils::Span<spv::Capability> capabilities() const;
+ utils::Span<spvtools::Extension> extensions() const;
+ OperandDesc(const OperandDesc&) = delete;
+ OperandDesc(OperandDesc&&) = delete;
+};
+""")
+
+ def ShouldEmit(operand_kind_json: Dict[str,any]):
+ """ Returns true if we should emit a table for the given
+ operand kind.
+ """
+ category = operand_kind_json.get('category')
+ return category in ['ValueEnum', 'BitEnum']
+
+ # Populate kOperandsByValue
+ operands_by_value: List[str] = []
+ operands_by_value_by_kind: Dict[str,IndexRange] = {}
+ # Maps the operand kind and value to the index into kOperandsByValue
+ index_by_kind_and_value: Dict[Tuple(str,int),int] = {}
+ index = 0
+ for operand_kind_json in self.operand_kinds:
+ kind_key: str = convert_operand_kind(operand_kind_json)
+ if ShouldEmit(operand_kind_json):
+ operands = [Operand(o) for o in operand_kind_json['enumerants']]
+ operand_descs: List[str] = []
+ for o in sorted(operands, key = lambda o: o.value):
+ suboperands = [convert_operand_kind(p) for p in o.parameters]
+ desc = [
+ o.value,
+ self.context.AddStringList('operand', suboperands),
+ str(self.context.AddString(o.enumerant)) + '/* {} */'.format(o.enumerant),
+ self.context.AddStringList('alias', o.aliases),
+ self.context.AddStringList('capability', o.capabilities),
+ self.context.AddStringList('extension', o.extensions),
+ convert_min_required_version(o.version),
+ convert_max_required_version(o.lastVersion),
+ ]
+ operand_descs.append('{' + ','.join([str(d) for d in desc]) + '}}, // {}'.format(kind_key))
+ index_by_kind_and_value[(kind_key,o.value)] = index
+ index += 1
+ operands_by_value_by_kind[kind_key] = IndexRange(len(operands_by_value), len(operand_descs))
+ operands_by_value.extend(operand_descs)
+ else:
+ pass
+
+ parts = []
+ parts.append("""// Operand descriptions, ordered by (operand kind, operand enum value).
+// The fields in order are:
+// enum value
+// operands, an IndexRange into kOperandSpans
+// name, a character-counting IndexRange into kStrings
+// aliases, an IndexRange into kAliasSpans
+// capabilities, an IndexRange into kCapabilitySpans
+// extensions, as an IndexRange into kExtensionSpans
+// version, first version of SPIR-V that has it
+// lastVersion, last version of SPIR-V that has it""")
+ parts.append("static const std::array<OperandDesc, {}> kOperandsByValue{{{{".format(len(operands_by_value)))
+ parts.extend([' ' + str(x) for x in operands_by_value])
+ parts.append("}};\n")
+ self.body_decls.extend(parts)
+
+ parts = []
+ parts.append("""// Maps an operand kind to possible operands for that kind.
+// The result is an IndexRange into kOperandsByValue, and the operands
+// are sorted by value within that span.
+// An optional variant of a kind maps to the details for the corresponding
+// concrete operand kind.""")
+ parts.append("IndexRange OperandByValueRangeForKind(spv_operand_type_t type) {\n switch(type) {")
+ for kind_key, ir in operands_by_value_by_kind.items():
+ parts.append(" case {}: return {};".format(
+ kind_key,
+ str(operands_by_value_by_kind[kind_key])))
+ for kind in self.operand_kinds_needing_optional_variant:
+ non_optional_kind = ctype(kind,'')
+ if non_optional_kind in operands_by_value_by_kind:
+ parts.append(" case {}: return {};".format(
+ ctype(kind, '?'),
+ str(operands_by_value_by_kind[ctype(kind,'')])))
+ else:
+ raise GrammarError(
+ "error: unknown operand type {}, from JSON grammar operand '{}':".format(non_optional_kind, kind) +
+ " consider updating spv_operand_type_t in spirv-tools/libspirv.h")
+
+ parts.append(" default: break;");
+ parts.append(" }\n return IR(0,0);\n}\n")
+ self.body_decls.extend(parts)
+
+ # Populate kOperandNames
+ operand_names: List[Tuple[IndexRange,int]] = []
+ name_range_for_kind: Dict[str,IndexRange] = {}
+ for operand_kind_json in self.operand_kinds:
+ kind_key: str = convert_operand_kind(operand_kind_json)
+ if ShouldEmit(operand_kind_json):
+ operands = [Operand(o) for o in operand_kind_json['enumerants']]
+ tuples: List[Tuple[str,int,str]] = []
+ for o in operands:
+ tuples.append((o.enumerant, o.value, kind_key))
+ for a in o.aliases:
+ tuples.append((a, o.value, kind_key))
+ tuples = sorted(tuples, key = lambda t: t[0])
+ ir_tuples = [(self.context.AddString(t[0]),t[1],t[2]) for t in tuples]
+ name_range_for_kind[kind_key] = IndexRange(len(operand_names), len(ir_tuples))
+ operand_names.extend(ir_tuples)
+ else:
+ pass
+ operand_name_strings: List[str] = []
+ for i in range(0, len(operand_names)):
+ ir, value, kind_key = operand_names[i]
+ index = index_by_kind_and_value[(kind_key,value)]
+ operand_name_strings.append('{{{}, {}}}, // {} {} in {}'.format(
+ str(ir),index,i,self.context.GetString(ir),kind_key))
+
+ parts: List[str] = []
+ parts.append("""// Operand names and index into kOperandsByValue, ordered by (operand kind, name)
+// The fields in order are:
+// name, either the primary name or an alias, indexing into kStrings
+// index into the kOperandsByValue array""")
+ parts.append("static const std::array<NameIndex, {}> kOperandNames{{{{".format(len(operand_name_strings)))
+ parts.extend([' ' + str(x) for x in operand_name_strings])
+ parts.append("}};\n")
+ self.body_decls.extend(parts)
+
+ parts.append("""// Maps an operand kind to possible names for operands of that kind.
+// The result is an IndexRange into kOperandNames, and the names
+// are sorted by name within that span.
+// An optional variant of a kind maps to the details for the corresponding
+// concrete operand kind.""")
+ parts = ["IndexRange OperandNameRangeForKind(spv_operand_type_t type) {\n switch(type) {"]
+ for kind_key, ir in name_range_for_kind.items():
+ parts.append(" case {}: return {};".format(
+ kind_key,
+ str(name_range_for_kind[kind_key])))
+ for kind in self.operand_kinds_needing_optional_variant:
+ parts.append(" case {}: return {};".format(
+ ctype(kind, '?'),
+ str(name_range_for_kind[ctype(kind,'')])))
+ parts.append(" default: break;");
+ parts.append(" }\n return IR(0,0);\n}\n")
+ self.body_decls.extend(parts)
+
+
+ def ComputeInstructionTables(self, insts) -> None:
+ """
+ Creates declarations for instruction tables.
+ Populates self.header_ignore_decls, self.body_decls.
+
+ Params:
+ insts: an array of instructions objects using the JSON schema
+ """
+ self.header_ignore_decls.append("""
+// Describes an Instruction
+struct InstructionDesc {
+ const spv::Op value;
+ const bool hasResult;
+ const bool hasType;
+ const IndexRange operands_range; // Indexes kOperandSpans
+ const IndexRange name_range; // Indexes kStrings
+ const IndexRange aliases_range; // Indexes kAliasSpans
+ const IndexRange capabilities_range; // Indexes kCapbilitySpans
+ // A set of extensions that enable this feature. If empty then this operand
+ // value is in core and its availability is subject to minVersion. The
+ // assembler, binary parser, and disassembler ignore this rule, so you can
+ // freely process invalid modules.
+ const IndexRange extensions_range; // Indexes kExtensionSpans
+ // Minimal core SPIR-V version required for this feature, if without
+ // extensions. ~0u means reserved for future use. ~0u and non-empty
+ // extension lists means only available in extensions.
+ uint32_t minVersion;
+ uint32_t lastVersion;
+ PrintingClass printingClass; // Section of SPIR-V spec. e.g. kComposite, kImage
+ utils::Span<spv_operand_type_t> operands() const;
+ utils::Span<char> name() const;
+ utils::Span<IndexRange> aliases() const;
+ utils::Span<spv::Capability> capabilities() const;
+ utils::Span<spvtools::Extension> extensions() const;
+ OperandDesc(const OperandDesc&) = delete;
+ OperandDesc(OperandDesc&&) = delete;
+};
+""")
+
+ # Create the array of InstructionDesc
+ lines: List[str] = []
+ # Maps the opcode name (without "Op" prefix) to its index in the table.
+ index_by_opcode: Dict[int,int] = {}
+ # Sort by opcode, so lookup can use binary search
+ for inst in sorted(insts, key = lambda inst: int(inst['opcode'])):
+ parts: List[str] = []
+
+ opname: str = inst['opname']
+
+ operand_kinds = [convert_operand_kind(o) for o in inst.get('operands',[])]
+ if opname == 'OpExtInst' and operand_kinds[-1] == 'SPV_OPERAND_TYPE_VARIABLE_ID':
+ # The published grammar uses 'sequence of ID' at the
+ # end of the ExtInst operands. But SPIRV-Tools uses
+ # a specific pattern based on the particular opcode.
+ # Drop it here.
+ # See https://github.com/KhronosGroup/SPIRV-Tools/issues/233
+ operand_kinds.pop()
+
+ hasResult = 'SPV_OPERAND_TYPE_RESULT_ID' in operand_kinds
+ hasType = 'SPV_OPERAND_TYPE_TYPE_ID' in operand_kinds
+
+ # Remove the "Op" prefix from opcode alias names
+ aliases = [name[2:] for name in inst.get('aliases',[])]
+
+ parts.extend([
+ 'spv::Op::' + opname,
+ c_bool(hasResult),
+ c_bool(hasType),
+ self.context.AddStringList('operand', operand_kinds),
+ self.context.AddString(opname[2:]),
+ self.context.AddStringList('alias', aliases),
+ self.context.AddStringList('capability', inst.get('capabilities',[])),
+ self.context.AddStringList('extension', inst.get('extensions',[])),
+ convert_min_required_version(inst.get('version', None)),
+ convert_max_required_version(inst.get('lastVersion', None)),
+ 'PrintingClass::' + to_safe_identifier(inst.get('class','@exclude'))
+ ])
+
+ index_by_opcode[int(inst['opcode'])] = len(lines)
+ lines.append('{{{}}},'.format(', '.join([str(x) for x in parts])))
+ parts = []
+ parts.append("""// Instruction descriptions, ordered by opcode.
+// The fields in order are:
+// opcode
+// a boolean indicating if the instruction produces a result ID
+// a boolean indicating if the instruction result ID has a type
+// operands, an IndexRange into kOperandSpans
+// opcode name (without the 'Op' prefix), a character-counting IndexRange into kStrings
+// aliases, an IndexRange into kAliasSpans
+// capabilities, an IndexRange into kCapabilitySpans
+// extensions, as an IndexRange into kExtensionSpans
+// version, first version of SPIR-V that has it
+// lastVersion, last version of SPIR-V that has it""")
+ parts.append("static const std::array<InstructionDesc, {}> kInstructionDesc{{{{".format(len(lines)));
+ parts.extend([' ' + l for l in lines])
+ parts.append("}};\n");
+ self.body_decls.extend(parts)
+
+ # Create kInstructionNames.
+ opcode_name_entries: List[str] = []
+ name_value_pairs: List[Tuple[str,int]] = []
+ for i in insts:
+ name_value_pairs.append((i['opname'][2:], i['opcode']))
+ for a in i.get('aliases',[]):
+ name_value_pairs.append((a[2:], i['opcode']))
+ name_value_pairs = sorted(name_value_pairs)
+ inst_name_strings: List[str] = []
+ for i in range(0, len(name_value_pairs)):
+ name, value = name_value_pairs[i]
+ ir = self.context.AddString(name)
+ index = index_by_opcode[value]
+ inst_name_strings.append('{{{}, {}}}, // {} {}'.format(str(ir),index,i,name))
+ parts: List[str] = []
+ parts.append("""// Opcode strings (without the 'Op' prefix) and opcode values, ordered by name.
+// The fields in order are:
+// name, either the primary name or an alias, indexing into kStrings
+// index into kInstructionDesc""")
+ parts.append("static const std::array<NameIndex, {}> kInstructionNames{{{{".format(len(inst_name_strings)))
+ parts.extend([' ' + str(x) for x in inst_name_strings])
+ parts.append("}};\n")
+ self.body_decls.extend(parts)
+
+
+ def ComputeExtendedInstructions(self, extinsts) -> None:
+ """
+ Generates tables for extended instructions
+
+ Args:
+ self
+ extinsts: a list of extinst objects
+ """
+
+ """
+ ExtInstDesc {
+ value: uint32_t
+ name: IndexRange
+ operands: IndexRange
+ capabilities: IndexRange
+ }
+
+ The definitions are:
+ - kExtInstByValue: a 1-dimensional array of all operand descriptions
+ sorted first by extended instruction enum, then by operand value.
+
+ - ExtInstByValueRangeForKind: a function mapping from extinst enum to
+ the index range into kExtInstByValue.
+
+ - kExtInstNames: a 1-dimensional array of all extinst name-index pairs,
+ sorted first by extinst enum, then by operand name.
+ The name part is represented by an index range into the string table.
+ The index part is the index of this name's entry in the kExtInstByValue
+ array.
+
+ - kExtInstNamesRangeByKind: a mapping from operand kind to the index
+ range into kOperandNames.
+ This has mappings for both concrete and corresponding optional operand kinds.
+ """
+
+ # Create kExtInstByValue
+ by_value: List[List[Any]] = []
+ by_value_by_kind: Dict[str,IndexRange] = {}
+ index_by_kind_and_opcode: Dict[Tuple[str,int],int] = {}
+ index = 0
+ for e in extinsts:
+ insts_in_set = []
+ for inst in sorted(e.grammar['instructions'], key = lambda inst: inst['opcode']):
+ operands = [convert_operand_kind(o) for o in inst.get('operands',[])]
+ inst_parts = [
+ inst['opcode'],
+ self.context.AddStringList('operand', operands),
+ self.context.AddString(inst['opname']),
+ self.context.AddStringList('capability', inst.get('capabilities',[])),
+ ]
+ inst_parts = [str(x) for x in inst_parts]
+ insts_in_set.append(' {{{}}}, // {} in {}'.format(
+ ','.join(inst_parts), inst['opname'], e.name))
+ index_by_kind_and_opcode[(e.enum_name,int(inst['opcode']))] = index
+ index += 1
+ by_value_by_kind[e.enum_name] = IndexRange(len(by_value), len(insts_in_set))
+ by_value.extend(insts_in_set)
+
+ parts: List[str] = []
+ parts.append("""// Extended instruction descriptions, ordered by (extinst enum, opcode value).
+// The fields in order are:
+// enum value
+// operands, an IndexRange into kOperandSpans
+// name, a character-counting IndexRange into kStrings
+// capabilities, an IndexRange into kCapabilitySpans""")
+ parts.append("static const std::array<ExtInstDesc, {}> kExtInstByValue{{{{".format(len(by_value)))
+ parts.extend(by_value)
+ parts.append('}};\n')
+ self.body_decls.extend(parts)
+
+ # Create kExtInstByValueRangeForKind
+ parts = []
+ parts.append("""// Maps an extended instruction enum to possible names for operands of that kind.
+// The result is an IndexRange into kOperandNames, and the names
+// are sorted by name within that span.
+// An optional variant of a kind maps to the details for the corresponding
+// concrete operand kind.""")
+ parts = ["IndexRange ExtInstByValueRangeForKind(spv_ext_inst_type_t type) {\n switch(type) {"]
+ for name, ir in by_value_by_kind.items():
+ parts.append(" case {}: return {};".format(name, ir))
+ parts.append(" default: break;");
+ parts.append(" }\n return IR(0,0);\n}\n")
+ self.body_decls.extend(parts)
+
+ # Create kExtInstNames
+ parts = []
+ by_name: List[List[Any]] = []
+ by_name_by_kind: Dict[str,IndexRange] = {}
+ for e in extinsts:
+ # Sort by name within a set
+ insts_by_name = sorted(e.grammar['instructions'], key = lambda i: i['opname'])
+ insts_in_set = []
+ for inst in insts_by_name:
+ index = index_by_kind_and_opcode[(e.enum_name,int(inst['opcode']))]
+ insts_in_set.append(
+ ' {{{}, {}}}, // {} in {}'.format(
+ str(self.context.AddString(inst['opname'])),
+ index,
+ inst['opname'],
+ e.name))
+ by_name_by_kind[e.enum_name] = IndexRange(len(by_name), len(insts_in_set))
+ by_name.extend(insts_in_set)
+ parts.append("""// Extended instruction opcode names sorted by extended instruction kind, then opcode name.
+// The fields in order are:
+// name
+// index into kExtInstByValue""")
+ parts.append("static const std::array<NameIndex, {}> kExtInstNames{{{{".format(len(by_name)))
+ parts.extend(by_name)
+ parts.append('}};\n')
+ self.body_decls.extend(parts)
+
+ # Create kExtInstNameRangeByKind
+ parts = []
+ parts.append("""// Maps an extended instruction kind to possible names for instructions of that kind.
+// The result is an IndexRange into kExtInstNames, and the names
+// are sorted by name within that span.""")
+ parts = ["IndexRange ExtInstNameRangeForKind(spv_ext_inst_type_t type) {\n switch(type) {"]
+ for name, ir in by_name_by_kind.items():
+ parts.append(" case {}: return {};".format(name, str(ir)))
+ parts.append(" default: break;");
+ parts.append(" }\n return IR(0,0);\n}\n")
+ self.body_decls.extend(parts)
+
+ def ComputeLeafTables(self) -> None:
+ """
+ Generates the tables that the instruction and operand tables point to.
+ The tables are:
+ - the string table
+ - the table of sequences of:
+ - capabilities
+ - extensions
+ - operands
+
+ This method must be called after computing instruction and operand tables.
+ """
+
+ def c_str(s: str):
+ """
+ Returns the source for a C string literal or the given string, including
+ the explicit null at the end
+ """
+ return '"{}\\0"'.format(json.dumps(s).strip('"'))
+
+ parts: List[str] = []
+ parts.append("// Array of characters, referenced by IndexRanges elsewhere.")
+ parts.append("// Each IndexRange denotes a string.")
+ parts.append('static const char kStrings[] =');
+ parts.extend([' {} // {}'.format(c_str(s), str(self.context.strings[s])) for s in self.context.string_buffer])
+ parts.append(';\n');
+ self.body_decls.extend(parts);
+
+ parts: List[str] = []
+ parts.append("""// Array of IndexRanges, where each represents a string by referencing
+// the kStrings table.
+// This array contains all sequences of alias strings used in the grammar.
+// This table is referenced by an IndexRange elsewhere, i.e. by the 'aliases'
+// field of an instruction or operand description.""")
+ parts.append('static const IndexRange kAliasSpans[] = {');
+ ranges = self.context.range_buffer['alias']
+ for i in range(0, len(ranges)):
+ ir = ranges[i]
+ parts.append(' {}, // {} {}'.format(str(ir), i, self.context.GetString(ir)))
+ parts.append('};\n');
+ self.body_decls.extend(parts);
+
+ parts = []
+ parts.append("// Array of capabilities, referenced by IndexRanges elsewhere.")
+ parts.append("// Contains all sequences of capabilities used in the grammar.")
+ parts.append('static const spv::Capability kCapabilitySpans[] = {');
+ capability_ranges = self.context.range_buffer['capability']
+ for i in range(0, len(capability_ranges)):
+ ir = capability_ranges[i]
+ cap = self.context.GetString(ir)
+ parts.append(' spv::Capability::{}, // {}'.format(cap, i))
+ parts.append('};\n');
+ self.body_decls.extend(parts);
+
+ parts = []
+ parts.append("// Array of extensions, referenced by IndexRanges elsewhere.")
+ parts.append("// Contains all sequences of extensions used in the grammar.")
+ parts.append('static const spvtools::Extension kExtensionSpans[] = {');
+ ranges = self.context.range_buffer['extension']
+ for i in range(0, len(ranges)):
+ ir = ranges[i]
+ name = self.context.GetString(ir)
+ parts.append(' spvtools::Extension::k{}, // {}'.format(name, i))
+ parts.append('};\n');
+ self.body_decls.extend(parts);
+
+ parts = []
+ parts.append("// Array of operand types, referenced by IndexRanges elsewhere.")
+ parts.append("// Contains all sequences of operand types used in the grammar.")
+ parts.append('static const spv_operand_type_t kOperandSpans[] = {');
+ ranges = self.context.range_buffer['operand']
+ for i in range(0, len(ranges)):
+ ir = ranges[i]
+ name = self.context.GetString(ir)
+ parts.append(' {}, // {}'.format(name, i))
+ parts.append('};\n');
+ self.body_decls.extend(parts)
+
+
+def make_path_to_file(f: str) -> None:
+ """Makes all ancestor directories to the given file, if they don't yet
+ exist.
+
+ Arguments:
+ f: The file whose ancestor directories are to be created.
+ """
+ dir = os.path.dirname(os.path.abspath(f))
+ try:
+ os.makedirs(dir)
+ except OSError as e:
+ if e.errno == errno.EEXIST and os.path.isdir(dir):
+ pass
+ else:
+ raise
+
+
+def get_extension_list(instructions, operand_kinds):
+ """Returns extensions as an alphabetically sorted list of strings.
+
+ Args:
+ instructions: list of instruction objects, using the JSON grammar file schema
+ operand_kinds: list of operand_kind objects, using the JSON grammar file schema
+ """
+
+ things_with_an_extensions_field = [item for item in instructions]
+
+ enumerants = sum([item.get('enumerants', [])
+ for item in operand_kinds], [])
+
+ things_with_an_extensions_field.extend(enumerants)
+
+ extensions = sum([item.get('extensions', [])
+ for item in things_with_an_extensions_field
+ if item.get('extensions')], [])
+
+ for item in EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS.split():
+ # If it's already listed in a grammar, then don't put it in the
+ # special exceptions list.
+ assert item not in extensions, 'Extension %s is already in a grammar file' % item
+
+ extensions.extend(
+ EXTENSIONS_FROM_SPIRV_REGISTRY_AND_NOT_FROM_GRAMMARS.split())
+
+ # Validator would ignore type declaration unique check. Should only be used
+ # for legacy autogenerated test files containing multiple instances of the
+ # same type declaration, if fixing the test by other methods is too
+ # difficult. Shouldn't be used for any other reasons.
+ extensions.append('SPV_VALIDATOR_ignore_type_decl_unique')
+
+ return sorted(set(extensions))
+
+
+def prefix_operand_kind_names(prefix, json_dict):
+ """Modifies json_dict, by prefixing all the operand kind names
+ with the given prefix. Also modifies their uses in the instructions
+ to match.
+ """
+
+ old_to_new = {}
+ for operand_kind in json_dict["operand_kinds"]:
+ old_name = operand_kind["kind"]
+ new_name = prefix + old_name
+ operand_kind["kind"] = new_name
+ old_to_new[old_name] = new_name
+
+ for instruction in json_dict["instructions"]:
+ for operand in instruction.get("operands", []):
+ replacement = old_to_new.get(operand["kind"])
+ if replacement is not None:
+ operand["kind"] = replacement
+
+
+def main():
+ import argparse
+ parser = argparse.ArgumentParser(description='Generate SPIR-V info tables')
+
+ parser.add_argument('--spirv-core-grammar', metavar='<path>',
+ type=str, required=False,
+ help='input JSON grammar file for core SPIR-V '
+ 'instructions')
+ parser.add_argument('--extinst', metavar='<path>',
+ type=str, action='append', required=False, default=None,
+ help='extended instruction info: an enum prefix, then a comma, then'
+ ' the file location of the JSON grammar')
+
+ parser.add_argument('--core-tables-body-output', metavar='<path>',
+ type=str, required=False, default=None,
+ help='output file for core SPIR-V grammar tables to be included in .cpp')
+ parser.add_argument('--core-tables-header-output', metavar='<path>',
+ type=str, required=False, default=None,
+ help='output file for core SPIR-V grammar tables to be included in .h')
+
+ args = parser.parse_args()
+
+ if args.spirv_core_grammar is None:
+ print('error: missing --spirv-core-grammar ')
+ sys.exit(1)
+ if (args.core_tables_body_output is None) and (args.core_tables_header_output is None):
+ print('error: need at least one of --core-tables-body-output --core-tables-header-output ')
+ sys.exit(1)
+ if len(args.extinst) < 1:
+ print('error: missing --extinst ')
+ sys.exit(1)
+
+ # Load the JSON grammar files.
+ extinsts = sorted([ExtInst(e) for e in args.extinst], key = lambda e: e.name)
+ with open(args.spirv_core_grammar) as json_file:
+ core_grammar = json.loads(json_file.read())
+ printing_class: List[str] = [e['tag'] for e in core_grammar['instruction_printing_class']]
+
+ # Collect all operand kinds and instructions, so we can generate
+ # extension lists, capability lists, and alias lists.
+ # Make a copy to avoid polluting the instruction list.
+ instructions = [x for x in core_grammar['instructions']]
+ operand_kinds = [x for x in core_grammar['operand_kinds']]
+ for e in extinsts:
+ instructions.extend(e.grammar.get('instructions',[]))
+ operand_kinds.extend(e.grammar.get('operand_kinds',[]))
+
+ extensions = get_extension_list(instructions, operand_kinds)
+
+ g = Grammar(extensions, operand_kinds, printing_class)
+ g.ComputeOperandTables()
+ g.ComputeInstructionTables(core_grammar['instructions'])
+ g.ComputeExtendedInstructions(extinsts)
+ g.ComputeLeafTables()
+
+ if args.core_tables_body_output is not None:
+ make_path_to_file(args.core_tables_body_output)
+ with open(args.core_tables_body_output, 'w') as f:
+ f.write('\n'.join(g.body_decls))
+ if args.core_tables_header_output is not None:
+ make_path_to_file(args.core_tables_header_output)
+ with open(args.core_tables_header_output, 'w') as f:
+ f.write('\n'.join(g.header_decls))
+ sys.exit(0)
+
+
+if __name__ == '__main__':
+ try:
+ main()
+ except GrammarError as ge:
+ print(ge)
+ sys.exit(1)
diff --git a/third_party/SPIRV-Tools/utils/git-sync-deps b/third_party/SPIRV-Tools/utils/git-sync-deps
index 6549afb..21bf2bc 100755
--- a/third_party/SPIRV-Tools/utils/git-sync-deps
+++ b/third_party/SPIRV-Tools/utils/git-sync-deps
@@ -78,7 +78,7 @@
minor=None
try:
version_info = subprocess.check_output([git, '--version']).decode('utf-8')
- match = re.search("^git version (\d+)\.(\d+)",version_info)
+ match = re.search(r"^git version (\d+)\.(\d+)",version_info)
print("Using {}".format(version_info))
if match:
major = int(match.group(1))
diff --git a/third_party/SPIRV-Tools/utils/roll_deps.sh b/third_party/SPIRV-Tools/utils/roll_deps.sh
index d19ee00..d8c1da3 100755
--- a/third_party/SPIRV-Tools/utils/roll_deps.sh
+++ b/third_party/SPIRV-Tools/utils/roll_deps.sh
@@ -29,13 +29,13 @@
}
-dependencies=("external/effcee/"
- "external/googletest/"
- "external/re2/"
- "external/spirv-headers/")
-
-
-branch="origin/main"
+declare -A dependency_to_branch_map
+dependency_to_branch_map["external/abseil_cpp"]="origin/master"
+dependency_to_branch_map["external/effcee/"]="origin/main"
+dependency_to_branch_map["external/googletest/"]="origin/main"
+dependency_to_branch_map["external/re2/"]="origin/main"
+dependency_to_branch_map["external/spirv-headers/"]="origin/main"
+dependency_to_branch_map["external/mimalloc/"]="origin/main"
# This script assumes it's parent directory is the repo root.
repo_path=$(dirname "$0")/..
@@ -53,7 +53,8 @@
set +e
-for dep in ${dependencies[@]}; do
+for dep in ${!dependency_to_branch_map[@]}; do
+ branch=${dependency_to_branch_map[$dep]}
echo "Rolling $dep"
roll-dep --ignore-dirty-tree --roll-to="${branch}" "${dep}"
ExitIfIsInterestingError $?
diff --git a/third_party/SPIRV-Tools/utils/update_build_version.py b/third_party/SPIRV-Tools/utils/update_build_version.py
index bb66e18..9115cab 100755
--- a/third_party/SPIRV-Tools/utils/update_build_version.py
+++ b/third_party/SPIRV-Tools/utils/update_build_version.py
@@ -24,9 +24,10 @@
# - The software version deduced from the given CHANGES file.
# - A longer string with the project name, the software version number, and
# git commit information for the CHANGES file's directory. The commit
-# information is the output of "git describe" if that succeeds, or "git
-# rev-parse HEAD" if that succeeds, or otherwise a message containing the
-# phrase "unknown hash".
+# information is the content of the FORCED_BUILD_VERSION_DESCRIPTION
+# environement variable is it exists, else the output of "git describe" if
+# that succeeds, or "git rev-parse HEAD" if that succeeds, or otherwise a
+# message containing the phrase "unknown hash".
# The string contents are escaped as necessary.
import datetime
@@ -150,7 +151,7 @@
sys.exit(1)
repo_path = os.path.dirname(changes_file_path)
- description = describe(repo_path)
+ description = os.getenv("FORCED_BUILD_VERSION_DESCRIPTION", describe(repo_path))
content = OUTPUT_FORMAT.format(version_tag=version, description=description)
# Escape file content.
diff --git a/third_party/SPIRV-Tools/utils/vim/README.md b/third_party/SPIRV-Tools/utils/vim/README.md
new file mode 100644
index 0000000..a73977e
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/vim/README.md
@@ -0,0 +1,87 @@
+# Neovim configuration guide for SPIR-V disassembly files
+
+This directory holds instructions to configure Neovim for SPIR-V assembly files (`.spvasm`)
+
+At the end, Neovim should support:
+* Syntax highlighting
+* Jump to definition
+* Find all references
+* Symbol renaming
+* Operand hover information
+* Formatting
+* Completion suggestions for all Opcodes and Ids
+
+While the instructions here are specifically for Neovim, they should translate easily to vim.
+
+## Dependencies
+
+In order to build and install the Visual Studio Code language server extension, you will need to install and have on your `PATH` the following dependencies:
+* [`golang 1.16+`](https://golang.org/)
+
+## File type detection
+
+Neovim's default config location is typically `~/.config/nvim` so the rest of the instructions assume that but it will need to be changed if your system is different.
+
+Tell neovim that `*.spvasm` files should be treated as `spvasm` filetype
+```bash
+echo "au BufRead,BufNewFile *.spvasm set filetype=spvasm" > ~/.config/nvim/ftdetect/spvasm.vim
+```
+
+## Syntax Highlighting
+
+### Generate the syntax highlighting file
+```bash
+cd <spirv-tools dir>
+mkdir -p build && cd build
+# Any platform is fine, ninja is used an as example
+cmake -G Ninja ..
+ninja spirv-tools-vimsyntax
+```
+
+### Copy the syntax file
+```bash
+cp spvasm.vim ~/.config/nvim/syntax/spvasm.vim
+```
+
+## Language Server
+
+### Building the LSP (masOS / Linux)
+
+Run `build_lsp.sh`
+Copy `spirvls` and `spirv.json` to a location in `$PATH`
+
+```bash
+cd <spirv-tools dir>/utils/vscode
+./build_lsp.sh
+sudo cp spirvls/* /usr/local/bin/
+```
+
+### Building the LSP (Windows)
+
+TODO
+
+### Configuring Neovim
+
+Configuration will depend a lot on your installed plugins but assuming you are using [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) the following should be sufficient.
+
+```lua
+local lspconfig = require 'lspconfig'
+local configs = require 'lspconfig.configs'
+
+if not configs.spvasm then
+ configs.spvasm = {
+ default_config = {
+ cmd = { 'spirvls' },
+ filetypes = { 'spvasm' },
+ root_dir = function(fname)
+ return '.'
+ end,
+ settings = {},
+ },
+ }
+end
+
+lspconfig.spvasm.setup {
+ capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()),
+}
+```
diff --git a/third_party/SPIRV-Tools/utils/generate_vim_syntax.py b/third_party/SPIRV-Tools/utils/vim/generate_syntax.py
similarity index 96%
rename from third_party/SPIRV-Tools/utils/generate_vim_syntax.py
rename to third_party/SPIRV-Tools/utils/vim/generate_syntax.py
index 5c9c6b2..1d156a0 100755
--- a/third_party/SPIRV-Tools/utils/generate_vim_syntax.py
+++ b/third_party/SPIRV-Tools/utils/vim/generate_syntax.py
@@ -161,11 +161,17 @@
print('\n" Core instructions')
for inst in core["instructions"]:
EmitAsStatement(inst['opname'])
+ aliases = inst.get('aliases', [])
+ for alias in aliases:
+ EmitAsStatement(alias)
print('\n" Core operand enums')
for operand_kind in core["operand_kinds"]:
if 'enumerants' in operand_kind:
for e in operand_kind['enumerants']:
EmitAsEnumerant(e['enumerant'])
+ aliases = e.get('aliases', [])
+ for a in aliases:
+ EmitAsEnumerant(a)
if args.extinst_glsl_grammar is not None:
print('\n" GLSL.std.450 extended instructions')
diff --git a/third_party/SPIRV-Tools/utils/vscode/README.md b/third_party/SPIRV-Tools/utils/vscode/README.md
index d7aa2b4..9cf82b1 100644
--- a/third_party/SPIRV-Tools/utils/vscode/README.md
+++ b/third_party/SPIRV-Tools/utils/vscode/README.md
@@ -9,6 +9,7 @@
* Symbol renaming
* Operand hover information
* Formatting
+* Completion suggestions for all Opcodes and Ids
## Dependencies
@@ -18,8 +19,8 @@
## Installing (macOS / Linux)
-Run `install.sh`
+Run `install_vscode.sh`
## Installing (Windows)
-Run `install.bat`
+Run `install_vscode.bat`
diff --git a/third_party/SPIRV-Tools/utils/vscode/build_lsp.sh b/third_party/SPIRV-Tools/utils/vscode/build_lsp.sh
new file mode 100755
index 0000000..dc92cc8
--- /dev/null
+++ b/third_party/SPIRV-Tools/utils/vscode/build_lsp.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Copyright (c) 2019 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e # Fail on any error.
+
+ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+pushd ${ROOT_PATH}
+ go run ./src/tools/gen-grammar.go --cache ./cache --template ./spirv.json.tmpl --out ./spirv.json
+ go run ./src/tools/gen-grammar.go --cache ./cache --template ./src/schema/schema.go.tmpl --out ./src/schema/schema.go
+
+ mkdir -p ./spirvls
+ cp ./spirv.json ./spirvls
+
+ go build -o ./spirvls/spirvls ./src/langsvr.go
+popd
diff --git a/third_party/SPIRV-Tools/utils/vscode/install.bat b/third_party/SPIRV-Tools/utils/vscode/install_vscode.bat
similarity index 100%
rename from third_party/SPIRV-Tools/utils/vscode/install.bat
rename to third_party/SPIRV-Tools/utils/vscode/install_vscode.bat
diff --git a/third_party/SPIRV-Tools/utils/vscode/install.sh b/third_party/SPIRV-Tools/utils/vscode/install_vscode.sh
similarity index 100%
rename from third_party/SPIRV-Tools/utils/vscode/install.sh
rename to third_party/SPIRV-Tools/utils/vscode/install_vscode.sh
diff --git a/third_party/SPIRV-Tools/utils/vscode/spirv.json b/third_party/SPIRV-Tools/utils/vscode/spirv.json
index 2e88296..4ab2529 100644
--- a/third_party/SPIRV-Tools/utils/vscode/spirv.json
+++ b/third_party/SPIRV-Tools/utils/vscode/spirv.json
@@ -12,6 +12,8 @@
{ "include": "#BitEnum_MemoryAccess" },
{ "include": "#BitEnum_KernelProfilingInfo" },
{ "include": "#BitEnum_RayFlags" },
+ { "include": "#BitEnum_FragmentShadingRate" },
+ { "include": "#BitEnum_RawAccessChainOperands" },
{ "include": "#ValueEnum_SourceLanguage" },
{ "include": "#ValueEnum_ExecutionModel" },
{ "include": "#ValueEnum_AddressingModel" },
@@ -25,8 +27,13 @@
{ "include": "#ValueEnum_ImageChannelOrder" },
{ "include": "#ValueEnum_ImageChannelDataType" },
{ "include": "#ValueEnum_FPRoundingMode" },
+ { "include": "#ValueEnum_FPDenormMode" },
+ { "include": "#ValueEnum_QuantizationModes" },
+ { "include": "#ValueEnum_FPOperationMode" },
+ { "include": "#ValueEnum_OverflowModes" },
{ "include": "#ValueEnum_LinkageType" },
{ "include": "#ValueEnum_AccessQualifier" },
+ { "include": "#ValueEnum_HostAccessQualifier" },
{ "include": "#ValueEnum_FunctionParameterAttribute" },
{ "include": "#ValueEnum_Decoration" },
{ "include": "#ValueEnum_BuiltIn" },
@@ -37,6 +44,17 @@
{ "include": "#ValueEnum_RayQueryIntersection" },
{ "include": "#ValueEnum_RayQueryCommittedIntersectionType" },
{ "include": "#ValueEnum_RayQueryCandidateIntersectionType" },
+ { "include": "#ValueEnum_PackedVectorFormat" },
+ { "include": "#BitEnum_CooperativeMatrixOperands" },
+ { "include": "#ValueEnum_CooperativeMatrixLayout" },
+ { "include": "#ValueEnum_CooperativeMatrixUse" },
+ { "include": "#BitEnum_CooperativeMatrixReduce" },
+ { "include": "#ValueEnum_TensorClampMode" },
+ { "include": "#BitEnum_TensorAddressingOperands" },
+ { "include": "#ValueEnum_InitializationModeQualifier" },
+ { "include": "#ValueEnum_LoadCacheControl" },
+ { "include": "#ValueEnum_StoreCacheControl" },
+ { "include": "#ValueEnum_NamedMaximumNumberOfRegisters" },
{ "include": "#BitEnum_DebugInfoFlags" },
{ "include": "#ValueEnum_DebugBaseTypeAttributeEncoding" },
{ "include": "#ValueEnum_DebugCompositeType" },
@@ -53,11 +71,11 @@
],
"repository": {
"BitEnum_ImageOperands": {
- "match": "\\b(None|Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod|MakeTexelAvailable|MakeTexelAvailableKHR|MakeTexelVisible|MakeTexelVisibleKHR|NonPrivateTexel|NonPrivateTexelKHR|VolatileTexel|VolatileTexelKHR|SignExtend|ZeroExtend)\\b",
+ "match": "\\b(None|Bias|Lod|Grad|ConstOffset|Offset|ConstOffsets|Sample|MinLod|MakeTexelAvailable|MakeTexelVisible|NonPrivateTexel|VolatileTexel|SignExtend|ZeroExtend|Nontemporal|Offsets)\\b",
"name": "keyword.spirv"
},
"BitEnum_FPFastMathMode": {
- "match": "\\b(None|NotNaN|NotInf|NSZ|AllowRecip|Fast)\\b",
+ "match": "\\b(None|NotNaN|NotInf|NSZ|AllowRecip|Fast|AllowContract|AllowReassoc|AllowTransform)\\b",
"name": "keyword.spirv"
},
"BitEnum_SelectionControl": {
@@ -65,19 +83,19 @@
"name": "keyword.spirv"
},
"BitEnum_LoopControl": {
- "match": "\\b(None|Unroll|DontUnroll|DependencyInfinite|DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount)\\b",
+ "match": "\\b(None|Unroll|DontUnroll|DependencyInfinite|DependencyLength|MinIterations|MaxIterations|IterationMultiple|PeelCount|PartialCount|InitiationIntervalINTEL|MaxConcurrencyINTEL|DependencyArrayINTEL|PipelineEnableINTEL|LoopCoalesceINTEL|MaxInterleavingINTEL|SpeculatedIterationsINTEL|NoFusionINTEL|LoopCountINTEL|MaxReinvocationDelayINTEL)\\b",
"name": "keyword.spirv"
},
"BitEnum_FunctionControl": {
- "match": "\\b(None|Inline|DontInline|Pure|Const)\\b",
+ "match": "\\b(None|Inline|DontInline|Pure|Const|OptNoneEXT)\\b",
"name": "keyword.spirv"
},
"BitEnum_MemorySemantics": {
- "match": "\\b(Relaxed|None|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|OutputMemoryKHR|MakeAvailable|MakeAvailableKHR|MakeVisible|MakeVisibleKHR|Volatile)\\b",
+ "match": "\\b(Relaxed|Acquire|Release|AcquireRelease|SequentiallyConsistent|UniformMemory|SubgroupMemory|WorkgroupMemory|CrossWorkgroupMemory|AtomicCounterMemory|ImageMemory|OutputMemory|MakeAvailable|MakeVisible|Volatile)\\b",
"name": "keyword.spirv"
},
"BitEnum_MemoryAccess": {
- "match": "\\b(None|Volatile|Aligned|Nontemporal|MakePointerAvailable|MakePointerAvailableKHR|MakePointerVisible|MakePointerVisibleKHR|NonPrivatePointer|NonPrivatePointerKHR)\\b",
+ "match": "\\b(None|Volatile|Aligned|Nontemporal|MakePointerAvailable|MakePointerVisible|NonPrivatePointer|AliasScopeINTELMask|NoAliasINTELMask)\\b",
"name": "keyword.spirv"
},
"BitEnum_KernelProfilingInfo": {
@@ -85,35 +103,43 @@
"name": "keyword.spirv"
},
"BitEnum_RayFlags": {
- "match": "\\b(NoneKHR|OpaqueKHR|NoOpaqueKHR|TerminateOnFirstHitKHR|SkipClosestHitShaderKHR|CullBackFacingTrianglesKHR|CullFrontFacingTrianglesKHR|CullOpaqueKHR|CullNoOpaqueKHR|SkipTrianglesKHR|SkipAABBsKHR)\\b",
+ "match": "\\b(NoneKHR|OpaqueKHR|NoOpaqueKHR|TerminateOnFirstHitKHR|SkipClosestHitShaderKHR|CullBackFacingTrianglesKHR|CullFrontFacingTrianglesKHR|CullOpaqueKHR|CullNoOpaqueKHR|SkipTrianglesKHR|SkipAABBsKHR|ForceOpacityMicromap2StateEXT)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_FragmentShadingRate": {
+ "match": "\\b(Vertical2Pixels|Vertical4Pixels|Horizontal2Pixels|Horizontal4Pixels)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_RawAccessChainOperands": {
+ "match": "\\b(None|RobustnessPerComponentNV|RobustnessPerElementNV)\\b",
"name": "keyword.spirv"
},
"ValueEnum_SourceLanguage": {
- "match": "\\b(Unknown|ESSL|GLSL|OpenCL_C|OpenCL_CPP|HLSL)\\b",
+ "match": "\\b(Unknown|ESSL|GLSL|OpenCL_C|OpenCL_CPP|HLSL|CPP_for_OpenCL|SYCL|HERO_C|NZSL|WGSL|Slang|Zig)\\b",
"name": "keyword.spirv"
},
"ValueEnum_ExecutionModel": {
- "match": "\\b(Vertex|TessellationControl|TessellationEvaluation|Geometry|Fragment|GLCompute|Kernel|TaskNV|MeshNV|RayGenerationNV|RayGenerationKHR|IntersectionNV|IntersectionKHR|AnyHitNV|AnyHitKHR|ClosestHitNV|ClosestHitKHR|MissNV|MissKHR|CallableNV|CallableKHR)\\b",
+ "match": "\\b(Vertex|TessellationControl|TessellationEvaluation|Geometry|Fragment|GLCompute|Kernel|TaskNV|MeshNV|RayGenerationKHR|IntersectionKHR|AnyHitKHR|ClosestHitKHR|MissKHR|CallableKHR|TaskEXT|MeshEXT)\\b",
"name": "keyword.spirv"
},
"ValueEnum_AddressingModel": {
- "match": "\\b(Logical|Physical32|Physical64|PhysicalStorageBuffer64|PhysicalStorageBuffer64EXT)\\b",
+ "match": "\\b(Logical|Physical32|Physical64|PhysicalStorageBuffer64)\\b",
"name": "keyword.spirv"
},
"ValueEnum_MemoryModel": {
- "match": "\\b(Simple|GLSL450|OpenCL|Vulkan|VulkanKHR)\\b",
+ "match": "\\b(Simple|GLSL450|OpenCL|Vulkan)\\b",
"name": "keyword.spirv"
},
"ValueEnum_ExecutionMode": {
- "match": "\\b(Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|StencilRefReplacingEXT|OutputLinesNV|OutputPrimitivesNV|DerivativeGroupQuadsNV|DerivativeGroupLinearNV|OutputTrianglesNV|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT)\\b",
+ "match": "\\b(Invocations|SpacingEqual|SpacingFractionalEven|SpacingFractionalOdd|VertexOrderCw|VertexOrderCcw|PixelCenterInteger|OriginUpperLeft|OriginLowerLeft|EarlyFragmentTests|PointMode|Xfb|DepthReplacing|DepthGreater|DepthLess|DepthUnchanged|LocalSize|LocalSizeHint|InputPoints|InputLines|InputLinesAdjacency|Triangles|InputTrianglesAdjacency|Quads|Isolines|OutputVertices|OutputPoints|OutputLineStrip|OutputTriangleStrip|VecTypeHint|ContractionOff|Initializer|Finalizer|SubgroupSize|SubgroupsPerWorkgroup|SubgroupsPerWorkgroupId|LocalSizeId|LocalSizeHintId|NonCoherentColorAttachmentReadEXT|NonCoherentDepthAttachmentReadEXT|NonCoherentStencilAttachmentReadEXT|SubgroupUniformControlFlowKHR|PostDepthCoverage|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|EarlyAndLateFragmentTestsAMD|StencilRefReplacingEXT|CoalescingAMDX|IsApiEntryAMDX|MaxNodeRecursionAMDX|StaticNumWorkgroupsAMDX|ShaderIndexAMDX|MaxNumWorkgroupsAMDX|StencilRefUnchangedFrontAMD|StencilRefGreaterFrontAMD|StencilRefLessFrontAMD|StencilRefUnchangedBackAMD|StencilRefGreaterBackAMD|StencilRefLessBackAMD|QuadDerivativesKHR|RequireFullQuadsKHR|SharesInputWithAMDX|OutputLinesEXT|OutputPrimitivesEXT|DerivativeGroupQuadsKHR|DerivativeGroupLinearKHR|OutputTrianglesEXT|PixelInterlockOrderedEXT|PixelInterlockUnorderedEXT|SampleInterlockOrderedEXT|SampleInterlockUnorderedEXT|ShadingRateInterlockOrderedEXT|ShadingRateInterlockUnorderedEXT|SharedLocalMemorySizeINTEL|RoundingModeRTPINTEL|RoundingModeRTNINTEL|FloatingPointModeALTINTEL|FloatingPointModeIEEEINTEL|MaxWorkgroupSizeINTEL|MaxWorkDimINTEL|NoGlobalOffsetINTEL|NumSIMDWorkitemsINTEL|SchedulerTargetFmaxMhzINTEL|MaximallyReconvergesKHR|FPFastMathDefault|StreamingInterfaceINTEL|RegisterMapInterfaceINTEL|NamedBarrierCountINTEL|MaximumRegistersINTEL|MaximumRegistersIdINTEL|NamedMaximumRegistersINTEL)\\b",
"name": "keyword.spirv"
},
"ValueEnum_StorageClass": {
- "match": "\\b(UniformConstant|Input|Uniform|Output|Workgroup|CrossWorkgroup|Private|Function|Generic|PushConstant|AtomicCounter|Image|StorageBuffer|CallableDataNV|CallableDataKHR|IncomingCallableDataNV|IncomingCallableDataKHR|RayPayloadNV|RayPayloadKHR|HitAttributeNV|HitAttributeKHR|IncomingRayPayloadNV|IncomingRayPayloadKHR|ShaderRecordBufferNV|ShaderRecordBufferKHR|PhysicalStorageBuffer|PhysicalStorageBufferEXT)\\b",
+ "match": "\\b(UniformConstant|Input|Uniform|Output|Workgroup|CrossWorkgroup|Private|Function|Generic|PushConstant|AtomicCounter|Image|StorageBuffer|TileImageEXT|NodePayloadAMDX|CallableDataKHR|IncomingCallableDataKHR|RayPayloadKHR|HitAttributeKHR|IncomingRayPayloadKHR|ShaderRecordBufferKHR|PhysicalStorageBuffer|HitObjectAttributeNV|TaskPayloadWorkgroupEXT|CodeSectionINTEL|DeviceOnlyINTEL|HostOnlyINTEL)\\b",
"name": "keyword.spirv"
},
"ValueEnum_Dim": {
- "match": "\\b(1D|2D|3D|Cube|Rect|Buffer|SubpassData)\\b",
+ "match": "\\b(1D|2D|3D|Cube|Rect|Buffer|SubpassData|TileImageDataEXT)\\b",
"name": "keyword.spirv"
},
"ValueEnum_SamplerAddressingMode": {
@@ -125,7 +151,7 @@
"name": "keyword.spirv"
},
"ValueEnum_ImageFormat": {
- "match": "\\b(Unknown|Rgba32f|Rgba16f|R32f|Rgba8|Rgba8Snorm|Rg32f|Rg16f|R11fG11fB10f|R16f|Rgba16|Rgb10A2|Rg16|Rg8|R16|R8|Rgba16Snorm|Rg16Snorm|Rg8Snorm|R16Snorm|R8Snorm|Rgba32i|Rgba16i|Rgba8i|R32i|Rg32i|Rg16i|Rg8i|R16i|R8i|Rgba32ui|Rgba16ui|Rgba8ui|R32ui|Rgb10a2ui|Rg32ui|Rg16ui|Rg8ui|R16ui|R8ui)\\b",
+ "match": "\\b(Unknown|Rgba32f|Rgba16f|R32f|Rgba8|Rgba8Snorm|Rg32f|Rg16f|R11fG11fB10f|R16f|Rgba16|Rgb10A2|Rg16|Rg8|R16|R8|Rgba16Snorm|Rg16Snorm|Rg8Snorm|R16Snorm|R8Snorm|Rgba32i|Rgba16i|Rgba8i|R32i|Rg32i|Rg16i|Rg8i|R16i|R8i|Rgba32ui|Rgba16ui|Rgba8ui|R32ui|Rgb10a2ui|Rg32ui|Rg16ui|Rg8ui|R16ui|R8ui|R64ui|R64i)\\b",
"name": "keyword.spirv"
},
"ValueEnum_ImageChannelOrder": {
@@ -133,35 +159,55 @@
"name": "keyword.spirv"
},
"ValueEnum_ImageChannelDataType": {
- "match": "\\b(SnormInt8|SnormInt16|UnormInt8|UnormInt16|UnormShort565|UnormShort555|UnormInt101010|SignedInt8|SignedInt16|SignedInt32|UnsignedInt8|UnsignedInt16|UnsignedInt32|HalfFloat|Float|UnormInt24|UnormInt101010_2)\\b",
+ "match": "\\b(SnormInt8|SnormInt16|UnormInt8|UnormInt16|UnormShort565|UnormShort555|UnormInt101010|SignedInt8|SignedInt16|SignedInt32|UnsignedInt8|UnsignedInt16|UnsignedInt32|HalfFloat|Float|UnormInt24|UnormInt101010_2|UnsignedIntRaw10EXT|UnsignedIntRaw12EXT|UnormInt2_101010EXT)\\b",
"name": "keyword.spirv"
},
"ValueEnum_FPRoundingMode": {
"match": "\\b(RTE|RTZ|RTP|RTN)\\b",
"name": "keyword.spirv"
},
+ "ValueEnum_FPDenormMode": {
+ "match": "\\b(Preserve|FlushToZero)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_QuantizationModes": {
+ "match": "\\b(TRN|TRN_ZERO|RND|RND_ZERO|RND_INF|RND_MIN_INF|RND_CONV|RND_CONV_ODD)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_FPOperationMode": {
+ "match": "\\b(IEEE|ALT)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_OverflowModes": {
+ "match": "\\b(WRAP|SAT|SAT_ZERO|SAT_SYM)\\b",
+ "name": "keyword.spirv"
+ },
"ValueEnum_LinkageType": {
- "match": "\\b(Export|Import)\\b",
+ "match": "\\b(Export|Import|LinkOnceODR)\\b",
"name": "keyword.spirv"
},
"ValueEnum_AccessQualifier": {
"match": "\\b(ReadOnly|WriteOnly|ReadWrite)\\b",
"name": "keyword.spirv"
},
+ "ValueEnum_HostAccessQualifier": {
+ "match": "\\b(NoneINTEL|ReadINTEL|WriteINTEL|ReadWriteINTEL)\\b",
+ "name": "keyword.spirv"
+ },
"ValueEnum_FunctionParameterAttribute": {
- "match": "\\b(Zext|Sext|ByVal|Sret|NoAlias|NoCapture|NoWrite|NoReadWrite)\\b",
+ "match": "\\b(Zext|Sext|ByVal|Sret|NoAlias|NoCapture|NoWrite|NoReadWrite|RuntimeAlignedINTEL)\\b",
"name": "keyword.spirv"
},
"ValueEnum_Decoration": {
- "match": "\\b(RelaxedPrecision|SpecId|Block|BufferBlock|RowMajor|ColMajor|ArrayStride|MatrixStride|GLSLShared|GLSLPacked|CPacked|BuiltIn|NoPerspective|Flat|Patch|Centroid|Sample|Invariant|Restrict|Aliased|Volatile|Constant|Coherent|NonWritable|NonReadable|Uniform|UniformId|SaturatedConversion|Stream|Location|Component|Index|Binding|DescriptorSet|Offset|XfbBuffer|XfbStride|FuncParamAttr|FPRoundingMode|FPFastMathMode|LinkageAttributes|NoContraction|InputAttachmentIndex|Alignment|MaxByteOffset|AlignmentId|MaxByteOffsetId|NoSignedWrap|NoUnsignedWrap|ExplicitInterpAMD|OverrideCoverageNV|PassthroughNV|ViewportRelativeNV|SecondaryViewportRelativeNV|PerPrimitiveNV|PerViewNV|PerTaskNV|PerVertexNV|NonUniform|NonUniformEXT|RestrictPointer|RestrictPointerEXT|AliasedPointer|AliasedPointerEXT|CounterBuffer|HlslCounterBufferGOOGLE|UserSemantic|HlslSemanticGOOGLE|UserTypeGOOGLE)\\b",
+ "match": "\\b(RelaxedPrecision|SpecId|Block|BufferBlock|RowMajor|ColMajor|ArrayStride|MatrixStride|GLSLShared|GLSLPacked|CPacked|BuiltIn|NoPerspective|Flat|Patch|Centroid|Sample|Invariant|Restrict|Aliased|Volatile|Constant|Coherent|NonWritable|NonReadable|Uniform|UniformId|SaturatedConversion|Stream|Location|Component|Index|Binding|DescriptorSet|Offset|XfbBuffer|XfbStride|FuncParamAttr|FPRoundingMode|FPFastMathMode|LinkageAttributes|NoContraction|InputAttachmentIndex|Alignment|MaxByteOffset|AlignmentId|MaxByteOffsetId|NoSignedWrap|NoUnsignedWrap|WeightTextureQCOM|BlockMatchTextureQCOM|BlockMatchSamplerQCOM|ExplicitInterpAMD|NodeSharesPayloadLimitsWithAMDX|NodeMaxPayloadsAMDX|TrackFinishWritingAMDX|PayloadNodeNameAMDX|PayloadNodeBaseIndexAMDX|PayloadNodeSparseArrayAMDX|PayloadNodeArraySizeAMDX|PayloadDispatchIndirectAMDX|OverrideCoverageNV|PassthroughNV|ViewportRelativeNV|SecondaryViewportRelativeNV|PerPrimitiveEXT|PerViewNV|PerTaskNV|PerVertexKHR|NonUniform|RestrictPointer|AliasedPointer|HitObjectShaderRecordBufferNV|BindlessSamplerNV|BindlessImageNV|BoundSamplerNV|BoundImageNV|SIMTCallINTEL|ReferencedIndirectlyINTEL|ClobberINTEL|SideEffectsINTEL|VectorComputeVariableINTEL|FuncParamIOKindINTEL|VectorComputeFunctionINTEL|StackCallINTEL|GlobalVariableOffsetINTEL|CounterBuffer|UserSemantic|UserTypeGOOGLE|FunctionRoundingModeINTEL|FunctionDenormModeINTEL|RegisterINTEL|MemoryINTEL|NumbanksINTEL|BankwidthINTEL|MaxPrivateCopiesINTEL|SinglepumpINTEL|DoublepumpINTEL|MaxReplicatesINTEL|SimpleDualPortINTEL|MergeINTEL|BankBitsINTEL|ForcePow2DepthINTEL|StridesizeINTEL|WordsizeINTEL|TrueDualPortINTEL|BurstCoalesceINTEL|CacheSizeINTEL|DontStaticallyCoalesceINTEL|PrefetchINTEL|StallEnableINTEL|FuseLoopsInFunctionINTEL|MathOpDSPModeINTEL|AliasScopeINTEL|NoAliasINTEL|InitiationIntervalINTEL|MaxConcurrencyINTEL|PipelineEnableINTEL|BufferLocationINTEL|IOPipeStorageINTEL|FunctionFloatingPointModeINTEL|SingleElementVectorINTEL|VectorComputeCallableFunctionINTEL|MediaBlockIOINTEL|StallFreeINTEL|FPMaxErrorDecorationINTEL|LatencyControlLabelINTEL|LatencyControlConstraintINTEL|ConduitKernelArgumentINTEL|RegisterMapKernelArgumentINTEL|MMHostInterfaceAddressWidthINTEL|MMHostInterfaceDataWidthINTEL|MMHostInterfaceLatencyINTEL|MMHostInterfaceReadWriteModeINTEL|MMHostInterfaceMaxBurstINTEL|MMHostInterfaceWaitRequestINTEL|StableKernelArgumentINTEL|HostAccessINTEL|InitModeINTEL|ImplementInRegisterMapINTEL|CacheControlLoadINTEL|CacheControlStoreINTEL)\\b",
"name": "keyword.spirv"
},
"ValueEnum_BuiltIn": {
- "match": "\\b(Position|PointSize|ClipDistance|CullDistance|VertexId|InstanceId|PrimitiveId|InvocationId|Layer|ViewportIndex|TessLevelOuter|TessLevelInner|TessCoord|PatchVertices|FragCoord|PointCoord|FrontFacing|SampleId|SamplePosition|SampleMask|FragDepth|HelperInvocation|NumWorkgroups|WorkgroupSize|WorkgroupId|LocalInvocationId|GlobalInvocationId|LocalInvocationIndex|WorkDim|GlobalSize|EnqueuedWorkgroupSize|GlobalOffset|GlobalLinearId|SubgroupSize|SubgroupMaxSize|NumSubgroups|NumEnqueuedSubgroups|SubgroupId|SubgroupLocalInvocationId|VertexIndex|InstanceIndex|SubgroupEqMask|SubgroupGeMask|SubgroupGtMask|SubgroupLeMask|SubgroupLtMask|SubgroupEqMaskKHR|SubgroupGeMaskKHR|SubgroupGtMaskKHR|SubgroupLeMaskKHR|SubgroupLtMaskKHR|BaseVertex|BaseInstance|DrawIndex|DeviceIndex|ViewIndex|BaryCoordNoPerspAMD|BaryCoordNoPerspCentroidAMD|BaryCoordNoPerspSampleAMD|BaryCoordSmoothAMD|BaryCoordSmoothCentroidAMD|BaryCoordSmoothSampleAMD|BaryCoordPullModelAMD|FragStencilRefEXT|ViewportMaskNV|SecondaryPositionNV|SecondaryViewportMaskNV|PositionPerViewNV|ViewportMaskPerViewNV|FullyCoveredEXT|TaskCountNV|PrimitiveCountNV|PrimitiveIndicesNV|ClipDistancePerViewNV|CullDistancePerViewNV|LayerPerViewNV|MeshViewCountNV|MeshViewIndicesNV|BaryCoordNV|BaryCoordNoPerspNV|FragSizeEXT|FragmentSizeNV|FragInvocationCountEXT|InvocationsPerPixelNV|LaunchIdNV|LaunchIdKHR|LaunchSizeNV|LaunchSizeKHR|WorldRayOriginNV|WorldRayOriginKHR|WorldRayDirectionNV|WorldRayDirectionKHR|ObjectRayOriginNV|ObjectRayOriginKHR|ObjectRayDirectionNV|ObjectRayDirectionKHR|RayTminNV|RayTminKHR|RayTmaxNV|RayTmaxKHR|InstanceCustomIndexNV|InstanceCustomIndexKHR|ObjectToWorldNV|ObjectToWorldKHR|WorldToObjectNV|WorldToObjectKHR|HitTNV|HitTKHR|HitKindNV|HitKindKHR|IncomingRayFlagsNV|IncomingRayFlagsKHR|RayGeometryIndexKHR|WarpsPerSMNV|SMCountNV|WarpIDNV|SMIDNV)\\b",
+ "match": "\\b(Position|PointSize|ClipDistance|CullDistance|VertexId|InstanceId|PrimitiveId|InvocationId|Layer|ViewportIndex|TessLevelOuter|TessLevelInner|TessCoord|PatchVertices|FragCoord|PointCoord|FrontFacing|SampleId|SamplePosition|SampleMask|FragDepth|HelperInvocation|NumWorkgroups|WorkgroupSize|WorkgroupId|LocalInvocationId|GlobalInvocationId|LocalInvocationIndex|WorkDim|GlobalSize|EnqueuedWorkgroupSize|GlobalOffset|GlobalLinearId|SubgroupSize|SubgroupMaxSize|NumSubgroups|NumEnqueuedSubgroups|SubgroupId|SubgroupLocalInvocationId|VertexIndex|InstanceIndex|CoreIDARM|CoreCountARM|CoreMaxIDARM|WarpIDARM|WarpMaxIDARM|SubgroupEqMask|SubgroupGeMask|SubgroupGtMask|SubgroupLeMask|SubgroupLtMask|BaseVertex|BaseInstance|DrawIndex|PrimitiveShadingRateKHR|DeviceIndex|ViewIndex|ShadingRateKHR|BaryCoordNoPerspAMD|BaryCoordNoPerspCentroidAMD|BaryCoordNoPerspSampleAMD|BaryCoordSmoothAMD|BaryCoordSmoothCentroidAMD|BaryCoordSmoothSampleAMD|BaryCoordPullModelAMD|FragStencilRefEXT|RemainingRecursionLevelsAMDX|ShaderIndexAMDX|ViewportMaskNV|SecondaryPositionNV|SecondaryViewportMaskNV|PositionPerViewNV|ViewportMaskPerViewNV|FullyCoveredEXT|TaskCountNV|PrimitiveCountNV|PrimitiveIndicesNV|ClipDistancePerViewNV|CullDistancePerViewNV|LayerPerViewNV|MeshViewCountNV|MeshViewIndicesNV|BaryCoordKHR|BaryCoordNoPerspKHR|FragSizeEXT|FragInvocationCountEXT|PrimitivePointIndicesEXT|PrimitiveLineIndicesEXT|PrimitiveTriangleIndicesEXT|CullPrimitiveEXT|LaunchIdKHR|LaunchSizeKHR|WorldRayOriginKHR|WorldRayDirectionKHR|ObjectRayOriginKHR|ObjectRayDirectionKHR|RayTminKHR|RayTmaxKHR|InstanceCustomIndexKHR|ObjectToWorldKHR|WorldToObjectKHR|HitTNV|HitKindKHR|CurrentRayTimeNV|HitTriangleVertexPositionsKHR|HitMicroTriangleVertexPositionsNV|HitMicroTriangleVertexBarycentricsNV|IncomingRayFlagsKHR|RayGeometryIndexKHR|WarpsPerSMNV|SMCountNV|WarpIDNV|SMIDNV|HitKindFrontFacingMicroTriangleNV|HitKindBackFacingMicroTriangleNV|CullMaskKHR)\\b",
"name": "keyword.spirv"
},
"ValueEnum_Scope": {
- "match": "\\b(CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|QueueFamilyKHR|ShaderCallKHR)\\b",
+ "match": "\\b(CrossDevice|Device|Workgroup|Subgroup|Invocation|QueueFamily|ShaderCallKHR)\\b",
"name": "keyword.spirv"
},
"ValueEnum_GroupOperation": {
@@ -173,7 +219,7 @@
"name": "keyword.spirv"
},
"ValueEnum_Capability": {
- "match": "\\b(Matrix|Shader|Geometry|Tessellation|Addresses|Linkage|Kernel|Vector16|Float16Buffer|Float16|Float64|Int64|Int64Atomics|ImageBasic|ImageReadWrite|ImageMipmap|Pipes|Groups|DeviceEnqueue|LiteralSampler|AtomicStorage|Int16|TessellationPointSize|GeometryPointSize|ImageGatherExtended|StorageImageMultisample|UniformBufferArrayDynamicIndexing|SampledImageArrayDynamicIndexing|StorageBufferArrayDynamicIndexing|StorageImageArrayDynamicIndexing|ClipDistance|CullDistance|ImageCubeArray|SampleRateShading|ImageRect|SampledRect|GenericPointer|Int8|InputAttachment|SparseResidency|MinLod|Sampled1D|Image1D|SampledCubeArray|SampledBuffer|ImageBuffer|ImageMSArray|StorageImageExtendedFormats|ImageQuery|DerivativeControl|InterpolationFunction|TransformFeedback|GeometryStreams|StorageImageReadWithoutFormat|StorageImageWriteWithoutFormat|MultiViewport|SubgroupDispatch|NamedBarrier|PipeStorage|GroupNonUniform|GroupNonUniformVote|GroupNonUniformArithmetic|GroupNonUniformBallot|GroupNonUniformShuffle|GroupNonUniformShuffleRelative|GroupNonUniformClustered|GroupNonUniformQuad|ShaderLayer|ShaderViewportIndex|SubgroupBallotKHR|DrawParameters|SubgroupVoteKHR|StorageBuffer16BitAccess|StorageUniformBufferBlock16|UniformAndStorageBuffer16BitAccess|StorageUniform16|StoragePushConstant16|StorageInputOutput16|DeviceGroup|MultiView|VariablePointersStorageBuffer|VariablePointers|AtomicStorageOps|SampleMaskPostDepthCoverage|StorageBuffer8BitAccess|UniformAndStorageBuffer8BitAccess|StoragePushConstant8|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|RayQueryProvisionalKHR|RayTraversalPrimitiveCullingProvisionalKHR|Float16ImageAMD|ImageGatherBiasLodAMD|FragmentMaskAMD|StencilExportEXT|ImageReadWriteLodAMD|ShaderClockKHR|SampleMaskOverrideCoverageNV|GeometryShaderPassthroughNV|ShaderViewportIndexLayerEXT|ShaderViewportIndexLayerNV|ShaderViewportMaskNV|ShaderStereoViewNV|PerViewAttributesNV|FragmentFullyCoveredEXT|MeshShadingNV|ImageFootprintNV|FragmentBarycentricNV|ComputeDerivativeGroupQuadsNV|FragmentDensityEXT|ShadingRateNV|GroupNonUniformPartitionedNV|ShaderNonUniform|ShaderNonUniformEXT|RuntimeDescriptorArray|RuntimeDescriptorArrayEXT|InputAttachmentArrayDynamicIndexing|InputAttachmentArrayDynamicIndexingEXT|UniformTexelBufferArrayDynamicIndexing|UniformTexelBufferArrayDynamicIndexingEXT|StorageTexelBufferArrayDynamicIndexing|StorageTexelBufferArrayDynamicIndexingEXT|UniformBufferArrayNonUniformIndexing|UniformBufferArrayNonUniformIndexingEXT|SampledImageArrayNonUniformIndexing|SampledImageArrayNonUniformIndexingEXT|StorageBufferArrayNonUniformIndexing|StorageBufferArrayNonUniformIndexingEXT|StorageImageArrayNonUniformIndexing|StorageImageArrayNonUniformIndexingEXT|InputAttachmentArrayNonUniformIndexing|InputAttachmentArrayNonUniformIndexingEXT|UniformTexelBufferArrayNonUniformIndexing|UniformTexelBufferArrayNonUniformIndexingEXT|StorageTexelBufferArrayNonUniformIndexing|StorageTexelBufferArrayNonUniformIndexingEXT|RayTracingNV|VulkanMemoryModel|VulkanMemoryModelKHR|VulkanMemoryModelDeviceScope|VulkanMemoryModelDeviceScopeKHR|PhysicalStorageBufferAddresses|PhysicalStorageBufferAddressesEXT|ComputeDerivativeGroupLinearNV|RayTracingProvisionalKHR|CooperativeMatrixNV|FragmentShaderSampleInterlockEXT|FragmentShaderShadingRateInterlockEXT|ShaderSMBuiltinsNV|FragmentShaderPixelInterlockEXT|DemoteToHelperInvocationEXT|SubgroupShuffleINTEL|SubgroupBufferBlockIOINTEL|SubgroupImageBlockIOINTEL|SubgroupImageMediaBlockIOINTEL|IntegerFunctions2INTEL|SubgroupAvcMotionEstimationINTEL|SubgroupAvcMotionEstimationIntraINTEL|SubgroupAvcMotionEstimationChromaINTEL)\\b",
+ "match": "\\b(Matrix|Shader|Geometry|Tessellation|Addresses|Linkage|Kernel|Vector16|Float16Buffer|Float16|Float64|Int64|Int64Atomics|ImageBasic|ImageReadWrite|ImageMipmap|Pipes|Groups|DeviceEnqueue|LiteralSampler|AtomicStorage|Int16|TessellationPointSize|GeometryPointSize|ImageGatherExtended|StorageImageMultisample|UniformBufferArrayDynamicIndexing|SampledImageArrayDynamicIndexing|StorageBufferArrayDynamicIndexing|StorageImageArrayDynamicIndexing|ClipDistance|CullDistance|ImageCubeArray|SampleRateShading|ImageRect|SampledRect|GenericPointer|Int8|InputAttachment|SparseResidency|MinLod|Sampled1D|Image1D|SampledCubeArray|SampledBuffer|ImageBuffer|ImageMSArray|StorageImageExtendedFormats|ImageQuery|DerivativeControl|InterpolationFunction|TransformFeedback|GeometryStreams|StorageImageReadWithoutFormat|StorageImageWriteWithoutFormat|MultiViewport|SubgroupDispatch|NamedBarrier|PipeStorage|GroupNonUniform|GroupNonUniformVote|GroupNonUniformArithmetic|GroupNonUniformBallot|GroupNonUniformShuffle|GroupNonUniformShuffleRelative|GroupNonUniformClustered|GroupNonUniformQuad|ShaderLayer|ShaderViewportIndex|UniformDecoration|CoreBuiltinsARM|TileImageColorReadAccessEXT|TileImageDepthReadAccessEXT|TileImageStencilReadAccessEXT|CooperativeMatrixLayoutsARM|FragmentShadingRateKHR|SubgroupBallotKHR|DrawParameters|WorkgroupMemoryExplicitLayoutKHR|WorkgroupMemoryExplicitLayout8BitAccessKHR|WorkgroupMemoryExplicitLayout16BitAccessKHR|SubgroupVoteKHR|StorageBuffer16BitAccess|UniformAndStorageBuffer16BitAccess|StoragePushConstant16|StorageInputOutput16|DeviceGroup|MultiView|VariablePointersStorageBuffer|VariablePointers|AtomicStorageOps|SampleMaskPostDepthCoverage|StorageBuffer8BitAccess|UniformAndStorageBuffer8BitAccess|StoragePushConstant8|DenormPreserve|DenormFlushToZero|SignedZeroInfNanPreserve|RoundingModeRTE|RoundingModeRTZ|RayQueryProvisionalKHR|RayQueryKHR|UntypedPointersKHR|RayTraversalPrimitiveCullingKHR|RayTracingKHR|TextureSampleWeightedQCOM|TextureBoxFilterQCOM|TextureBlockMatchQCOM|TextureBlockMatch2QCOM|Float16ImageAMD|ImageGatherBiasLodAMD|FragmentMaskAMD|StencilExportEXT|ImageReadWriteLodAMD|Int64ImageEXT|ShaderClockKHR|ShaderEnqueueAMDX|QuadControlKHR|SampleMaskOverrideCoverageNV|GeometryShaderPassthroughNV|ShaderViewportIndexLayerEXT|ShaderViewportMaskNV|ShaderStereoViewNV|PerViewAttributesNV|FragmentFullyCoveredEXT|MeshShadingNV|ImageFootprintNV|MeshShadingEXT|FragmentBarycentricKHR|ComputeDerivativeGroupQuadsKHR|FragmentDensityEXT|GroupNonUniformPartitionedNV|ShaderNonUniform|RuntimeDescriptorArray|InputAttachmentArrayDynamicIndexing|UniformTexelBufferArrayDynamicIndexing|StorageTexelBufferArrayDynamicIndexing|UniformBufferArrayNonUniformIndexing|SampledImageArrayNonUniformIndexing|StorageBufferArrayNonUniformIndexing|StorageImageArrayNonUniformIndexing|InputAttachmentArrayNonUniformIndexing|UniformTexelBufferArrayNonUniformIndexing|StorageTexelBufferArrayNonUniformIndexing|RayTracingPositionFetchKHR|RayTracingNV|RayTracingMotionBlurNV|VulkanMemoryModel|VulkanMemoryModelDeviceScope|PhysicalStorageBufferAddresses|ComputeDerivativeGroupLinearKHR|RayTracingProvisionalKHR|CooperativeMatrixNV|FragmentShaderSampleInterlockEXT|FragmentShaderShadingRateInterlockEXT|ShaderSMBuiltinsNV|FragmentShaderPixelInterlockEXT|DemoteToHelperInvocation|DisplacementMicromapNV|RayTracingOpacityMicromapEXT|ShaderInvocationReorderNV|BindlessTextureNV|RayQueryPositionFetchKHR|AtomicFloat16VectorNV|RayTracingDisplacementMicromapNV|RawAccessChainsNV|CooperativeMatrixReductionsNV|CooperativeMatrixConversionsNV|CooperativeMatrixPerElementOperationsNV|CooperativeMatrixTensorAddressingNV|CooperativeMatrixBlockLoadsNV|TensorAddressingNV|SubgroupShuffleINTEL|SubgroupBufferBlockIOINTEL|SubgroupImageBlockIOINTEL|SubgroupImageMediaBlockIOINTEL|RoundToInfinityINTEL|FloatingPointModeINTEL|IntegerFunctions2INTEL|FunctionPointersINTEL|IndirectReferencesINTEL|AsmINTEL|AtomicFloat32MinMaxEXT|AtomicFloat64MinMaxEXT|AtomicFloat16MinMaxEXT|VectorComputeINTEL|VectorAnyINTEL|ExpectAssumeKHR|SubgroupAvcMotionEstimationINTEL|SubgroupAvcMotionEstimationIntraINTEL|SubgroupAvcMotionEstimationChromaINTEL|VariableLengthArrayINTEL|FunctionFloatControlINTEL|FPGAMemoryAttributesINTEL|FPFastMathModeINTEL|ArbitraryPrecisionIntegersINTEL|ArbitraryPrecisionFloatingPointINTEL|UnstructuredLoopControlsINTEL|FPGALoopControlsINTEL|KernelAttributesINTEL|FPGAKernelAttributesINTEL|FPGAMemoryAccessesINTEL|FPGAClusterAttributesINTEL|LoopFuseINTEL|FPGADSPControlINTEL|MemoryAccessAliasingINTEL|FPGAInvocationPipeliningAttributesINTEL|FPGABufferLocationINTEL|ArbitraryPrecisionFixedPointINTEL|USMStorageClassesINTEL|RuntimeAlignedAttributeINTEL|IOPipesINTEL|BlockingPipesINTEL|FPGARegINTEL|DotProductInputAll|DotProductInput4x8Bit|DotProductInput4x8BitPacked|DotProduct|RayCullMaskKHR|CooperativeMatrixKHR|ReplicatedCompositesEXT|BitInstructions|GroupNonUniformRotateKHR|FloatControls2|AtomicFloat32AddEXT|AtomicFloat64AddEXT|LongCompositesINTEL|OptNoneEXT|AtomicFloat16AddEXT|DebugInfoModuleINTEL|BFloat16ConversionINTEL|SplitBarrierINTEL|ArithmeticFenceEXT|FPGAClusterAttributesV2INTEL|FPGAKernelAttributesv2INTEL|FPMaxErrorINTEL|FPGALatencyControlINTEL|FPGAArgumentInterfacesINTEL|GlobalVariableHostAccessINTEL|GlobalVariableFPGADecorationsINTEL|SubgroupBufferPrefetchINTEL|GroupUniformArithmeticKHR|MaskedGatherScatterINTEL|CacheControlsINTEL|RegisterLimitsINTEL)\\b",
"name": "keyword.spirv"
},
"ValueEnum_RayQueryIntersection": {
@@ -188,8 +234,52 @@
"match": "\\b(RayQueryCandidateIntersectionTriangleKHR|RayQueryCandidateIntersectionAABBKHR)\\b",
"name": "keyword.spirv"
},
+ "ValueEnum_PackedVectorFormat": {
+ "match": "\\b(PackedVectorFormat4x8Bit)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_CooperativeMatrixOperands": {
+ "match": "\\b(NoneKHR|MatrixASignedComponentsKHR|MatrixBSignedComponentsKHR|MatrixCSignedComponentsKHR|MatrixResultSignedComponentsKHR|SaturatingAccumulationKHR)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_CooperativeMatrixLayout": {
+ "match": "\\b(RowMajorKHR|ColumnMajorKHR|RowBlockedInterleavedARM|ColumnBlockedInterleavedARM)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_CooperativeMatrixUse": {
+ "match": "\\b(MatrixAKHR|MatrixBKHR|MatrixAccumulatorKHR)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_CooperativeMatrixReduce": {
+ "match": "\\b(Row|Column|2x2)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_TensorClampMode": {
+ "match": "\\b(Undefined|Constant|ClampToEdge|Repeat|RepeatMirrored)\\b",
+ "name": "keyword.spirv"
+ },
+ "BitEnum_TensorAddressingOperands": {
+ "match": "\\b(None|TensorView|DecodeFunc)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_InitializationModeQualifier": {
+ "match": "\\b(InitOnDeviceReprogramINTEL|InitOnDeviceResetINTEL)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_LoadCacheControl": {
+ "match": "\\b(UncachedINTEL|CachedINTEL|StreamingINTEL|InvalidateAfterReadINTEL|ConstCachedINTEL)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_StoreCacheControl": {
+ "match": "\\b(UncachedINTEL|WriteThroughINTEL|WriteBackINTEL|StreamingINTEL)\\b",
+ "name": "keyword.spirv"
+ },
+ "ValueEnum_NamedMaximumNumberOfRegisters": {
+ "match": "\\b(AutoINTEL)\\b",
+ "name": "keyword.spirv"
+ },
"BitEnum_DebugInfoFlags": {
- "match": "\\b(FlagIsProtected|FlagIsPrivate|FlagIsPublic|FlagIsLocal|FlagIsDefinition|FlagFwdDecl|FlagArtificial|FlagExplicit|FlagPrototyped|FlagObjectPointer|FlagStaticMember|FlagIndirectVariable|FlagLValueReference|FlagRValueReference|FlagIsOptimized|FlagIsEnumClass|FlagTypePassByValue|FlagTypePassByReference)\\b",
+ "match": "\\b(None|FlagIsProtected|FlagIsPrivate|FlagIsPublic|FlagIsLocal|FlagIsDefinition|FlagFwdDecl|FlagArtificial|FlagExplicit|FlagPrototyped|FlagObjectPointer|FlagStaticMember|FlagIndirectVariable|FlagLValueReference|FlagRValueReference|FlagIsOptimized|FlagIsEnumClass|FlagTypePassByValue|FlagTypePassByReference)\\b",
"name": "keyword.spirv"
},
"ValueEnum_DebugBaseTypeAttributeEncoding": {
@@ -217,7 +307,7 @@
"name": "entity.name.function.spirv"
},
"extopcode": {
- "match": "(Round|RoundEven|Trunc|FAbs|SAbs|FSign|SSign|Floor|Ceil|Fract|Radians|Degrees|Sin|Cos|Tan|Asin|Acos|Atan|Sinh|Cosh|Tanh|Asinh|Acosh|Atanh|Atan2|Pow|Exp|Log|Exp2|Log2|Sqrt|InverseSqrt|Determinant|MatrixInverse|Modf|ModfStruct|FMin|UMin|SMin|FMax|UMax|SMax|FClamp|UClamp|SClamp|FMix|IMix|Step|SmoothStep|Fma|Frexp|FrexpStruct|Ldexp|PackSnorm4x8|PackUnorm4x8|PackSnorm2x16|PackUnorm2x16|PackHalf2x16|PackDouble2x32|UnpackSnorm2x16|UnpackUnorm2x16|UnpackHalf2x16|UnpackSnorm4x8|UnpackUnorm4x8|UnpackDouble2x32|Length|Distance|Cross|Normalize|FaceForward|Reflect|Refract|FindILsb|FindSMsb|FindUMsb|InterpolateAtCentroid|InterpolateAtSample|InterpolateAtOffset|NMin|NMax|NClamp|acos|acosh|acospi|asin|asinh|asinpi|atan|atan2|atanh|atanpi|atan2pi|cbrt|ceil|copysign|cos|cosh|cospi|erfc|erf|exp|exp2|exp10|expm1|fabs|fdim|floor|fma|fmax|fmin|fmod|fract|frexp|hypot|ilogb|ldexp|lgamma|lgamma_r|log|log2|log10|log1p|logb|mad|maxmag|minmag|modf|nan|nextafter|pow|pown|powr|remainder|remquo|rint|rootn|round|rsqrt|sin|sincos|sinh|sinpi|sqrt|tan|tanh|tanpi|tgamma|trunc|half_cos|half_divide|half_exp|half_exp2|half_exp10|half_log|half_log2|half_log10|half_powr|half_recip|half_rsqrt|half_sin|half_sqrt|half_tan|native_cos|native_divide|native_exp|native_exp2|native_exp10|native_log|native_log2|native_log10|native_powr|native_recip|native_rsqrt|native_sin|native_sqrt|native_tan|s_abs|s_abs_diff|s_add_sat|u_add_sat|s_hadd|u_hadd|s_rhadd|u_rhadd|s_clamp|u_clamp|clz|ctz|s_mad_hi|u_mad_sat|s_mad_sat|s_max|u_max|s_min|u_min|s_mul_hi|rotate|s_sub_sat|u_sub_sat|u_upsample|s_upsample|popcount|s_mad24|u_mad24|s_mul24|u_mul24|u_abs|u_abs_diff|u_mul_hi|u_mad_hi|fclamp|degrees|fmax_common|fmin_common|mix|radians|step|smoothstep|sign|cross|distance|length|normalize|fast_distance|fast_length|fast_normalize|bitselect|select|vloadn|vstoren|vload_half|vload_halfn|vstore_half|vstore_half_r|vstore_halfn|vstore_halfn_r|vloada_halfn|vstorea_halfn|vstorea_halfn_r|shuffle|shuffle2|printf|prefetch|DebugInfoNone|DebugCompilationUnit|DebugTypeBasic|DebugTypePointer|DebugTypeQualifier|DebugTypeArray|DebugTypeVector|DebugTypedef|DebugTypeFunction|DebugTypeEnum|DebugTypeComposite|DebugTypeMember|DebugTypeInheritance|DebugTypePtrToMember|DebugTypeTemplate|DebugTypeTemplateParameter|DebugTypeTemplateTemplateParameter|DebugTypeTemplateParameterPack|DebugGlobalVariable|DebugFunctionDeclaration|DebugFunction|DebugLexicalBlock|DebugLexicalBlockDiscriminator|DebugScope|DebugNoScope|DebugInlinedAt|DebugLocalVariable|DebugInlinedVariable|DebugDeclare|DebugValue|DebugOperation|DebugExpression|DebugMacroDef|DebugMacroUndef|DebugImportedEntity|DebugSource)",
+ "match": "(Round|RoundEven|Trunc|FAbs|SAbs|FSign|SSign|Floor|Ceil|Fract|Radians|Degrees|Sin|Cos|Tan|Asin|Acos|Atan|Sinh|Cosh|Tanh|Asinh|Acosh|Atanh|Atan2|Pow|Exp|Log|Exp2|Log2|Sqrt|InverseSqrt|Determinant|MatrixInverse|Modf|ModfStruct|FMin|UMin|SMin|FMax|UMax|SMax|FClamp|UClamp|SClamp|FMix|IMix|Step|SmoothStep|Fma|Frexp|FrexpStruct|Ldexp|PackSnorm4x8|PackUnorm4x8|PackSnorm2x16|PackUnorm2x16|PackHalf2x16|PackDouble2x32|UnpackSnorm2x16|UnpackUnorm2x16|UnpackHalf2x16|UnpackSnorm4x8|UnpackUnorm4x8|UnpackDouble2x32|Length|Distance|Cross|Normalize|FaceForward|Reflect|Refract|FindILsb|FindSMsb|FindUMsb|InterpolateAtCentroid|InterpolateAtSample|InterpolateAtOffset|NMin|NMax|NClamp|acos|acosh|acospi|asin|asinh|asinpi|atan|atan2|atanh|atanpi|atan2pi|cbrt|ceil|copysign|cos|cosh|cospi|erfc|erf|exp|exp2|exp10|expm1|fabs|fdim|floor|fma|fmax|fmin|fmod|fract|frexp|hypot|ilogb|ldexp|lgamma|lgamma_r|log|log2|log10|log1p|logb|mad|maxmag|minmag|modf|nan|nextafter|pow|pown|powr|remainder|remquo|rint|rootn|round|rsqrt|sin|sincos|sinh|sinpi|sqrt|tan|tanh|tanpi|tgamma|trunc|half_cos|half_divide|half_exp|half_exp2|half_exp10|half_log|half_log2|half_log10|half_powr|half_recip|half_rsqrt|half_sin|half_sqrt|half_tan|native_cos|native_divide|native_exp|native_exp2|native_exp10|native_log|native_log2|native_log10|native_powr|native_recip|native_rsqrt|native_sin|native_sqrt|native_tan|s_abs|s_abs_diff|s_add_sat|u_add_sat|s_hadd|u_hadd|s_rhadd|u_rhadd|s_clamp|u_clamp|clz|ctz|s_mad_hi|u_mad_sat|s_mad_sat|s_max|u_max|s_min|u_min|s_mul_hi|rotate|s_sub_sat|u_sub_sat|u_upsample|s_upsample|popcount|s_mad24|u_mad24|s_mul24|u_mul24|u_abs|u_abs_diff|u_mul_hi|u_mad_hi|fclamp|degrees|fmax_common|fmin_common|mix|radians|step|smoothstep|sign|cross|distance|length|normalize|fast_distance|fast_length|fast_normalize|bitselect|select|vloadn|vstoren|vload_half|vload_halfn|vstore_half|vstore_half_r|vstore_halfn|vstore_halfn_r|vloada_halfn|vstorea_halfn|vstorea_halfn_r|shuffle|shuffle2|printf|prefetch|DebugInfoNone|DebugCompilationUnit|DebugTypeBasic|DebugTypePointer|DebugTypeQualifier|DebugTypeArray|DebugTypeVector|DebugTypedef|DebugTypeFunction|DebugTypeEnum|DebugTypeComposite|DebugTypeMember|DebugTypeInheritance|DebugTypePtrToMember|DebugTypeTemplate|DebugTypeTemplateParameter|DebugTypeTemplateTemplateParameter|DebugTypeTemplateParameterPack|DebugGlobalVariable|DebugFunctionDeclaration|DebugFunction|DebugLexicalBlock|DebugLexicalBlockDiscriminator|DebugScope|DebugNoScope|DebugInlinedAt|DebugLocalVariable|DebugInlinedVariable|DebugDeclare|DebugValue|DebugOperation|DebugExpression|DebugMacroDef|DebugMacroUndef|DebugImportedEntity|DebugSource|DebugModuleINTEL)",
"name": "entity.name.function.ext"
},
"identifier": {
diff --git a/third_party/SPIRV-Tools/utils/vscode/src/langsvr.go b/third_party/SPIRV-Tools/utils/vscode/src/langsvr.go
index b76e35f..56b11b2 100644
--- a/third_party/SPIRV-Tools/utils/vscode/src/langsvr.go
+++ b/third_party/SPIRV-Tools/utils/vscode/src/langsvr.go
@@ -19,7 +19,6 @@
"context"
"fmt"
"io"
- "io/ioutil"
"log"
"os"
"path"
@@ -67,7 +66,7 @@
// main entry point.
func main() {
- log.SetOutput(ioutil.Discard)
+ log.SetOutput(io.Discard)
if enableDebugLogging {
// create a log file in the executable's directory.
if logfile, err := os.Create(path.Join(path.Dir(os.Args[0]), "log.txt")); err == nil {
@@ -213,6 +212,10 @@
ReferencesProvider: true,
RenameProvider: true,
DocumentFormattingProvider: true,
+ CompletionProvider: &lsp.CompletionOptions{
+ TriggerCharacters: []string{"%"},
+ ResolveProvider: false,
+ },
},
}
return &res, nil
@@ -225,9 +228,56 @@
log.Println("server.WillSaveWaitUntil()")
return nil, nil
}
+
+func markdownOpcode(op *schema.Opcode) string {
+ sb := strings.Builder{}
+ sb.WriteString(fmt.Sprintf("**%s** (%s)\n\n", op.Opname, op.Class))
+
+ for idx, operand := range op.Operands {
+ sb.WriteString(fmt.Sprintf("Operand %d%s: ", idx, operand.Quantifier))
+ sb.WriteString(fmt.Sprintf("%s (%s)\n", operand.Name, operand.Kind.Kind))
+ }
+
+ return sb.String()
+}
+
func (s *server) Completion(ctx context.Context, p *lsp.CompletionParams) (*lsp.CompletionList, error) {
log.Println("server.Completion()")
- return nil, nil
+ f := s.getFile(p.TextDocument.URI)
+ if f == nil {
+ return nil, fmt.Errorf("Unknown file")
+ }
+
+ if p.Context.TriggerCharacter == "%" {
+ idents := []lsp.CompletionItem{}
+ for name, ident := range f.res.Identifiers {
+ idents = append(idents, lsp.CompletionItem{
+ Label: name,
+ Kind: 6,
+ Documentation: ident.Definition.Range.Text(f.res.Lines),
+ })
+ }
+ res := &lsp.CompletionList{
+ IsIncomplete: false,
+ Items: idents,
+ }
+
+ return res, nil
+ }
+
+ opcodes := []lsp.CompletionItem{}
+ for name, opcode := range schema.Opcodes {
+ opcodes = append(opcodes, lsp.CompletionItem{
+ Label: name,
+ Kind: 3,
+ Documentation: markdownOpcode(opcode),
+ })
+ }
+ res := &lsp.CompletionList{
+ IsIncomplete: false,
+ Items: opcodes,
+ }
+ return res, nil
}
func (s *server) Resolve(ctx context.Context, p *lsp.CompletionItem) (*lsp.CompletionItem, error) {
log.Println("server.Resolve()")
@@ -246,7 +296,7 @@
default:
sb.WriteString(fmt.Sprintf("<Unhandled type '%T'>", v))
case *parser.Instruction:
- sb.WriteString(fmt.Sprintf("```\n%v\n```", v.Opcode.Opname))
+ sb.WriteString(markdownOpcode(v.Opcode))
case *parser.Identifier:
sb.WriteString(fmt.Sprintf("```\n%v\n```", v.Definition.Range.Text(f.res.Lines)))
case *parser.Operand:
diff --git a/third_party/SPIRV-Tools/utils/vscode/src/schema/schema.go b/third_party/SPIRV-Tools/utils/vscode/src/schema/schema.go
index ed02de4..4a34fec 100755
--- a/third_party/SPIRV-Tools/utils/vscode/src/schema/schema.go
+++ b/third_party/SPIRV-Tools/utils/vscode/src/schema/schema.go
@@ -447,12 +447,60 @@
"OpPtrEqual": OpPtrEqual,
"OpPtrNotEqual": OpPtrNotEqual,
"OpPtrDiff": OpPtrDiff,
+ "OpColorAttachmentReadEXT": OpColorAttachmentReadEXT,
+ "OpDepthAttachmentReadEXT": OpDepthAttachmentReadEXT,
+ "OpStencilAttachmentReadEXT": OpStencilAttachmentReadEXT,
+ "OpTerminateInvocation": OpTerminateInvocation,
+ "OpTypeUntypedPointerKHR": OpTypeUntypedPointerKHR,
+ "OpUntypedVariableKHR": OpUntypedVariableKHR,
+ "OpUntypedAccessChainKHR": OpUntypedAccessChainKHR,
+ "OpUntypedInBoundsAccessChainKHR": OpUntypedInBoundsAccessChainKHR,
"OpSubgroupBallotKHR": OpSubgroupBallotKHR,
"OpSubgroupFirstInvocationKHR": OpSubgroupFirstInvocationKHR,
+ "OpUntypedPtrAccessChainKHR": OpUntypedPtrAccessChainKHR,
+ "OpUntypedInBoundsPtrAccessChainKHR": OpUntypedInBoundsPtrAccessChainKHR,
+ "OpUntypedArrayLengthKHR": OpUntypedArrayLengthKHR,
+ "OpUntypedPrefetchKHR": OpUntypedPrefetchKHR,
"OpSubgroupAllKHR": OpSubgroupAllKHR,
"OpSubgroupAnyKHR": OpSubgroupAnyKHR,
"OpSubgroupAllEqualKHR": OpSubgroupAllEqualKHR,
+ "OpGroupNonUniformRotateKHR": OpGroupNonUniformRotateKHR,
"OpSubgroupReadInvocationKHR": OpSubgroupReadInvocationKHR,
+ "OpExtInstWithForwardRefsKHR": OpExtInstWithForwardRefsKHR,
+ "OpTraceRayKHR": OpTraceRayKHR,
+ "OpExecuteCallableKHR": OpExecuteCallableKHR,
+ "OpConvertUToAccelerationStructureKHR": OpConvertUToAccelerationStructureKHR,
+ "OpIgnoreIntersectionKHR": OpIgnoreIntersectionKHR,
+ "OpTerminateRayKHR": OpTerminateRayKHR,
+ "OpSDot": OpSDot,
+ "OpUDot": OpUDot,
+ "OpSUDot": OpSUDot,
+ "OpSDotAccSat": OpSDotAccSat,
+ "OpUDotAccSat": OpUDotAccSat,
+ "OpSUDotAccSat": OpSUDotAccSat,
+ "OpTypeCooperativeMatrixKHR": OpTypeCooperativeMatrixKHR,
+ "OpCooperativeMatrixLoadKHR": OpCooperativeMatrixLoadKHR,
+ "OpCooperativeMatrixStoreKHR": OpCooperativeMatrixStoreKHR,
+ "OpCooperativeMatrixMulAddKHR": OpCooperativeMatrixMulAddKHR,
+ "OpCooperativeMatrixLengthKHR": OpCooperativeMatrixLengthKHR,
+ "OpConstantCompositeReplicateEXT": OpConstantCompositeReplicateEXT,
+ "OpSpecConstantCompositeReplicateEXT": OpSpecConstantCompositeReplicateEXT,
+ "OpCompositeConstructReplicateEXT": OpCompositeConstructReplicateEXT,
+ "OpTypeRayQueryKHR": OpTypeRayQueryKHR,
+ "OpRayQueryInitializeKHR": OpRayQueryInitializeKHR,
+ "OpRayQueryTerminateKHR": OpRayQueryTerminateKHR,
+ "OpRayQueryGenerateIntersectionKHR": OpRayQueryGenerateIntersectionKHR,
+ "OpRayQueryConfirmIntersectionKHR": OpRayQueryConfirmIntersectionKHR,
+ "OpRayQueryProceedKHR": OpRayQueryProceedKHR,
+ "OpRayQueryGetIntersectionTypeKHR": OpRayQueryGetIntersectionTypeKHR,
+ "OpImageSampleWeightedQCOM": OpImageSampleWeightedQCOM,
+ "OpImageBoxFilterQCOM": OpImageBoxFilterQCOM,
+ "OpImageBlockMatchSSDQCOM": OpImageBlockMatchSSDQCOM,
+ "OpImageBlockMatchSADQCOM": OpImageBlockMatchSADQCOM,
+ "OpImageBlockMatchWindowSSDQCOM": OpImageBlockMatchWindowSSDQCOM,
+ "OpImageBlockMatchWindowSADQCOM": OpImageBlockMatchWindowSADQCOM,
+ "OpImageBlockMatchGatherSSDQCOM": OpImageBlockMatchGatherSSDQCOM,
+ "OpImageBlockMatchGatherSADQCOM": OpImageBlockMatchGatherSADQCOM,
"OpGroupIAddNonUniformAMD": OpGroupIAddNonUniformAMD,
"OpGroupFAddNonUniformAMD": OpGroupFAddNonUniformAMD,
"OpGroupFMinNonUniformAMD": OpGroupFMinNonUniformAMD,
@@ -464,45 +512,66 @@
"OpFragmentMaskFetchAMD": OpFragmentMaskFetchAMD,
"OpFragmentFetchAMD": OpFragmentFetchAMD,
"OpReadClockKHR": OpReadClockKHR,
+ "OpAllocateNodePayloadsAMDX": OpAllocateNodePayloadsAMDX,
+ "OpEnqueueNodePayloadsAMDX": OpEnqueueNodePayloadsAMDX,
+ "OpTypeNodePayloadArrayAMDX": OpTypeNodePayloadArrayAMDX,
+ "OpFinishWritingNodePayloadAMDX": OpFinishWritingNodePayloadAMDX,
+ "OpNodePayloadArrayLengthAMDX": OpNodePayloadArrayLengthAMDX,
+ "OpIsNodePayloadValidAMDX": OpIsNodePayloadValidAMDX,
+ "OpConstantStringAMDX": OpConstantStringAMDX,
+ "OpSpecConstantStringAMDX": OpSpecConstantStringAMDX,
+ "OpGroupNonUniformQuadAllKHR": OpGroupNonUniformQuadAllKHR,
+ "OpGroupNonUniformQuadAnyKHR": OpGroupNonUniformQuadAnyKHR,
+ "OpHitObjectRecordHitMotionNV": OpHitObjectRecordHitMotionNV,
+ "OpHitObjectRecordHitWithIndexMotionNV": OpHitObjectRecordHitWithIndexMotionNV,
+ "OpHitObjectRecordMissMotionNV": OpHitObjectRecordMissMotionNV,
+ "OpHitObjectGetWorldToObjectNV": OpHitObjectGetWorldToObjectNV,
+ "OpHitObjectGetObjectToWorldNV": OpHitObjectGetObjectToWorldNV,
+ "OpHitObjectGetObjectRayDirectionNV": OpHitObjectGetObjectRayDirectionNV,
+ "OpHitObjectGetObjectRayOriginNV": OpHitObjectGetObjectRayOriginNV,
+ "OpHitObjectTraceRayMotionNV": OpHitObjectTraceRayMotionNV,
+ "OpHitObjectGetShaderRecordBufferHandleNV": OpHitObjectGetShaderRecordBufferHandleNV,
+ "OpHitObjectGetShaderBindingTableRecordIndexNV": OpHitObjectGetShaderBindingTableRecordIndexNV,
+ "OpHitObjectRecordEmptyNV": OpHitObjectRecordEmptyNV,
+ "OpHitObjectTraceRayNV": OpHitObjectTraceRayNV,
+ "OpHitObjectRecordHitNV": OpHitObjectRecordHitNV,
+ "OpHitObjectRecordHitWithIndexNV": OpHitObjectRecordHitWithIndexNV,
+ "OpHitObjectRecordMissNV": OpHitObjectRecordMissNV,
+ "OpHitObjectExecuteShaderNV": OpHitObjectExecuteShaderNV,
+ "OpHitObjectGetCurrentTimeNV": OpHitObjectGetCurrentTimeNV,
+ "OpHitObjectGetAttributesNV": OpHitObjectGetAttributesNV,
+ "OpHitObjectGetHitKindNV": OpHitObjectGetHitKindNV,
+ "OpHitObjectGetPrimitiveIndexNV": OpHitObjectGetPrimitiveIndexNV,
+ "OpHitObjectGetGeometryIndexNV": OpHitObjectGetGeometryIndexNV,
+ "OpHitObjectGetInstanceIdNV": OpHitObjectGetInstanceIdNV,
+ "OpHitObjectGetInstanceCustomIndexNV": OpHitObjectGetInstanceCustomIndexNV,
+ "OpHitObjectGetWorldRayDirectionNV": OpHitObjectGetWorldRayDirectionNV,
+ "OpHitObjectGetWorldRayOriginNV": OpHitObjectGetWorldRayOriginNV,
+ "OpHitObjectGetRayTMaxNV": OpHitObjectGetRayTMaxNV,
+ "OpHitObjectGetRayTMinNV": OpHitObjectGetRayTMinNV,
+ "OpHitObjectIsEmptyNV": OpHitObjectIsEmptyNV,
+ "OpHitObjectIsHitNV": OpHitObjectIsHitNV,
+ "OpHitObjectIsMissNV": OpHitObjectIsMissNV,
+ "OpReorderThreadWithHitObjectNV": OpReorderThreadWithHitObjectNV,
+ "OpReorderThreadWithHintNV": OpReorderThreadWithHintNV,
+ "OpTypeHitObjectNV": OpTypeHitObjectNV,
"OpImageSampleFootprintNV": OpImageSampleFootprintNV,
+ "OpCooperativeMatrixConvertNV": OpCooperativeMatrixConvertNV,
+ "OpEmitMeshTasksEXT": OpEmitMeshTasksEXT,
+ "OpSetMeshOutputsEXT": OpSetMeshOutputsEXT,
"OpGroupNonUniformPartitionNV": OpGroupNonUniformPartitionNV,
"OpWritePackedPrimitiveIndices4x8NV": OpWritePackedPrimitiveIndices4x8NV,
- "OpReportIntersectionNV": OpReportIntersectionNV,
+ "OpFetchMicroTriangleVertexPositionNV": OpFetchMicroTriangleVertexPositionNV,
+ "OpFetchMicroTriangleVertexBarycentricNV": OpFetchMicroTriangleVertexBarycentricNV,
"OpReportIntersectionKHR": OpReportIntersectionKHR,
"OpIgnoreIntersectionNV": OpIgnoreIntersectionNV,
- "OpIgnoreIntersectionKHR": OpIgnoreIntersectionKHR,
"OpTerminateRayNV": OpTerminateRayNV,
- "OpTerminateRayKHR": OpTerminateRayKHR,
"OpTraceNV": OpTraceNV,
- "OpTraceRayKHR": OpTraceRayKHR,
- "OpTypeAccelerationStructureNV": OpTypeAccelerationStructureNV,
+ "OpTraceMotionNV": OpTraceMotionNV,
+ "OpTraceRayMotionNV": OpTraceRayMotionNV,
+ "OpRayQueryGetIntersectionTriangleVertexPositionsKHR": OpRayQueryGetIntersectionTriangleVertexPositionsKHR,
"OpTypeAccelerationStructureKHR": OpTypeAccelerationStructureKHR,
- "OpTypeRayQueryProvisionalKHR": OpTypeRayQueryProvisionalKHR,
- "OpRayQueryInitializeKHR": OpRayQueryInitializeKHR,
- "OpRayQueryTerminateKHR": OpRayQueryTerminateKHR,
- "OpRayQueryGenerateIntersectionKHR": OpRayQueryGenerateIntersectionKHR,
- "OpRayQueryConfirmIntersectionKHR": OpRayQueryConfirmIntersectionKHR,
- "OpRayQueryProceedKHR": OpRayQueryProceedKHR,
- "OpRayQueryGetIntersectionTypeKHR": OpRayQueryGetIntersectionTypeKHR,
- "OpRayQueryGetRayTMinKHR": OpRayQueryGetRayTMinKHR,
- "OpRayQueryGetRayFlagsKHR": OpRayQueryGetRayFlagsKHR,
- "OpRayQueryGetIntersectionTKHR": OpRayQueryGetIntersectionTKHR,
- "OpRayQueryGetIntersectionInstanceCustomIndexKHR": OpRayQueryGetIntersectionInstanceCustomIndexKHR,
- "OpRayQueryGetIntersectionInstanceIdKHR": OpRayQueryGetIntersectionInstanceIdKHR,
- "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR": OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR,
- "OpRayQueryGetIntersectionGeometryIndexKHR": OpRayQueryGetIntersectionGeometryIndexKHR,
- "OpRayQueryGetIntersectionPrimitiveIndexKHR": OpRayQueryGetIntersectionPrimitiveIndexKHR,
- "OpRayQueryGetIntersectionBarycentricsKHR": OpRayQueryGetIntersectionBarycentricsKHR,
- "OpRayQueryGetIntersectionFrontFaceKHR": OpRayQueryGetIntersectionFrontFaceKHR,
- "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR": OpRayQueryGetIntersectionCandidateAABBOpaqueKHR,
- "OpRayQueryGetIntersectionObjectRayDirectionKHR": OpRayQueryGetIntersectionObjectRayDirectionKHR,
- "OpRayQueryGetIntersectionObjectRayOriginKHR": OpRayQueryGetIntersectionObjectRayOriginKHR,
- "OpRayQueryGetWorldRayDirectionKHR": OpRayQueryGetWorldRayDirectionKHR,
- "OpRayQueryGetWorldRayOriginKHR": OpRayQueryGetWorldRayOriginKHR,
- "OpRayQueryGetIntersectionObjectToWorldKHR": OpRayQueryGetIntersectionObjectToWorldKHR,
- "OpRayQueryGetIntersectionWorldToObjectKHR": OpRayQueryGetIntersectionWorldToObjectKHR,
"OpExecuteCallableNV": OpExecuteCallableNV,
- "OpExecuteCallableKHR": OpExecuteCallableKHR,
"OpTypeCooperativeMatrixNV": OpTypeCooperativeMatrixNV,
"OpCooperativeMatrixLoadNV": OpCooperativeMatrixLoadNV,
"OpCooperativeMatrixStoreNV": OpCooperativeMatrixStoreNV,
@@ -510,8 +579,33 @@
"OpCooperativeMatrixLengthNV": OpCooperativeMatrixLengthNV,
"OpBeginInvocationInterlockEXT": OpBeginInvocationInterlockEXT,
"OpEndInvocationInterlockEXT": OpEndInvocationInterlockEXT,
- "OpDemoteToHelperInvocationEXT": OpDemoteToHelperInvocationEXT,
+ "OpCooperativeMatrixReduceNV": OpCooperativeMatrixReduceNV,
+ "OpCooperativeMatrixLoadTensorNV": OpCooperativeMatrixLoadTensorNV,
+ "OpCooperativeMatrixStoreTensorNV": OpCooperativeMatrixStoreTensorNV,
+ "OpCooperativeMatrixPerElementOpNV": OpCooperativeMatrixPerElementOpNV,
+ "OpTypeTensorLayoutNV": OpTypeTensorLayoutNV,
+ "OpTypeTensorViewNV": OpTypeTensorViewNV,
+ "OpCreateTensorLayoutNV": OpCreateTensorLayoutNV,
+ "OpTensorLayoutSetDimensionNV": OpTensorLayoutSetDimensionNV,
+ "OpTensorLayoutSetStrideNV": OpTensorLayoutSetStrideNV,
+ "OpTensorLayoutSliceNV": OpTensorLayoutSliceNV,
+ "OpTensorLayoutSetClampValueNV": OpTensorLayoutSetClampValueNV,
+ "OpCreateTensorViewNV": OpCreateTensorViewNV,
+ "OpTensorViewSetDimensionNV": OpTensorViewSetDimensionNV,
+ "OpTensorViewSetStrideNV": OpTensorViewSetStrideNV,
+ "OpDemoteToHelperInvocation": OpDemoteToHelperInvocation,
"OpIsHelperInvocationEXT": OpIsHelperInvocationEXT,
+ "OpTensorViewSetClipNV": OpTensorViewSetClipNV,
+ "OpTensorLayoutSetBlockSizeNV": OpTensorLayoutSetBlockSizeNV,
+ "OpCooperativeMatrixTransposeNV": OpCooperativeMatrixTransposeNV,
+ "OpConvertUToImageNV": OpConvertUToImageNV,
+ "OpConvertUToSamplerNV": OpConvertUToSamplerNV,
+ "OpConvertImageToUNV": OpConvertImageToUNV,
+ "OpConvertSamplerToUNV": OpConvertSamplerToUNV,
+ "OpConvertUToSampledImageNV": OpConvertUToSampledImageNV,
+ "OpConvertSampledImageToUNV": OpConvertSampledImageToUNV,
+ "OpSamplerImageAddressingModeNV": OpSamplerImageAddressingModeNV,
+ "OpRawAccessChainNV": OpRawAccessChainNV,
"OpSubgroupShuffleINTEL": OpSubgroupShuffleINTEL,
"OpSubgroupShuffleDownINTEL": OpSubgroupShuffleDownINTEL,
"OpSubgroupShuffleUpINTEL": OpSubgroupShuffleUpINTEL,
@@ -536,10 +630,17 @@
"OpUSubSatINTEL": OpUSubSatINTEL,
"OpIMul32x16INTEL": OpIMul32x16INTEL,
"OpUMul32x16INTEL": OpUMul32x16INTEL,
+ "OpConstantFunctionPointerINTEL": OpConstantFunctionPointerINTEL,
+ "OpFunctionPointerCallINTEL": OpFunctionPointerCallINTEL,
+ "OpAsmTargetINTEL": OpAsmTargetINTEL,
+ "OpAsmINTEL": OpAsmINTEL,
+ "OpAsmCallINTEL": OpAsmCallINTEL,
+ "OpAtomicFMinEXT": OpAtomicFMinEXT,
+ "OpAtomicFMaxEXT": OpAtomicFMaxEXT,
+ "OpAssumeTrueKHR": OpAssumeTrueKHR,
+ "OpExpectKHR": OpExpectKHR,
"OpDecorateString": OpDecorateString,
- "OpDecorateStringGOOGLE": OpDecorateStringGOOGLE,
"OpMemberDecorateString": OpMemberDecorateString,
- "OpMemberDecorateStringGOOGLE": OpMemberDecorateStringGOOGLE,
"OpVmeImageINTEL": OpVmeImageINTEL,
"OpTypeVmeImageINTEL": OpTypeVmeImageINTEL,
"OpTypeAvcImePayloadINTEL": OpTypeAvcImePayloadINTEL,
@@ -658,6 +759,109 @@
"OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL": OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL,
"OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL": OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL,
"OpSubgroupAvcSicGetInterRawSadsINTEL": OpSubgroupAvcSicGetInterRawSadsINTEL,
+ "OpVariableLengthArrayINTEL": OpVariableLengthArrayINTEL,
+ "OpSaveMemoryINTEL": OpSaveMemoryINTEL,
+ "OpRestoreMemoryINTEL": OpRestoreMemoryINTEL,
+ "OpArbitraryFloatSinCosPiINTEL": OpArbitraryFloatSinCosPiINTEL,
+ "OpArbitraryFloatCastINTEL": OpArbitraryFloatCastINTEL,
+ "OpArbitraryFloatCastFromIntINTEL": OpArbitraryFloatCastFromIntINTEL,
+ "OpArbitraryFloatCastToIntINTEL": OpArbitraryFloatCastToIntINTEL,
+ "OpArbitraryFloatAddINTEL": OpArbitraryFloatAddINTEL,
+ "OpArbitraryFloatSubINTEL": OpArbitraryFloatSubINTEL,
+ "OpArbitraryFloatMulINTEL": OpArbitraryFloatMulINTEL,
+ "OpArbitraryFloatDivINTEL": OpArbitraryFloatDivINTEL,
+ "OpArbitraryFloatGTINTEL": OpArbitraryFloatGTINTEL,
+ "OpArbitraryFloatGEINTEL": OpArbitraryFloatGEINTEL,
+ "OpArbitraryFloatLTINTEL": OpArbitraryFloatLTINTEL,
+ "OpArbitraryFloatLEINTEL": OpArbitraryFloatLEINTEL,
+ "OpArbitraryFloatEQINTEL": OpArbitraryFloatEQINTEL,
+ "OpArbitraryFloatRecipINTEL": OpArbitraryFloatRecipINTEL,
+ "OpArbitraryFloatRSqrtINTEL": OpArbitraryFloatRSqrtINTEL,
+ "OpArbitraryFloatCbrtINTEL": OpArbitraryFloatCbrtINTEL,
+ "OpArbitraryFloatHypotINTEL": OpArbitraryFloatHypotINTEL,
+ "OpArbitraryFloatSqrtINTEL": OpArbitraryFloatSqrtINTEL,
+ "OpArbitraryFloatLogINTEL": OpArbitraryFloatLogINTEL,
+ "OpArbitraryFloatLog2INTEL": OpArbitraryFloatLog2INTEL,
+ "OpArbitraryFloatLog10INTEL": OpArbitraryFloatLog10INTEL,
+ "OpArbitraryFloatLog1pINTEL": OpArbitraryFloatLog1pINTEL,
+ "OpArbitraryFloatExpINTEL": OpArbitraryFloatExpINTEL,
+ "OpArbitraryFloatExp2INTEL": OpArbitraryFloatExp2INTEL,
+ "OpArbitraryFloatExp10INTEL": OpArbitraryFloatExp10INTEL,
+ "OpArbitraryFloatExpm1INTEL": OpArbitraryFloatExpm1INTEL,
+ "OpArbitraryFloatSinINTEL": OpArbitraryFloatSinINTEL,
+ "OpArbitraryFloatCosINTEL": OpArbitraryFloatCosINTEL,
+ "OpArbitraryFloatSinCosINTEL": OpArbitraryFloatSinCosINTEL,
+ "OpArbitraryFloatSinPiINTEL": OpArbitraryFloatSinPiINTEL,
+ "OpArbitraryFloatCosPiINTEL": OpArbitraryFloatCosPiINTEL,
+ "OpArbitraryFloatASinINTEL": OpArbitraryFloatASinINTEL,
+ "OpArbitraryFloatASinPiINTEL": OpArbitraryFloatASinPiINTEL,
+ "OpArbitraryFloatACosINTEL": OpArbitraryFloatACosINTEL,
+ "OpArbitraryFloatACosPiINTEL": OpArbitraryFloatACosPiINTEL,
+ "OpArbitraryFloatATanINTEL": OpArbitraryFloatATanINTEL,
+ "OpArbitraryFloatATanPiINTEL": OpArbitraryFloatATanPiINTEL,
+ "OpArbitraryFloatATan2INTEL": OpArbitraryFloatATan2INTEL,
+ "OpArbitraryFloatPowINTEL": OpArbitraryFloatPowINTEL,
+ "OpArbitraryFloatPowRINTEL": OpArbitraryFloatPowRINTEL,
+ "OpArbitraryFloatPowNINTEL": OpArbitraryFloatPowNINTEL,
+ "OpLoopControlINTEL": OpLoopControlINTEL,
+ "OpAliasDomainDeclINTEL": OpAliasDomainDeclINTEL,
+ "OpAliasScopeDeclINTEL": OpAliasScopeDeclINTEL,
+ "OpAliasScopeListDeclINTEL": OpAliasScopeListDeclINTEL,
+ "OpFixedSqrtINTEL": OpFixedSqrtINTEL,
+ "OpFixedRecipINTEL": OpFixedRecipINTEL,
+ "OpFixedRsqrtINTEL": OpFixedRsqrtINTEL,
+ "OpFixedSinINTEL": OpFixedSinINTEL,
+ "OpFixedCosINTEL": OpFixedCosINTEL,
+ "OpFixedSinCosINTEL": OpFixedSinCosINTEL,
+ "OpFixedSinPiINTEL": OpFixedSinPiINTEL,
+ "OpFixedCosPiINTEL": OpFixedCosPiINTEL,
+ "OpFixedSinCosPiINTEL": OpFixedSinCosPiINTEL,
+ "OpFixedLogINTEL": OpFixedLogINTEL,
+ "OpFixedExpINTEL": OpFixedExpINTEL,
+ "OpPtrCastToCrossWorkgroupINTEL": OpPtrCastToCrossWorkgroupINTEL,
+ "OpCrossWorkgroupCastToPtrINTEL": OpCrossWorkgroupCastToPtrINTEL,
+ "OpReadPipeBlockingINTEL": OpReadPipeBlockingINTEL,
+ "OpWritePipeBlockingINTEL": OpWritePipeBlockingINTEL,
+ "OpFPGARegINTEL": OpFPGARegINTEL,
+ "OpRayQueryGetRayTMinKHR": OpRayQueryGetRayTMinKHR,
+ "OpRayQueryGetRayFlagsKHR": OpRayQueryGetRayFlagsKHR,
+ "OpRayQueryGetIntersectionTKHR": OpRayQueryGetIntersectionTKHR,
+ "OpRayQueryGetIntersectionInstanceCustomIndexKHR": OpRayQueryGetIntersectionInstanceCustomIndexKHR,
+ "OpRayQueryGetIntersectionInstanceIdKHR": OpRayQueryGetIntersectionInstanceIdKHR,
+ "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR": OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR,
+ "OpRayQueryGetIntersectionGeometryIndexKHR": OpRayQueryGetIntersectionGeometryIndexKHR,
+ "OpRayQueryGetIntersectionPrimitiveIndexKHR": OpRayQueryGetIntersectionPrimitiveIndexKHR,
+ "OpRayQueryGetIntersectionBarycentricsKHR": OpRayQueryGetIntersectionBarycentricsKHR,
+ "OpRayQueryGetIntersectionFrontFaceKHR": OpRayQueryGetIntersectionFrontFaceKHR,
+ "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR": OpRayQueryGetIntersectionCandidateAABBOpaqueKHR,
+ "OpRayQueryGetIntersectionObjectRayDirectionKHR": OpRayQueryGetIntersectionObjectRayDirectionKHR,
+ "OpRayQueryGetIntersectionObjectRayOriginKHR": OpRayQueryGetIntersectionObjectRayOriginKHR,
+ "OpRayQueryGetWorldRayDirectionKHR": OpRayQueryGetWorldRayDirectionKHR,
+ "OpRayQueryGetWorldRayOriginKHR": OpRayQueryGetWorldRayOriginKHR,
+ "OpRayQueryGetIntersectionObjectToWorldKHR": OpRayQueryGetIntersectionObjectToWorldKHR,
+ "OpRayQueryGetIntersectionWorldToObjectKHR": OpRayQueryGetIntersectionWorldToObjectKHR,
+ "OpAtomicFAddEXT": OpAtomicFAddEXT,
+ "OpTypeBufferSurfaceINTEL": OpTypeBufferSurfaceINTEL,
+ "OpTypeStructContinuedINTEL": OpTypeStructContinuedINTEL,
+ "OpConstantCompositeContinuedINTEL": OpConstantCompositeContinuedINTEL,
+ "OpSpecConstantCompositeContinuedINTEL": OpSpecConstantCompositeContinuedINTEL,
+ "OpCompositeConstructContinuedINTEL": OpCompositeConstructContinuedINTEL,
+ "OpConvertFToBF16INTEL": OpConvertFToBF16INTEL,
+ "OpConvertBF16ToFINTEL": OpConvertBF16ToFINTEL,
+ "OpControlBarrierArriveINTEL": OpControlBarrierArriveINTEL,
+ "OpControlBarrierWaitINTEL": OpControlBarrierWaitINTEL,
+ "OpArithmeticFenceEXT": OpArithmeticFenceEXT,
+ "OpSubgroupBlockPrefetchINTEL": OpSubgroupBlockPrefetchINTEL,
+ "OpGroupIMulKHR": OpGroupIMulKHR,
+ "OpGroupFMulKHR": OpGroupFMulKHR,
+ "OpGroupBitwiseAndKHR": OpGroupBitwiseAndKHR,
+ "OpGroupBitwiseOrKHR": OpGroupBitwiseOrKHR,
+ "OpGroupBitwiseXorKHR": OpGroupBitwiseXorKHR,
+ "OpGroupLogicalAndKHR": OpGroupLogicalAndKHR,
+ "OpGroupLogicalOrKHR": OpGroupLogicalOrKHR,
+ "OpGroupLogicalXorKHR": OpGroupLogicalXorKHR,
+ "OpMaskedGatherINTEL": OpMaskedGatherINTEL,
+ "OpMaskedScatterINTEL": OpMaskedScatterINTEL,
}
// ExtOpcodes is a map of extension name to Opcode description list.
@@ -946,6 +1150,7 @@
"DebugMacroUndef": OpenCLDebugInfo100_DebugMacroUndef,
"DebugImportedEntity": OpenCLDebugInfo100_DebugImportedEntity,
"DebugSource": OpenCLDebugInfo100_DebugSource,
+ "DebugModuleINTEL": OpenCLDebugInfo100_DebugModuleINTEL,
},
}
@@ -1297,6 +1502,11 @@
Name: "'Width'",
Quantifier: "",
},
+ Operand {
+ Kind: OperandKindFPEncoding,
+ Name: "'Floating Point Encoding'",
+ Quantifier: "?",
+ },
},
}
OpTypeVector = &Opcode {
@@ -10022,6 +10232,197 @@
},
},
}
+ OpColorAttachmentReadEXT = &Opcode {
+ Opname: "OpColorAttachmentReadEXT",
+ Class: "Image",
+ Opcode: 4160,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Attachment'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Sample'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpDepthAttachmentReadEXT = &Opcode {
+ Opname: "OpDepthAttachmentReadEXT",
+ Class: "Image",
+ Opcode: 4161,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Sample'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpStencilAttachmentReadEXT = &Opcode {
+ Opname: "OpStencilAttachmentReadEXT",
+ Class: "Image",
+ Opcode: 4162,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Sample'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpTerminateInvocation = &Opcode {
+ Opname: "OpTerminateInvocation",
+ Class: "Control-Flow",
+ Opcode: 4416,
+ Operands: []Operand {
+ },
+ }
+ OpTypeUntypedPointerKHR = &Opcode {
+ Opname: "OpTypeUntypedPointerKHR",
+ Class: "Type-Declaration",
+ Opcode: 4417,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindStorageClass,
+ Name: "",
+ Quantifier: "",
+ },
+ },
+ }
+ OpUntypedVariableKHR = &Opcode {
+ Opname: "OpUntypedVariableKHR",
+ Class: "Memory",
+ Opcode: 4418,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindStorageClass,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Data Type'",
+ Quantifier: "?",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Initializer'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpUntypedAccessChainKHR = &Opcode {
+ Opname: "OpUntypedAccessChainKHR",
+ Class: "Memory",
+ Opcode: 4419,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Indexes'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpUntypedInBoundsAccessChainKHR = &Opcode {
+ Opname: "OpUntypedInBoundsAccessChainKHR",
+ Class: "Memory",
+ Opcode: 4420,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Indexes'",
+ Quantifier: "*",
+ },
+ },
+ }
OpSubgroupBallotKHR = &Opcode {
Opname: "OpSubgroupBallotKHR",
Class: "Group",
@@ -10066,6 +10467,144 @@
},
},
}
+ OpUntypedPtrAccessChainKHR = &Opcode {
+ Opname: "OpUntypedPtrAccessChainKHR",
+ Class: "Memory",
+ Opcode: 4423,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Element'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Indexes'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpUntypedInBoundsPtrAccessChainKHR = &Opcode {
+ Opname: "OpUntypedInBoundsPtrAccessChainKHR",
+ Class: "Memory",
+ Opcode: 4424,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Element'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Indexes'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpUntypedArrayLengthKHR = &Opcode {
+ Opname: "OpUntypedArrayLengthKHR",
+ Class: "Memory",
+ Opcode: 4425,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Array member'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpUntypedPrefetchKHR = &Opcode {
+ Opname: "OpUntypedPrefetchKHR",
+ Class: "Memory",
+ Opcode: 4426,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Num Bytes'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RW'",
+ Quantifier: "?",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Locality'",
+ Quantifier: "?",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Cache Type'",
+ Quantifier: "?",
+ },
+ },
+ }
OpSubgroupAllKHR = &Opcode {
Opname: "OpSubgroupAllKHR",
Class: "Group",
@@ -10132,6 +10671,43 @@
},
},
}
+ OpGroupNonUniformRotateKHR = &Opcode {
+ Opname: "OpGroupNonUniformRotateKHR",
+ Class: "Group",
+ Opcode: 4431,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Delta'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ClusterSize'",
+ Quantifier: "?",
+ },
+ },
+ }
OpSubgroupReadInvocationKHR = &Opcode {
Opname: "OpSubgroupReadInvocationKHR",
Class: "Group",
@@ -10159,6 +10735,1056 @@
},
},
}
+ OpExtInstWithForwardRefsKHR = &Opcode {
+ Opname: "OpExtInstWithForwardRefsKHR",
+ Class: "Extension",
+ Opcode: 4433,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Set'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralExtInstInteger,
+ Name: "'Instruction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand 1', + 'Operand 2', + ...",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpTraceRayKHR = &Opcode {
+ Opname: "OpTraceRayKHR",
+ Class: "Reserved",
+ Opcode: 4445,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accel'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Flags'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Cull Mask'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Offset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Stride'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Miss Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Tmin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Tmax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpExecuteCallableKHR = &Opcode {
+ Opname: "OpExecuteCallableKHR",
+ Class: "Reserved",
+ Opcode: 4446,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Callable Data'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertUToAccelerationStructureKHR = &Opcode {
+ Opname: "OpConvertUToAccelerationStructureKHR",
+ Class: "Reserved",
+ Opcode: 4447,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accel'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpIgnoreIntersectionKHR = &Opcode {
+ Opname: "OpIgnoreIntersectionKHR",
+ Class: "Reserved",
+ Opcode: 4448,
+ Operands: []Operand {
+ },
+ }
+ OpTerminateRayKHR = &Opcode {
+ Opname: "OpTerminateRayKHR",
+ Class: "Reserved",
+ Opcode: 4449,
+ Operands: []Operand {
+ },
+ }
+ OpSDot = &Opcode {
+ Opname: "OpSDot",
+ Class: "Arithmetic",
+ Opcode: 4450,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindPackedVectorFormat,
+ Name: "'Packed Vector Format'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpUDot = &Opcode {
+ Opname: "OpUDot",
+ Class: "Arithmetic",
+ Opcode: 4451,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindPackedVectorFormat,
+ Name: "'Packed Vector Format'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpSUDot = &Opcode {
+ Opname: "OpSUDot",
+ Class: "Arithmetic",
+ Opcode: 4452,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindPackedVectorFormat,
+ Name: "'Packed Vector Format'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpSDotAccSat = &Opcode {
+ Opname: "OpSDotAccSat",
+ Class: "Arithmetic",
+ Opcode: 4453,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accumulator'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindPackedVectorFormat,
+ Name: "'Packed Vector Format'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpUDotAccSat = &Opcode {
+ Opname: "OpUDotAccSat",
+ Class: "Arithmetic",
+ Opcode: 4454,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accumulator'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindPackedVectorFormat,
+ Name: "'Packed Vector Format'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpSUDotAccSat = &Opcode {
+ Opname: "OpSUDotAccSat",
+ Class: "Arithmetic",
+ Opcode: 4455,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vector 2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accumulator'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindPackedVectorFormat,
+ Name: "'Packed Vector Format'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpTypeCooperativeMatrixKHR = &Opcode {
+ Opname: "OpTypeCooperativeMatrixKHR",
+ Class: "Type-Declaration",
+ Opcode: 4456,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Component Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Scope'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Rows'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Columns'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Use'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCooperativeMatrixLoadKHR = &Opcode {
+ Opname: "OpCooperativeMatrixLoadKHR",
+ Class: "Memory",
+ Opcode: 4457,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'MemoryLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Stride'",
+ Quantifier: "?",
+ },
+ Operand {
+ Kind: OperandKindMemoryAccess,
+ Name: "'Memory Operand'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpCooperativeMatrixStoreKHR = &Opcode {
+ Opname: "OpCooperativeMatrixStoreKHR",
+ Class: "Memory",
+ Opcode: 4458,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'MemoryLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Stride'",
+ Quantifier: "?",
+ },
+ Operand {
+ Kind: OperandKindMemoryAccess,
+ Name: "'Memory Operand'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpCooperativeMatrixMulAddKHR = &Opcode {
+ Opname: "OpCooperativeMatrixMulAddKHR",
+ Class: "Arithmetic",
+ Opcode: 4459,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'C'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindCooperativeMatrixOperands,
+ Name: "'Cooperative Matrix Operands'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpCooperativeMatrixLengthKHR = &Opcode {
+ Opname: "OpCooperativeMatrixLengthKHR",
+ Class: "Miscellaneous",
+ Opcode: 4460,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Type'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConstantCompositeReplicateEXT = &Opcode {
+ Opname: "OpConstantCompositeReplicateEXT",
+ Class: "Constant-Creation",
+ Opcode: 4461,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpSpecConstantCompositeReplicateEXT = &Opcode {
+ Opname: "OpSpecConstantCompositeReplicateEXT",
+ Class: "Constant-Creation",
+ Opcode: 4462,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCompositeConstructReplicateEXT = &Opcode {
+ Opname: "OpCompositeConstructReplicateEXT",
+ Class: "Composite",
+ Opcode: 4463,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTypeRayQueryKHR = &Opcode {
+ Opname: "OpTypeRayQueryKHR",
+ Class: "Type-Declaration",
+ Opcode: 4472,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryInitializeKHR = &Opcode {
+ Opname: "OpRayQueryInitializeKHR",
+ Class: "Reserved",
+ Opcode: 4473,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accel'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayFlags'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'CullMask'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayOrigin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayTMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayDirection'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayTMax'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryTerminateKHR = &Opcode {
+ Opname: "OpRayQueryTerminateKHR",
+ Class: "Reserved",
+ Opcode: 4474,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGenerateIntersectionKHR = &Opcode {
+ Opname: "OpRayQueryGenerateIntersectionKHR",
+ Class: "Reserved",
+ Opcode: 4475,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'HitT'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryConfirmIntersectionKHR = &Opcode {
+ Opname: "OpRayQueryConfirmIntersectionKHR",
+ Class: "Reserved",
+ Opcode: 4476,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryProceedKHR = &Opcode {
+ Opname: "OpRayQueryProceedKHR",
+ Class: "Reserved",
+ Opcode: 4477,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionTypeKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionTypeKHR",
+ Class: "Reserved",
+ Opcode: 4479,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageSampleWeightedQCOM = &Opcode {
+ Opname: "OpImageSampleWeightedQCOM",
+ Class: "Image",
+ Opcode: 4480,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Texture'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Weights'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBoxFilterQCOM = &Opcode {
+ Opname: "OpImageBoxFilterQCOM",
+ Class: "Image",
+ Opcode: 4481,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Texture'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Box Size'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBlockMatchSSDQCOM = &Opcode {
+ Opname: "OpImageBlockMatchSSDQCOM",
+ Class: "Image",
+ Opcode: 4482,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Block Size'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBlockMatchSADQCOM = &Opcode {
+ Opname: "OpImageBlockMatchSADQCOM",
+ Class: "Image",
+ Opcode: 4483,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Block Size'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBlockMatchWindowSSDQCOM = &Opcode {
+ Opname: "OpImageBlockMatchWindowSSDQCOM",
+ Class: "Image",
+ Opcode: 4500,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Block Size'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBlockMatchWindowSADQCOM = &Opcode {
+ Opname: "OpImageBlockMatchWindowSADQCOM",
+ Class: "Image",
+ Opcode: 4501,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Block Size'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBlockMatchGatherSSDQCOM = &Opcode {
+ Opname: "OpImageBlockMatchGatherSSDQCOM",
+ Class: "Image",
+ Opcode: 4502,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Block Size'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpImageBlockMatchGatherSADQCOM = &Opcode {
+ Opname: "OpImageBlockMatchGatherSADQCOM",
+ Class: "Image",
+ Opcode: 4503,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Sampled Image'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Reference Coordinates'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Block Size'",
+ Quantifier: "",
+ },
+ },
+ }
OpGroupIAddNonUniformAMD = &Opcode {
Opname: "OpGroupIAddNonUniformAMD",
Class: "Group",
@@ -10491,7 +12117,1238 @@
},
Operand {
Kind: OperandKindIdScope,
- Name: "'Execution'",
+ Name: "'Scope'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpAllocateNodePayloadsAMDX = &Opcode {
+ Opname: "OpAllocateNodePayloadsAMDX",
+ Class: "Reserved",
+ Opcode: 5074,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Visibility'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload Count'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Node Index'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpEnqueueNodePayloadsAMDX = &Opcode {
+ Opname: "OpEnqueueNodePayloadsAMDX",
+ Class: "Reserved",
+ Opcode: 5075,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload Array'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTypeNodePayloadArrayAMDX = &Opcode {
+ Opname: "OpTypeNodePayloadArrayAMDX",
+ Class: "Reserved",
+ Opcode: 5076,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload Type'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFinishWritingNodePayloadAMDX = &Opcode {
+ Opname: "OpFinishWritingNodePayloadAMDX",
+ Class: "Reserved",
+ Opcode: 5078,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpNodePayloadArrayLengthAMDX = &Opcode {
+ Opname: "OpNodePayloadArrayLengthAMDX",
+ Class: "Reserved",
+ Opcode: 5090,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload Array'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpIsNodePayloadValidAMDX = &Opcode {
+ Opname: "OpIsNodePayloadValidAMDX",
+ Class: "Reserved",
+ Opcode: 5101,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Node Index'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConstantStringAMDX = &Opcode {
+ Opname: "OpConstantStringAMDX",
+ Class: "Reserved",
+ Opcode: 5103,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralString,
+ Name: "'Literal String'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpSpecConstantStringAMDX = &Opcode {
+ Opname: "OpSpecConstantStringAMDX",
+ Class: "Reserved",
+ Opcode: 5104,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralString,
+ Name: "'Literal String'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupNonUniformQuadAllKHR = &Opcode {
+ Opname: "OpGroupNonUniformQuadAllKHR",
+ Class: "Non-Uniform",
+ Opcode: 5110,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Predicate'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupNonUniformQuadAnyKHR = &Opcode {
+ Opname: "OpGroupNonUniformQuadAnyKHR",
+ Class: "Non-Uniform",
+ Opcode: 5111,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Predicate'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordHitMotionNV = &Opcode {
+ Opname: "OpHitObjectRecordHitMotionNV",
+ Class: "Reserved",
+ Opcode: 5249,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Acceleration Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'InstanceId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'PrimitiveId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'GeometryIndex'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Kind'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Offset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Stride'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Current Time'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'HitObject Attributes'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordHitWithIndexMotionNV = &Opcode {
+ Opname: "OpHitObjectRecordHitWithIndexMotionNV",
+ Class: "Reserved",
+ Opcode: 5250,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Acceleration Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'InstanceId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'PrimitiveId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'GeometryIndex'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Kind'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Current Time'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'HitObject Attributes'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordMissMotionNV = &Opcode {
+ Opname: "OpHitObjectRecordMissMotionNV",
+ Class: "Reserved",
+ Opcode: 5251,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Current Time'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetWorldToObjectNV = &Opcode {
+ Opname: "OpHitObjectGetWorldToObjectNV",
+ Class: "Reserved",
+ Opcode: 5252,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetObjectToWorldNV = &Opcode {
+ Opname: "OpHitObjectGetObjectToWorldNV",
+ Class: "Reserved",
+ Opcode: 5253,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetObjectRayDirectionNV = &Opcode {
+ Opname: "OpHitObjectGetObjectRayDirectionNV",
+ Class: "Reserved",
+ Opcode: 5254,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetObjectRayOriginNV = &Opcode {
+ Opname: "OpHitObjectGetObjectRayOriginNV",
+ Class: "Reserved",
+ Opcode: 5255,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectTraceRayMotionNV = &Opcode {
+ Opname: "OpHitObjectTraceRayMotionNV",
+ Class: "Reserved",
+ Opcode: 5256,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Acceleration Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayFlags'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Cullmask'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Offset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Stride'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Miss Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Time'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetShaderRecordBufferHandleNV = &Opcode {
+ Opname: "OpHitObjectGetShaderRecordBufferHandleNV",
+ Class: "Reserved",
+ Opcode: 5257,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetShaderBindingTableRecordIndexNV = &Opcode {
+ Opname: "OpHitObjectGetShaderBindingTableRecordIndexNV",
+ Class: "Reserved",
+ Opcode: 5258,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordEmptyNV = &Opcode {
+ Opname: "OpHitObjectRecordEmptyNV",
+ Class: "Reserved",
+ Opcode: 5259,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectTraceRayNV = &Opcode {
+ Opname: "OpHitObjectTraceRayNV",
+ Class: "Reserved",
+ Opcode: 5260,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Acceleration Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayFlags'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Cullmask'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Offset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Stride'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Miss Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordHitNV = &Opcode {
+ Opname: "OpHitObjectRecordHitNV",
+ Class: "Reserved",
+ Opcode: 5261,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Acceleration Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'InstanceId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'PrimitiveId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'GeometryIndex'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Kind'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Offset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Stride'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'HitObject Attributes'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordHitWithIndexNV = &Opcode {
+ Opname: "OpHitObjectRecordHitWithIndexNV",
+ Class: "Reserved",
+ Opcode: 5262,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Acceleration Structure'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'InstanceId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'PrimitiveId'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'GeometryIndex'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Kind'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Record Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'HitObject Attributes'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectRecordMissNV = &Opcode {
+ Opname: "OpHitObjectRecordMissNV",
+ Class: "Reserved",
+ Opcode: 5263,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'SBT Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TMax'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectExecuteShaderNV = &Opcode {
+ Opname: "OpHitObjectExecuteShaderNV",
+ Class: "Reserved",
+ Opcode: 5264,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetCurrentTimeNV = &Opcode {
+ Opname: "OpHitObjectGetCurrentTimeNV",
+ Class: "Reserved",
+ Opcode: 5265,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetAttributesNV = &Opcode {
+ Opname: "OpHitObjectGetAttributesNV",
+ Class: "Reserved",
+ Opcode: 5266,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object Attribute'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetHitKindNV = &Opcode {
+ Opname: "OpHitObjectGetHitKindNV",
+ Class: "Reserved",
+ Opcode: 5267,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetPrimitiveIndexNV = &Opcode {
+ Opname: "OpHitObjectGetPrimitiveIndexNV",
+ Class: "Reserved",
+ Opcode: 5268,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetGeometryIndexNV = &Opcode {
+ Opname: "OpHitObjectGetGeometryIndexNV",
+ Class: "Reserved",
+ Opcode: 5269,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetInstanceIdNV = &Opcode {
+ Opname: "OpHitObjectGetInstanceIdNV",
+ Class: "Reserved",
+ Opcode: 5270,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetInstanceCustomIndexNV = &Opcode {
+ Opname: "OpHitObjectGetInstanceCustomIndexNV",
+ Class: "Reserved",
+ Opcode: 5271,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetWorldRayDirectionNV = &Opcode {
+ Opname: "OpHitObjectGetWorldRayDirectionNV",
+ Class: "Reserved",
+ Opcode: 5272,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetWorldRayOriginNV = &Opcode {
+ Opname: "OpHitObjectGetWorldRayOriginNV",
+ Class: "Reserved",
+ Opcode: 5273,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetRayTMaxNV = &Opcode {
+ Opname: "OpHitObjectGetRayTMaxNV",
+ Class: "Reserved",
+ Opcode: 5274,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectGetRayTMinNV = &Opcode {
+ Opname: "OpHitObjectGetRayTMinNV",
+ Class: "Reserved",
+ Opcode: 5275,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectIsEmptyNV = &Opcode {
+ Opname: "OpHitObjectIsEmptyNV",
+ Class: "Reserved",
+ Opcode: 5276,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectIsHitNV = &Opcode {
+ Opname: "OpHitObjectIsHitNV",
+ Class: "Reserved",
+ Opcode: 5277,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpHitObjectIsMissNV = &Opcode {
+ Opname: "OpHitObjectIsMissNV",
+ Class: "Reserved",
+ Opcode: 5278,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpReorderThreadWithHitObjectNV = &Opcode {
+ Opname: "OpReorderThreadWithHitObjectNV",
+ Class: "Reserved",
+ Opcode: 5279,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hit Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hint'",
+ Quantifier: "?",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Bits'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpReorderThreadWithHintNV = &Opcode {
+ Opname: "OpReorderThreadWithHintNV",
+ Class: "Reserved",
+ Opcode: 5280,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Hint'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Bits'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTypeHitObjectNV = &Opcode {
+ Opname: "OpTypeHitObjectNV",
+ Class: "Type-Declaration",
+ Opcode: 5281,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
Quantifier: "",
},
},
@@ -10538,6 +13395,72 @@
},
},
}
+ OpCooperativeMatrixConvertNV = &Opcode {
+ Opname: "OpCooperativeMatrixConvertNV",
+ Class: "Conversion",
+ Opcode: 5293,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Matrix'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpEmitMeshTasksEXT = &Opcode {
+ Opname: "OpEmitMeshTasksEXT",
+ Class: "Reserved",
+ Opcode: 5294,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Group Count X'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Group Count Y'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Group Count Z'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpSetMeshOutputsEXT = &Opcode {
+ Opname: "OpSetMeshOutputsEXT",
+ Class: "Reserved",
+ Opcode: 5295,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Vertex Count'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Primitive Count'",
+ Quantifier: "",
+ },
+ },
+ }
OpGroupNonUniformPartitionNV = &Opcode {
Opname: "OpGroupNonUniformPartitionNV",
Class: "Non-Uniform",
@@ -10577,10 +13500,10 @@
},
},
}
- OpReportIntersectionNV = &Opcode {
- Opname: "OpReportIntersectionNV",
+ OpFetchMicroTriangleVertexPositionNV = &Opcode {
+ Opname: "OpFetchMicroTriangleVertexPositionNV",
Class: "Reserved",
- Opcode: 5334,
+ Opcode: 5300,
Operands: []Operand {
Operand {
Kind: OperandKindIdResultType,
@@ -10594,12 +13517,69 @@
},
Operand {
Kind: OperandKindIdRef,
- Name: "'Hit'",
+ Name: "'Accel'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'HitKind'",
+ Name: "'Instance Id'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Geometry Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Primitive Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Barycentric'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFetchMicroTriangleVertexBarycentricNV = &Opcode {
+ Opname: "OpFetchMicroTriangleVertexBarycentricNV",
+ Class: "Reserved",
+ Opcode: 5301,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Accel'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Instance Id'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Geometry Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Primitive Index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Barycentric'",
Quantifier: "",
},
},
@@ -10638,13 +13618,6 @@
Operands: []Operand {
},
}
- OpIgnoreIntersectionKHR = &Opcode {
- Opname: "OpIgnoreIntersectionKHR",
- Class: "Reserved",
- Opcode: 5335,
- Operands: []Operand {
- },
- }
OpTerminateRayNV = &Opcode {
Opname: "OpTerminateRayNV",
Class: "Reserved",
@@ -10652,13 +13625,6 @@
Operands: []Operand {
},
}
- OpTerminateRayKHR = &Opcode {
- Opname: "OpTerminateRayKHR",
- Class: "Reserved",
- Opcode: 5336,
- Operands: []Operand {
- },
- }
OpTraceNV = &Opcode {
Opname: "OpTraceNV",
Class: "Reserved",
@@ -10721,10 +13687,10 @@
},
},
}
- OpTraceRayKHR = &Opcode {
- Opname: "OpTraceRayKHR",
+ OpTraceMotionNV = &Opcode {
+ Opname: "OpTraceMotionNV",
Class: "Reserved",
- Opcode: 5337,
+ Opcode: 5338,
Operands: []Operand {
Operand {
Kind: OperandKindIdRef,
@@ -10778,161 +13744,87 @@
},
Operand {
Kind: OperandKindIdRef,
+ Name: "'Time'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
Name: "'PayloadId'",
Quantifier: "",
},
},
}
- OpTypeAccelerationStructureNV = &Opcode {
- Opname: "OpTypeAccelerationStructureNV",
+ OpTraceRayMotionNV = &Opcode {
+ Opname: "OpTraceRayMotionNV",
Class: "Reserved",
- Opcode: 5341,
+ Opcode: 5339,
Operands: []Operand {
Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- },
- }
- OpTypeAccelerationStructureKHR = &Opcode {
- Opname: "OpTypeAccelerationStructureKHR",
- Class: "Reserved",
- Opcode: 5341,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- },
- }
- OpTypeRayQueryProvisionalKHR = &Opcode {
- Opname: "OpTypeRayQueryProvisionalKHR",
- Class: "Reserved",
- Opcode: 4472,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- },
- }
- OpRayQueryInitializeKHR = &Opcode {
- Opname: "OpRayQueryInitializeKHR",
- Class: "Reserved",
- Opcode: 4473,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
Kind: OperandKindIdRef,
Name: "'Accel'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'RayFlags'",
+ Name: "'Ray Flags'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'CullMask'",
+ Name: "'Cull Mask'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'RayOrigin'",
+ Name: "'SBT Offset'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'RayTMin'",
+ Name: "'SBT Stride'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'RayDirection'",
+ Name: "'Miss Index'",
Quantifier: "",
},
Operand {
Kind: OperandKindIdRef,
- Name: "'RayTMax'",
+ Name: "'Ray Origin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Tmin'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Direction'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ray Tmax'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Time'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Payload'",
Quantifier: "",
},
},
}
- OpRayQueryTerminateKHR = &Opcode {
- Opname: "OpRayQueryTerminateKHR",
+ OpRayQueryGetIntersectionTriangleVertexPositionsKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionTriangleVertexPositionsKHR",
Class: "Reserved",
- Opcode: 4474,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGenerateIntersectionKHR = &Opcode {
- Opname: "OpRayQueryGenerateIntersectionKHR",
- Class: "Reserved",
- Opcode: 4475,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'HitT'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryConfirmIntersectionKHR = &Opcode {
- Opname: "OpRayQueryConfirmIntersectionKHR",
- Class: "Reserved",
- Opcode: 4476,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryProceedKHR = &Opcode {
- Opname: "OpRayQueryProceedKHR",
- Class: "Reserved",
- Opcode: 4477,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionTypeKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionTypeKHR",
- Class: "Reserved",
- Opcode: 4479,
+ Opcode: 5340,
Operands: []Operand {
Operand {
Kind: OperandKindIdResultType,
@@ -10956,438 +13848,16 @@
},
},
}
- OpRayQueryGetRayTMinKHR = &Opcode {
- Opname: "OpRayQueryGetRayTMinKHR",
- Class: "Reserved",
- Opcode: 6016,
+ OpTypeAccelerationStructureKHR = &Opcode {
+ Opname: "OpTypeAccelerationStructureKHR",
+ Class: "Type-Declaration",
+ Opcode: 5341,
Operands: []Operand {
Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
Kind: OperandKindIdResult,
Name: "",
Quantifier: "",
},
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetRayFlagsKHR = &Opcode {
- Opname: "OpRayQueryGetRayFlagsKHR",
- Class: "Reserved",
- Opcode: 6017,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionTKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionTKHR",
- Class: "Reserved",
- Opcode: 6018,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionInstanceCustomIndexKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionInstanceCustomIndexKHR",
- Class: "Reserved",
- Opcode: 6019,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionInstanceIdKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionInstanceIdKHR",
- Class: "Reserved",
- Opcode: 6020,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR",
- Class: "Reserved",
- Opcode: 6021,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionGeometryIndexKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionGeometryIndexKHR",
- Class: "Reserved",
- Opcode: 6022,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionPrimitiveIndexKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionPrimitiveIndexKHR",
- Class: "Reserved",
- Opcode: 6023,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionBarycentricsKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionBarycentricsKHR",
- Class: "Reserved",
- Opcode: 6024,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionFrontFaceKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionFrontFaceKHR",
- Class: "Reserved",
- Opcode: 6025,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR",
- Class: "Reserved",
- Opcode: 6026,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionObjectRayDirectionKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionObjectRayDirectionKHR",
- Class: "Reserved",
- Opcode: 6027,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionObjectRayOriginKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionObjectRayOriginKHR",
- Class: "Reserved",
- Opcode: 6028,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetWorldRayDirectionKHR = &Opcode {
- Opname: "OpRayQueryGetWorldRayDirectionKHR",
- Class: "Reserved",
- Opcode: 6029,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetWorldRayOriginKHR = &Opcode {
- Opname: "OpRayQueryGetWorldRayOriginKHR",
- Class: "Reserved",
- Opcode: 6030,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionObjectToWorldKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionObjectToWorldKHR",
- Class: "Reserved",
- Opcode: 6031,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
- },
- }
- OpRayQueryGetIntersectionWorldToObjectKHR = &Opcode {
- Opname: "OpRayQueryGetIntersectionWorldToObjectKHR",
- Class: "Reserved",
- Opcode: 6032,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdResultType,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdResult,
- Name: "",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'RayQuery'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Intersection'",
- Quantifier: "",
- },
},
}
OpExecuteCallableNV = &Opcode {
@@ -11407,26 +13877,9 @@
},
},
}
- OpExecuteCallableKHR = &Opcode {
- Opname: "OpExecuteCallableKHR",
- Class: "Reserved",
- Opcode: 5344,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'SBT Index'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Callable DataId'",
- Quantifier: "",
- },
- },
- }
OpTypeCooperativeMatrixNV = &Opcode {
Opname: "OpTypeCooperativeMatrixNV",
- Class: "Reserved",
+ Class: "Type-Declaration",
Opcode: 5358,
Operands: []Operand {
Operand {
@@ -11593,9 +14046,392 @@
Operands: []Operand {
},
}
- OpDemoteToHelperInvocationEXT = &Opcode {
- Opname: "OpDemoteToHelperInvocationEXT",
+ OpCooperativeMatrixReduceNV = &Opcode {
+ Opname: "OpCooperativeMatrixReduceNV",
+ Class: "Arithmetic",
+ Opcode: 5366,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Matrix'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindCooperativeMatrixReduce,
+ Name: "'Reduce'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'CombineFunc'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCooperativeMatrixLoadTensorNV = &Opcode {
+ Opname: "OpCooperativeMatrixLoadTensorNV",
+ Class: "Memory",
+ Opcode: 5367,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindMemoryAccess,
+ Name: "'Memory Operand'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindTensorAddressingOperands,
+ Name: "'Tensor Addressing Operands'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCooperativeMatrixStoreTensorNV = &Opcode {
+ Opname: "OpCooperativeMatrixStoreTensorNV",
+ Class: "Memory",
+ Opcode: 5368,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Object'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindMemoryAccess,
+ Name: "'Memory Operand'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindTensorAddressingOperands,
+ Name: "'Tensor Addressing Operands'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCooperativeMatrixPerElementOpNV = &Opcode {
+ Opname: "OpCooperativeMatrixPerElementOpNV",
+ Class: "Function",
+ Opcode: 5369,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Matrix'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Func'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operands'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpTypeTensorLayoutNV = &Opcode {
+ Opname: "OpTypeTensorLayoutNV",
+ Class: "Type-Declaration",
+ Opcode: 5370,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Dim'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ClampMode'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTypeTensorViewNV = &Opcode {
+ Opname: "OpTypeTensorViewNV",
+ Class: "Type-Declaration",
+ Opcode: 5371,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Dim'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'HasDimensions'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'p'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpCreateTensorLayoutNV = &Opcode {
+ Opname: "OpCreateTensorLayoutNV",
Class: "Reserved",
+ Opcode: 5372,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTensorLayoutSetDimensionNV = &Opcode {
+ Opname: "OpTensorLayoutSetDimensionNV",
+ Class: "Reserved",
+ Opcode: 5373,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Dim'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpTensorLayoutSetStrideNV = &Opcode {
+ Opname: "OpTensorLayoutSetStrideNV",
+ Class: "Reserved",
+ Opcode: 5374,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Stride'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpTensorLayoutSliceNV = &Opcode {
+ Opname: "OpTensorLayoutSliceNV",
+ Class: "Reserved",
+ Opcode: 5375,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operands'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpTensorLayoutSetClampValueNV = &Opcode {
+ Opname: "OpTensorLayoutSetClampValueNV",
+ Class: "Reserved",
+ Opcode: 5376,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCreateTensorViewNV = &Opcode {
+ Opname: "OpCreateTensorViewNV",
+ Class: "Reserved",
+ Opcode: 5377,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTensorViewSetDimensionNV = &Opcode {
+ Opname: "OpTensorViewSetDimensionNV",
+ Class: "Reserved",
+ Opcode: 5378,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorView'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Dim'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpTensorViewSetStrideNV = &Opcode {
+ Opname: "OpTensorViewSetStrideNV",
+ Class: "Reserved",
+ Opcode: 5379,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorView'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Stride'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpDemoteToHelperInvocation = &Opcode {
+ Opname: "OpDemoteToHelperInvocation",
+ Class: "Control-Flow",
Opcode: 5380,
Operands: []Operand {
},
@@ -11617,6 +14453,283 @@
},
},
}
+ OpTensorViewSetClipNV = &Opcode {
+ Opname: "OpTensorViewSetClipNV",
+ Class: "Reserved",
+ Opcode: 5382,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorView'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ClipRowOffset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ClipRowSpan'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ClipColOffset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ClipColSpan'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTensorLayoutSetBlockSizeNV = &Opcode {
+ Opname: "OpTensorLayoutSetBlockSizeNV",
+ Class: "Reserved",
+ Opcode: 5384,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'TensorLayout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'BlockSize'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpCooperativeMatrixTransposeNV = &Opcode {
+ Opname: "OpCooperativeMatrixTransposeNV",
+ Class: "Conversion",
+ Opcode: 5390,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Matrix'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertUToImageNV = &Opcode {
+ Opname: "OpConvertUToImageNV",
+ Class: "Reserved",
+ Opcode: 5391,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertUToSamplerNV = &Opcode {
+ Opname: "OpConvertUToSamplerNV",
+ Class: "Reserved",
+ Opcode: 5392,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertImageToUNV = &Opcode {
+ Opname: "OpConvertImageToUNV",
+ Class: "Reserved",
+ Opcode: 5393,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertSamplerToUNV = &Opcode {
+ Opname: "OpConvertSamplerToUNV",
+ Class: "Reserved",
+ Opcode: 5394,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertUToSampledImageNV = &Opcode {
+ Opname: "OpConvertUToSampledImageNV",
+ Class: "Reserved",
+ Opcode: 5395,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertSampledImageToUNV = &Opcode {
+ Opname: "OpConvertSampledImageToUNV",
+ Class: "Reserved",
+ Opcode: 5396,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpSamplerImageAddressingModeNV = &Opcode {
+ Opname: "OpSamplerImageAddressingModeNV",
+ Class: "Reserved",
+ Opcode: 5397,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Bit Width'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRawAccessChainNV = &Opcode {
+ Opname: "OpRawAccessChainNV",
+ Class: "Memory",
+ Opcode: 5398,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Base'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Byte stride'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Element index'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Byte offset'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindRawAccessChainOperands,
+ Name: "",
+ Quantifier: "?",
+ },
+ },
+ }
OpSubgroupShuffleINTEL = &Opcode {
Opname: "OpSubgroupShuffleINTEL",
Class: "Group",
@@ -12260,6 +15373,249 @@
},
},
}
+ OpConstantFunctionPointerINTEL = &Opcode {
+ Opname: "OpConstantFunctionPointerINTEL",
+ Class: "@exclude",
+ Opcode: 5600,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Function'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFunctionPointerCallINTEL = &Opcode {
+ Opname: "OpFunctionPointerCallINTEL",
+ Class: "@exclude",
+ Opcode: 5601,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Operand 1'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpAsmTargetINTEL = &Opcode {
+ Opname: "OpAsmTargetINTEL",
+ Class: "@exclude",
+ Opcode: 5609,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralString,
+ Name: "'Asm target'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpAsmINTEL = &Opcode {
+ Opname: "OpAsmINTEL",
+ Class: "@exclude",
+ Opcode: 5610,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Asm type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralString,
+ Name: "'Asm instructions'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralString,
+ Name: "'Constraints'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpAsmCallINTEL = &Opcode {
+ Opname: "OpAsmCallINTEL",
+ Class: "@exclude",
+ Opcode: 5611,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Asm'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Argument 0'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpAtomicFMinEXT = &Opcode {
+ Opname: "OpAtomicFMinEXT",
+ Class: "Atomic",
+ Opcode: 5614,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Memory'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdMemorySemantics,
+ Name: "'Semantics'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpAtomicFMaxEXT = &Opcode {
+ Opname: "OpAtomicFMaxEXT",
+ Class: "Atomic",
+ Opcode: 5615,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Memory'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdMemorySemantics,
+ Name: "'Semantics'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpAssumeTrueKHR = &Opcode {
+ Opname: "OpAssumeTrueKHR",
+ Class: "Miscellaneous",
+ Opcode: 5630,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Condition'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpExpectKHR = &Opcode {
+ Opname: "OpExpectKHR",
+ Class: "Miscellaneous",
+ Opcode: 5631,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ExpectedValue'",
+ Quantifier: "",
+ },
+ },
+ }
OpDecorateString = &Opcode {
Opname: "OpDecorateString",
Class: "Annotation",
@@ -12277,23 +15633,6 @@
},
},
}
- OpDecorateStringGOOGLE = &Opcode {
- Opname: "OpDecorateStringGOOGLE",
- Class: "Annotation",
- Opcode: 5632,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Target'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindDecoration,
- Name: "",
- Quantifier: "",
- },
- },
- }
OpMemberDecorateString = &Opcode {
Opname: "OpMemberDecorateString",
Class: "Annotation",
@@ -12316,28 +15655,6 @@
},
},
}
- OpMemberDecorateStringGOOGLE = &Opcode {
- Opname: "OpMemberDecorateStringGOOGLE",
- Class: "Annotation",
- Opcode: 5633,
- Operands: []Operand {
- Operand {
- Kind: OperandKindIdRef,
- Name: "'Struct Type'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindLiteralInteger,
- Name: "'Member'",
- Quantifier: "",
- },
- Operand {
- Kind: OperandKindDecoration,
- Name: "",
- Quantifier: "",
- },
- },
- }
OpVmeImageINTEL = &Opcode {
Opname: "OpVmeImageINTEL",
Class: "@exclude",
@@ -15439,6 +18756,3782 @@
},
},
}
+ OpVariableLengthArrayINTEL = &Opcode {
+ Opname: "OpVariableLengthArrayINTEL",
+ Class: "@exclude",
+ Opcode: 5818,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Lenght'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpSaveMemoryINTEL = &Opcode {
+ Opname: "OpSaveMemoryINTEL",
+ Class: "@exclude",
+ Opcode: 5819,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRestoreMemoryINTEL = &Opcode {
+ Opname: "OpRestoreMemoryINTEL",
+ Class: "@exclude",
+ Opcode: 5820,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ptr'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatSinCosPiINTEL = &Opcode {
+ Opname: "OpArbitraryFloatSinCosPiINTEL",
+ Class: "@exclude",
+ Opcode: 5840,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'FromSign'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatCastINTEL = &Opcode {
+ Opname: "OpArbitraryFloatCastINTEL",
+ Class: "@exclude",
+ Opcode: 5841,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatCastFromIntINTEL = &Opcode {
+ Opname: "OpArbitraryFloatCastFromIntINTEL",
+ Class: "@exclude",
+ Opcode: 5842,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'FromSign'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatCastToIntINTEL = &Opcode {
+ Opname: "OpArbitraryFloatCastToIntINTEL",
+ Class: "@exclude",
+ Opcode: 5843,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatAddINTEL = &Opcode {
+ Opname: "OpArbitraryFloatAddINTEL",
+ Class: "@exclude",
+ Opcode: 5846,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatSubINTEL = &Opcode {
+ Opname: "OpArbitraryFloatSubINTEL",
+ Class: "@exclude",
+ Opcode: 5847,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatMulINTEL = &Opcode {
+ Opname: "OpArbitraryFloatMulINTEL",
+ Class: "@exclude",
+ Opcode: 5848,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatDivINTEL = &Opcode {
+ Opname: "OpArbitraryFloatDivINTEL",
+ Class: "@exclude",
+ Opcode: 5849,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatGTINTEL = &Opcode {
+ Opname: "OpArbitraryFloatGTINTEL",
+ Class: "@exclude",
+ Opcode: 5850,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatGEINTEL = &Opcode {
+ Opname: "OpArbitraryFloatGEINTEL",
+ Class: "@exclude",
+ Opcode: 5851,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatLTINTEL = &Opcode {
+ Opname: "OpArbitraryFloatLTINTEL",
+ Class: "@exclude",
+ Opcode: 5852,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatLEINTEL = &Opcode {
+ Opname: "OpArbitraryFloatLEINTEL",
+ Class: "@exclude",
+ Opcode: 5853,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatEQINTEL = &Opcode {
+ Opname: "OpArbitraryFloatEQINTEL",
+ Class: "@exclude",
+ Opcode: 5854,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatRecipINTEL = &Opcode {
+ Opname: "OpArbitraryFloatRecipINTEL",
+ Class: "@exclude",
+ Opcode: 5855,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatRSqrtINTEL = &Opcode {
+ Opname: "OpArbitraryFloatRSqrtINTEL",
+ Class: "@exclude",
+ Opcode: 5856,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatCbrtINTEL = &Opcode {
+ Opname: "OpArbitraryFloatCbrtINTEL",
+ Class: "@exclude",
+ Opcode: 5857,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatHypotINTEL = &Opcode {
+ Opname: "OpArbitraryFloatHypotINTEL",
+ Class: "@exclude",
+ Opcode: 5858,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatSqrtINTEL = &Opcode {
+ Opname: "OpArbitraryFloatSqrtINTEL",
+ Class: "@exclude",
+ Opcode: 5859,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatLogINTEL = &Opcode {
+ Opname: "OpArbitraryFloatLogINTEL",
+ Class: "@exclude",
+ Opcode: 5860,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatLog2INTEL = &Opcode {
+ Opname: "OpArbitraryFloatLog2INTEL",
+ Class: "@exclude",
+ Opcode: 5861,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatLog10INTEL = &Opcode {
+ Opname: "OpArbitraryFloatLog10INTEL",
+ Class: "@exclude",
+ Opcode: 5862,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatLog1pINTEL = &Opcode {
+ Opname: "OpArbitraryFloatLog1pINTEL",
+ Class: "@exclude",
+ Opcode: 5863,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatExpINTEL = &Opcode {
+ Opname: "OpArbitraryFloatExpINTEL",
+ Class: "@exclude",
+ Opcode: 5864,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatExp2INTEL = &Opcode {
+ Opname: "OpArbitraryFloatExp2INTEL",
+ Class: "@exclude",
+ Opcode: 5865,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatExp10INTEL = &Opcode {
+ Opname: "OpArbitraryFloatExp10INTEL",
+ Class: "@exclude",
+ Opcode: 5866,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatExpm1INTEL = &Opcode {
+ Opname: "OpArbitraryFloatExpm1INTEL",
+ Class: "@exclude",
+ Opcode: 5867,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatSinINTEL = &Opcode {
+ Opname: "OpArbitraryFloatSinINTEL",
+ Class: "@exclude",
+ Opcode: 5868,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatCosINTEL = &Opcode {
+ Opname: "OpArbitraryFloatCosINTEL",
+ Class: "@exclude",
+ Opcode: 5869,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatSinCosINTEL = &Opcode {
+ Opname: "OpArbitraryFloatSinCosINTEL",
+ Class: "@exclude",
+ Opcode: 5870,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatSinPiINTEL = &Opcode {
+ Opname: "OpArbitraryFloatSinPiINTEL",
+ Class: "@exclude",
+ Opcode: 5871,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatCosPiINTEL = &Opcode {
+ Opname: "OpArbitraryFloatCosPiINTEL",
+ Class: "@exclude",
+ Opcode: 5872,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatASinINTEL = &Opcode {
+ Opname: "OpArbitraryFloatASinINTEL",
+ Class: "@exclude",
+ Opcode: 5873,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatASinPiINTEL = &Opcode {
+ Opname: "OpArbitraryFloatASinPiINTEL",
+ Class: "@exclude",
+ Opcode: 5874,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatACosINTEL = &Opcode {
+ Opname: "OpArbitraryFloatACosINTEL",
+ Class: "@exclude",
+ Opcode: 5875,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatACosPiINTEL = &Opcode {
+ Opname: "OpArbitraryFloatACosPiINTEL",
+ Class: "@exclude",
+ Opcode: 5876,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatATanINTEL = &Opcode {
+ Opname: "OpArbitraryFloatATanINTEL",
+ Class: "@exclude",
+ Opcode: 5877,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatATanPiINTEL = &Opcode {
+ Opname: "OpArbitraryFloatATanPiINTEL",
+ Class: "@exclude",
+ Opcode: 5878,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatATan2INTEL = &Opcode {
+ Opname: "OpArbitraryFloatATan2INTEL",
+ Class: "@exclude",
+ Opcode: 5879,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatPowINTEL = &Opcode {
+ Opname: "OpArbitraryFloatPowINTEL",
+ Class: "@exclude",
+ Opcode: 5880,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatPowRINTEL = &Opcode {
+ Opname: "OpArbitraryFloatPowRINTEL",
+ Class: "@exclude",
+ Opcode: 5881,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M2'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArbitraryFloatPowNINTEL = &Opcode {
+ Opname: "OpArbitraryFloatPowNINTEL",
+ Class: "@exclude",
+ Opcode: 5882,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'A'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'M1'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'B'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Mout'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'EnableSubnormals'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingMode'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'RoundingAccuracy'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpLoopControlINTEL = &Opcode {
+ Opname: "OpLoopControlINTEL",
+ Class: "Reserved",
+ Opcode: 5887,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Loop Control Parameters'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpAliasDomainDeclINTEL = &Opcode {
+ Opname: "OpAliasDomainDeclINTEL",
+ Class: "@exclude",
+ Opcode: 5911,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Name'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpAliasScopeDeclINTEL = &Opcode {
+ Opname: "OpAliasScopeDeclINTEL",
+ Class: "@exclude",
+ Opcode: 5912,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Alias Domain'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Name'",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpAliasScopeListDeclINTEL = &Opcode {
+ Opname: "OpAliasScopeListDeclINTEL",
+ Class: "@exclude",
+ Opcode: 5913,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'AliasScope1, AliasScope2, ...'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpFixedSqrtINTEL = &Opcode {
+ Opname: "OpFixedSqrtINTEL",
+ Class: "@exclude",
+ Opcode: 5923,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedRecipINTEL = &Opcode {
+ Opname: "OpFixedRecipINTEL",
+ Class: "@exclude",
+ Opcode: 5924,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedRsqrtINTEL = &Opcode {
+ Opname: "OpFixedRsqrtINTEL",
+ Class: "@exclude",
+ Opcode: 5925,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedSinINTEL = &Opcode {
+ Opname: "OpFixedSinINTEL",
+ Class: "@exclude",
+ Opcode: 5926,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedCosINTEL = &Opcode {
+ Opname: "OpFixedCosINTEL",
+ Class: "@exclude",
+ Opcode: 5927,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedSinCosINTEL = &Opcode {
+ Opname: "OpFixedSinCosINTEL",
+ Class: "@exclude",
+ Opcode: 5928,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedSinPiINTEL = &Opcode {
+ Opname: "OpFixedSinPiINTEL",
+ Class: "@exclude",
+ Opcode: 5929,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedCosPiINTEL = &Opcode {
+ Opname: "OpFixedCosPiINTEL",
+ Class: "@exclude",
+ Opcode: 5930,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedSinCosPiINTEL = &Opcode {
+ Opname: "OpFixedSinCosPiINTEL",
+ Class: "@exclude",
+ Opcode: 5931,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedLogINTEL = &Opcode {
+ Opname: "OpFixedLogINTEL",
+ Class: "@exclude",
+ Opcode: 5932,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFixedExpINTEL = &Opcode {
+ Opname: "OpFixedExpINTEL",
+ Class: "@exclude",
+ Opcode: 5933,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input Type'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'S'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'I'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'rI'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Q'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'O'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpPtrCastToCrossWorkgroupINTEL = &Opcode {
+ Opname: "OpPtrCastToCrossWorkgroupINTEL",
+ Class: "@exclude",
+ Opcode: 5934,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpCrossWorkgroupCastToPtrINTEL = &Opcode {
+ Opname: "OpCrossWorkgroupCastToPtrINTEL",
+ Class: "@exclude",
+ Opcode: 5938,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpReadPipeBlockingINTEL = &Opcode {
+ Opname: "OpReadPipeBlockingINTEL",
+ Class: "Pipe",
+ Opcode: 5946,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Packet Size'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Packet Alignment'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpWritePipeBlockingINTEL = &Opcode {
+ Opname: "OpWritePipeBlockingINTEL",
+ Class: "Pipe",
+ Opcode: 5947,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Packet Size'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Packet Alignment'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpFPGARegINTEL = &Opcode {
+ Opname: "OpFPGARegINTEL",
+ Class: "Reserved",
+ Opcode: 5949,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Result'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Input'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetRayTMinKHR = &Opcode {
+ Opname: "OpRayQueryGetRayTMinKHR",
+ Class: "Reserved",
+ Opcode: 6016,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetRayFlagsKHR = &Opcode {
+ Opname: "OpRayQueryGetRayFlagsKHR",
+ Class: "Reserved",
+ Opcode: 6017,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionTKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionTKHR",
+ Class: "Reserved",
+ Opcode: 6018,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionInstanceCustomIndexKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionInstanceCustomIndexKHR",
+ Class: "Reserved",
+ Opcode: 6019,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionInstanceIdKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionInstanceIdKHR",
+ Class: "Reserved",
+ Opcode: 6020,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR",
+ Class: "Reserved",
+ Opcode: 6021,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionGeometryIndexKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionGeometryIndexKHR",
+ Class: "Reserved",
+ Opcode: 6022,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionPrimitiveIndexKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionPrimitiveIndexKHR",
+ Class: "Reserved",
+ Opcode: 6023,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionBarycentricsKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionBarycentricsKHR",
+ Class: "Reserved",
+ Opcode: 6024,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionFrontFaceKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionFrontFaceKHR",
+ Class: "Reserved",
+ Opcode: 6025,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR",
+ Class: "Reserved",
+ Opcode: 6026,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionObjectRayDirectionKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionObjectRayDirectionKHR",
+ Class: "Reserved",
+ Opcode: 6027,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionObjectRayOriginKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionObjectRayOriginKHR",
+ Class: "Reserved",
+ Opcode: 6028,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetWorldRayDirectionKHR = &Opcode {
+ Opname: "OpRayQueryGetWorldRayDirectionKHR",
+ Class: "Reserved",
+ Opcode: 6029,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetWorldRayOriginKHR = &Opcode {
+ Opname: "OpRayQueryGetWorldRayOriginKHR",
+ Class: "Reserved",
+ Opcode: 6030,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionObjectToWorldKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionObjectToWorldKHR",
+ Class: "Reserved",
+ Opcode: 6031,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpRayQueryGetIntersectionWorldToObjectKHR = &Opcode {
+ Opname: "OpRayQueryGetIntersectionWorldToObjectKHR",
+ Class: "Reserved",
+ Opcode: 6032,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'RayQuery'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Intersection'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpAtomicFAddEXT = &Opcode {
+ Opname: "OpAtomicFAddEXT",
+ Class: "Atomic",
+ Opcode: 6035,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Pointer'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Memory'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdMemorySemantics,
+ Name: "'Semantics'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTypeBufferSurfaceINTEL = &Opcode {
+ Opname: "OpTypeBufferSurfaceINTEL",
+ Class: "Type-Declaration",
+ Opcode: 6086,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindAccessQualifier,
+ Name: "'AccessQualifier'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpTypeStructContinuedINTEL = &Opcode {
+ Opname: "OpTypeStructContinuedINTEL",
+ Class: "Type-Declaration",
+ Opcode: 6090,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Member 0 type', + 'member 1 type', + ...",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpConstantCompositeContinuedINTEL = &Opcode {
+ Opname: "OpConstantCompositeContinuedINTEL",
+ Class: "Constant-Creation",
+ Opcode: 6091,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Constituents'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpSpecConstantCompositeContinuedINTEL = &Opcode {
+ Opname: "OpSpecConstantCompositeContinuedINTEL",
+ Class: "Constant-Creation",
+ Opcode: 6092,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Constituents'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpCompositeConstructContinuedINTEL = &Opcode {
+ Opname: "OpCompositeConstructContinuedINTEL",
+ Class: "Composite",
+ Opcode: 6096,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Constituents'",
+ Quantifier: "*",
+ },
+ },
+ }
+ OpConvertFToBF16INTEL = &Opcode {
+ Opname: "OpConvertFToBF16INTEL",
+ Class: "Conversion",
+ Opcode: 6116,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Float Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpConvertBF16ToFINTEL = &Opcode {
+ Opname: "OpConvertBF16ToFINTEL",
+ Class: "Conversion",
+ Opcode: 6117,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'BFloat16 Value'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpControlBarrierArriveINTEL = &Opcode {
+ Opname: "OpControlBarrierArriveINTEL",
+ Class: "Barrier",
+ Opcode: 6142,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Memory'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdMemorySemantics,
+ Name: "'Semantics'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpControlBarrierWaitINTEL = &Opcode {
+ Opname: "OpControlBarrierWaitINTEL",
+ Class: "Barrier",
+ Opcode: 6143,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Memory'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdMemorySemantics,
+ Name: "'Semantics'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpArithmeticFenceEXT = &Opcode {
+ Opname: "OpArithmeticFenceEXT",
+ Class: "Miscellaneous",
+ Opcode: 6145,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Target '",
+ Quantifier: "",
+ },
+ },
+ }
+ OpSubgroupBlockPrefetchINTEL = &Opcode {
+ Opname: "OpSubgroupBlockPrefetchINTEL",
+ Class: "Group",
+ Opcode: 6221,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Ptr'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'NumBytes'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindMemoryAccess,
+ Name: "",
+ Quantifier: "?",
+ },
+ },
+ }
+ OpGroupIMulKHR = &Opcode {
+ Opname: "OpGroupIMulKHR",
+ Class: "Group",
+ Opcode: 6401,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupFMulKHR = &Opcode {
+ Opname: "OpGroupFMulKHR",
+ Class: "Group",
+ Opcode: 6402,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupBitwiseAndKHR = &Opcode {
+ Opname: "OpGroupBitwiseAndKHR",
+ Class: "Group",
+ Opcode: 6403,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupBitwiseOrKHR = &Opcode {
+ Opname: "OpGroupBitwiseOrKHR",
+ Class: "Group",
+ Opcode: 6404,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupBitwiseXorKHR = &Opcode {
+ Opname: "OpGroupBitwiseXorKHR",
+ Class: "Group",
+ Opcode: 6405,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupLogicalAndKHR = &Opcode {
+ Opname: "OpGroupLogicalAndKHR",
+ Class: "Group",
+ Opcode: 6406,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupLogicalOrKHR = &Opcode {
+ Opname: "OpGroupLogicalOrKHR",
+ Class: "Group",
+ Opcode: 6407,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpGroupLogicalXorKHR = &Opcode {
+ Opname: "OpGroupLogicalXorKHR",
+ Class: "Group",
+ Opcode: 6408,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdScope,
+ Name: "'Execution'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindGroupOperation,
+ Name: "'Operation'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'X'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpMaskedGatherINTEL = &Opcode {
+ Opname: "OpMaskedGatherINTEL",
+ Class: "Memory",
+ Opcode: 6428,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdResultType,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdResult,
+ Name: "",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'PtrVector'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Alignment'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Mask'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'FillEmpty'",
+ Quantifier: "",
+ },
+ },
+ }
+ OpMaskedScatterINTEL = &Opcode {
+ Opname: "OpMaskedScatterINTEL",
+ Class: "Memory",
+ Opcode: 6429,
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'InputVector'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'PtrVector'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Alignment'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Mask'",
+ Quantifier: "",
+ },
+ },
+ }
GLSLStd450_Round = &Opcode {
Opname: "Round",
@@ -19600,6 +26693,51 @@
},
},
}
+ OpenCLDebugInfo100_DebugModuleINTEL = &Opcode {
+ Opname: "DebugModuleINTEL",
+ Operands: []Operand {
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Name'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Source'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'Parent'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'Line'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'ConfigurationMacros'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'IncludePath'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindIdRef,
+ Name: "'APINotesFile'",
+ Quantifier: "",
+ },
+ Operand {
+ Kind: OperandKindLiteralInteger,
+ Name: "'IsDeclaration'",
+ Quantifier: "",
+ },
+ },
+ }
OperandKindImageOperands = &OperandKind {
@@ -19618,56 +26756,56 @@
Value: 0x0001,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Lod",
Value: 0x0002,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Grad",
Value: 0x0004,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindIdRef, ""},{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ConstOffset",
Value: 0x0008,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Offset",
Value: 0x0010,
Capabilities: []string{"ImageGatherExtended",},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ConstOffsets",
Value: 0x0020,
Capabilities: []string{"ImageGatherExtended",},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Sample",
Value: 0x0040,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MinLod",
Value: 0x0080,
Capabilities: []string{"MinLod",},
Parameters: []Parameter{{OperandKindIdRef, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MakeTexelAvailable",
@@ -19677,13 +26815,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "MakeTexelAvailableKHR",
- Value: 0x0100,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{{OperandKindIdScope, ""},},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "MakeTexelVisible",
Value: 0x0200,
Capabilities: []string{"VulkanMemoryModel",},
@@ -19691,13 +26822,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "MakeTexelVisibleKHR",
- Value: 0x0200,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{{OperandKindIdScope, ""},},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "NonPrivateTexel",
Value: 0x0400,
Capabilities: []string{"VulkanMemoryModel",},
@@ -19705,13 +26829,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "NonPrivateTexelKHR",
- Value: 0x0400,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "VolatileTexel",
Value: 0x0800,
Capabilities: []string{"VulkanMemoryModel",},
@@ -19719,13 +26836,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "VolatileTexelKHR",
- Value: 0x0800,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "SignExtend",
Value: 0x1000,
Capabilities: []string{},
@@ -19739,6 +26849,20 @@
Parameters: []Parameter{},
Version: "1.4",
},
+ Enumerant{
+ Enumerant: "Nontemporal",
+ Value: 0x4000,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "Offsets",
+ Value: 0x10000,
+ Capabilities: []string{},
+ Parameters: []Parameter{{OperandKindIdRef, ""},},
+ Version: "1.0",
+ },
},
Bases: []*OperandKind {},
}
@@ -19751,42 +26875,63 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NotNaN",
Value: 0x0001,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NotInf",
Value: 0x0002,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NSZ",
Value: 0x0004,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "AllowRecip",
Value: 0x0008,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Fast",
Value: 0x0010,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "AllowContract",
+ Value: 0x10000,
+ Capabilities: []string{"FloatControls2","FPFastMathModeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AllowReassoc",
+ Value: 0x20000,
+ Capabilities: []string{"FloatControls2","FPFastMathModeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AllowTransform",
+ Value: 0x40000,
+ Capabilities: []string{"FloatControls2",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -19800,21 +26945,21 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Flatten",
Value: 0x0001,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DontFlatten",
Value: 0x0002,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -19828,21 +26973,21 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Unroll",
Value: 0x0001,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DontUnroll",
Value: 0x0002,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DependencyInfinite",
@@ -19893,6 +27038,76 @@
Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
Version: "1.4",
},
+ Enumerant{
+ Enumerant: "InitiationIntervalINTEL",
+ Value: 0x10000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxConcurrencyINTEL",
+ Value: 0x20000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DependencyArrayINTEL",
+ Value: 0x40000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PipelineEnableINTEL",
+ Value: 0x80000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "LoopCoalesceINTEL",
+ Value: 0x100000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxInterleavingINTEL",
+ Value: 0x200000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SpeculatedIterationsINTEL",
+ Value: 0x400000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NoFusionINTEL",
+ Value: 0x800000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "LoopCountINTEL",
+ Value: 0x1000000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxReinvocationDelayINTEL",
+ Value: 0x2000000,
+ Capabilities: []string{"FPGALoopControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
+ Version: "None",
+ },
},
Bases: []*OperandKind {},
}
@@ -19905,35 +27120,42 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Inline",
Value: 0x0001,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DontInline",
Value: 0x0002,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Pure",
Value: 0x0004,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Const",
Value: 0x0008,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "OptNoneEXT",
+ Value: 0x10000,
+ Capabilities: []string{"OptNoneEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -19947,84 +27169,77 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
- },
- Enumerant{
- Enumerant: "None",
- Value: 0x0000,
- Capabilities: []string{},
- Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Acquire",
Value: 0x0002,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Release",
Value: 0x0004,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "AcquireRelease",
Value: 0x0008,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SequentiallyConsistent",
Value: 0x0010,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UniformMemory",
Value: 0x0040,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupMemory",
Value: 0x0080,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WorkgroupMemory",
Value: 0x0100,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "CrossWorkgroupMemory",
Value: 0x0200,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "AtomicCounterMemory",
Value: 0x0400,
Capabilities: []string{"AtomicStorage",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageMemory",
Value: 0x0800,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OutputMemory",
@@ -20034,13 +27249,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "OutputMemoryKHR",
- Value: 0x1000,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "MakeAvailable",
Value: 0x2000,
Capabilities: []string{"VulkanMemoryModel",},
@@ -20048,13 +27256,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "MakeAvailableKHR",
- Value: 0x2000,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "MakeVisible",
Value: 0x4000,
Capabilities: []string{"VulkanMemoryModel",},
@@ -20062,13 +27263,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "MakeVisibleKHR",
- Value: 0x4000,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "Volatile",
Value: 0x8000,
Capabilities: []string{"VulkanMemoryModel",},
@@ -20087,28 +27281,28 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Volatile",
Value: 0x0001,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Aligned",
Value: 0x0002,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindLiteralInteger, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Nontemporal",
Value: 0x0004,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MakePointerAvailable",
@@ -20118,13 +27312,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "MakePointerAvailableKHR",
- Value: 0x0008,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{{OperandKindIdScope, ""},},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "MakePointerVisible",
Value: 0x0010,
Capabilities: []string{"VulkanMemoryModel",},
@@ -20132,13 +27319,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "MakePointerVisibleKHR",
- Value: 0x0010,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{{OperandKindIdScope, ""},},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "NonPrivatePointer",
Value: 0x0020,
Capabilities: []string{"VulkanMemoryModel",},
@@ -20146,11 +27326,18 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "NonPrivatePointerKHR",
- Value: 0x0020,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
+ Enumerant: "AliasScopeINTELMask",
+ Value: 0x10000,
+ Capabilities: []string{"MemoryAccessAliasingINTEL",},
+ Parameters: []Parameter{{OperandKindIdRef, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NoAliasINTELMask",
+ Value: 0x20000,
+ Capabilities: []string{"MemoryAccessAliasingINTEL",},
+ Parameters: []Parameter{{OperandKindIdRef, ""},},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -20164,14 +27351,14 @@
Value: 0x0000,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "CmdExecTime",
Value: 0x0001,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -20183,80 +27370,150 @@
Enumerant{
Enumerant: "NoneKHR",
Value: 0x0000,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "OpaqueKHR",
Value: 0x0001,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "NoOpaqueKHR",
Value: 0x0002,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "TerminateOnFirstHitKHR",
Value: 0x0004,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "SkipClosestHitShaderKHR",
Value: 0x0008,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "CullBackFacingTrianglesKHR",
Value: 0x0010,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "CullFrontFacingTrianglesKHR",
Value: 0x0020,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "CullOpaqueKHR",
Value: 0x0040,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "CullNoOpaqueKHR",
Value: 0x0080,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "SkipTrianglesKHR",
Value: 0x0100,
- Capabilities: []string{"RayTraversalPrimitiveCullingProvisionalKHR",},
+ Capabilities: []string{"RayTraversalPrimitiveCullingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "SkipAABBsKHR",
Value: 0x0200,
- Capabilities: []string{"RayTraversalPrimitiveCullingProvisionalKHR",},
+ Capabilities: []string{"RayTraversalPrimitiveCullingKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ForceOpacityMicromap2StateEXT",
+ Value: 0x0400,
+ Capabilities: []string{"RayTracingOpacityMicromapEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindFragmentShadingRate = &OperandKind {
+ Kind: "FragmentShadingRate",
+ Category: "BitEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "Vertical2Pixels",
+ Value: 0x0001,
+ Capabilities: []string{"FragmentShadingRateKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "Vertical4Pixels",
+ Value: 0x0002,
+ Capabilities: []string{"FragmentShadingRateKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "Horizontal2Pixels",
+ Value: 0x0004,
+ Capabilities: []string{"FragmentShadingRateKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "Horizontal4Pixels",
+ Value: 0x0008,
+ Capabilities: []string{"FragmentShadingRateKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindRawAccessChainOperands = &OperandKind {
+ Kind: "RawAccessChainOperands",
+ Category: "BitEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "None",
+ Value: 0x0000,
+ Capabilities: []string{},
Parameters: []Parameter{},
Version: "",
},
+ Enumerant{
+ Enumerant: "RobustnessPerComponentNV",
+ Value: 0x0001,
+ Capabilities: []string{"RawAccessChainsNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RobustnessPerElementNV",
+ Value: 0x0002,
+ Capabilities: []string{"RawAccessChainsNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
},
Bases: []*OperandKind {},
}
@@ -20269,42 +27526,91 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ESSL",
Value: 1,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GLSL",
Value: 2,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OpenCL_C",
Value: 3,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OpenCL_CPP",
Value: 4,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "HLSL",
Value: 5,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "CPP_for_OpenCL",
+ Value: 6,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "SYCL",
+ Value: 7,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "HERO_C",
+ Value: 8,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "NZSL",
+ Value: 9,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "WGSL",
+ Value: 10,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "Slang",
+ Value: 11,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "Zig",
+ Value: 12,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -20318,49 +27624,49 @@
Value: 0,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TessellationControl",
Value: 1,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TessellationEvaluation",
Value: 2,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Geometry",
Value: 3,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Fragment",
Value: 4,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GLCompute",
Value: 5,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Kernel",
Value: 6,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TaskNV",
@@ -20377,86 +27683,58 @@
Version: "None",
},
Enumerant{
- Enumerant: "RayGenerationNV",
- Value: 5313,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
Enumerant: "RayGenerationKHR",
Value: 5313,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "IntersectionNV",
- Value: 5314,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "IntersectionKHR",
Value: 5314,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "AnyHitNV",
- Value: 5315,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "AnyHitKHR",
Value: 5315,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "ClosestHitNV",
- Value: 5316,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "ClosestHitKHR",
Value: 5316,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "MissNV",
- Value: 5317,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "MissKHR",
Value: 5317,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "CallableNV",
- Value: 5318,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "CallableKHR",
Value: 5318,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TaskEXT",
+ Value: 5364,
+ Capabilities: []string{"MeshShadingEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MeshEXT",
+ Value: 5365,
+ Capabilities: []string{"MeshShadingEXT",},
Parameters: []Parameter{},
Version: "None",
},
@@ -20472,21 +27750,21 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Physical32",
Value: 1,
Capabilities: []string{"Addresses",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Physical64",
Value: 2,
Capabilities: []string{"Addresses",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PhysicalStorageBuffer64",
@@ -20495,13 +27773,6 @@
Parameters: []Parameter{},
Version: "1.5",
},
- Enumerant{
- Enumerant: "PhysicalStorageBuffer64EXT",
- Value: 5348,
- Capabilities: []string{"PhysicalStorageBufferAddresses",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
},
Bases: []*OperandKind {},
}
@@ -20514,21 +27785,21 @@
Value: 0,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GLSL450",
Value: 1,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OpenCL",
Value: 2,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Vulkan",
@@ -20537,13 +27808,6 @@
Parameters: []Parameter{},
Version: "1.5",
},
- Enumerant{
- Enumerant: "VulkanKHR",
- Value: 3,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
},
Bases: []*OperandKind {},
}
@@ -20556,217 +27820,217 @@
Value: 0,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Number of <<Invocation,invocations>>'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SpacingEqual",
Value: 1,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SpacingFractionalEven",
Value: 2,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SpacingFractionalOdd",
Value: 3,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "VertexOrderCw",
Value: 4,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "VertexOrderCcw",
Value: 5,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PixelCenterInteger",
Value: 6,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OriginUpperLeft",
Value: 7,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OriginLowerLeft",
Value: 8,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "EarlyFragmentTests",
Value: 9,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PointMode",
Value: 10,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Xfb",
Value: 11,
Capabilities: []string{"TransformFeedback",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DepthReplacing",
Value: 12,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DepthGreater",
Value: 14,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DepthLess",
Value: 15,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DepthUnchanged",
Value: 16,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "LocalSize",
Value: 17,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindLiteralInteger, "'x size'"},{OperandKindLiteralInteger, "'y size'"},{OperandKindLiteralInteger, "'z size'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "LocalSizeHint",
Value: 18,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'x size'"},{OperandKindLiteralInteger, "'y size'"},{OperandKindLiteralInteger, "'z size'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InputPoints",
Value: 19,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InputLines",
Value: 20,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InputLinesAdjacency",
Value: 21,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Triangles",
Value: 22,
Capabilities: []string{"Geometry","Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InputTrianglesAdjacency",
Value: 23,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Quads",
Value: 24,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Isolines",
Value: 25,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OutputVertices",
Value: 26,
- Capabilities: []string{"Geometry","Tessellation","MeshShadingNV",},
+ Capabilities: []string{"Geometry","Tessellation","MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Vertex count'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OutputPoints",
Value: 27,
- Capabilities: []string{"Geometry","MeshShadingNV",},
+ Capabilities: []string{"Geometry","MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OutputLineStrip",
Value: 28,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "OutputTriangleStrip",
Value: 29,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "VecTypeHint",
Value: 30,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Vector type'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ContractionOff",
Value: 31,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Initializer",
@@ -20814,10 +28078,38 @@
Enumerant: "LocalSizeHintId",
Value: 39,
Capabilities: []string{"Kernel",},
- Parameters: []Parameter{{OperandKindIdRef, "'Local Size Hint'"},},
+ Parameters: []Parameter{{OperandKindIdRef, "'x size hint'"},{OperandKindIdRef, "'y size hint'"},{OperandKindIdRef, "'z size hint'"},},
Version: "1.2",
},
Enumerant{
+ Enumerant: "NonCoherentColorAttachmentReadEXT",
+ Value: 4169,
+ Capabilities: []string{"TileImageColorReadAccessEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NonCoherentDepthAttachmentReadEXT",
+ Value: 4170,
+ Capabilities: []string{"TileImageDepthReadAccessEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NonCoherentStencilAttachmentReadEXT",
+ Value: 4171,
+ Capabilities: []string{"TileImageStencilReadAccessEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SubgroupUniformControlFlowKHR",
+ Value: 4421,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "PostDepthCoverage",
Value: 4446,
Capabilities: []string{"SampleMaskPostDepthCoverage",},
@@ -20860,6 +28152,13 @@
Version: "1.4",
},
Enumerant{
+ Enumerant: "EarlyAndLateFragmentTestsAMD",
+ Value: 5017,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "StencilRefReplacingEXT",
Value: 5027,
Capabilities: []string{"StencilExportEXT",},
@@ -20867,37 +28166,142 @@
Version: "None",
},
Enumerant{
- Enumerant: "OutputLinesNV",
- Value: 5269,
- Capabilities: []string{"MeshShadingNV",},
+ Enumerant: "CoalescingAMDX",
+ Value: 5069,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "OutputPrimitivesNV",
+ Enumerant: "IsApiEntryAMDX",
+ Value: 5070,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Is Entry'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxNodeRecursionAMDX",
+ Value: 5071,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Number of recursions'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StaticNumWorkgroupsAMDX",
+ Value: 5072,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'x size'"},{OperandKindIdRef, "'y size'"},{OperandKindIdRef, "'z size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ShaderIndexAMDX",
+ Value: 5073,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Shader Index'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxNumWorkgroupsAMDX",
+ Value: 5077,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'x size'"},{OperandKindIdRef, "'y size'"},{OperandKindIdRef, "'z size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StencilRefUnchangedFrontAMD",
+ Value: 5079,
+ Capabilities: []string{"StencilExportEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StencilRefGreaterFrontAMD",
+ Value: 5080,
+ Capabilities: []string{"StencilExportEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StencilRefLessFrontAMD",
+ Value: 5081,
+ Capabilities: []string{"StencilExportEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StencilRefUnchangedBackAMD",
+ Value: 5082,
+ Capabilities: []string{"StencilExportEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StencilRefGreaterBackAMD",
+ Value: 5083,
+ Capabilities: []string{"StencilExportEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StencilRefLessBackAMD",
+ Value: 5084,
+ Capabilities: []string{"StencilExportEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "QuadDerivativesKHR",
+ Value: 5088,
+ Capabilities: []string{"QuadControlKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RequireFullQuadsKHR",
+ Value: 5089,
+ Capabilities: []string{"QuadControlKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SharesInputWithAMDX",
+ Value: 5102,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Node Name'"},{OperandKindIdRef, "'Shader Index'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "OutputLinesEXT",
+ Value: 5269,
+ Capabilities: []string{"MeshShadingNV","MeshShadingEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "OutputPrimitivesEXT",
Value: 5270,
- Capabilities: []string{"MeshShadingNV",},
+ Capabilities: []string{"MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Primitive count'"},},
Version: "None",
},
Enumerant{
- Enumerant: "DerivativeGroupQuadsNV",
+ Enumerant: "DerivativeGroupQuadsKHR",
Value: 5289,
- Capabilities: []string{"ComputeDerivativeGroupQuadsNV",},
+ Capabilities: []string{"ComputeDerivativeGroupQuadsNV","ComputeDerivativeGroupQuadsKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "DerivativeGroupLinearNV",
+ Enumerant: "DerivativeGroupLinearKHR",
Value: 5290,
- Capabilities: []string{"ComputeDerivativeGroupLinearNV",},
+ Capabilities: []string{"ComputeDerivativeGroupLinearNV","ComputeDerivativeGroupLinearKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "OutputTrianglesNV",
+ Enumerant: "OutputTrianglesEXT",
Value: 5298,
- Capabilities: []string{"MeshShadingNV",},
+ Capabilities: []string{"MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
Version: "None",
},
@@ -20943,6 +28347,132 @@
Parameters: []Parameter{},
Version: "None",
},
+ Enumerant{
+ Enumerant: "SharedLocalMemorySizeINTEL",
+ Value: 5618,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RoundingModeRTPINTEL",
+ Value: 5620,
+ Capabilities: []string{"RoundToInfinityINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RoundingModeRTNINTEL",
+ Value: 5621,
+ Capabilities: []string{"RoundToInfinityINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FloatingPointModeALTINTEL",
+ Value: 5622,
+ Capabilities: []string{"RoundToInfinityINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FloatingPointModeIEEEINTEL",
+ Value: 5623,
+ Capabilities: []string{"RoundToInfinityINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxWorkgroupSizeINTEL",
+ Value: 5893,
+ Capabilities: []string{"KernelAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'max_x_size'"},{OperandKindLiteralInteger, "'max_y_size'"},{OperandKindLiteralInteger, "'max_z_size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxWorkDimINTEL",
+ Value: 5894,
+ Capabilities: []string{"KernelAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'max_dimensions'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NoGlobalOffsetINTEL",
+ Value: 5895,
+ Capabilities: []string{"KernelAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NumSIMDWorkitemsINTEL",
+ Value: 5896,
+ Capabilities: []string{"FPGAKernelAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'vector_width'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SchedulerTargetFmaxMhzINTEL",
+ Value: 5903,
+ Capabilities: []string{"FPGAKernelAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'target_fmax'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaximallyReconvergesKHR",
+ Value: 6023,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPFastMathDefault",
+ Value: 6028,
+ Capabilities: []string{"FloatControls2",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Target Type'"},{OperandKindIdRef, "'Fast-Math Mode'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StreamingInterfaceINTEL",
+ Value: 6154,
+ Capabilities: []string{"FPGAKernelAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'StallFreeReturn'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RegisterMapInterfaceINTEL",
+ Value: 6160,
+ Capabilities: []string{"FPGAKernelAttributesv2INTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'WaitForDoneWrite'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NamedBarrierCountINTEL",
+ Value: 6417,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Barrier Count'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaximumRegistersINTEL",
+ Value: 6461,
+ Capabilities: []string{"RegisterLimitsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Number of Registers'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaximumRegistersIdINTEL",
+ Value: 6462,
+ Capabilities: []string{"RegisterLimitsINTEL",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Number of Registers'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NamedMaximumRegistersINTEL",
+ Value: 6463,
+ Capabilities: []string{"RegisterLimitsINTEL",},
+ Parameters: []Parameter{{OperandKindNamedMaximumNumberOfRegisters, "'Named Maximum Number of Registers'"},},
+ Version: "None",
+ },
},
Bases: []*OperandKind {},
}
@@ -20955,84 +28485,84 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Input",
Value: 1,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Uniform",
Value: 2,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Output",
Value: 3,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Workgroup",
Value: 4,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "CrossWorkgroup",
Value: 5,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Private",
Value: 6,
- Capabilities: []string{"Shader",},
+ Capabilities: []string{"Shader","VectorComputeINTEL",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Function",
Value: 7,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Generic",
Value: 8,
Capabilities: []string{"GenericPointer",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PushConstant",
Value: 9,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "AtomicCounter",
Value: 10,
Capabilities: []string{"AtomicStorage",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Image",
Value: 11,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageBuffer",
@@ -21042,86 +28572,58 @@
Version: "1.3",
},
Enumerant{
- Enumerant: "CallableDataNV",
- Value: 5328,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Enumerant: "TileImageEXT",
+ Value: 4172,
+ Capabilities: []string{"TileImageColorReadAccessEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NodePayloadAMDX",
+ Value: 5068,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "CallableDataKHR",
Value: 5328,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "IncomingCallableDataNV",
- Value: 5329,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "IncomingCallableDataKHR",
Value: 5329,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "RayPayloadNV",
- Value: 5338,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "RayPayloadKHR",
Value: 5338,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "HitAttributeNV",
- Value: 5339,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "HitAttributeKHR",
Value: 5339,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "IncomingRayPayloadNV",
- Value: 5342,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "IncomingRayPayloadKHR",
Value: 5342,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "ShaderRecordBufferNV",
- Value: 5343,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "ShaderRecordBufferKHR",
Value: 5343,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
@@ -21133,11 +28635,39 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "PhysicalStorageBufferEXT",
- Value: 5349,
- Capabilities: []string{"PhysicalStorageBufferAddresses",},
+ Enumerant: "HitObjectAttributeNV",
+ Value: 5385,
+ Capabilities: []string{"ShaderInvocationReorderNV",},
Parameters: []Parameter{},
- Version: "1.5",
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TaskPayloadWorkgroupEXT",
+ Value: 5402,
+ Capabilities: []string{"MeshShadingEXT",},
+ Parameters: []Parameter{},
+ Version: "1.4",
+ },
+ Enumerant{
+ Enumerant: "CodeSectionINTEL",
+ Value: 5605,
+ Capabilities: []string{"FunctionPointersINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DeviceOnlyINTEL",
+ Value: 5936,
+ Capabilities: []string{"USMStorageClassesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "HostOnlyINTEL",
+ Value: 5937,
+ Capabilities: []string{"USMStorageClassesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -21149,51 +28679,58 @@
Enumerant{
Enumerant: "1D",
Value: 0,
- Capabilities: []string{"Sampled1D","Image1D",},
+ Capabilities: []string{"Sampled1D",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "2D",
Value: 1,
- Capabilities: []string{"Shader","Kernel","ImageMSArray",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "3D",
Value: 2,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Cube",
Value: 3,
- Capabilities: []string{"Shader","ImageCubeArray",},
+ Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rect",
Value: 4,
- Capabilities: []string{"SampledRect","ImageRect",},
+ Capabilities: []string{"SampledRect",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Buffer",
Value: 5,
- Capabilities: []string{"SampledBuffer","ImageBuffer",},
+ Capabilities: []string{"SampledBuffer",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubpassData",
Value: 6,
Capabilities: []string{"InputAttachment",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "TileImageDataEXT",
+ Value: 4173,
+ Capabilities: []string{"TileImageColorReadAccessEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -21205,37 +28742,37 @@
Enumerant{
Enumerant: "None",
Value: 0,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ClampToEdge",
Value: 1,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Clamp",
Value: 2,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Repeat",
Value: 3,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RepeatMirrored",
Value: 4,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -21247,16 +28784,16 @@
Enumerant{
Enumerant: "Nearest",
Value: 0,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Linear",
Value: 1,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -21270,280 +28807,294 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba32f",
Value: 1,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba16f",
Value: 2,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R32f",
Value: 3,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba8",
Value: 4,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba8Snorm",
Value: 5,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg32f",
Value: 6,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg16f",
Value: 7,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R11fG11fB10f",
Value: 8,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R16f",
Value: 9,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba16",
Value: 10,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgb10A2",
Value: 11,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg16",
Value: 12,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg8",
Value: 13,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R16",
Value: 14,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R8",
Value: 15,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba16Snorm",
Value: 16,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg16Snorm",
Value: 17,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg8Snorm",
Value: 18,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R16Snorm",
Value: 19,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R8Snorm",
Value: 20,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba32i",
Value: 21,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba16i",
Value: 22,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba8i",
Value: 23,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R32i",
Value: 24,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg32i",
Value: 25,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg16i",
Value: 26,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg8i",
Value: 27,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R16i",
Value: 28,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R8i",
Value: 29,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba32ui",
Value: 30,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba16ui",
Value: 31,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgba8ui",
Value: 32,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R32ui",
Value: 33,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rgb10a2ui",
Value: 34,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg32ui",
Value: 35,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg16ui",
Value: 36,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rg8ui",
Value: 37,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R16ui",
Value: 38,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "R8ui",
Value: 39,
Capabilities: []string{"StorageImageExtendedFormats",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "R64ui",
+ Value: 40,
+ Capabilities: []string{"Int64ImageEXT",},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "R64i",
+ Value: 41,
+ Capabilities: []string{"Int64ImageEXT",},
+ Parameters: []Parameter{},
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -21555,142 +29106,142 @@
Enumerant{
Enumerant: "R",
Value: 0,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "A",
Value: 1,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RG",
Value: 2,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RA",
Value: 3,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RGB",
Value: 4,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RGBA",
Value: 5,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "BGRA",
Value: 6,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ARGB",
Value: 7,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Intensity",
Value: 8,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Luminance",
Value: 9,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Rx",
Value: 10,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RGx",
Value: 11,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RGBx",
Value: 12,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Depth",
Value: 13,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DepthStencil",
Value: 14,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "sRGB",
Value: 15,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "sRGBx",
Value: 16,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "sRGBA",
Value: 17,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "sBGRA",
Value: 18,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ABGR",
Value: 19,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -21702,121 +29253,142 @@
Enumerant{
Enumerant: "SnormInt8",
Value: 0,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SnormInt16",
Value: 1,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormInt8",
Value: 2,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormInt16",
Value: 3,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormShort565",
Value: 4,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormShort555",
Value: 5,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormInt101010",
Value: 6,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SignedInt8",
Value: 7,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SignedInt16",
Value: 8,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SignedInt32",
Value: 9,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnsignedInt8",
Value: 10,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnsignedInt16",
Value: 11,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnsignedInt32",
Value: 12,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "HalfFloat",
Value: 13,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Float",
Value: 14,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormInt24",
Value: 15,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UnormInt101010_2",
Value: 16,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "UnsignedIntRaw10EXT",
+ Value: 19,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "UnsignedIntRaw12EXT",
+ Value: 20,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "UnormInt2_101010EXT",
+ Value: 21,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -21830,28 +29402,168 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RTZ",
Value: 1,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RTP",
Value: 2,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RTN",
Value: 3,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindFPDenormMode = &OperandKind {
+ Kind: "FPDenormMode",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "Preserve",
+ Value: 0,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FlushToZero",
+ Value: 1,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindQuantizationModes = &OperandKind {
+ Kind: "QuantizationModes",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "TRN",
+ Value: 0,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TRN_ZERO",
+ Value: 1,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RND",
+ Value: 2,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RND_ZERO",
+ Value: 3,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RND_INF",
+ Value: 4,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RND_MIN_INF",
+ Value: 5,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RND_CONV",
+ Value: 6,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RND_CONV_ODD",
+ Value: 7,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindFPOperationMode = &OperandKind {
+ Kind: "FPOperationMode",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "IEEE",
+ Value: 0,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ALT",
+ Value: 1,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindOverflowModes = &OperandKind {
+ Kind: "OverflowModes",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "WRAP",
+ Value: 0,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SAT",
+ Value: 1,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SAT_ZERO",
+ Value: 2,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SAT_SYM",
+ Value: 3,
+ Capabilities: []string{"ArbitraryPrecisionFixedPointINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -21865,14 +29577,21 @@
Value: 0,
Capabilities: []string{"Linkage",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Import",
Value: 1,
Capabilities: []string{"Linkage",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "LinkOnceODR",
+ Value: 2,
+ Capabilities: []string{"Linkage",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -21886,21 +29605,56 @@
Value: 0,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WriteOnly",
Value: 1,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ReadWrite",
Value: 2,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindHostAccessQualifier = &OperandKind {
+ Kind: "HostAccessQualifier",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "NoneINTEL",
+ Value: 0,
+ Capabilities: []string{"GlobalVariableHostAccessINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ReadINTEL",
+ Value: 1,
+ Capabilities: []string{"GlobalVariableHostAccessINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "WriteINTEL",
+ Value: 2,
+ Capabilities: []string{"GlobalVariableHostAccessINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ReadWriteINTEL",
+ Value: 3,
+ Capabilities: []string{"GlobalVariableHostAccessINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -21914,56 +29668,63 @@
Value: 0,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Sext",
Value: 1,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ByVal",
Value: 2,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Sret",
Value: 3,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NoAlias",
Value: 4,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NoCapture",
Value: 5,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NoWrite",
Value: 6,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NoReadWrite",
Value: 7,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "RuntimeAlignedINTEL",
+ Value: 5940,
+ Capabilities: []string{"RuntimeAlignedAttributeINTEL",},
+ Parameters: []Parameter{},
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -21977,187 +29738,187 @@
Value: 0,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SpecId",
Value: 1,
Capabilities: []string{"Shader","Kernel",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Specialization Constant ID'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Block",
Value: 2,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "BufferBlock",
Value: 3,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "RowMajor",
Value: 4,
Capabilities: []string{"Matrix",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ColMajor",
Value: 5,
Capabilities: []string{"Matrix",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ArrayStride",
Value: 6,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Array Stride'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MatrixStride",
Value: 7,
Capabilities: []string{"Matrix",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Matrix Stride'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GLSLShared",
Value: 8,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GLSLPacked",
Value: 9,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "CPacked",
Value: 10,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "BuiltIn",
Value: 11,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindBuiltIn, ""},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NoPerspective",
Value: 13,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Flat",
Value: 14,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Patch",
Value: 15,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Centroid",
Value: 16,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Sample",
Value: 17,
Capabilities: []string{"SampleRateShading",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Invariant",
Value: 18,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Restrict",
Value: 19,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Aliased",
Value: 20,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Volatile",
Value: 21,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Constant",
Value: 22,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Coherent",
Value: 23,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NonWritable",
Value: 24,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NonReadable",
Value: 25,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Uniform",
Value: 26,
- Capabilities: []string{"Shader",},
+ Capabilities: []string{"Shader","UniformDecoration",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UniformId",
Value: 27,
- Capabilities: []string{"Shader",},
+ Capabilities: []string{"Shader","UniformDecoration",},
Parameters: []Parameter{{OperandKindIdScope, "'Execution'"},},
Version: "1.4",
},
@@ -22166,119 +29927,119 @@
Value: 28,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Stream",
Value: 29,
Capabilities: []string{"GeometryStreams",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Stream Number'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Location",
Value: 30,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Location'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Component",
Value: 31,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Component'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Index",
Value: 32,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Index'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Binding",
Value: 33,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Binding Point'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DescriptorSet",
Value: 34,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Descriptor Set'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Offset",
Value: 35,
Capabilities: []string{"Shader",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Byte Offset'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "XfbBuffer",
Value: 36,
Capabilities: []string{"TransformFeedback",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'XFB Buffer Number'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "XfbStride",
Value: 37,
Capabilities: []string{"TransformFeedback",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'XFB Stride'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "FuncParamAttr",
Value: 38,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{{OperandKindFunctionParameterAttribute, "'Function Parameter Attribute'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "FPRoundingMode",
Value: 39,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindFPRoundingMode, "'Floating-Point Rounding Mode'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "FPFastMathMode",
Value: 40,
- Capabilities: []string{"Kernel",},
+ Capabilities: []string{"Kernel","FloatControls2",},
Parameters: []Parameter{{OperandKindFPFastMathMode, "'Fast-Math Mode'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "LinkageAttributes",
Value: 41,
Capabilities: []string{"Linkage",},
Parameters: []Parameter{{OperandKindLiteralString, "'Name'"},{OperandKindLinkageType, "'Linkage Type'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NoContraction",
Value: 42,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InputAttachmentIndex",
Value: 43,
Capabilities: []string{"InputAttachment",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Attachment Index'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Alignment",
Value: 44,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{{OperandKindLiteralInteger, "'Alignment'"},},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MaxByteOffset",
@@ -22316,6 +30077,27 @@
Version: "1.4",
},
Enumerant{
+ Enumerant: "WeightTextureQCOM",
+ Value: 4487,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BlockMatchTextureQCOM",
+ Value: 4488,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BlockMatchSamplerQCOM",
+ Value: 4499,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "ExplicitInterpAMD",
Value: 4999,
Capabilities: []string{},
@@ -22323,6 +30105,62 @@
Version: "None",
},
Enumerant{
+ Enumerant: "NodeSharesPayloadLimitsWithAMDX",
+ Value: 5019,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Payload Type'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NodeMaxPayloadsAMDX",
+ Value: 5020,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Max number of payloads'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TrackFinishWritingAMDX",
+ Value: 5078,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PayloadNodeNameAMDX",
+ Value: 5091,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Node Name'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PayloadNodeBaseIndexAMDX",
+ Value: 5098,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Base Index'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PayloadNodeSparseArrayAMDX",
+ Value: 5099,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PayloadNodeArraySizeAMDX",
+ Value: 5100,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Array Size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PayloadDispatchIndirectAMDX",
+ Value: 5105,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "OverrideCoverageNV",
Value: 5248,
Capabilities: []string{"SampleMaskOverrideCoverageNV",},
@@ -22351,9 +30189,9 @@
Version: "None",
},
Enumerant{
- Enumerant: "PerPrimitiveNV",
+ Enumerant: "PerPrimitiveEXT",
Value: 5271,
- Capabilities: []string{"MeshShadingNV",},
+ Capabilities: []string{"MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
Version: "None",
},
@@ -22367,14 +30205,14 @@
Enumerant{
Enumerant: "PerTaskNV",
Value: 5273,
- Capabilities: []string{"MeshShadingNV",},
+ Capabilities: []string{"MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "PerVertexNV",
+ Enumerant: "PerVertexKHR",
Value: 5285,
- Capabilities: []string{"FragmentBarycentricNV",},
+ Capabilities: []string{"FragmentBarycentricKHR",},
Parameters: []Parameter{},
Version: "None",
},
@@ -22386,13 +30224,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "NonUniformEXT",
- Value: 5300,
- Capabilities: []string{"ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "RestrictPointer",
Value: 5355,
Capabilities: []string{"PhysicalStorageBufferAddresses",},
@@ -22400,13 +30231,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "RestrictPointerEXT",
- Value: 5355,
- Capabilities: []string{"PhysicalStorageBufferAddresses",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "AliasedPointer",
Value: 5356,
Capabilities: []string{"PhysicalStorageBufferAddresses",},
@@ -22414,11 +30238,102 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "AliasedPointerEXT",
- Value: 5356,
- Capabilities: []string{"PhysicalStorageBufferAddresses",},
+ Enumerant: "HitObjectShaderRecordBufferNV",
+ Value: 5386,
+ Capabilities: []string{"ShaderInvocationReorderNV",},
Parameters: []Parameter{},
- Version: "1.5",
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BindlessSamplerNV",
+ Value: 5398,
+ Capabilities: []string{"BindlessTextureNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BindlessImageNV",
+ Value: 5399,
+ Capabilities: []string{"BindlessTextureNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BoundSamplerNV",
+ Value: 5400,
+ Capabilities: []string{"BindlessTextureNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BoundImageNV",
+ Value: 5401,
+ Capabilities: []string{"BindlessTextureNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SIMTCallINTEL",
+ Value: 5599,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'N'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ReferencedIndirectlyINTEL",
+ Value: 5602,
+ Capabilities: []string{"IndirectReferencesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ClobberINTEL",
+ Value: 5607,
+ Capabilities: []string{"AsmINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralString, "'Register'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SideEffectsINTEL",
+ Value: 5608,
+ Capabilities: []string{"AsmINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "VectorComputeVariableINTEL",
+ Value: 5624,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FuncParamIOKindINTEL",
+ Value: 5625,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Kind'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "VectorComputeFunctionINTEL",
+ Value: 5626,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StackCallINTEL",
+ Value: 5627,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "GlobalVariableOffsetINTEL",
+ Value: 5628,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Offset'"},},
+ Version: "None",
},
Enumerant{
Enumerant: "CounterBuffer",
@@ -22428,13 +30343,6 @@
Version: "1.4",
},
Enumerant{
- Enumerant: "HlslCounterBufferGOOGLE",
- Value: 5634,
- Capabilities: []string{},
- Parameters: []Parameter{{OperandKindIdRef, "'Counter Buffer'"},},
- Version: "None",
- },
- Enumerant{
Enumerant: "UserSemantic",
Value: 5635,
Capabilities: []string{},
@@ -22442,19 +30350,383 @@
Version: "1.4",
},
Enumerant{
- Enumerant: "HlslSemanticGOOGLE",
- Value: 5635,
- Capabilities: []string{},
- Parameters: []Parameter{{OperandKindLiteralString, "'Semantic'"},},
- Version: "None",
- },
- Enumerant{
Enumerant: "UserTypeGOOGLE",
Value: 5636,
Capabilities: []string{},
Parameters: []Parameter{{OperandKindLiteralString, "'User Type'"},},
Version: "None",
},
+ Enumerant{
+ Enumerant: "FunctionRoundingModeINTEL",
+ Value: 5822,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},{OperandKindFPRoundingMode, "'FP Rounding Mode'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FunctionDenormModeINTEL",
+ Value: 5823,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},{OperandKindFPDenormMode, "'FP Denorm Mode'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RegisterINTEL",
+ Value: 5825,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MemoryINTEL",
+ Value: 5826,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralString, "'Memory Type'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NumbanksINTEL",
+ Value: 5827,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Banks'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BankwidthINTEL",
+ Value: 5828,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Bank Width'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxPrivateCopiesINTEL",
+ Value: 5829,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Maximum Copies'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SinglepumpINTEL",
+ Value: 5830,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DoublepumpINTEL",
+ Value: 5831,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxReplicatesINTEL",
+ Value: 5832,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Maximum Replicates'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SimpleDualPortINTEL",
+ Value: 5833,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MergeINTEL",
+ Value: 5834,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralString, "'Merge Key'"},{OperandKindLiteralString, "'Merge Type'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BankBitsINTEL",
+ Value: 5835,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Bank Bits'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ForcePow2DepthINTEL",
+ Value: 5836,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Force Key'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StridesizeINTEL",
+ Value: 5883,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Stride Size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "WordsizeINTEL",
+ Value: 5884,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Word Size'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TrueDualPortINTEL",
+ Value: 5885,
+ Capabilities: []string{"FPGAMemoryAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BurstCoalesceINTEL",
+ Value: 5899,
+ Capabilities: []string{"FPGAMemoryAccessesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CacheSizeINTEL",
+ Value: 5900,
+ Capabilities: []string{"FPGAMemoryAccessesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Cache Size in bytes'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DontStaticallyCoalesceINTEL",
+ Value: 5901,
+ Capabilities: []string{"FPGAMemoryAccessesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PrefetchINTEL",
+ Value: 5902,
+ Capabilities: []string{"FPGAMemoryAccessesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Prefetcher Size in bytes'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StallEnableINTEL",
+ Value: 5905,
+ Capabilities: []string{"FPGAClusterAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FuseLoopsInFunctionINTEL",
+ Value: 5907,
+ Capabilities: []string{"LoopFuseINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MathOpDSPModeINTEL",
+ Value: 5909,
+ Capabilities: []string{"FPGADSPControlINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Mode'"},{OperandKindLiteralInteger, "'Propagate'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AliasScopeINTEL",
+ Value: 5914,
+ Capabilities: []string{"MemoryAccessAliasingINTEL",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Aliasing Scopes List'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "NoAliasINTEL",
+ Value: 5915,
+ Capabilities: []string{"MemoryAccessAliasingINTEL",},
+ Parameters: []Parameter{{OperandKindIdRef, "'Aliasing Scopes List'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "InitiationIntervalINTEL",
+ Value: 5917,
+ Capabilities: []string{"FPGAInvocationPipeliningAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Cycles'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaxConcurrencyINTEL",
+ Value: 5918,
+ Capabilities: []string{"FPGAInvocationPipeliningAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Invocations'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PipelineEnableINTEL",
+ Value: 5919,
+ Capabilities: []string{"FPGAInvocationPipeliningAttributesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Enable'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BufferLocationINTEL",
+ Value: 5921,
+ Capabilities: []string{"FPGABufferLocationINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Buffer Location ID'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "IOPipeStorageINTEL",
+ Value: 5944,
+ Capabilities: []string{"IOPipesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'IO Pipe ID'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FunctionFloatingPointModeINTEL",
+ Value: 6080,
+ Capabilities: []string{"FunctionFloatControlINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Target Width'"},{OperandKindFPOperationMode, "'FP Operation Mode'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SingleElementVectorINTEL",
+ Value: 6085,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "VectorComputeCallableFunctionINTEL",
+ Value: 6087,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MediaBlockIOINTEL",
+ Value: 6140,
+ Capabilities: []string{"VectorComputeINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StallFreeINTEL",
+ Value: 6151,
+ Capabilities: []string{"FPGAClusterAttributesV2INTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPMaxErrorDecorationINTEL",
+ Value: 6170,
+ Capabilities: []string{"FPMaxErrorINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralFloat, "'Max Error'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "LatencyControlLabelINTEL",
+ Value: 6172,
+ Capabilities: []string{"FPGALatencyControlINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Latency Label'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "LatencyControlConstraintINTEL",
+ Value: 6173,
+ Capabilities: []string{"FPGALatencyControlINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Relative To'"},{OperandKindLiteralInteger, "'Control Type'"},{OperandKindLiteralInteger, "'Relative Cycle'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ConduitKernelArgumentINTEL",
+ Value: 6175,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RegisterMapKernelArgumentINTEL",
+ Value: 6176,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MMHostInterfaceAddressWidthINTEL",
+ Value: 6177,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'AddressWidth'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MMHostInterfaceDataWidthINTEL",
+ Value: 6178,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'DataWidth'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MMHostInterfaceLatencyINTEL",
+ Value: 6179,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Latency'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MMHostInterfaceReadWriteModeINTEL",
+ Value: 6180,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{{OperandKindAccessQualifier, "'ReadWriteMode'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MMHostInterfaceMaxBurstINTEL",
+ Value: 6181,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'MaxBurstCount'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MMHostInterfaceWaitRequestINTEL",
+ Value: 6182,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Waitrequest'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StableKernelArgumentINTEL",
+ Value: 6183,
+ Capabilities: []string{"FPGAArgumentInterfacesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "HostAccessINTEL",
+ Value: 6188,
+ Capabilities: []string{"GlobalVariableHostAccessINTEL",},
+ Parameters: []Parameter{{OperandKindHostAccessQualifier, "'Access'"},{OperandKindLiteralString, "'Name'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "InitModeINTEL",
+ Value: 6190,
+ Capabilities: []string{"GlobalVariableFPGADecorationsINTEL",},
+ Parameters: []Parameter{{OperandKindInitializationModeQualifier, "'Trigger'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ImplementInRegisterMapINTEL",
+ Value: 6191,
+ Capabilities: []string{"GlobalVariableFPGADecorationsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "Value"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CacheControlLoadINTEL",
+ Value: 6442,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Cache Level'"},{OperandKindLoadCacheControl, "'Cache Control'"},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CacheControlStoreINTEL",
+ Value: 6443,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{{OperandKindLiteralInteger, "'Cache Level'"},{OperandKindStoreCacheControl, "'Cache Control'"},},
+ Version: "None",
+ },
},
Bases: []*OperandKind {},
}
@@ -22467,287 +30739,322 @@
Value: 0,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PointSize",
Value: 1,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ClipDistance",
Value: 3,
Capabilities: []string{"ClipDistance",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "CullDistance",
Value: 4,
Capabilities: []string{"CullDistance",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "VertexId",
Value: 5,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InstanceId",
Value: 6,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PrimitiveId",
Value: 7,
- Capabilities: []string{"Geometry","Tessellation","RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"Geometry","Tessellation","RayTracingNV","RayTracingKHR","MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InvocationId",
Value: 8,
Capabilities: []string{"Geometry","Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Layer",
Value: 9,
- Capabilities: []string{"Geometry","ShaderLayer","ShaderViewportIndexLayerEXT",},
+ Capabilities: []string{"Geometry","ShaderLayer","ShaderViewportIndexLayerEXT","MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ViewportIndex",
Value: 10,
- Capabilities: []string{"MultiViewport","ShaderViewportIndex","ShaderViewportIndexLayerEXT",},
+ Capabilities: []string{"MultiViewport","ShaderViewportIndex","ShaderViewportIndexLayerEXT","MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TessLevelOuter",
Value: 11,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TessLevelInner",
Value: 12,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TessCoord",
Value: 13,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PatchVertices",
Value: 14,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "FragCoord",
Value: 15,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "PointCoord",
Value: 16,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "FrontFacing",
Value: 17,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampleId",
Value: 18,
Capabilities: []string{"SampleRateShading",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SamplePosition",
Value: 19,
Capabilities: []string{"SampleRateShading",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampleMask",
Value: 20,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "FragDepth",
Value: 22,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "HelperInvocation",
Value: 23,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NumWorkgroups",
Value: 24,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WorkgroupSize",
Value: 25,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WorkgroupId",
Value: 26,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "LocalInvocationId",
Value: 27,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GlobalInvocationId",
Value: 28,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "LocalInvocationIndex",
Value: 29,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WorkDim",
Value: 30,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GlobalSize",
Value: 31,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "EnqueuedWorkgroupSize",
Value: 32,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GlobalOffset",
Value: 33,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GlobalLinearId",
Value: 34,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupSize",
Value: 36,
Capabilities: []string{"Kernel","GroupNonUniform","SubgroupBallotKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupMaxSize",
Value: 37,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NumSubgroups",
Value: 38,
Capabilities: []string{"Kernel","GroupNonUniform",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "NumEnqueuedSubgroups",
Value: 39,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupId",
Value: 40,
Capabilities: []string{"Kernel","GroupNonUniform",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupLocalInvocationId",
Value: 41,
Capabilities: []string{"Kernel","GroupNonUniform","SubgroupBallotKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "VertexIndex",
Value: 42,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InstanceIndex",
Value: 43,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "CoreIDARM",
+ Value: 4160,
+ Capabilities: []string{"CoreBuiltinsARM",},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "CoreCountARM",
+ Value: 4161,
+ Capabilities: []string{"CoreBuiltinsARM",},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "CoreMaxIDARM",
+ Value: 4162,
+ Capabilities: []string{"CoreBuiltinsARM",},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "WarpIDARM",
+ Value: 4163,
+ Capabilities: []string{"CoreBuiltinsARM",},
+ Parameters: []Parameter{},
+ Version: "1.0",
+ },
+ Enumerant{
+ Enumerant: "WarpMaxIDARM",
+ Value: 4164,
+ Capabilities: []string{"CoreBuiltinsARM",},
+ Parameters: []Parameter{},
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupEqMask",
@@ -22785,41 +31092,6 @@
Version: "1.3",
},
Enumerant{
- Enumerant: "SubgroupEqMaskKHR",
- Value: 4416,
- Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
- Enumerant: "SubgroupGeMaskKHR",
- Value: 4417,
- Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
- Enumerant: "SubgroupGtMaskKHR",
- Value: 4418,
- Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
- Enumerant: "SubgroupLeMaskKHR",
- Value: 4419,
- Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
- Enumerant: "SubgroupLtMaskKHR",
- Value: 4420,
- Capabilities: []string{"SubgroupBallotKHR","GroupNonUniformBallot",},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
Enumerant: "BaseVertex",
Value: 4424,
Capabilities: []string{"DrawParameters",},
@@ -22836,11 +31108,18 @@
Enumerant{
Enumerant: "DrawIndex",
Value: 4426,
- Capabilities: []string{"DrawParameters","MeshShadingNV",},
+ Capabilities: []string{"DrawParameters","MeshShadingNV","MeshShadingEXT",},
Parameters: []Parameter{},
Version: "1.3",
},
Enumerant{
+ Enumerant: "PrimitiveShadingRateKHR",
+ Value: 4432,
+ Capabilities: []string{"FragmentShadingRateKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "DeviceIndex",
Value: 4438,
Capabilities: []string{"DeviceGroup",},
@@ -22855,6 +31134,13 @@
Version: "1.3",
},
Enumerant{
+ Enumerant: "ShadingRateKHR",
+ Value: 4444,
+ Capabilities: []string{"FragmentShadingRateKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "BaryCoordNoPerspAMD",
Value: 4992,
Capabilities: []string{},
@@ -22911,6 +31197,20 @@
Version: "None",
},
Enumerant{
+ Enumerant: "RemainingRecursionLevelsAMDX",
+ Value: 5021,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ShaderIndexAMDX",
+ Value: 5073,
+ Capabilities: []string{"ShaderEnqueueAMDX",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "ViewportMaskNV",
Value: 5253,
Capabilities: []string{"ShaderViewportMaskNV","MeshShadingNV",},
@@ -23009,247 +31309,191 @@
Version: "None",
},
Enumerant{
- Enumerant: "BaryCoordNV",
+ Enumerant: "BaryCoordKHR",
Value: 5286,
- Capabilities: []string{"FragmentBarycentricNV",},
+ Capabilities: []string{"FragmentBarycentricKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "BaryCoordNoPerspNV",
+ Enumerant: "BaryCoordNoPerspKHR",
Value: 5287,
- Capabilities: []string{"FragmentBarycentricNV",},
+ Capabilities: []string{"FragmentBarycentricKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "FragSizeEXT",
Value: 5292,
- Capabilities: []string{"FragmentDensityEXT","ShadingRateNV",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "FragmentSizeNV",
- Value: 5292,
- Capabilities: []string{"ShadingRateNV","FragmentDensityEXT",},
+ Capabilities: []string{"FragmentDensityEXT",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "FragInvocationCountEXT",
Value: 5293,
- Capabilities: []string{"FragmentDensityEXT","ShadingRateNV",},
+ Capabilities: []string{"FragmentDensityEXT",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "InvocationsPerPixelNV",
- Value: 5293,
- Capabilities: []string{"ShadingRateNV","FragmentDensityEXT",},
+ Enumerant: "PrimitivePointIndicesEXT",
+ Value: 5294,
+ Capabilities: []string{"MeshShadingEXT",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "LaunchIdNV",
- Value: 5319,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Enumerant: "PrimitiveLineIndicesEXT",
+ Value: 5295,
+ Capabilities: []string{"MeshShadingEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "PrimitiveTriangleIndicesEXT",
+ Value: 5296,
+ Capabilities: []string{"MeshShadingEXT",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CullPrimitiveEXT",
+ Value: 5299,
+ Capabilities: []string{"MeshShadingEXT",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "LaunchIdKHR",
Value: 5319,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "LaunchSizeNV",
- Value: 5320,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "LaunchSizeKHR",
Value: 5320,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "WorldRayOriginNV",
- Value: 5321,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "WorldRayOriginKHR",
Value: 5321,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "WorldRayDirectionNV",
- Value: 5322,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "WorldRayDirectionKHR",
Value: 5322,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "ObjectRayOriginNV",
- Value: 5323,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "ObjectRayOriginKHR",
Value: 5323,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "ObjectRayDirectionNV",
- Value: 5324,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "ObjectRayDirectionKHR",
Value: 5324,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "RayTminNV",
- Value: 5325,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "RayTminKHR",
Value: 5325,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "RayTmaxNV",
- Value: 5326,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "RayTmaxKHR",
Value: 5326,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "InstanceCustomIndexNV",
- Value: 5327,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "InstanceCustomIndexKHR",
Value: 5327,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "ObjectToWorldNV",
- Value: 5330,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "ObjectToWorldKHR",
Value: 5330,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "WorldToObjectNV",
- Value: 5331,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "WorldToObjectKHR",
Value: 5331,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "HitTNV",
Value: 5332,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "HitTKHR",
- Value: 5332,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "HitKindNV",
- Value: 5333,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "HitKindKHR",
Value: 5333,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "IncomingRayFlagsNV",
- Value: 5351,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Enumerant: "CurrentRayTimeNV",
+ Value: 5334,
+ Capabilities: []string{"RayTracingMotionBlurNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "HitTriangleVertexPositionsKHR",
+ Value: 5335,
+ Capabilities: []string{"RayTracingPositionFetchKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "HitMicroTriangleVertexPositionsNV",
+ Value: 5337,
+ Capabilities: []string{"RayTracingDisplacementMicromapNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "HitMicroTriangleVertexBarycentricsNV",
+ Value: 5344,
+ Capabilities: []string{"RayTracingDisplacementMicromapNV",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "IncomingRayFlagsKHR",
Value: 5351,
- Capabilities: []string{"RayTracingNV","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingNV","RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
Enumerant: "RayGeometryIndexKHR",
Value: 5352,
- Capabilities: []string{"RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingKHR",},
Parameters: []Parameter{},
Version: "None",
},
@@ -23281,6 +31525,27 @@
Parameters: []Parameter{},
Version: "None",
},
+ Enumerant{
+ Enumerant: "HitKindFrontFacingMicroTriangleNV",
+ Value: 5405,
+ Capabilities: []string{"RayTracingDisplacementMicromapNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "HitKindBackFacingMicroTriangleNV",
+ Value: 5406,
+ Capabilities: []string{"RayTracingDisplacementMicromapNV",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CullMaskKHR",
+ Value: 6021,
+ Capabilities: []string{"RayCullMaskKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
},
Bases: []*OperandKind {},
}
@@ -23293,35 +31558,35 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Device",
Value: 1,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Workgroup",
Value: 2,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Subgroup",
Value: 3,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Invocation",
Value: 4,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "QueueFamily",
@@ -23331,18 +31596,11 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "QueueFamilyKHR",
- Value: 5,
- Capabilities: []string{"VulkanMemoryModel",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "ShaderCallKHR",
Value: 6,
- Capabilities: []string{"RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayTracingKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -23356,21 +31614,21 @@
Value: 0,
Capabilities: []string{"Kernel","GroupNonUniformArithmetic","GroupNonUniformBallot",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InclusiveScan",
Value: 1,
Capabilities: []string{"Kernel","GroupNonUniformArithmetic","GroupNonUniformBallot",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ExclusiveScan",
Value: 2,
Capabilities: []string{"Kernel","GroupNonUniformArithmetic","GroupNonUniformBallot",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ClusteredReduce",
@@ -23412,21 +31670,21 @@
Value: 0,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WaitKernel",
Value: 1,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "WaitWorkGroup",
Value: 2,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
},
Bases: []*OperandKind {},
@@ -23440,392 +31698,392 @@
Value: 0,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Shader",
Value: 1,
Capabilities: []string{"Matrix",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Geometry",
Value: 2,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Tessellation",
Value: 3,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Addresses",
Value: 4,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Linkage",
Value: 5,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Kernel",
Value: 6,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Vector16",
Value: 7,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Float16Buffer",
Value: 8,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Float16",
Value: 9,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Float64",
Value: 10,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Int64",
Value: 11,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Int64Atomics",
Value: 12,
Capabilities: []string{"Int64",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageBasic",
Value: 13,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageReadWrite",
Value: 14,
Capabilities: []string{"ImageBasic",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageMipmap",
Value: 15,
Capabilities: []string{"ImageBasic",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Pipes",
Value: 17,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Groups",
Value: 18,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DeviceEnqueue",
Value: 19,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "LiteralSampler",
Value: 20,
Capabilities: []string{"Kernel",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "AtomicStorage",
Value: 21,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Int16",
Value: 22,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TessellationPointSize",
Value: 23,
Capabilities: []string{"Tessellation",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GeometryPointSize",
Value: 24,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageGatherExtended",
Value: 25,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageImageMultisample",
Value: 27,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "UniformBufferArrayDynamicIndexing",
Value: 28,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampledImageArrayDynamicIndexing",
Value: 29,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageBufferArrayDynamicIndexing",
Value: 30,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageImageArrayDynamicIndexing",
Value: 31,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ClipDistance",
Value: 32,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "CullDistance",
Value: 33,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageCubeArray",
Value: 34,
Capabilities: []string{"SampledCubeArray",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampleRateShading",
Value: 35,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageRect",
Value: 36,
Capabilities: []string{"SampledRect",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampledRect",
Value: 37,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GenericPointer",
Value: 38,
Capabilities: []string{"Addresses",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Int8",
Value: 39,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InputAttachment",
Value: 40,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SparseResidency",
Value: 41,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MinLod",
Value: 42,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Sampled1D",
Value: 43,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "Image1D",
Value: 44,
Capabilities: []string{"Sampled1D",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampledCubeArray",
Value: 45,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SampledBuffer",
Value: 46,
Capabilities: []string{},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageBuffer",
Value: 47,
Capabilities: []string{"SampledBuffer",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageMSArray",
Value: 48,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageImageExtendedFormats",
Value: 49,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "ImageQuery",
Value: 50,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "DerivativeControl",
Value: 51,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "InterpolationFunction",
Value: 52,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "TransformFeedback",
Value: 53,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "GeometryStreams",
Value: 54,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageImageReadWithoutFormat",
Value: 55,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "StorageImageWriteWithoutFormat",
Value: 56,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "MultiViewport",
Value: 57,
Capabilities: []string{"Geometry",},
Parameters: []Parameter{},
- Version: "",
+ Version: "1.0",
},
Enumerant{
Enumerant: "SubgroupDispatch",
@@ -23919,6 +32177,55 @@
Version: "1.5",
},
Enumerant{
+ Enumerant: "UniformDecoration",
+ Value: 71,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "CoreBuiltinsARM",
+ Value: 4165,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TileImageColorReadAccessEXT",
+ Value: 4166,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TileImageDepthReadAccessEXT",
+ Value: 4167,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TileImageStencilReadAccessEXT",
+ Value: 4168,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixLayoutsARM",
+ Value: 4201,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FragmentShadingRateKHR",
+ Value: 4422,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "SubgroupBallotKHR",
Value: 4423,
Capabilities: []string{},
@@ -23933,6 +32240,27 @@
Version: "1.3",
},
Enumerant{
+ Enumerant: "WorkgroupMemoryExplicitLayoutKHR",
+ Value: 4428,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "WorkgroupMemoryExplicitLayout8BitAccessKHR",
+ Value: 4429,
+ Capabilities: []string{"WorkgroupMemoryExplicitLayoutKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "WorkgroupMemoryExplicitLayout16BitAccessKHR",
+ Value: 4430,
+ Capabilities: []string{"WorkgroupMemoryExplicitLayoutKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "SubgroupVoteKHR",
Value: 4431,
Capabilities: []string{},
@@ -23947,23 +32275,9 @@
Version: "1.3",
},
Enumerant{
- Enumerant: "StorageUniformBufferBlock16",
- Value: 4433,
- Capabilities: []string{},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
Enumerant: "UniformAndStorageBuffer16BitAccess",
Value: 4434,
- Capabilities: []string{"StorageBuffer16BitAccess","StorageUniformBufferBlock16",},
- Parameters: []Parameter{},
- Version: "1.3",
- },
- Enumerant{
- Enumerant: "StorageUniform16",
- Value: 4434,
- Capabilities: []string{"StorageBuffer16BitAccess","StorageUniformBufferBlock16",},
+ Capabilities: []string{"StorageBuffer16BitAccess",},
Parameters: []Parameter{},
Version: "1.3",
},
@@ -24087,9 +32401,58 @@
Version: "None",
},
Enumerant{
- Enumerant: "RayTraversalPrimitiveCullingProvisionalKHR",
+ Enumerant: "RayQueryKHR",
+ Value: 4472,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "UntypedPointersKHR",
+ Value: 4473,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RayTraversalPrimitiveCullingKHR",
Value: 4478,
- Capabilities: []string{"RayQueryProvisionalKHR","RayTracingProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RayTracingKHR",
+ Value: 4479,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TextureSampleWeightedQCOM",
+ Value: 4484,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TextureBoxFilterQCOM",
+ Value: 4485,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TextureBlockMatchQCOM",
+ Value: 4486,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TextureBlockMatch2QCOM",
+ Value: 4498,
+ Capabilities: []string{},
Parameters: []Parameter{},
Version: "None",
},
@@ -24129,13 +32492,34 @@
Version: "None",
},
Enumerant{
+ Enumerant: "Int64ImageEXT",
+ Value: 5016,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "ShaderClockKHR",
Value: 5055,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ShaderEnqueueAMDX",
+ Value: 5067,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
+ Enumerant: "QuadControlKHR",
+ Value: 5087,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "SampleMaskOverrideCoverageNV",
Value: 5249,
Capabilities: []string{"SampleRateShading",},
@@ -24157,16 +32541,9 @@
Version: "None",
},
Enumerant{
- Enumerant: "ShaderViewportIndexLayerNV",
- Value: 5254,
- Capabilities: []string{"MultiViewport",},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
Enumerant: "ShaderViewportMaskNV",
Value: 5255,
- Capabilities: []string{"ShaderViewportIndexLayerNV",},
+ Capabilities: []string{"ShaderViewportIndexLayerEXT",},
Parameters: []Parameter{},
Version: "None",
},
@@ -24206,28 +32583,28 @@
Version: "None",
},
Enumerant{
- Enumerant: "FragmentBarycentricNV",
+ Enumerant: "MeshShadingEXT",
+ Value: 5283,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FragmentBarycentricKHR",
Value: 5284,
Capabilities: []string{},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "ComputeDerivativeGroupQuadsNV",
+ Enumerant: "ComputeDerivativeGroupQuadsKHR",
Value: 5288,
- Capabilities: []string{},
- Parameters: []Parameter{},
- Version: "None",
- },
- Enumerant{
- Enumerant: "FragmentDensityEXT",
- Value: 5291,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
Version: "None",
},
Enumerant{
- Enumerant: "ShadingRateNV",
+ Enumerant: "FragmentDensityEXT",
Value: 5291,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
@@ -24248,13 +32625,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "ShaderNonUniformEXT",
- Value: 5301,
- Capabilities: []string{"Shader",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "RuntimeDescriptorArray",
Value: 5302,
Capabilities: []string{"Shader",},
@@ -24262,13 +32632,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "RuntimeDescriptorArrayEXT",
- Value: 5302,
- Capabilities: []string{"Shader",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "InputAttachmentArrayDynamicIndexing",
Value: 5303,
Capabilities: []string{"InputAttachment",},
@@ -24276,13 +32639,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "InputAttachmentArrayDynamicIndexingEXT",
- Value: 5303,
- Capabilities: []string{"InputAttachment",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "UniformTexelBufferArrayDynamicIndexing",
Value: 5304,
Capabilities: []string{"SampledBuffer",},
@@ -24290,13 +32646,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "UniformTexelBufferArrayDynamicIndexingEXT",
- Value: 5304,
- Capabilities: []string{"SampledBuffer",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "StorageTexelBufferArrayDynamicIndexing",
Value: 5305,
Capabilities: []string{"ImageBuffer",},
@@ -24304,13 +32653,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "StorageTexelBufferArrayDynamicIndexingEXT",
- Value: 5305,
- Capabilities: []string{"ImageBuffer",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "UniformBufferArrayNonUniformIndexing",
Value: 5306,
Capabilities: []string{"ShaderNonUniform",},
@@ -24318,13 +32660,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "UniformBufferArrayNonUniformIndexingEXT",
- Value: 5306,
- Capabilities: []string{"ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "SampledImageArrayNonUniformIndexing",
Value: 5307,
Capabilities: []string{"ShaderNonUniform",},
@@ -24332,13 +32667,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "SampledImageArrayNonUniformIndexingEXT",
- Value: 5307,
- Capabilities: []string{"ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "StorageBufferArrayNonUniformIndexing",
Value: 5308,
Capabilities: []string{"ShaderNonUniform",},
@@ -24346,13 +32674,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "StorageBufferArrayNonUniformIndexingEXT",
- Value: 5308,
- Capabilities: []string{"ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "StorageImageArrayNonUniformIndexing",
Value: 5309,
Capabilities: []string{"ShaderNonUniform",},
@@ -24360,13 +32681,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "StorageImageArrayNonUniformIndexingEXT",
- Value: 5309,
- Capabilities: []string{"ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "InputAttachmentArrayNonUniformIndexing",
Value: 5310,
Capabilities: []string{"InputAttachment","ShaderNonUniform",},
@@ -24374,13 +32688,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "InputAttachmentArrayNonUniformIndexingEXT",
- Value: 5310,
- Capabilities: []string{"InputAttachment","ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "UniformTexelBufferArrayNonUniformIndexing",
Value: 5311,
Capabilities: []string{"SampledBuffer","ShaderNonUniform",},
@@ -24388,13 +32695,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "UniformTexelBufferArrayNonUniformIndexingEXT",
- Value: 5311,
- Capabilities: []string{"SampledBuffer","ShaderNonUniform",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "StorageTexelBufferArrayNonUniformIndexing",
Value: 5312,
Capabilities: []string{"ImageBuffer","ShaderNonUniform",},
@@ -24402,11 +32702,11 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "StorageTexelBufferArrayNonUniformIndexingEXT",
- Value: 5312,
- Capabilities: []string{"ImageBuffer","ShaderNonUniform",},
+ Enumerant: "RayTracingPositionFetchKHR",
+ Value: 5336,
+ Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "1.5",
+ Version: "None",
},
Enumerant{
Enumerant: "RayTracingNV",
@@ -24416,14 +32716,14 @@
Version: "None",
},
Enumerant{
- Enumerant: "VulkanMemoryModel",
- Value: 5345,
- Capabilities: []string{},
+ Enumerant: "RayTracingMotionBlurNV",
+ Value: 5341,
+ Capabilities: []string{"Shader",},
Parameters: []Parameter{},
- Version: "1.5",
+ Version: "None",
},
Enumerant{
- Enumerant: "VulkanMemoryModelKHR",
+ Enumerant: "VulkanMemoryModel",
Value: 5345,
Capabilities: []string{},
Parameters: []Parameter{},
@@ -24437,13 +32737,6 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "VulkanMemoryModelDeviceScopeKHR",
- Value: 5346,
- Capabilities: []string{},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
Enumerant: "PhysicalStorageBufferAddresses",
Value: 5347,
Capabilities: []string{"Shader",},
@@ -24451,16 +32744,9 @@
Version: "1.5",
},
Enumerant{
- Enumerant: "PhysicalStorageBufferAddressesEXT",
- Value: 5347,
- Capabilities: []string{"Shader",},
- Parameters: []Parameter{},
- Version: "1.5",
- },
- Enumerant{
- Enumerant: "ComputeDerivativeGroupLinearNV",
+ Enumerant: "ComputeDerivativeGroupLinearKHR",
Value: 5350,
- Capabilities: []string{},
+ Capabilities: []string{"Shader",},
Parameters: []Parameter{},
Version: "None",
},
@@ -24507,10 +32793,108 @@
Version: "None",
},
Enumerant{
- Enumerant: "DemoteToHelperInvocationEXT",
+ Enumerant: "DemoteToHelperInvocation",
Value: 5379,
Capabilities: []string{"Shader",},
Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "DisplacementMicromapNV",
+ Value: 5380,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RayTracingOpacityMicromapEXT",
+ Value: 5381,
+ Capabilities: []string{"RayQueryKHR","RayTracingKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ShaderInvocationReorderNV",
+ Value: 5383,
+ Capabilities: []string{"RayTracingKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BindlessTextureNV",
+ Value: 5390,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RayQueryPositionFetchKHR",
+ Value: 5391,
+ Capabilities: []string{"Shader",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat16VectorNV",
+ Value: 5404,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RayTracingDisplacementMicromapNV",
+ Value: 5409,
+ Capabilities: []string{"RayTracingKHR",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RawAccessChainsNV",
+ Value: 5414,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixReductionsNV",
+ Value: 5430,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixConversionsNV",
+ Value: 5431,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixPerElementOperationsNV",
+ Value: 5432,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixTensorAddressingNV",
+ Value: 5433,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixBlockLoadsNV",
+ Value: 5434,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TensorAddressingNV",
+ Value: 5439,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
Version: "None",
},
Enumerant{
@@ -24542,6 +32926,20 @@
Version: "None",
},
Enumerant{
+ Enumerant: "RoundToInfinityINTEL",
+ Value: 5582,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FloatingPointModeINTEL",
+ Value: 5583,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "IntegerFunctions2INTEL",
Value: 5584,
Capabilities: []string{"Shader",},
@@ -24549,6 +32947,69 @@
Version: "None",
},
Enumerant{
+ Enumerant: "FunctionPointersINTEL",
+ Value: 5603,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "IndirectReferencesINTEL",
+ Value: 5604,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AsmINTEL",
+ Value: 5606,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat32MinMaxEXT",
+ Value: 5612,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat64MinMaxEXT",
+ Value: 5613,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat16MinMaxEXT",
+ Value: 5616,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "VectorComputeINTEL",
+ Value: 5617,
+ Capabilities: []string{"VectorAnyINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "VectorAnyINTEL",
+ Value: 5619,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ExpectAssumeKHR",
+ Value: 5629,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
Enumerant: "SubgroupAvcMotionEstimationINTEL",
Value: 5696,
Capabilities: []string{},
@@ -24569,6 +33030,384 @@
Parameters: []Parameter{},
Version: "None",
},
+ Enumerant{
+ Enumerant: "VariableLengthArrayINTEL",
+ Value: 5817,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FunctionFloatControlINTEL",
+ Value: 5821,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAMemoryAttributesINTEL",
+ Value: 5824,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPFastMathModeINTEL",
+ Value: 5837,
+ Capabilities: []string{"Kernel",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ArbitraryPrecisionIntegersINTEL",
+ Value: 5844,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ArbitraryPrecisionFloatingPointINTEL",
+ Value: 5845,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "UnstructuredLoopControlsINTEL",
+ Value: 5886,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGALoopControlsINTEL",
+ Value: 5888,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "KernelAttributesINTEL",
+ Value: 5892,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAKernelAttributesINTEL",
+ Value: 5897,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAMemoryAccessesINTEL",
+ Value: 5898,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAClusterAttributesINTEL",
+ Value: 5904,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "LoopFuseINTEL",
+ Value: 5906,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGADSPControlINTEL",
+ Value: 5908,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MemoryAccessAliasingINTEL",
+ Value: 5910,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAInvocationPipeliningAttributesINTEL",
+ Value: 5916,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGABufferLocationINTEL",
+ Value: 5920,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ArbitraryPrecisionFixedPointINTEL",
+ Value: 5922,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "USMStorageClassesINTEL",
+ Value: 5935,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RuntimeAlignedAttributeINTEL",
+ Value: 5939,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "IOPipesINTEL",
+ Value: 5943,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BlockingPipesINTEL",
+ Value: 5945,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGARegINTEL",
+ Value: 5948,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DotProductInputAll",
+ Value: 6016,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "DotProductInput4x8Bit",
+ Value: 6017,
+ Capabilities: []string{"Int8",},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "DotProductInput4x8BitPacked",
+ Value: 6018,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "DotProduct",
+ Value: 6019,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ Enumerant{
+ Enumerant: "RayCullMaskKHR",
+ Value: 6020,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CooperativeMatrixKHR",
+ Value: 6022,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ReplicatedCompositesEXT",
+ Value: 6024,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BitInstructions",
+ Value: 6025,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "GroupNonUniformRotateKHR",
+ Value: 6026,
+ Capabilities: []string{"GroupNonUniform",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FloatControls2",
+ Value: 6029,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat32AddEXT",
+ Value: 6033,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat64AddEXT",
+ Value: 6034,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "LongCompositesINTEL",
+ Value: 6089,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "OptNoneEXT",
+ Value: 6094,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "AtomicFloat16AddEXT",
+ Value: 6095,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DebugInfoModuleINTEL",
+ Value: 6114,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "BFloat16ConversionINTEL",
+ Value: 6115,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SplitBarrierINTEL",
+ Value: 6141,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ArithmeticFenceEXT",
+ Value: 6144,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAClusterAttributesV2INTEL",
+ Value: 6150,
+ Capabilities: []string{"FPGAClusterAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAKernelAttributesv2INTEL",
+ Value: 6161,
+ Capabilities: []string{"FPGAKernelAttributesINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPMaxErrorINTEL",
+ Value: 6169,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGALatencyControlINTEL",
+ Value: 6171,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "FPGAArgumentInterfacesINTEL",
+ Value: 6174,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "GlobalVariableHostAccessINTEL",
+ Value: 6187,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "GlobalVariableFPGADecorationsINTEL",
+ Value: 6189,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SubgroupBufferPrefetchINTEL",
+ Value: 6220,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "GroupUniformArithmeticKHR",
+ Value: 6400,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MaskedGatherScatterINTEL",
+ Value: 6427,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CacheControlsINTEL",
+ Value: 6441,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RegisterLimitsINTEL",
+ Value: 6460,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
},
Bases: []*OperandKind {},
}
@@ -24579,16 +33418,16 @@
Enumerant{
Enumerant: "RayQueryCandidateIntersectionKHR",
Value: 0,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "RayQueryCommittedIntersectionKHR",
Value: 1,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -24600,23 +33439,23 @@
Enumerant{
Enumerant: "RayQueryCommittedIntersectionNoneKHR",
Value: 0,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "RayQueryCommittedIntersectionTriangleKHR",
Value: 1,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "RayQueryCommittedIntersectionGeneratedKHR",
Value: 2,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
},
Bases: []*OperandKind {},
@@ -24628,20 +33467,363 @@
Enumerant{
Enumerant: "RayQueryCandidateIntersectionTriangleKHR",
Value: 0,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
Enumerant{
Enumerant: "RayQueryCandidateIntersectionAABBKHR",
Value: 1,
- Capabilities: []string{"RayQueryProvisionalKHR",},
+ Capabilities: []string{"RayQueryKHR",},
Parameters: []Parameter{},
- Version: "",
+ Version: "None",
},
},
Bases: []*OperandKind {},
}
+ OperandKindPackedVectorFormat = &OperandKind {
+ Kind: "PackedVectorFormat",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "PackedVectorFormat4x8Bit",
+ Value: 0,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "1.6",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindCooperativeMatrixOperands = &OperandKind {
+ Kind: "CooperativeMatrixOperands",
+ Category: "BitEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "NoneKHR",
+ Value: 0x0000,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MatrixASignedComponentsKHR",
+ Value: 0x0001,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MatrixBSignedComponentsKHR",
+ Value: 0x0002,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MatrixCSignedComponentsKHR",
+ Value: 0x0004,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MatrixResultSignedComponentsKHR",
+ Value: 0x0008,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "SaturatingAccumulationKHR",
+ Value: 0x0010,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindCooperativeMatrixLayout = &OperandKind {
+ Kind: "CooperativeMatrixLayout",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "RowMajorKHR",
+ Value: 0,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ColumnMajorKHR",
+ Value: 1,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RowBlockedInterleavedARM",
+ Value: 4202,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ColumnBlockedInterleavedARM",
+ Value: 4203,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindCooperativeMatrixUse = &OperandKind {
+ Kind: "CooperativeMatrixUse",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "MatrixAKHR",
+ Value: 0,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MatrixBKHR",
+ Value: 1,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "MatrixAccumulatorKHR",
+ Value: 2,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindCooperativeMatrixReduce = &OperandKind {
+ Kind: "CooperativeMatrixReduce",
+ Category: "BitEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "Row",
+ Value: 0x0001,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "Column",
+ Value: 0x0002,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "2x2",
+ Value: 0x0004,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindTensorClampMode = &OperandKind {
+ Kind: "TensorClampMode",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "Undefined",
+ Value: 0,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "Constant",
+ Value: 1,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ClampToEdge",
+ Value: 2,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "Repeat",
+ Value: 3,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "RepeatMirrored",
+ Value: 4,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindTensorAddressingOperands = &OperandKind {
+ Kind: "TensorAddressingOperands",
+ Category: "BitEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "None",
+ Value: 0x0000,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "TensorView",
+ Value: 0x0001,
+ Capabilities: []string{"CooperativeMatrixTensorAddressingNV",},
+ Parameters: []Parameter{{OperandKindIdRef, ""},},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "DecodeFunc",
+ Value: 0x0002,
+ Capabilities: []string{"CooperativeMatrixBlockLoadsNV",},
+ Parameters: []Parameter{{OperandKindIdRef, ""},},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindInitializationModeQualifier = &OperandKind {
+ Kind: "InitializationModeQualifier",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "InitOnDeviceReprogramINTEL",
+ Value: 0,
+ Capabilities: []string{"GlobalVariableFPGADecorationsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "InitOnDeviceResetINTEL",
+ Value: 1,
+ Capabilities: []string{"GlobalVariableFPGADecorationsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindLoadCacheControl = &OperandKind {
+ Kind: "LoadCacheControl",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "UncachedINTEL",
+ Value: 0,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "CachedINTEL",
+ Value: 1,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StreamingINTEL",
+ Value: 2,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "InvalidateAfterReadINTEL",
+ Value: 3,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "ConstCachedINTEL",
+ Value: 4,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindStoreCacheControl = &OperandKind {
+ Kind: "StoreCacheControl",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "UncachedINTEL",
+ Value: 0,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "WriteThroughINTEL",
+ Value: 1,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "WriteBackINTEL",
+ Value: 2,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ Enumerant{
+ Enumerant: "StreamingINTEL",
+ Value: 3,
+ Capabilities: []string{"CacheControlsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindNamedMaximumNumberOfRegisters = &OperandKind {
+ Kind: "NamedMaximumNumberOfRegisters",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ Enumerant{
+ Enumerant: "AutoINTEL",
+ Value: 0,
+ Capabilities: []string{"RegisterLimitsINTEL",},
+ Parameters: []Parameter{},
+ Version: "None",
+ },
+ },
+ Bases: []*OperandKind {},
+ }
+ OperandKindFPEncoding = &OperandKind {
+ Kind: "FPEncoding",
+ Category: "ValueEnum",
+ Enumerants: []Enumerant {
+ },
+ Bases: []*OperandKind {},
+ }
OperandKindIdResultType = &OperandKind {
Kind: "IdResultType",
Category: "Id",
@@ -24691,6 +33873,13 @@
},
Bases: []*OperandKind {},
}
+ OperandKindLiteralFloat = &OperandKind {
+ Kind: "LiteralFloat",
+ Category: "Literal",
+ Enumerants: []Enumerant {
+ },
+ Bases: []*OperandKind {},
+ }
OperandKindLiteralContextDependentNumber = &OperandKind {
Kind: "LiteralContextDependentNumber",
Category: "Literal",
@@ -24738,6 +33927,13 @@
Category: "BitEnum",
Enumerants: []Enumerant {
Enumerant{
+ Enumerant: "None",
+ Value: 0x0000,
+ Capabilities: []string{},
+ Parameters: []Parameter{},
+ Version: "",
+ },
+ Enumerant{
Enumerant: "FlagIsProtected",
Value: 0x01,
Capabilities: []string{},