diff options
author | alan-baker <alanbaker@google.com> | 2019-09-13 14:59:02 -0400 |
---|---|---|
committer | David Neto <dneto@google.com> | 2019-09-13 14:59:02 -0400 |
commit | 5a48c0da15628d69b176f152fcddb1d67661f61e (patch) | |
tree | 6c6da36c76b5cdeeb5f806710ff1aaae34b905f7 | |
parent | ad7f2c5c4c7f51360e9e079109a9217aa5ba5cc0 (diff) | |
download | SPIRV-Tools-5a48c0da15628d69b176f152fcddb1d67661f61e.tar.gz |
SPIRV-Tools support for SPIR-V 1.5 (#2865)
* Ensure same enum values have consistent extension lists
* val: fix checking of capabilities
The operand for an OpCapability should only be
checked for the extension or core version.
The InstructionPass registers a capability, and all its implied
sub-capabilities before actually checking the operand to an
OpCapability.
* Add basic support for SPIR-V 1.5
- Adds SPV_ENV_UNIVERSAL_1_5
- Command line tools default to spv1.5 environment
- SPIR-V 1.5 incorporates several extensions. Now the disassembler
prefers outputing the non-EXT or non-KHR names. This requires
updates to many tests, to make strings match again.
- Command line tests: Expect SPIR-V 1.5 by default
* Test validation of SPIR-V 1.5 incorporated extensions
Starting with 1.5, incorporated features no longer require
the associated OpExtension instruction.
34 files changed, 715 insertions, 478 deletions
diff --git a/include/spirv-tools/libspirv.h b/include/spirv-tools/libspirv.h index e21b0582..672848ea 100644 --- a/include/spirv-tools/libspirv.h +++ b/include/spirv-tools/libspirv.h @@ -433,6 +433,7 @@ typedef enum { SPV_ENV_WEBGPU_0, // Work in progress WebGPU 1.0. SPV_ENV_UNIVERSAL_1_4, // SPIR-V 1.4 latest revision, no other restrictions. SPV_ENV_VULKAN_1_1_SPIRV_1_4, // Vulkan 1.1 with SPIR-V 1.4 binary. + SPV_ENV_UNIVERSAL_1_5, // SPIR-V 1.5 latest revision, no other restrictions. } spv_target_env; // SPIR-V Validator can be parameterized with the following Universal Limits. diff --git a/source/ext_inst.cpp b/source/ext_inst.cpp index 1198f76a..0499e230 100644 --- a/source/ext_inst.cpp +++ b/source/ext_inst.cpp @@ -84,6 +84,7 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable, case SPV_ENV_VULKAN_1_1_SPIRV_1_4: case SPV_ENV_WEBGPU_0: case SPV_ENV_UNIVERSAL_1_4: + case SPV_ENV_UNIVERSAL_1_5: *pExtInstTable = &kTable_1_0; return SPV_SUCCESS; default: diff --git a/source/spirv_target_env.cpp b/source/spirv_target_env.cpp index 66856a05..86f2c8d1 100644 --- a/source/spirv_target_env.cpp +++ b/source/spirv_target_env.cpp @@ -66,6 +66,8 @@ const char* spvTargetEnvDescription(spv_target_env env) { return "SPIR-V 1.4"; case SPV_ENV_VULKAN_1_1_SPIRV_1_4: return "SPIR-V 1.4 (under Vulkan 1.1 semantics)"; + case SPV_ENV_UNIVERSAL_1_5: + return "SPIR-V 1.5"; } return ""; } @@ -99,6 +101,8 @@ uint32_t spvVersionForTargetEnv(spv_target_env env) { case SPV_ENV_UNIVERSAL_1_4: case SPV_ENV_VULKAN_1_1_SPIRV_1_4: return SPV_SPIRV_VERSION_WORD(1, 4); + case SPV_ENV_UNIVERSAL_1_5: + return SPV_SPIRV_VERSION_WORD(1, 5); } return SPV_SPIRV_VERSION_WORD(0, 0); } @@ -112,6 +116,7 @@ static const std::pair<const char*, spv_target_env> spvTargetEnvNameMap[] = { {"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}, {"opencl1.2embedded", SPV_ENV_OPENCL_EMBEDDED_1_2}, {"opencl1.2", SPV_ENV_OPENCL_1_2}, {"opencl2.0embedded", SPV_ENV_OPENCL_EMBEDDED_2_0}, @@ -165,6 +170,7 @@ bool spvIsVulkanEnv(spv_target_env env) { case SPV_ENV_UNIVERSAL_1_3: case SPV_ENV_WEBGPU_0: case SPV_ENV_UNIVERSAL_1_4: + case SPV_ENV_UNIVERSAL_1_5: return false; case SPV_ENV_VULKAN_1_0: case SPV_ENV_VULKAN_1_1: @@ -190,6 +196,7 @@ bool spvIsOpenCLEnv(spv_target_env env) { case SPV_ENV_WEBGPU_0: case SPV_ENV_UNIVERSAL_1_4: case SPV_ENV_VULKAN_1_1_SPIRV_1_4: + case SPV_ENV_UNIVERSAL_1_5: return false; case SPV_ENV_OPENCL_1_2: case SPV_ENV_OPENCL_EMBEDDED_1_2: @@ -227,6 +234,7 @@ bool spvIsWebGPUEnv(spv_target_env env) { case SPV_ENV_OPENCL_2_2: case SPV_ENV_UNIVERSAL_1_4: case SPV_ENV_VULKAN_1_1_SPIRV_1_4: + case SPV_ENV_UNIVERSAL_1_5: return false; case SPV_ENV_WEBGPU_0: return true; @@ -253,6 +261,7 @@ bool spvIsOpenGLEnv(spv_target_env env) { case SPV_ENV_WEBGPU_0: case SPV_ENV_UNIVERSAL_1_4: case SPV_ENV_VULKAN_1_1_SPIRV_1_4: + case SPV_ENV_UNIVERSAL_1_5: return false; case SPV_ENV_OPENGL_4_0: case SPV_ENV_OPENGL_4_1: @@ -299,7 +308,8 @@ std::string spvLogStringForEnv(spv_target_env env) { case SPV_ENV_UNIVERSAL_1_1: case SPV_ENV_UNIVERSAL_1_2: case SPV_ENV_UNIVERSAL_1_3: - case SPV_ENV_UNIVERSAL_1_4: { + case SPV_ENV_UNIVERSAL_1_4: + case SPV_ENV_UNIVERSAL_1_5: { return "Universal"; } } diff --git a/source/table.cpp b/source/table.cpp index 78903059..b7a96cc9 100644 --- a/source/table.cpp +++ b/source/table.cpp @@ -40,6 +40,7 @@ spv_context spvContextCreate(spv_target_env env) { case SPV_ENV_VULKAN_1_1_SPIRV_1_4: case SPV_ENV_WEBGPU_0: case SPV_ENV_UNIVERSAL_1_4: + case SPV_ENV_UNIVERSAL_1_5: break; default: return nullptr; diff --git a/source/val/validate_instruction.cpp b/source/val/validate_instruction.cpp index b74b5355..fecc3519 100644 --- a/source/val/validate_instruction.cpp +++ b/source/val/validate_instruction.cpp @@ -205,17 +205,24 @@ spv_result_t CheckRequiredCapabilities(ValidationState_t& state, operand_desc->capabilities, operand_desc->numCapabilities); } - if (!state.HasAnyOfCapabilities(enabling_capabilities)) { - return state.diag(SPV_ERROR_INVALID_CAPABILITY, inst) - << "Operand " << which_operand << " of " - << spvOpcodeString(inst->opcode()) - << " requires one of these capabilities: " - << ToString(enabling_capabilities, state.grammar()); + // When encountering an OpCapability instruction, the instruction pass + // registers a capability with the module *before* checking capabilities. + // So in the case of an OpCapability instruction, don't bother checking + // enablement by another capability. + if (inst->opcode() != SpvOpCapability) { + const bool enabled_by_cap = + state.HasAnyOfCapabilities(enabling_capabilities); + if (!enabling_capabilities.IsEmpty() && !enabled_by_cap) { + return state.diag(SPV_ERROR_INVALID_CAPABILITY, inst) + << "Operand " << which_operand << " of " + << spvOpcodeString(inst->opcode()) + << " requires one of these capabilities: " + << ToString(enabling_capabilities, state.grammar()); + } } return OperandVersionExtensionCheck(state, inst, which_operand, *operand_desc, word); } - return SPV_SUCCESS; } diff --git a/source/val/validation_state.h b/source/val/validation_state.h index 3a9222c7..e650d2ea 100644 --- a/source/val/validation_state.h +++ b/source/val/validation_state.h @@ -330,6 +330,12 @@ class ValidationState_t { return module_capabilities_.Contains(cap); } + /// Returns a reference to the set of capabilities in the module. + /// This is provided for debuggability. + const CapabilitySet& module_capabilities() const { + return module_capabilities_; + } + /// Returns true if the extension is enabled in the module. bool HasExtension(Extension ext) const { return module_extensions_.Contains(ext); diff --git a/test/operand_capabilities_test.cpp b/test/operand_capabilities_test.cpp index 5b065271..11955970 100644 --- a/test/operand_capabilities_test.cpp +++ b/test/operand_capabilities_test.cpp @@ -494,8 +494,8 @@ INSTANTIATE_TEST_SUITE_P( CASE3(BUILT_IN, BuiltInPrimitiveId, Geometry, Tessellation, RayTracingNV), CASE2(BUILT_IN, BuiltInInvocationId, Geometry, Tessellation), - CASE1(BUILT_IN, BuiltInLayer, Geometry), - CASE1(BUILT_IN, BuiltInViewportIndex, MultiViewport), // Bug 15234 + CASE2(BUILT_IN, BuiltInLayer, Geometry, ShaderViewportIndexLayerEXT), + CASE2(BUILT_IN, BuiltInViewportIndex, MultiViewport, ShaderViewportIndexLayerEXT), // Bug 15234 CASE1(BUILT_IN, BuiltInTessLevelOuter, Tessellation), CASE1(BUILT_IN, BuiltInTessLevelInner, Tessellation), CASE1(BUILT_IN, BuiltInTessCoord, Tessellation), @@ -532,6 +532,18 @@ INSTANTIATE_TEST_SUITE_P( // clang-format on }))); +INSTANTIATE_TEST_SUITE_P( + BuiltInV1_5, EnumCapabilityTest, + Combine( + Values(SPV_ENV_UNIVERSAL_1_5), + ValuesIn(std::vector<EnumCapabilityCase>{ + // SPIR-V 1.5 adds new capabilities to enable these two builtins. + CASE3(BUILT_IN, BuiltInLayer, Geometry, ShaderLayer, + ShaderViewportIndexLayerEXT), + CASE3(BUILT_IN, BuiltInViewportIndex, MultiViewport, + ShaderViewportIndex, ShaderViewportIndexLayerEXT), + }))); + // See SPIR-V Section 3.22 Selection Control INSTANTIATE_TEST_SUITE_P( SelectionControl, EnumCapabilityTest, diff --git a/test/opt/aggressive_dead_code_elim_test.cpp b/test/opt/aggressive_dead_code_elim_test.cpp index 3a7fc279..9e5197d5 100644 --- a/test/opt/aggressive_dead_code_elim_test.cpp +++ b/test/opt/aggressive_dead_code_elim_test.cpp @@ -6645,11 +6645,11 @@ TEST_F(AggressiveDCETest, NoEliminateForwardPointer) { const std::string predefs1 = R"(OpCapability Shader -OpCapability PhysicalStorageBufferAddressesEXT +OpCapability PhysicalStorageBufferAddresses OpExtension "SPV_EXT_physical_storage_buffer" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 +OpMemoryModel PhysicalStorageBuffer64 GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 OpSource GLSL 450 @@ -6668,7 +6668,7 @@ OpName %r "r" OpMemberDecorate %blockType 0 Offset 0 OpMemberDecorate %blockType 1 Offset 8 OpDecorate %blockType Block -OpDecorate %b AliasedPointerEXT +OpDecorate %b AliasedPointer OpMemberDecorate %rootBlock 0 Offset 0 OpDecorate %rootBlock Block OpDecorate %r DescriptorSet 0 @@ -6695,50 +6695,50 @@ OpDecorate %r Binding 0 const std::string predefs2_before = R"(%void = OpTypeVoid %3 = OpTypeFunction %void -OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_blockType PhysicalStorageBufferEXT +OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_blockType PhysicalStorageBuffer %int = OpTypeInt 32 1 -%blockType = OpTypeStruct %int %_ptr_PhysicalStorageBufferEXT_blockType -%_ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %blockType -%_ptr_Function__ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer Function %_ptr_PhysicalStorageBufferEXT_blockType -%rootBlock = OpTypeStruct %_ptr_PhysicalStorageBufferEXT_blockType +%blockType = OpTypeStruct %int %_ptr_PhysicalStorageBuffer_blockType +%_ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %blockType +%_ptr_Function__ptr_PhysicalStorageBuffer_blockType = OpTypePointer Function %_ptr_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_PhysicalStorageBufferEXT_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_1 = OpConstant %int 1 -%_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_531 = OpConstant %int 531 -%_ptr_PhysicalStorageBufferEXT_int = OpTypePointer PhysicalStorageBufferEXT %int +%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int )"; const std::string predefs2_after = R"(%void = OpTypeVoid %8 = OpTypeFunction %void -OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_blockType PhysicalStorageBufferEXT +OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_blockType PhysicalStorageBuffer %int = OpTypeInt 32 1 -%blockType = OpTypeStruct %int %_ptr_PhysicalStorageBufferEXT_blockType -%_ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %blockType -%rootBlock = OpTypeStruct %_ptr_PhysicalStorageBufferEXT_blockType +%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_PhysicalStorageBufferEXT_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_1 = OpConstant %int 1 -%_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_531 = OpConstant %int 531 -%_ptr_PhysicalStorageBufferEXT_int = OpTypePointer PhysicalStorageBufferEXT %int +%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int )"; const std::string func_before = R"(%main = OpFunction %void None %3 %5 = OpLabel -%b = OpVariable %_ptr_Function__ptr_PhysicalStorageBufferEXT_blockType Function -%16 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBufferEXT_blockType %r %int_0 -%17 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %16 -%21 = OpAccessChain %_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType %17 %int_1 -%22 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %21 Aligned 8 +%b = OpVariable %_ptr_Function__ptr_PhysicalStorageBuffer_blockType Function +%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 OpStore %b %22 -%26 = OpAccessChain %_ptr_PhysicalStorageBufferEXT_int %22 %int_0 +%26 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %22 %int_0 OpStore %26 %int_531 Aligned 16 OpReturn OpFunctionEnd @@ -6747,11 +6747,11 @@ OpFunctionEnd const std::string func_after = R"(%main = OpFunction %void None %8 %19 = OpLabel -%20 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBufferEXT_blockType %r %int_0 -%21 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %20 -%22 = OpAccessChain %_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType %21 %int_1 -%23 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %22 Aligned 8 -%24 = OpAccessChain %_ptr_PhysicalStorageBufferEXT_int %23 %int_0 +%20 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType %r %int_0 +%21 = OpLoad %_ptr_PhysicalStorageBuffer_blockType %20 +%22 = OpAccessChain %_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType %21 %int_1 +%23 = OpLoad %_ptr_PhysicalStorageBuffer_blockType %22 Aligned 8 +%24 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %23 %int_0 OpStore %24 %int_531 Aligned 16 OpReturn OpFunctionEnd diff --git a/test/opt/decompose_initialized_variables_test.cpp b/test/opt/decompose_initialized_variables_test.cpp index cdebb3f7..06ba59a5 100644 --- a/test/opt/decompose_initialized_variables_test.cpp +++ b/test/opt/decompose_initialized_variables_test.cpp @@ -24,9 +24,9 @@ namespace { using DecomposeInitializedVariablesTest = PassTest<::testing::Test>; std::string single_entry_header = R"(OpCapability Shader -OpCapability VulkanMemoryModelKHR +OpCapability VulkanMemoryModel OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical VulkanKHR +OpMemoryModel Logical Vulkan OpEntryPoint Vertex %1 "shader" %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 @@ -126,9 +126,9 @@ TEST_F(DecomposeInitializedVariablesTest, OutputUnchanged) { } std::string multiple_entry_header = R"(OpCapability Shader -OpCapability VulkanMemoryModelKHR +OpCapability VulkanMemoryModel OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical VulkanKHR +OpMemoryModel Logical Vulkan OpEntryPoint Vertex %1 "vertex" OpEntryPoint Fragment %2 "fragment" %uint = OpTypeInt 32 0 diff --git a/test/opt/generate_webgpu_initializers_test.cpp b/test/opt/generate_webgpu_initializers_test.cpp index f35cf56d..4aab2ce2 100644 --- a/test/opt/generate_webgpu_initializers_test.cpp +++ b/test/opt/generate_webgpu_initializers_test.cpp @@ -46,9 +46,9 @@ std::string GetGlobalVariableTestString(std::string ptr_str, std::vector<const char*> result = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", ptr_str.c_str()}; @@ -132,9 +132,9 @@ std::string GetLocalVariableTestString(std::string ptr_str, std::string var_str, std::vector<const char*> result = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", ptr_str.c_str(), @@ -206,9 +206,9 @@ TEST_F(GenerateWebGPUInitializersTest, AlreadyInitializedUnchanged) { std::vector<const char*> spirv = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%_ptr_Private_uint = OpTypePointer Private %uint", @@ -232,9 +232,9 @@ TEST_F(GenerateWebGPUInitializersTest, AmbigiousArrays) { std::vector<const char*> input_spirv = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%uint_2 = OpConstant %uint 2", @@ -258,9 +258,9 @@ TEST_F(GenerateWebGPUInitializersTest, AmbigiousArrays) { std::vector<const char*> expected_spirv = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%uint_2 = OpConstant %uint 2", @@ -290,9 +290,9 @@ TEST_F(GenerateWebGPUInitializersTest, AmbigiousStructs) { std::vector<const char*> input_spirv = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%_struct_3 = OpTypeStruct %uint", @@ -315,9 +315,9 @@ TEST_F(GenerateWebGPUInitializersTest, AmbigiousStructs) { std::vector<const char*> expected_spirv = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%_struct_3 = OpTypeStruct %uint", diff --git a/test/opt/graphics_robust_access_test.cpp b/test/opt/graphics_robust_access_test.cpp index 137d0e89..646b92c2 100644 --- a/test/opt/graphics_robust_access_test.cpp +++ b/test/opt/graphics_robust_access_test.cpp @@ -90,7 +90,7 @@ OpMemoryModel Physical64 OpenCL TEST_F(GraphicsRobustAccessTest, FailCantProcessPhysicalStorageBuffer64EXTAddressingModel) { const std::string text = R"( -; CHECK: Addressing model must be Logical. Found OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 +; CHECK: Addressing model must be Logical. Found OpMemoryModel PhysicalStorageBuffer64 GLSL450 OpCapability Shader OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 )"; diff --git a/test/opt/inst_bindless_check_test.cpp b/test/opt/inst_bindless_check_test.cpp index 6e1adaa6..130f70de 100644 --- a/test/opt/inst_bindless_check_test.cpp +++ b/test/opt/inst_bindless_check_test.cpp @@ -1915,7 +1915,7 @@ TEST_F(InstBindlessTest, RuntimeArray) { const std::string defs_before = R"(OpCapability Shader -OpCapability RuntimeDescriptorArrayEXT +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -1968,7 +1968,7 @@ OpDecorate %_entryPointOutput_vColor Location 0 const std::string defs_after = R"(OpCapability Shader -OpCapability RuntimeDescriptorArrayEXT +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -2647,9 +2647,9 @@ TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedUBOArray) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -2670,9 +2670,9 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %16 NonUniformEXT -OpDecorate %20 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %16 NonUniform +OpDecorate %20 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -2691,9 +2691,9 @@ OpDecorate %20 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -2715,22 +2715,22 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %102 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %102 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block OpMemberDecorate %_struct_31 0 Offset 0 OpDecorate %33 DescriptorSet 7 OpDecorate %33 Binding 1 -OpDecorate %130 NonUniformEXT +OpDecorate %130 NonUniform OpDecorate %_struct_55 Block OpMemberDecorate %_struct_55 0 Offset 0 OpMemberDecorate %_struct_55 1 Offset 4 OpDecorate %57 DescriptorSet 7 OpDecorate %57 Binding 0 OpDecorate %gl_FragCoord BuiltIn FragCoord -OpDecorate %127 NonUniformEXT +OpDecorate %127 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -2928,9 +2928,9 @@ TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedSSBOArrayDeprecated) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -2951,9 +2951,9 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %16 NonUniformEXT -OpDecorate %20 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %16 NonUniform +OpDecorate %20 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -2972,9 +2972,9 @@ OpDecorate %20 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -2996,22 +2996,22 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %102 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %102 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block OpMemberDecorate %_struct_31 0 Offset 0 OpDecorate %33 DescriptorSet 7 OpDecorate %33 Binding 1 -OpDecorate %130 NonUniformEXT +OpDecorate %130 NonUniform OpDecorate %_struct_55 Block OpMemberDecorate %_struct_55 0 Offset 0 OpMemberDecorate %_struct_55 1 Offset 4 OpDecorate %57 DescriptorSet 7 OpDecorate %57 Binding 0 OpDecorate %gl_FragCoord BuiltIn FragCoord -OpDecorate %127 NonUniformEXT +OpDecorate %127 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -3198,9 +3198,9 @@ TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedSSBOArray) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -3221,9 +3221,9 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %16 NonUniformEXT -OpDecorate %20 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %16 NonUniform +OpDecorate %20 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -3242,9 +3242,9 @@ OpDecorate %20 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -3266,22 +3266,22 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %102 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %102 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block OpMemberDecorate %_struct_31 0 Offset 0 OpDecorate %33 DescriptorSet 7 OpDecorate %33 Binding 1 -OpDecorate %130 NonUniformEXT +OpDecorate %130 NonUniform OpDecorate %_struct_55 Block OpMemberDecorate %_struct_55 0 Offset 0 OpMemberDecorate %_struct_55 1 Offset 4 OpDecorate %57 DescriptorSet 7 OpDecorate %57 Binding 0 OpDecorate %gl_FragCoord BuiltIn FragCoord -OpDecorate %127 NonUniformEXT +OpDecorate %127 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -3704,9 +3704,9 @@ TEST_F(InstBindlessTest, InstBoundsInitStoreUnsizedSSBOArray) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -3726,8 +3726,8 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 4 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %14 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %14 NonUniform OpDecorate %b Location 1 %void = OpTypeVoid %3 = OpTypeFunction %void @@ -3747,9 +3747,9 @@ OpDecorate %b Location 1 const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -3770,8 +3770,8 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 4 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform OpDecorate %b Location 1 OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block @@ -3978,8 +3978,8 @@ TEST_F(InstBindlessTest, InstBoundsInitLoadSizedUBOArray) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -4000,9 +4000,9 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %18 NonUniformEXT -OpDecorate %22 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %18 NonUniform +OpDecorate %22 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -4023,8 +4023,8 @@ OpDecorate %22 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -4046,10 +4046,10 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %89 NonUniformEXT -OpDecorate %120 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %89 NonUniform +OpDecorate %120 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_39 Block OpMemberDecorate %_struct_39 0 Offset 0 @@ -4061,7 +4061,7 @@ OpDecorate %_struct_98 Block OpMemberDecorate %_struct_98 0 Offset 0 OpDecorate %100 DescriptorSet 7 OpDecorate %100 Binding 1 -OpDecorate %117 NonUniformEXT +OpDecorate %117 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -6313,7 +6313,7 @@ TEST_F(InstBindlessTest, RuntimeArrayV2) { const std::string defs_before = R"(OpCapability Shader -OpCapability RuntimeDescriptorArrayEXT +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -6366,7 +6366,7 @@ OpDecorate %_entryPointOutput_vColor Location 0 const std::string defs_after = R"(OpCapability Shader -OpCapability RuntimeDescriptorArrayEXT +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -6970,9 +6970,9 @@ TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedUBOArrayV2) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -6993,9 +6993,9 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %16 NonUniformEXT -OpDecorate %20 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %16 NonUniform +OpDecorate %20 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -7014,9 +7014,9 @@ OpDecorate %20 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -7038,22 +7038,22 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %102 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %102 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block OpMemberDecorate %_struct_31 0 Offset 0 OpDecorate %33 DescriptorSet 7 OpDecorate %33 Binding 1 -OpDecorate %130 NonUniformEXT +OpDecorate %130 NonUniform OpDecorate %_struct_55 Block OpMemberDecorate %_struct_55 0 Offset 0 OpMemberDecorate %_struct_55 1 Offset 4 OpDecorate %57 DescriptorSet 7 OpDecorate %57 Binding 0 OpDecorate %gl_FragCoord BuiltIn FragCoord -OpDecorate %127 NonUniformEXT +OpDecorate %127 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -7251,9 +7251,9 @@ TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedSSBOArrayDeprecatedV2) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -7274,9 +7274,9 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %16 NonUniformEXT -OpDecorate %20 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %16 NonUniform +OpDecorate %20 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -7295,9 +7295,9 @@ OpDecorate %20 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -7319,22 +7319,22 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %102 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %102 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block OpMemberDecorate %_struct_31 0 Offset 0 OpDecorate %33 DescriptorSet 7 OpDecorate %33 Binding 1 -OpDecorate %130 NonUniformEXT +OpDecorate %130 NonUniform OpDecorate %_struct_55 Block OpMemberDecorate %_struct_55 0 Offset 0 OpMemberDecorate %_struct_55 1 Offset 4 OpDecorate %57 DescriptorSet 7 OpDecorate %57 Binding 0 OpDecorate %gl_FragCoord BuiltIn FragCoord -OpDecorate %127 NonUniformEXT +OpDecorate %127 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -7521,9 +7521,9 @@ TEST_F(InstBindlessTest, InstBoundsAndInitLoadUnsizedSSBOArrayV2) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -7544,9 +7544,9 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %16 NonUniformEXT -OpDecorate %20 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %16 NonUniform +OpDecorate %20 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -7565,9 +7565,9 @@ OpDecorate %20 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -7589,22 +7589,22 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %102 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %102 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block OpMemberDecorate %_struct_31 0 Offset 0 OpDecorate %33 DescriptorSet 7 OpDecorate %33 Binding 1 -OpDecorate %130 NonUniformEXT +OpDecorate %130 NonUniform OpDecorate %_struct_55 Block OpMemberDecorate %_struct_55 0 Offset 0 OpMemberDecorate %_struct_55 1 Offset 4 OpDecorate %57 DescriptorSet 7 OpDecorate %57 Binding 0 OpDecorate %gl_FragCoord BuiltIn FragCoord -OpDecorate %127 NonUniformEXT +OpDecorate %127 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -8027,9 +8027,9 @@ TEST_F(InstBindlessTest, InstBoundsInitStoreUnsizedSSBOArrayV2) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -8049,8 +8049,8 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 4 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %14 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %14 NonUniform OpDecorate %b Location 1 %void = OpTypeVoid %3 = OpTypeFunction %void @@ -8070,9 +8070,9 @@ OpDecorate %b Location 1 const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability RuntimeDescriptorArrayEXT -OpCapability StorageBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability RuntimeDescriptorArray +OpCapability StorageBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -8093,8 +8093,8 @@ OpDecorate %storageBuffer DescriptorSet 0 OpDecorate %storageBuffer Binding 4 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform OpDecorate %b Location 1 OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_31 Block @@ -8301,8 +8301,8 @@ TEST_F(InstBindlessTest, InstBoundsInitLoadSizedUBOArrayV2) { const std::string defs_before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -8323,9 +8323,9 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %18 NonUniformEXT -OpDecorate %22 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %18 NonUniform +OpDecorate %22 NonUniform %void = OpTypeVoid %3 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -8346,8 +8346,8 @@ OpDecorate %22 NonUniformEXT const std::string defs_after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT -OpCapability UniformBufferArrayNonUniformIndexingEXT +OpCapability ShaderNonUniform +OpCapability UniformBufferArrayNonUniformIndexing OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -8369,10 +8369,10 @@ OpDecorate %uniformBuffer DescriptorSet 0 OpDecorate %uniformBuffer Binding 3 OpDecorate %nu_ii Flat OpDecorate %nu_ii Location 0 -OpDecorate %nu_ii NonUniformEXT -OpDecorate %7 NonUniformEXT -OpDecorate %89 NonUniformEXT -OpDecorate %120 NonUniformEXT +OpDecorate %nu_ii NonUniform +OpDecorate %7 NonUniform +OpDecorate %89 NonUniform +OpDecorate %120 NonUniform OpDecorate %_runtimearr_uint ArrayStride 4 OpDecorate %_struct_39 Block OpMemberDecorate %_struct_39 0 Offset 0 @@ -8384,7 +8384,7 @@ OpDecorate %_struct_98 Block OpMemberDecorate %_struct_98 0 Offset 0 OpDecorate %100 DescriptorSet 7 OpDecorate %100 Binding 1 -OpDecorate %117 NonUniformEXT +OpDecorate %117 NonUniform %void = OpTypeVoid %10 = OpTypeFunction %void %float = OpTypeFloat 32 @@ -8575,7 +8575,7 @@ TEST_F(InstBindlessTest, const std::string defs_before = R"(OpCapability Shader -OpCapability RuntimeDescriptorArrayEXT +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 @@ -8622,7 +8622,7 @@ OpDecorate %images NonWritable const std::string defs_after = R"(OpCapability Shader -OpCapability RuntimeDescriptorArrayEXT +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" @@ -8895,7 +8895,7 @@ TEST_F(InstBindlessTest, // } const std::string defs_before = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -8923,7 +8923,7 @@ OpDecorate %images NonWritable )"; const std::string defs_after = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -9219,7 +9219,7 @@ TEST_F(InstBindlessTest, // } const std::string defs_before = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -9247,7 +9247,7 @@ OpDecorate %images NonWritable )"; const std::string defs_after = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -9543,7 +9543,7 @@ TEST_F(InstBindlessTest, // } const std::string defs_before = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -9571,7 +9571,7 @@ OpDecorate %images NonWritable )"; const std::string defs_after = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -9867,7 +9867,7 @@ TEST_F(InstBindlessTest, // } const std::string defs_before = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -9895,7 +9895,7 @@ OpDecorate %images NonWritable )"; const std::string defs_after = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -10191,7 +10191,7 @@ TEST_F(InstBindlessTest, // } const std::string defs_before = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -10219,7 +10219,7 @@ OpDecorate %images NonWritable )"; const std::string defs_after = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -10515,7 +10515,7 @@ TEST_F(InstBindlessTest, // } const std::string defs_before = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" @@ -10543,7 +10543,7 @@ OpDecorate %images NonWritable )"; const std::string defs_after = - R"(OpCapability RuntimeDescriptorArrayEXT + R"(OpCapability RuntimeDescriptorArray OpCapability RayTracingNV OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_NV_ray_tracing" diff --git a/test/opt/inst_buff_addr_check_test.cpp b/test/opt/inst_buff_addr_check_test.cpp index c31266e6..837c8166 100644 --- a/test/opt/inst_buff_addr_check_test.cpp +++ b/test/opt/inst_buff_addr_check_test.cpp @@ -51,10 +51,10 @@ TEST_F(InstBuffAddrTest, InstPhysicalStorageBufferStore) { const std::string defs_before = R"(OpCapability Shader -OpCapability PhysicalStorageBufferAddressesEXT +OpCapability PhysicalStorageBufferAddresses OpExtension "SPV_EXT_physical_storage_buffer" %1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 +OpMemoryModel PhysicalStorageBuffer64 GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 OpSource GLSL 450 @@ -78,31 +78,31 @@ OpDecorate %u_info DescriptorSet 0 OpDecorate %u_info Binding 0 %void = OpTypeVoid %3 = OpTypeFunction %void -OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_bufStruct PhysicalStorageBufferEXT +OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_bufStruct PhysicalStorageBuffer %uint = OpTypeInt 32 0 -%ufoo = OpTypeStruct %_ptr_PhysicalStorageBufferEXT_bufStruct %uint +%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_PhysicalStorageBufferEXT_bufStruct = OpTypePointer PhysicalStorageBufferEXT %bufStruct +%_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_PhysicalStorageBufferEXT_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBufferEXT_bufStruct +%_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBuffer_bufStruct %int_1 = OpConstant %int 1 %int_3239 = OpConstant %int 3239 -%_ptr_PhysicalStorageBufferEXT_int = OpTypePointer PhysicalStorageBufferEXT %int +%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int )"; const std::string defs_after = R"(OpCapability Shader -OpCapability PhysicalStorageBufferAddressesEXT +OpCapability PhysicalStorageBufferAddresses OpCapability Int64 OpExtension "SPV_EXT_physical_storage_buffer" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 +OpMemoryModel PhysicalStorageBuffer64 GLSL450 OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID OpExecutionMode %main LocalSize 1 1 1 OpSource GLSL 450 @@ -138,21 +138,21 @@ OpDecorate %79 Binding 0 OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId %void = OpTypeVoid %8 = OpTypeFunction %void -OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_bufStruct PhysicalStorageBufferEXT +OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_bufStruct PhysicalStorageBuffer %uint = OpTypeInt 32 0 -%ufoo = OpTypeStruct %_ptr_PhysicalStorageBufferEXT_bufStruct %uint +%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_PhysicalStorageBufferEXT_bufStruct = OpTypePointer PhysicalStorageBufferEXT %bufStruct +%_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_PhysicalStorageBufferEXT_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBufferEXT_bufStruct +%_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct = OpTypePointer Uniform %_ptr_PhysicalStorageBuffer_bufStruct %int_1 = OpConstant %int 1 %int_3239 = OpConstant %int 3239 -%_ptr_PhysicalStorageBufferEXT_int = OpTypePointer PhysicalStorageBufferEXT %int +%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int %ulong = OpTypeInt 64 0 %uint_4 = OpConstant %uint 4 %bool = OpTypeBool @@ -188,9 +188,9 @@ OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_bufStruct PhysicalStorageBuf const std::string func_before = R"(%main = OpFunction %void None %3 %5 = OpLabel -%17 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBufferEXT_bufStruct %u_info %int_0 -%18 = OpLoad %_ptr_PhysicalStorageBufferEXT_bufStruct %17 -%22 = OpAccessChain %_ptr_PhysicalStorageBufferEXT_int %18 %int_1 +%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 OpStore %22 %int_3239 Aligned 16 OpReturn OpFunctionEnd @@ -199,9 +199,9 @@ OpFunctionEnd const std::string func_after = R"(%main = OpFunction %void None %8 %19 = OpLabel -%20 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBufferEXT_bufStruct %u_info %int_0 -%21 = OpLoad %_ptr_PhysicalStorageBufferEXT_bufStruct %20 -%22 = OpAccessChain %_ptr_PhysicalStorageBufferEXT_int %21 %int_1 +%20 = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_bufStruct %u_info %int_0 +%21 = OpLoad %_ptr_PhysicalStorageBuffer_bufStruct %20 +%22 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %21 %int_1 %24 = OpConvertPtrToU %ulong %22 %61 = OpFunctionCall %bool %26 %24 %uint_4 OpSelectionMerge %62 None @@ -339,11 +339,11 @@ TEST_F(InstBuffAddrTest, InstPhysicalStorageBufferLoadAndStore) { const std::string defs_before = R"(OpCapability Shader -OpCapability PhysicalStorageBufferAddressesEXT +OpCapability PhysicalStorageBufferAddresses OpExtension "SPV_EXT_physical_storage_buffer" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 +OpMemoryModel PhysicalStorageBuffer64 GLSL450 OpEntryPoint GLCompute %main "main" OpExecutionMode %main LocalSize 1 1 1 OpSource GLSL 450 @@ -364,29 +364,29 @@ OpDecorate %r DescriptorSet 0 OpDecorate %r Binding 0 %void = OpTypeVoid %3 = OpTypeFunction %void -OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_blockType PhysicalStorageBufferEXT +OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_blockType PhysicalStorageBuffer %int = OpTypeInt 32 1 -%blockType = OpTypeStruct %int %_ptr_PhysicalStorageBufferEXT_blockType -%_ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %blockType -%rootBlock = OpTypeStruct %_ptr_PhysicalStorageBufferEXT_blockType +%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_PhysicalStorageBufferEXT_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_1 = OpConstant %int 1 -%_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_531 = OpConstant %int 531 -%_ptr_PhysicalStorageBufferEXT_int = OpTypePointer PhysicalStorageBufferEXT %int +%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int )"; const std::string defs_after = R"(OpCapability Shader -OpCapability PhysicalStorageBufferAddressesEXT +OpCapability PhysicalStorageBufferAddresses OpCapability Int64 OpExtension "SPV_EXT_physical_storage_buffer" OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" -OpMemoryModel PhysicalStorageBuffer64EXT GLSL450 +OpMemoryModel PhysicalStorageBuffer64 GLSL450 OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID OpExecutionMode %main LocalSize 1 1 1 OpSource GLSL 450 @@ -419,19 +419,19 @@ OpDecorate %86 Binding 0 OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId %void = OpTypeVoid %3 = OpTypeFunction %void -OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_blockType PhysicalStorageBufferEXT +OpTypeForwardPointer %_ptr_PhysicalStorageBuffer_blockType PhysicalStorageBuffer %int = OpTypeInt 32 1 -%blockType = OpTypeStruct %int %_ptr_PhysicalStorageBufferEXT_blockType -%_ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %blockType -%rootBlock = OpTypeStruct %_ptr_PhysicalStorageBufferEXT_blockType +%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_PhysicalStorageBufferEXT_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_StorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer StorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_1 = OpConstant %int 1 -%_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType = OpTypePointer PhysicalStorageBufferEXT %_ptr_PhysicalStorageBufferEXT_blockType +%_ptr_PhysicalStorageBuffer__ptr_PhysicalStorageBuffer_blockType = OpTypePointer PhysicalStorageBuffer %_ptr_PhysicalStorageBuffer_blockType %int_531 = OpConstant %int 531 -%_ptr_PhysicalStorageBufferEXT_int = OpTypePointer PhysicalStorageBufferEXT %int +%_ptr_PhysicalStorageBuffer_int = OpTypePointer PhysicalStorageBuffer %int %uint = OpTypeInt 32 0 %uint_2 = OpConstant %uint 2 %ulong = OpTypeInt 64 0 @@ -464,18 +464,18 @@ OpTypeForwardPointer %_ptr_PhysicalStorageBufferEXT_blockType PhysicalStorageBuf %uint_7 = OpConstant %uint 7 %uint_9 = OpConstant %uint 9 %uint_44 = OpConstant %uint 44 -%132 = OpConstantNull %_ptr_PhysicalStorageBufferEXT_blockType +%132 = OpConstantNull %_ptr_PhysicalStorageBuffer_blockType %uint_46 = OpConstant %uint 46 )"; const std::string func_before = R"(%main = OpFunction %void None %3 %5 = OpLabel -%16 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBufferEXT_blockType %r %int_0 -%17 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %16 -%21 = OpAccessChain %_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType %17 %int_1 -%22 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %21 Aligned 8 -%26 = OpAccessChain %_ptr_PhysicalStorageBufferEXT_int %22 %int_0 +%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 OpReturn OpFunctionEnd @@ -484,15 +484,15 @@ OpFunctionEnd const std::string func_after = R"(%main = OpFunction %void None %3 %5 = OpLabel -%16 = OpAccessChain %_ptr_StorageBuffer__ptr_PhysicalStorageBufferEXT_blockType %r %int_0 -%17 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %16 -%21 = OpAccessChain %_ptr_PhysicalStorageBufferEXT__ptr_PhysicalStorageBufferEXT_blockType %17 %int_1 +%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 %30 = OpConvertPtrToU %ulong %21 %67 = OpFunctionCall %bool %32 %30 %uint_8 OpSelectionMerge %68 None OpBranchConditional %67 %69 %70 %69 = OpLabel -%71 = OpLoad %_ptr_PhysicalStorageBufferEXT_blockType %21 Aligned 8 +%71 = OpLoad %_ptr_PhysicalStorageBuffer_blockType %21 Aligned 8 OpBranch %68 %70 = OpLabel %72 = OpUConvert %uint %30 @@ -501,8 +501,8 @@ OpBranch %68 %131 = OpFunctionCall %void %76 %uint_44 %uint_2 %72 %75 OpBranch %68 %68 = OpLabel -%133 = OpPhi %_ptr_PhysicalStorageBufferEXT_blockType %71 %69 %132 %70 -%26 = OpAccessChain %_ptr_PhysicalStorageBufferEXT_int %133 %int_0 +%133 = OpPhi %_ptr_PhysicalStorageBuffer_blockType %71 %69 %132 %70 +%26 = OpAccessChain %_ptr_PhysicalStorageBuffer_int %133 %int_0 %134 = OpConvertPtrToU %ulong %26 %135 = OpFunctionCall %bool %32 %134 %uint_4 OpSelectionMerge %136 None diff --git a/test/opt/legalize_vector_shuffle_test.cpp b/test/opt/legalize_vector_shuffle_test.cpp index 8b9695b9..07d96eb3 100644 --- a/test/opt/legalize_vector_shuffle_test.cpp +++ b/test/opt/legalize_vector_shuffle_test.cpp @@ -34,9 +34,9 @@ void operator+=(std::vector<const char*>& lhs, std::vector<const char*> header = { "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%v3uint = OpTypeVector %uint 3"}; diff --git a/test/opt/optimizer_test.cpp b/test/opt/optimizer_test.cpp index 85208140..5e9ea950 100644 --- a/test/opt/optimizer_test.cpp +++ b/test/opt/optimizer_test.cpp @@ -291,9 +291,9 @@ INSTANTIATE_TEST_SUITE_P( // FlattenDecorations {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Fragment %main \"main\" %hue %saturation %value\n" "OpExecutionMode %main OriginUpperLeft\n" "OpDecorate %group Flat\n" @@ -312,9 +312,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Fragment %1 \"main\" %2 %3 %4\n" "OpExecutionMode %1 OriginUpperLeft\n" "%void = OpTypeVoid\n" @@ -333,9 +333,9 @@ INSTANTIATE_TEST_SUITE_P( // Strip Debug {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %func \"shader\"\n" "OpName %main \"main\"\n" "OpName %void_fn \"void_fn\"\n" @@ -347,9 +347,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%void = OpTypeVoid\n" "%3 = OpTypeFunction %void\n" @@ -362,9 +362,9 @@ INSTANTIATE_TEST_SUITE_P( // Eliminate Dead Constants {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %func \"shader\"\n" "%u32 = OpTypeInt 32 0\n" "%u32_ptr = OpTypePointer Workgroup %u32\n" @@ -381,9 +381,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint\n" @@ -398,9 +398,9 @@ INSTANTIATE_TEST_SUITE_P( // Strip Atomic Counter Memory {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %func \"shader\"\n" "%u32 = OpTypeInt 32 0\n" "%u32_ptr = OpTypePointer Workgroup %u32\n" @@ -424,9 +424,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint\n" @@ -450,9 +450,9 @@ INSTANTIATE_TEST_SUITE_P( // Generate WebGPU Initializers {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %func \"shader\"\n" "%u32 = OpTypeInt 32 0\n" "%u32_ptr = OpTypePointer Private %u32\n" @@ -467,9 +467,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%_ptr_Private_uint = OpTypePointer Private %uint\n" @@ -488,9 +488,9 @@ INSTANTIATE_TEST_SUITE_P( // Legalize Vector Shuffle {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%v3uint = OpTypeVector %uint 3\n" @@ -507,9 +507,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%v3uint = OpTypeVector %uint 3\n" @@ -530,9 +530,9 @@ INSTANTIATE_TEST_SUITE_P( // Split Invalid Unreachable {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%uint_1 = OpConstant %uint 1\n" @@ -561,9 +561,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%uint_1 = OpConstant %uint 1\n" @@ -597,9 +597,9 @@ INSTANTIATE_TEST_SUITE_P( // Compact IDs {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1000 \"shader\"\n" "%10 = OpTypeVoid\n" "%100 = OpTypeFunction %10\n" @@ -609,9 +609,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%void = OpTypeVoid\n" "%3 = OpTypeFunction %void\n" @@ -683,9 +683,9 @@ INSTANTIATE_TEST_SUITE_P( // Decompose Initialized Variables {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%_ptr_Function_uint = OpTypePointer Function %uint\n" @@ -699,9 +699,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%uint = OpTypeInt 32 0\n" "%_ptr_Function_uint = OpTypePointer Function %uint\n" @@ -719,9 +719,9 @@ INSTANTIATE_TEST_SUITE_P( // Compact IDs {// input "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1000 \"shader\"\n" "%10 = OpTypeVoid\n" "%100 = OpTypeFunction %10\n" @@ -731,9 +731,9 @@ INSTANTIATE_TEST_SUITE_P( "OpFunctionEnd\n", // expected "OpCapability Shader\n" - "OpCapability VulkanMemoryModelKHR\n" + "OpCapability VulkanMemoryModel\n" "OpExtension \"SPV_KHR_vulkan_memory_model\"\n" - "OpMemoryModel Logical VulkanKHR\n" + "OpMemoryModel Logical Vulkan\n" "OpEntryPoint Vertex %1 \"shader\"\n" "%void = OpTypeVoid\n" "%3 = OpTypeFunction %void\n" diff --git a/test/opt/simplification_test.cpp b/test/opt/simplification_test.cpp index 14204980..e1f10a56 100644 --- a/test/opt/simplification_test.cpp +++ b/test/opt/simplification_test.cpp @@ -206,7 +206,7 @@ TEST_F(SimplificationTest, CopyObjectWithDecorations1) { // Don't simplify OpCopyObject if the result id has a decoration that the // operand does not. const std::string text = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT +OpCapability ShaderNonUniform %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %2 "main" @@ -214,7 +214,7 @@ OpExecutionMode %2 OriginUpperLeft OpSource GLSL 430 OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" OpSourceExtension "GL_GOOGLE_include_directive" -OpDecorate %3 NonUniformEXT +OpDecorate %3 NonUniform %void = OpTypeVoid %5 = OpTypeFunction %void %int = OpTypeInt 32 1 @@ -234,7 +234,7 @@ TEST_F(SimplificationTest, CopyObjectWithDecorations2) { // Simplify OpCopyObject if the result id is a subset of the decorations of // the operand. const std::string before = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT +OpCapability ShaderNonUniform %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %2 "main" @@ -242,7 +242,7 @@ OpExecutionMode %2 OriginUpperLeft OpSource GLSL 430 OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" OpSourceExtension "GL_GOOGLE_include_directive" -OpDecorate %3 NonUniformEXT +OpDecorate %3 NonUniform %void = OpTypeVoid %5 = OpTypeFunction %void %int = OpTypeInt 32 1 @@ -256,7 +256,7 @@ OpFunctionEnd )"; const std::string after = R"(OpCapability Shader -OpCapability ShaderNonUniformEXT +OpCapability ShaderNonUniform %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %2 "main" @@ -264,7 +264,7 @@ OpExecutionMode %2 OriginUpperLeft OpSource GLSL 430 OpSourceExtension "GL_GOOGLE_cpp_style_line_directive" OpSourceExtension "GL_GOOGLE_include_directive" -OpDecorate %3 NonUniformEXT +OpDecorate %3 NonUniform %void = OpTypeVoid %5 = OpTypeFunction %void %int = OpTypeInt 32 1 diff --git a/test/opt/split_invalid_unreachable_test.cpp b/test/opt/split_invalid_unreachable_test.cpp index 868c7b51..520af015 100644 --- a/test/opt/split_invalid_unreachable_test.cpp +++ b/test/opt/split_invalid_unreachable_test.cpp @@ -24,9 +24,9 @@ namespace { using SplitInvalidUnreachableTest = PassTest<::testing::Test>; std::string spirv_header = R"(OpCapability Shader -OpCapability VulkanMemoryModelKHR +OpCapability VulkanMemoryModel OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical VulkanKHR +OpMemoryModel Logical Vulkan OpEntryPoint Vertex %1 "shader" %uint = OpTypeInt 32 0 %uint_1 = OpConstant %uint 1 diff --git a/test/opt/strip_atomic_counter_memory_test.cpp b/test/opt/strip_atomic_counter_memory_test.cpp index 6287a13b..90daa59c 100644 --- a/test/opt/strip_atomic_counter_memory_test.cpp +++ b/test/opt/strip_atomic_counter_memory_test.cpp @@ -45,9 +45,9 @@ std::string GetUnchangedString(std::string(generate_inst)(std::string), std::vector<const char*> result = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint", @@ -76,9 +76,9 @@ std::string GetChangedString(std::string(generate_inst)(std::string), std::vector<const char*> result = { // clang-format off "OpCapability Shader", - "OpCapability VulkanMemoryModelKHR", + "OpCapability VulkanMemoryModel", "OpExtension \"SPV_KHR_vulkan_memory_model\"", - "OpMemoryModel Logical VulkanKHR", + "OpMemoryModel Logical Vulkan", "OpEntryPoint Vertex %1 \"shader\"", "%uint = OpTypeInt 32 0", "%_ptr_Workgroup_uint = OpTypePointer Workgroup %uint", diff --git a/test/opt/upgrade_memory_model_test.cpp b/test/opt/upgrade_memory_model_test.cpp index ada4d748..b6b596d4 100644 --- a/test/opt/upgrade_memory_model_test.cpp +++ b/test/opt/upgrade_memory_model_test.cpp @@ -34,14 +34,14 @@ OpMemoryModel Logical OpenCL SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true); } -TEST_F(UpgradeMemoryModelTest, InvalidMemoryModelVulkanKHR) { +TEST_F(UpgradeMemoryModelTest, InvalidMemoryModelVulkan) { const std::string text = R"( -; CHECK: OpMemoryModel Logical VulkanKHR +; CHECK: OpMemoryModel Logical Vulkan OpCapability Shader OpCapability Linkage -OpCapability VulkanMemoryModelKHR +OpCapability VulkanMemoryModel OpExtension "SPV_KHR_vulkan_memory_model" -OpMemoryModel Logical VulkanKHR +OpMemoryModel Logical Vulkan )"; SinglePassRunAndMatch<opt::UpgradeMemoryModel>(text, true); @@ -49,9 +49,9 @@ OpMemoryModel Logical VulkanKHR TEST_F(UpgradeMemoryModelTest, JustMemoryModel) { const std::string text = R"( -; CHECK: OpCapability VulkanMemoryModelKHR +; CHECK: OpCapability VulkanMemoryModel ; CHECK: OpExtension "SPV_KHR_vulkan_memory_model" -; CHECK: OpMemoryModel Logical VulkanKHR +; CHECK: OpMemoryModel Logical Vulkan OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -79,8 +79,8 @@ OpDecorate %var Coherent TEST_F(UpgradeMemoryModelTest, WorkgroupVariable) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 2 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -103,8 +103,8 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, WorkgroupFunctionParameter) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 2 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -128,8 +128,8 @@ TEST_F(UpgradeMemoryModelTest, SimpleUniformVariable) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -155,8 +155,8 @@ TEST_F(UpgradeMemoryModelTest, SimpleUniformFunctionParameter) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -208,8 +208,8 @@ TEST_F(UpgradeMemoryModelTest, SimpleUniformVariableCopied) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -236,8 +236,8 @@ TEST_F(UpgradeMemoryModelTest, SimpleUniformFunctionParameterCopied) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -265,8 +265,8 @@ TEST_F(UpgradeMemoryModelTest, SimpleUniformVariableAccessChain) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -297,8 +297,8 @@ TEST_F(UpgradeMemoryModelTest, SimpleUniformFunctionParameterAccessChain) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 @@ -330,8 +330,8 @@ TEST_F(UpgradeMemoryModelTest, VariablePointerSelect) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpCapability VariablePointers @@ -363,8 +363,8 @@ TEST_F(UpgradeMemoryModelTest, VariablePointerSelectConservative) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpCapability VariablePointers @@ -396,8 +396,8 @@ TEST_F(UpgradeMemoryModelTest, VariablePointerIncrement) { const std::string text = R"( ; CHECK-NOT: OpDecorate {{%\w+}} Coherent ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpCapability VariablePointers @@ -439,8 +439,8 @@ TEST_F(UpgradeMemoryModelTest, CoherentStructElement) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -470,8 +470,8 @@ TEST_F(UpgradeMemoryModelTest, CoherentElementFullStructAccess) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -497,9 +497,9 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, CoherentElementNotAccessed) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate -; CHECK-NOT: MakePointerAvailableKHR -; CHECK-NOT: NonPrivatePointerKHR -; CHECK-NOT: MakePointerVisibleKHR +; CHECK-NOT: MakePointerAvailable +; CHECK-NOT: NonPrivatePointer +; CHECK-NOT: MakePointerVisible OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -529,8 +529,8 @@ TEST_F(UpgradeMemoryModelTest, MultiIndexAccessCoherent) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -563,9 +563,9 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, MultiIndexAccessNonCoherent) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate -; CHECK-NOT: MakePointerAvailableKHR -; CHECK-NOT: NonPrivatePointerKHR -; CHECK-NOT: MakePointerVisibleKHR +; CHECK-NOT: MakePointerAvailable +; CHECK-NOT: NonPrivatePointer +; CHECK-NOT: MakePointerVisible OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -599,8 +599,8 @@ TEST_F(UpgradeMemoryModelTest, ConsecutiveAccessChainCoherent) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -639,9 +639,9 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, ConsecutiveAccessChainNonCoherent) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate -; CHECK-NOT: MakePointerAvailableKHR -; CHECK-NOT: NonPrivatePointerKHR -; CHECK-NOT: MakePointerVisibleKHR +; CHECK-NOT: MakePointerAvailable +; CHECK-NOT: NonPrivatePointer +; CHECK-NOT: MakePointerVisible OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -681,8 +681,8 @@ TEST_F(UpgradeMemoryModelTest, CoherentStructElementAccess) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -722,8 +722,8 @@ TEST_F(UpgradeMemoryModelTest, NonCoherentLoadCoherentStore) { const std::string text = R"( ; CHECK-NOT: OpMemberDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK-NOT: MakePointerVisibleKHR -; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] +; CHECK-NOT: MakePointerVisible +; CHECK: OpStore {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -763,7 +763,7 @@ TEST_F(UpgradeMemoryModelTest, CopyMemory) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[queuefamily:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Volatile|MakePointerVisibleKHR|NonPrivatePointerKHR [[queuefamily]] +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Volatile|MakePointerVisible|NonPrivatePointer [[queuefamily]] ; CHECK-NOT: [[queuefamily]] OpCapability Shader OpCapability Linkage @@ -791,7 +791,7 @@ TEST_F(UpgradeMemoryModelTest, CopyMemorySized) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[queuefamily:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemorySized {{%\w+}} {{%\w+}} {{%\w+}} Volatile|MakePointerAvailableKHR|NonPrivatePointerKHR [[queuefamily]] +; CHECK: OpCopyMemorySized {{%\w+}} {{%\w+}} {{%\w+}} Volatile|MakePointerAvailable|NonPrivatePointer [[queuefamily]] ; CHECK-NOT: [[queuefamily]] OpCapability Shader OpCapability Linkage @@ -822,7 +822,7 @@ TEST_F(UpgradeMemoryModelTest, CopyMemoryTwoScopes) { ; CHECK-NOT: OpDecorate ; CHECK-DAG: [[queuefamily:%\w+]] = OpConstant {{%\w+}} 5 ; CHECK-DAG: [[workgroup:%\w+]] = OpConstant {{%\w+}} 2 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailableKHR|MakePointerVisibleKHR|NonPrivatePointerKHR [[workgroup]] [[queuefamily]] +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailable|MakePointerVisible|NonPrivatePointer [[workgroup]] [[queuefamily]] OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -850,7 +850,7 @@ TEST_F(UpgradeMemoryModelTest, VolatileImageRead) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile -; CHECK: OpImageRead {{%\w+}} {{%\w+}} {{%\w+}} VolatileTexelKHR +; CHECK: OpImageRead {{%\w+}} {{%\w+}} {{%\w+}} VolatileTexel OpCapability Shader OpCapability Linkage OpCapability StorageImageReadWithoutFormat @@ -882,8 +882,8 @@ TEST_F(UpgradeMemoryModelTest, CoherentImageRead) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpImageRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisibleKHR|NonPrivateTexelKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpImageRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisible|NonPrivateTexel [[scope]] OpCapability Shader OpCapability Linkage OpCapability StorageImageReadWithoutFormat @@ -916,9 +916,9 @@ TEST_F(UpgradeMemoryModelTest, CoherentImageReadExtractedFromSampledImage) { ; CHECK-NOT: OpDecorate ; CHECK: [[image:%\w+]] = OpTypeImage ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad [[image]] {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK-NOT: NonPrivatePointerKHR -; CHECK: OpImageRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisibleKHR|NonPrivateTexelKHR [[scope]] +; CHECK: OpLoad [[image]] {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK-NOT: NonPrivatePointer +; CHECK: OpImageRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisible|NonPrivateTexel [[scope]] OpCapability Shader OpCapability Linkage OpCapability StorageImageReadWithoutFormat @@ -957,7 +957,7 @@ TEST_F(UpgradeMemoryModelTest, VolatileImageWrite) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile -; CHECK: OpImageWrite {{%\w+}} {{%\w+}} {{%\w+}} VolatileTexelKHR +; CHECK: OpImageWrite {{%\w+}} {{%\w+}} {{%\w+}} VolatileTexel OpCapability Shader OpCapability Linkage OpCapability StorageImageWriteWithoutFormat @@ -989,8 +989,8 @@ TEST_F(UpgradeMemoryModelTest, CoherentImageWrite) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR -; CHECK: OpImageWrite {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelAvailableKHR|NonPrivateTexelKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer +; CHECK: OpImageWrite {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelAvailable|NonPrivateTexel [[scope]] OpCapability Shader OpCapability Linkage OpCapability StorageImageWriteWithoutFormat @@ -1022,9 +1022,9 @@ TEST_F(UpgradeMemoryModelTest, CoherentImageWriteExtractFromSampledImage) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR -; CHECK-NOT: NonPrivatePointerKHR -; CHECK: OpImageWrite {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelAvailableKHR|NonPrivateTexelKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer +; CHECK-NOT: NonPrivatePointer +; CHECK: OpImageWrite {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelAvailable|NonPrivateTexel [[scope]] OpCapability Shader OpCapability Linkage OpCapability StorageImageWriteWithoutFormat @@ -1063,7 +1063,7 @@ TEST_F(UpgradeMemoryModelTest, VolatileImageSparseRead) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: OpLoad {{%\w+}} {{%\w+}} Volatile -; CHECK: OpImageSparseRead {{%\w+}} {{%\w+}} {{%\w+}} VolatileTexelKHR +; CHECK: OpImageSparseRead {{%\w+}} {{%\w+}} {{%\w+}} VolatileTexel OpCapability Shader OpCapability Linkage OpCapability StorageImageReadWithoutFormat @@ -1097,8 +1097,8 @@ TEST_F(UpgradeMemoryModelTest, CoherentImageSparseRead) { const std::string text = R"( ; CHECK-NOT: OpDecorate ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK: OpImageSparseRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisibleKHR|NonPrivateTexelKHR [[scope]] +; CHECK: OpLoad {{%\w+}} {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK: OpImageSparseRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisible|NonPrivateTexel [[scope]] OpCapability Shader OpCapability Linkage OpCapability StorageImageReadWithoutFormat @@ -1134,9 +1134,9 @@ TEST_F(UpgradeMemoryModelTest, ; CHECK-NOT: OpDecorate ; CHECK: [[image:%\w+]] = OpTypeImage ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpLoad [[image]] {{%\w+}} MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] -; CHECK-NOT: NonPrivatePointerKHR -; CHECK: OpImageSparseRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisibleKHR|NonPrivateTexelKHR [[scope]] +; CHECK: OpLoad [[image]] {{%\w+}} MakePointerVisible|NonPrivatePointer [[scope]] +; CHECK-NOT: NonPrivatePointer +; CHECK: OpImageSparseRead {{%\w+}} {{%\w+}} {{%\w+}} MakeTexelVisible|NonPrivateTexel [[scope]] OpCapability Shader OpCapability Linkage OpCapability StorageImageReadWithoutFormat @@ -1440,7 +1440,7 @@ TEST_F(UpgradeMemoryModelTest, UpgradeModfNoFlags) { ; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 0 ; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 1 ; CHECK: OpStore [[var]] [[ex1]] -; CHECK-NOT: NonPrivatePointerKHR +; CHECK-NOT: NonPrivatePointer ; CHECK: OpFAdd [[float]] [[float_0]] [[ex0]] OpCapability Shader OpMemoryModel Logical GLSL450 @@ -1474,7 +1474,7 @@ TEST_F(UpgradeMemoryModelTest, UpgradeModfWorkgroupCoherent) { ; CHECK: [[modfstruct:%\w+]] = OpExtInst [[struct]] {{%\w+}} ModfStruct [[float_0]] ; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 0 ; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 1 -; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailableKHR|NonPrivatePointerKHR [[wg_scope]] +; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailable|NonPrivatePointer [[wg_scope]] ; CHECK: OpFAdd [[float]] [[float_0]] [[ex0]] OpCapability Shader OpMemoryModel Logical GLSL450 @@ -1509,7 +1509,7 @@ TEST_F(UpgradeMemoryModelTest, UpgradeModfSSBOCoherent) { ; CHECK: [[modfstruct:%\w+]] = OpExtInst [[struct]] {{%\w+}} ModfStruct [[float_0]] ; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 0 ; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 1 -; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailableKHR|NonPrivatePointerKHR [[qf_scope]] +; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailable|NonPrivatePointer [[qf_scope]] ; CHECK: OpFAdd [[float]] [[float_0]] [[ex0]] OpCapability Shader OpMemoryModel Logical GLSL450 @@ -1579,7 +1579,7 @@ TEST_F(UpgradeMemoryModelTest, UpgradeFrexpNoFlags) { ; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 0 ; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[int]] [[modfstruct]] 1 ; CHECK: OpStore [[var]] [[ex1]] -; CHECK-NOT: NonPrivatePointerKHR +; CHECK-NOT: NonPrivatePointer ; CHECK: OpFAdd [[float]] [[float_0]] [[ex0]] OpCapability Shader OpMemoryModel Logical GLSL450 @@ -1615,7 +1615,7 @@ TEST_F(UpgradeMemoryModelTest, UpgradeFrexpWorkgroupCoherent) { ; CHECK: [[modfstruct:%\w+]] = OpExtInst [[struct]] {{%\w+}} FrexpStruct [[float_0]] ; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 0 ; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[int]] [[modfstruct]] 1 -; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailableKHR|NonPrivatePointerKHR [[wg_scope]] +; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailable|NonPrivatePointer [[wg_scope]] ; CHECK: OpFAdd [[float]] [[float_0]] [[ex0]] OpCapability Shader OpMemoryModel Logical GLSL450 @@ -1652,7 +1652,7 @@ TEST_F(UpgradeMemoryModelTest, UpgradeFrexpSSBOCoherent) { ; CHECK: [[modfstruct:%\w+]] = OpExtInst [[struct]] {{%\w+}} FrexpStruct [[float_0]] ; CHECK: [[ex0:%\w+]] = OpCompositeExtract [[float]] [[modfstruct]] 0 ; CHECK: [[ex1:%\w+]] = OpCompositeExtract [[int]] [[modfstruct]] 1 -; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailableKHR|NonPrivatePointerKHR [[qf_scope]] +; CHECK: OpStore [[var]] [[ex1]] MakePointerAvailable|NonPrivatePointer [[qf_scope]] ; CHECK: OpFAdd [[float]] [[float_0]] [[ex0]] OpCapability Shader OpMemoryModel Logical GLSL450 @@ -1785,7 +1785,7 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, SPV14CopyMemoryDstCoherent) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] None +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] None OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -1810,7 +1810,7 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, SPV14CopyMemoryDstCoherentPreviousArgs) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned|MakePointerAvailableKHR|NonPrivatePointerKHR 4 [[scope]] Aligned 4 +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned|MakePointerAvailable|NonPrivatePointer 4 [[scope]] Aligned 4 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -1835,7 +1835,7 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, SPV14CopyMemorySrcCoherent) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} None MakePointerVisibleKHR|NonPrivatePointerKHR [[scope]] +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} None MakePointerVisible|NonPrivatePointer [[scope]] OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -1860,7 +1860,7 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, SPV14CopyMemorySrcCoherentPreviousArgs) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned 4 Aligned|MakePointerVisibleKHR|NonPrivatePointerKHR 4 [[scope]] +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned 4 Aligned|MakePointerVisible|NonPrivatePointer 4 [[scope]] OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -1886,7 +1886,7 @@ TEST_F(UpgradeMemoryModelTest, SPV14CopyMemoryBothCoherent) { const std::string text = R"( ; CHECK-DAG: [[queue:%\w+]] = OpConstant {{%\w+}} 5 ; CHECK-DAG: [[wg:%\w+]] = OpConstant {{%\w+}} 2 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[wg]] MakePointerVisibleKHR|NonPrivatePointerKHR [[queue]] +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[wg]] MakePointerVisible|NonPrivatePointer [[queue]] OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -1913,7 +1913,7 @@ TEST_F(UpgradeMemoryModelTest, SPV14CopyMemoryBothCoherentPreviousArgs) { const std::string text = R"( ; CHECK-DAG: [[queue:%\w+]] = OpConstant {{%\w+}} 5 ; CHECK-DAG: [[wg:%\w+]] = OpConstant {{%\w+}} 2 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned|MakePointerAvailableKHR|NonPrivatePointerKHR 4 [[queue]] Aligned|MakePointerVisibleKHR|NonPrivatePointerKHR 4 [[wg]] +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned|MakePointerAvailable|NonPrivatePointer 4 [[queue]] Aligned|MakePointerVisible|NonPrivatePointer 4 [[wg]] OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -1989,7 +1989,7 @@ OpFunctionEnd TEST_F(UpgradeMemoryModelTest, SPV14CopyMemoryDstCoherentTwoOperands) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailableKHR|NonPrivatePointerKHR [[scope]] None +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} MakePointerAvailable|NonPrivatePointer [[scope]] None OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst @@ -2015,7 +2015,7 @@ TEST_F(UpgradeMemoryModelTest, SPV14CopyMemoryDstCoherentPreviousArgsTwoOperands) { const std::string text = R"( ; CHECK: [[scope:%\w+]] = OpConstant {{%\w+}} 5 -; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned|MakePointerAvailableKHR|NonPrivatePointerKHR 4 [[scope]] Aligned 8 +; CHECK: OpCopyMemory {{%\w+}} {{%\w+}} Aligned|MakePointerAvailable|NonPrivatePointer 4 [[scope]] Aligned 8 OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint GLCompute %func "func" %src %dst diff --git a/test/text_to_binary.extension_test.cpp b/test/text_to_binary.extension_test.cpp index 9408e9ac..023763b7 100644 --- a/test/text_to_binary.extension_test.cpp +++ b/test/text_to_binary.extension_test.cpp @@ -527,54 +527,54 @@ INSTANTIATE_TEST_SUITE_P( Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1), ValuesIn(std::vector<AssemblyCase>{ - {"OpCapability VulkanMemoryModelKHR\n", + {"OpCapability VulkanMemoryModel\n", MakeInstruction(SpvOpCapability, {SpvCapabilityVulkanMemoryModelKHR})}, - {"OpCapability VulkanMemoryModelDeviceScopeKHR\n", + {"OpCapability VulkanMemoryModelDeviceScope\n", MakeInstruction(SpvOpCapability, {SpvCapabilityVulkanMemoryModelDeviceScopeKHR})}, - {"OpMemoryModel Logical VulkanKHR\n", + {"OpMemoryModel Logical Vulkan\n", MakeInstruction(SpvOpMemoryModel, {SpvAddressingModelLogical, SpvMemoryModelVulkanKHR})}, - {"OpStore %1 %2 MakePointerAvailableKHR %3\n", + {"OpStore %1 %2 MakePointerAvailable %3\n", MakeInstruction(SpvOpStore, {1, 2, SpvMemoryAccessMakePointerAvailableKHRMask, 3})}, - {"OpStore %1 %2 Volatile|MakePointerAvailableKHR %3\n", + {"OpStore %1 %2 Volatile|MakePointerAvailable %3\n", MakeInstruction(SpvOpStore, {1, 2, int(SpvMemoryAccessMakePointerAvailableKHRMask) | int(SpvMemoryAccessVolatileMask), 3})}, - {"OpStore %1 %2 Aligned|MakePointerAvailableKHR 4 %3\n", + {"OpStore %1 %2 Aligned|MakePointerAvailable 4 %3\n", MakeInstruction(SpvOpStore, {1, 2, int(SpvMemoryAccessMakePointerAvailableKHRMask) | int(SpvMemoryAccessAlignedMask), 4, 3})}, - {"OpStore %1 %2 MakePointerAvailableKHR|NonPrivatePointerKHR %3\n", + {"OpStore %1 %2 MakePointerAvailable|NonPrivatePointer %3\n", MakeInstruction(SpvOpStore, {1, 2, int(SpvMemoryAccessMakePointerAvailableKHRMask) | int(SpvMemoryAccessNonPrivatePointerKHRMask), 3})}, - {"%2 = OpLoad %1 %3 MakePointerVisibleKHR %4\n", + {"%2 = OpLoad %1 %3 MakePointerVisible %4\n", MakeInstruction(SpvOpLoad, {1, 2, 3, SpvMemoryAccessMakePointerVisibleKHRMask, 4})}, - {"%2 = OpLoad %1 %3 Volatile|MakePointerVisibleKHR %4\n", + {"%2 = OpLoad %1 %3 Volatile|MakePointerVisible %4\n", MakeInstruction(SpvOpLoad, {1, 2, 3, int(SpvMemoryAccessMakePointerVisibleKHRMask) | int(SpvMemoryAccessVolatileMask), 4})}, - {"%2 = OpLoad %1 %3 Aligned|MakePointerVisibleKHR 8 %4\n", + {"%2 = OpLoad %1 %3 Aligned|MakePointerVisible 8 %4\n", MakeInstruction(SpvOpLoad, {1, 2, 3, int(SpvMemoryAccessMakePointerVisibleKHRMask) | int(SpvMemoryAccessAlignedMask), 8, 4})}, - {"%2 = OpLoad %1 %3 MakePointerVisibleKHR|NonPrivatePointerKHR " + {"%2 = OpLoad %1 %3 MakePointerVisible|NonPrivatePointer " "%4\n", MakeInstruction(SpvOpLoad, {1, 2, 3, @@ -582,9 +582,9 @@ INSTANTIATE_TEST_SUITE_P( int(SpvMemoryAccessNonPrivatePointerKHRMask), 4})}, {"OpCopyMemory %1 %2 " - "MakePointerAvailableKHR|" - "MakePointerVisibleKHR|" - "NonPrivatePointerKHR " + "MakePointerAvailable|" + "MakePointerVisible|" + "NonPrivatePointer " "%3 %4\n", MakeInstruction(SpvOpCopyMemory, {1, 2, @@ -593,9 +593,9 @@ INSTANTIATE_TEST_SUITE_P( int(SpvMemoryAccessNonPrivatePointerKHRMask)), 3, 4})}, {"OpCopyMemorySized %1 %2 %3 " - "MakePointerAvailableKHR|" - "MakePointerVisibleKHR|" - "NonPrivatePointerKHR " + "MakePointerAvailable|" + "MakePointerVisible|" + "NonPrivatePointer " "%4 %5\n", MakeInstruction(SpvOpCopyMemorySized, {1, 2, 3, @@ -604,12 +604,12 @@ INSTANTIATE_TEST_SUITE_P( int(SpvMemoryAccessNonPrivatePointerKHRMask)), 4, 5})}, // Image operands - {"OpImageWrite %1 %2 %3 MakeTexelAvailableKHR " + {"OpImageWrite %1 %2 %3 MakeTexelAvailable " "%4\n", MakeInstruction( SpvOpImageWrite, {1, 2, 3, int(SpvImageOperandsMakeTexelAvailableKHRMask), 4})}, - {"OpImageWrite %1 %2 %3 MakeTexelAvailableKHR|NonPrivateTexelKHR " + {"OpImageWrite %1 %2 %3 MakeTexelAvailable|NonPrivateTexel " "%4\n", MakeInstruction(SpvOpImageWrite, {1, 2, 3, @@ -617,7 +617,7 @@ INSTANTIATE_TEST_SUITE_P( int(SpvImageOperandsNonPrivateTexelKHRMask), 4})}, {"OpImageWrite %1 %2 %3 " - "MakeTexelAvailableKHR|NonPrivateTexelKHR|VolatileTexelKHR " + "MakeTexelAvailable|NonPrivateTexel|VolatileTexel " "%4\n", MakeInstruction(SpvOpImageWrite, {1, 2, 3, @@ -625,14 +625,14 @@ INSTANTIATE_TEST_SUITE_P( int(SpvImageOperandsNonPrivateTexelKHRMask) | int(SpvImageOperandsVolatileTexelKHRMask), 4})}, - {"%2 = OpImageRead %1 %3 %4 MakeTexelVisibleKHR " + {"%2 = OpImageRead %1 %3 %4 MakeTexelVisible " "%5\n", MakeInstruction(SpvOpImageRead, {1, 2, 3, 4, int(SpvImageOperandsMakeTexelVisibleKHRMask), 5})}, {"%2 = OpImageRead %1 %3 %4 " - "MakeTexelVisibleKHR|NonPrivateTexelKHR " + "MakeTexelVisible|NonPrivateTexel " "%5\n", MakeInstruction(SpvOpImageRead, {1, 2, 3, 4, @@ -640,7 +640,7 @@ INSTANTIATE_TEST_SUITE_P( int(SpvImageOperandsNonPrivateTexelKHRMask), 5})}, {"%2 = OpImageRead %1 %3 %4 " - "MakeTexelVisibleKHR|NonPrivateTexelKHR|VolatileTexelKHR " + "MakeTexelVisible|NonPrivateTexel|VolatileTexel " "%5\n", MakeInstruction(SpvOpImageRead, {1, 2, 3, 4, @@ -826,82 +826,82 @@ INSTANTIATE_TEST_SUITE_P( MakeInstruction(SpvOpExtension, MakeVector("SPV_EXT_descriptor_indexing"))}, // Check capabilities, by name - {"OpCapability ShaderNonUniformEXT\n", + {"OpCapability ShaderNonUniform\n", MakeInstruction(SpvOpCapability, {SpvCapabilityShaderNonUniformEXT})}, - {"OpCapability RuntimeDescriptorArrayEXT\n", + {"OpCapability RuntimeDescriptorArray\n", MakeInstruction(SpvOpCapability, {SpvCapabilityRuntimeDescriptorArrayEXT})}, - {"OpCapability InputAttachmentArrayDynamicIndexingEXT\n", + {"OpCapability InputAttachmentArrayDynamicIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityInputAttachmentArrayDynamicIndexingEXT})}, - {"OpCapability UniformTexelBufferArrayDynamicIndexingEXT\n", + {"OpCapability UniformTexelBufferArrayDynamicIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityUniformTexelBufferArrayDynamicIndexingEXT})}, - {"OpCapability StorageTexelBufferArrayDynamicIndexingEXT\n", + {"OpCapability StorageTexelBufferArrayDynamicIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityStorageTexelBufferArrayDynamicIndexingEXT})}, - {"OpCapability UniformBufferArrayNonUniformIndexingEXT\n", + {"OpCapability UniformBufferArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityUniformBufferArrayNonUniformIndexingEXT})}, - {"OpCapability SampledImageArrayNonUniformIndexingEXT\n", + {"OpCapability SampledImageArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilitySampledImageArrayNonUniformIndexingEXT})}, - {"OpCapability StorageBufferArrayNonUniformIndexingEXT\n", + {"OpCapability StorageBufferArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityStorageBufferArrayNonUniformIndexingEXT})}, - {"OpCapability StorageImageArrayNonUniformIndexingEXT\n", + {"OpCapability StorageImageArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityStorageImageArrayNonUniformIndexingEXT})}, - {"OpCapability InputAttachmentArrayNonUniformIndexingEXT\n", + {"OpCapability InputAttachmentArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityInputAttachmentArrayNonUniformIndexingEXT})}, - {"OpCapability UniformTexelBufferArrayNonUniformIndexingEXT\n", + {"OpCapability UniformTexelBufferArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityUniformTexelBufferArrayNonUniformIndexingEXT})}, - {"OpCapability StorageTexelBufferArrayNonUniformIndexingEXT\n", + {"OpCapability StorageTexelBufferArrayNonUniformIndexing\n", MakeInstruction( SpvOpCapability, {SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT})}, // Check capabilities, by number - {"OpCapability ShaderNonUniformEXT\n", + {"OpCapability ShaderNonUniform\n", MakeInstruction(SpvOpCapability, {5301})}, - {"OpCapability RuntimeDescriptorArrayEXT\n", + {"OpCapability RuntimeDescriptorArray\n", MakeInstruction(SpvOpCapability, {5302})}, - {"OpCapability InputAttachmentArrayDynamicIndexingEXT\n", + {"OpCapability InputAttachmentArrayDynamicIndexing\n", MakeInstruction(SpvOpCapability, {5303})}, - {"OpCapability UniformTexelBufferArrayDynamicIndexingEXT\n", + {"OpCapability UniformTexelBufferArrayDynamicIndexing\n", MakeInstruction(SpvOpCapability, {5304})}, - {"OpCapability StorageTexelBufferArrayDynamicIndexingEXT\n", + {"OpCapability StorageTexelBufferArrayDynamicIndexing\n", MakeInstruction(SpvOpCapability, {5305})}, - {"OpCapability UniformBufferArrayNonUniformIndexingEXT\n", + {"OpCapability UniformBufferArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5306})}, - {"OpCapability SampledImageArrayNonUniformIndexingEXT\n", + {"OpCapability SampledImageArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5307})}, - {"OpCapability StorageBufferArrayNonUniformIndexingEXT\n", + {"OpCapability StorageBufferArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5308})}, - {"OpCapability StorageImageArrayNonUniformIndexingEXT\n", + {"OpCapability StorageImageArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5309})}, - {"OpCapability InputAttachmentArrayNonUniformIndexingEXT\n", + {"OpCapability InputAttachmentArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5310})}, - {"OpCapability UniformTexelBufferArrayNonUniformIndexingEXT\n", + {"OpCapability UniformTexelBufferArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5311})}, - {"OpCapability StorageTexelBufferArrayNonUniformIndexingEXT\n", + {"OpCapability StorageTexelBufferArrayNonUniformIndexing\n", MakeInstruction(SpvOpCapability, {5312})}, // Check the decoration token - {"OpDecorate %1 NonUniformEXT\n", + {"OpDecorate %1 NonUniform\n", MakeInstruction(SpvOpDecorate, {1, SpvDecorationNonUniformEXT})}, - {"OpDecorate %1 NonUniformEXT\n", + {"OpDecorate %1 NonUniform\n", MakeInstruction(SpvOpDecorate, {1, 5300})}, }))); diff --git a/test/text_to_binary.memory_test.cpp b/test/text_to_binary.memory_test.cpp index c83c8479..7b09ed58 100644 --- a/test/text_to_binary.memory_test.cpp +++ b/test/text_to_binary.memory_test.cpp @@ -212,7 +212,7 @@ TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessNontemporalGood) { } TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessAvGood) { - std::string spirv = "OpCopyMemory %1 %2 MakePointerAvailableKHR %3\n"; + std::string spirv = "OpCopyMemory %1 %2 MakePointerAvailable %3\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemory, {1, 2, 8, 3}))); std::string disassembly = @@ -221,7 +221,7 @@ TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessAvGood) { } TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessVisGood) { - std::string spirv = "OpCopyMemory %1 %2 MakePointerVisibleKHR %3\n"; + std::string spirv = "OpCopyMemory %1 %2 MakePointerVisible %3\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemory, {1, 2, 16, 3}))); std::string disassembly = @@ -230,7 +230,7 @@ TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessVisGood) { } TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessNonPrivateGood) { - std::string spirv = "OpCopyMemory %1 %2 NonPrivatePointerKHR\n"; + std::string spirv = "OpCopyMemory %1 %2 NonPrivatePointer\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemory, {1, 2, 32}))); std::string disassembly = @@ -241,8 +241,8 @@ TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessNonPrivateGood) { TEST_F(MemoryRoundTripTest, OpCopyMemoryAccessMixedGood) { std::string spirv = "OpCopyMemory %1 %2 " - "Volatile|Aligned|Nontemporal|MakePointerAvailableKHR|" - "MakePointerVisibleKHR|NonPrivatePointerKHR 16 %3 %4\n"; + "Volatile|Aligned|Nontemporal|MakePointerAvailable|" + "MakePointerVisible|NonPrivatePointer 16 %3 %4\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemory, {1, 2, 63, 16, 3, 4}))); std::string disassembly = @@ -272,8 +272,8 @@ TEST_F(MemoryRoundTripTest, OpCopyMemoryTwoAccessV14Good) { TEST_F(MemoryRoundTripTest, OpCopyMemoryTwoAccessMixedV14Good) { std::string spirv = "OpCopyMemory %1 %2 Volatile|Nontemporal|" - "MakePointerVisibleKHR %3 " - "Aligned|MakePointerAvailableKHR|NonPrivatePointerKHR 16 %4\n"; + "MakePointerVisible %3 " + "Aligned|MakePointerAvailable|NonPrivatePointer 16 %4\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemory, {1, 2, 21, 3, 42, 16, 4}))); std::string disassembly = @@ -341,7 +341,7 @@ TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessNontemporalGood) { } TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessAvGood) { - std::string spirv = "OpCopyMemorySized %1 %2 %3 MakePointerAvailableKHR %4\n"; + std::string spirv = "OpCopyMemorySized %1 %2 %3 MakePointerAvailable %4\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemorySized, {1, 2, 3, 8, 4}))); std::string disassembly = @@ -350,7 +350,7 @@ TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessAvGood) { } TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessVisGood) { - std::string spirv = "OpCopyMemorySized %1 %2 %3 MakePointerVisibleKHR %4\n"; + std::string spirv = "OpCopyMemorySized %1 %2 %3 MakePointerVisible %4\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemorySized, {1, 2, 3, 16, 4}))); std::string disassembly = @@ -359,7 +359,7 @@ TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessVisGood) { } TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessNonPrivateGood) { - std::string spirv = "OpCopyMemorySized %1 %2 %3 NonPrivatePointerKHR\n"; + std::string spirv = "OpCopyMemorySized %1 %2 %3 NonPrivatePointer\n"; EXPECT_THAT(CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemorySized, {1, 2, 3, 32}))); std::string disassembly = @@ -370,8 +370,8 @@ TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessNonPrivateGood) { TEST_F(MemoryRoundTripTest, OpCopyMemorySizedAccessMixedGood) { std::string spirv = "OpCopyMemorySized %1 %2 %3 " - "Volatile|Aligned|Nontemporal|MakePointerAvailableKHR|" - "MakePointerVisibleKHR|NonPrivatePointerKHR 16 %4 %5\n"; + "Volatile|Aligned|Nontemporal|MakePointerAvailable|" + "MakePointerVisible|NonPrivatePointer 16 %4 %5\n"; EXPECT_THAT( CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemorySized, {1, 2, 3, 63, 16, 4, 5}))); @@ -402,8 +402,8 @@ TEST_F(MemoryRoundTripTest, OpCopyMemorySizedTwoAccessV14Good) { TEST_F(MemoryRoundTripTest, OpCopyMemorySizedTwoAccessMixedV14Good) { std::string spirv = "OpCopyMemorySized %1 %2 %3 Volatile|Nontemporal|" - "MakePointerVisibleKHR %4 " - "Aligned|MakePointerAvailableKHR|NonPrivatePointerKHR 16 %5\n"; + "MakePointerVisible %4 " + "Aligned|MakePointerAvailable|NonPrivatePointer 16 %5\n"; EXPECT_THAT( CompiledInstructions(spirv), Eq(MakeInstruction(SpvOpCopyMemorySized, {1, 2, 3, 21, 4, 42, 16, 5}))); diff --git a/test/tools/expect.py b/test/tools/expect.py index e21a0c4f..52999ce5 100755 --- a/test/tools/expect.py +++ b/test/tools/expect.py @@ -270,8 +270,8 @@ class ValidObjectFile1_3(ReturnCodeIsZero, CorrectObjectFilePreamble): return True, '' -class ValidObjectFile1_4(ReturnCodeIsZero, CorrectObjectFilePreamble): - """Mixin class for checking that every input file generates a valid SPIR-V 1.4 +class ValidObjectFile1_5(ReturnCodeIsZero, CorrectObjectFilePreamble): + """Mixin class for checking that every input file generates a valid SPIR-V 1.5 object file following the object file naming rule, and there is no output on stdout/stderr.""" @@ -279,7 +279,7 @@ class ValidObjectFile1_4(ReturnCodeIsZero, CorrectObjectFilePreamble): for input_filename in status.input_filenames: object_filename = get_object_filename(input_filename) success, message = self.verify_object_file_preamble( - os.path.join(status.directory, object_filename), 0x10400) + os.path.join(status.directory, object_filename), 0x10500) if not success: return False, message return True, '' diff --git a/test/tools/opt/flags.py b/test/tools/opt/flags.py index e0f53870..b34a1688 100644 --- a/test/tools/opt/flags.py +++ b/test/tools/opt/flags.py @@ -34,7 +34,7 @@ def empty_main_assembly(): @inside_spirv_testsuite('SpirvOptBase') -class TestAssemblyFileAsOnlyParameter(expect.ValidObjectFile1_4): +class TestAssemblyFileAsOnlyParameter(expect.ValidObjectFile1_5): """Tests that spirv-opt accepts a SPIR-V object file.""" shader = placeholder.FileSPIRVShader(empty_main_assembly(), '.spvasm') @@ -52,7 +52,7 @@ class TestHelpFlag(expect.ReturnCodeIsZero, expect.StdoutMatch): @inside_spirv_testsuite('SpirvOptFlags') -class TestValidPassFlags(expect.ValidObjectFile1_4, +class TestValidPassFlags(expect.ValidObjectFile1_5, expect.ExecutedListOfPasses): """Tests that spirv-opt accepts all valid optimization flags.""" @@ -129,7 +129,7 @@ class TestValidPassFlags(expect.ValidObjectFile1_4, @inside_spirv_testsuite('SpirvOptFlags') -class TestPerformanceOptimizationPasses(expect.ValidObjectFile1_4, +class TestPerformanceOptimizationPasses(expect.ValidObjectFile1_5, expect.ExecutedListOfPasses): """Tests that spirv-opt schedules all the passes triggered by -O.""" @@ -177,7 +177,7 @@ class TestPerformanceOptimizationPasses(expect.ValidObjectFile1_4, @inside_spirv_testsuite('SpirvOptFlags') -class TestSizeOptimizationPasses(expect.ValidObjectFile1_4, +class TestSizeOptimizationPasses(expect.ValidObjectFile1_5, expect.ExecutedListOfPasses): """Tests that spirv-opt schedules all the passes triggered by -Os.""" @@ -217,7 +217,7 @@ class TestSizeOptimizationPasses(expect.ValidObjectFile1_4, @inside_spirv_testsuite('SpirvOptFlags') -class TestLegalizationPasses(expect.ValidObjectFile1_4, +class TestLegalizationPasses(expect.ValidObjectFile1_5, expect.ExecutedListOfPasses): """Tests that spirv-opt schedules all the passes triggered by --legalize-hlsl. """ diff --git a/test/val/val_capability_test.cpp b/test/val/val_capability_test.cpp index 505edb22..ae1d62bd 100644 --- a/test/val/val_capability_test.cpp +++ b/test/val/val_capability_test.cpp @@ -23,6 +23,7 @@ #include "gmock/gmock.h" #include "source/assembly_grammar.h" #include "source/spirv_target_env.h" +#include "spirv-tools/libspirv.h" #include "test/test_fixture.h" #include "test/unit_spirv.h" #include "test/val/val_fixtures.h" @@ -33,6 +34,7 @@ namespace { using spvtest::ScopedContext; using testing::Combine; +using testing::Eq; using testing::HasSubstr; using testing::Values; using testing::ValuesIn; @@ -2484,6 +2486,178 @@ OpFunctionEnd << getDiagnosticString(); } +// Test that extensions incorporated into SPIR-V 1.5 no longer require +// the associated OpExtension instruction. Test one capability per extension. + +struct CapabilityExtensionVersionCase { + std::string capability; + std::string capability_new_name; + std::string extension; + spv_target_env last_version_requiring_extension; + spv_target_env first_version_in_core; +}; + +using ValidateCapabilityExtensionVersionTest = + spvtest::ValidateBase<CapabilityExtensionVersionCase>; + +// Returns a minimal shader module with the given capability instruction. +std::string MinimalShaderModuleWithCapability(std::string cap) { + std::string mem_model = + (cap.find("VulkanMemory") == 0) ? "VulkanKHR" : "GLSL450"; + std::string extra_cap = (cap.find("VulkanMemoryModelDeviceScope") == 0) + ? "\nOpCapability VulkanMemoryModelKHR\n" + : ""; + return std::string("OpCapability ") + cap + extra_cap + R"( +OpCapability Shader +OpMemoryModel Logical )" + mem_model + R"( +OpEntryPoint Vertex %main "main" +%void = OpTypeVoid +%void_fn = OpTypeFunction %void +%main = OpFunction %void None %void_fn +%entry = OpLabel +OpReturn +OpFunctionEnd +)"; +} + +TEST_P(ValidateCapabilityExtensionVersionTest, FailsInOlderSpirvVersion) { + const auto spirv = MinimalShaderModuleWithCapability(GetParam().capability); + CompileSuccessfully(spirv, GetParam().last_version_requiring_extension); + EXPECT_EQ(SPV_ERROR_MISSING_EXTENSION, + ValidateInstructions(GetParam().last_version_requiring_extension)); + EXPECT_THAT(getDiagnosticString(), + HasSubstr(std::string("1st operand of Capability: operand ") + + GetParam().capability_new_name)) + << spirv << "\n"; + EXPECT_THAT(getDiagnosticString(), + HasSubstr(std::string("requires one of these extensions: ") + + GetParam().extension)); +} + +TEST_P(ValidateCapabilityExtensionVersionTest, + SucceedsInNewerSpirvVersionWithOldName) { + const auto spirv = MinimalShaderModuleWithCapability(GetParam().capability); + CompileSuccessfully(spirv, GetParam().first_version_in_core); + EXPECT_EQ(SPV_SUCCESS, + ValidateInstructions(GetParam().first_version_in_core)); + EXPECT_THAT(getDiagnosticString(), Eq("")) << spirv << "\n"; +} + +TEST_P(ValidateCapabilityExtensionVersionTest, + SucceedsInNewerSpirvVersionWithNewName) { + const auto spirv = + MinimalShaderModuleWithCapability(GetParam().capability_new_name); + CompileSuccessfully(spirv, GetParam().first_version_in_core); + EXPECT_EQ(SPV_SUCCESS, + ValidateInstructions(GetParam().first_version_in_core)); + EXPECT_THAT(getDiagnosticString(), Eq("")) << spirv << "\n"; +} + +std::vector<CapabilityExtensionVersionCase> CapVersionCases1_5() { +#define IN15NOSUFFIX(C, E) \ + { C, C, E, SPV_ENV_UNIVERSAL_1_4, SPV_ENV_UNIVERSAL_1_5 } +#define IN15(C, C_WITHOUT_SUFFIX, E) \ + { C, C_WITHOUT_SUFFIX, E, SPV_ENV_UNIVERSAL_1_4, SPV_ENV_UNIVERSAL_1_5 } + return std::vector<CapabilityExtensionVersionCase>{ + // SPV_KHR_8bit_storage + IN15NOSUFFIX("StorageBuffer8BitAccess", "SPV_KHR_8bit_storage"), + IN15NOSUFFIX("UniformAndStorageBuffer8BitAccess", "SPV_KHR_8bit_storage"), + IN15NOSUFFIX("StoragePushConstant8", "SPV_KHR_8bit_storage"), + // SPV_EXT_descriptor_indexing + IN15("ShaderNonUniformEXT", "ShaderNonUniform", + "SPV_EXT_descriptor_indexing"), + IN15("RuntimeDescriptorArrayEXT", "RuntimeDescriptorArray", + "SPV_EXT_descriptor_indexing"), + IN15("InputAttachmentArrayDynamicIndexingEXT", + "InputAttachmentArrayDynamicIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("UniformTexelBufferArrayDynamicIndexingEXT", + "UniformTexelBufferArrayDynamicIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("StorageTexelBufferArrayDynamicIndexingEXT", + "StorageTexelBufferArrayDynamicIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("UniformBufferArrayNonUniformIndexingEXT", + "UniformBufferArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("SampledImageArrayNonUniformIndexingEXT", + "SampledImageArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("StorageBufferArrayNonUniformIndexingEXT", + "StorageBufferArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("StorageImageArrayNonUniformIndexingEXT", + "StorageImageArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("InputAttachmentArrayNonUniformIndexingEXT", + "InputAttachmentArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("UniformTexelBufferArrayNonUniformIndexingEXT", + "UniformTexelBufferArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + IN15("StorageTexelBufferArrayNonUniformIndexingEXT", + "StorageTexelBufferArrayNonUniformIndexing", + "SPV_EXT_descriptor_indexing"), + // SPV_EXT_physical_storage_buffer + IN15("PhysicalStorageBufferAddressesEXT", + "PhysicalStorageBufferAddresses", "SPV_EXT_physical_storage_buffer"), + // SPV_KHR_vulkan_memory_model + IN15("VulkanMemoryModelKHR", "VulkanMemoryModel", + "SPV_KHR_vulkan_memory_model"), + IN15("VulkanMemoryModelDeviceScopeKHR", "VulkanMemoryModelDeviceScope", + "SPV_KHR_vulkan_memory_model"), + }; +#undef IN15 +} + +INSTANTIATE_TEST_SUITE_P(NewInSpirv1_5, ValidateCapabilityExtensionVersionTest, + ValuesIn(CapVersionCases1_5())); + +TEST_P(ValidateCapability, + CapShaderViewportIndexLayerFailsInOlderSpirvVersion) { + const auto spirv = + MinimalShaderModuleWithCapability("ShaderViewportIndexLayerEXT"); + CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_4); + EXPECT_EQ(SPV_ERROR_MISSING_EXTENSION, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_4)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "1st operand of Capability: operand ShaderViewportIndexLayerEXT")); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("requires one of these extensions: " + "SPV_EXT_shader_viewport_index_layer")); +} + +TEST_P(ValidateCapability, CapShaderViewportIndexLayerFailsInNewSpirvVersion) { + const auto spirv = + MinimalShaderModuleWithCapability("ShaderViewportIndexLayerEXT"); + CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_5); + EXPECT_EQ(SPV_ERROR_MISSING_EXTENSION, + ValidateInstructions(SPV_ENV_UNIVERSAL_1_5)); + EXPECT_THAT( + getDiagnosticString(), + HasSubstr( + "1st operand of Capability: operand ShaderViewportIndexLayerEXT")); + EXPECT_THAT(getDiagnosticString(), + HasSubstr("requires one of these extensions: " + "SPV_EXT_shader_viewport_index_layer")); +} + +TEST_F(ValidateCapability, CapShaderViewportIndexSucceedsInNewSpirvVersion) { + const auto spirv = MinimalShaderModuleWithCapability("ShaderViewportIndex"); + CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_5); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5)); + EXPECT_THAT(getDiagnosticString(), Eq("")); +} + +TEST_F(ValidateCapability, CapShaderLayerSucceedsInNewSpirvVersion) { + const auto spirv = MinimalShaderModuleWithCapability("ShaderLayer"); + CompileSuccessfully(spirv, SPV_ENV_UNIVERSAL_1_5); + EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_UNIVERSAL_1_5)); + EXPECT_THAT(getDiagnosticString(), Eq("")); +} + } // namespace } // namespace val } // namespace spvtools diff --git a/test/val/val_decoration_test.cpp b/test/val/val_decoration_test.cpp index c267dbf5..ef3a4eb0 100644 --- a/test/val/val_decoration_test.cpp +++ b/test/val/val_decoration_test.cpp @@ -4785,7 +4785,8 @@ TEST_F(ValidateDecorations, UniformIdDecorationWithScopeIdV13Bad) { ValidateInstructions(SPV_ENV_UNIVERSAL_1_3)); EXPECT_THAT(getDiagnosticString(), HasSubstr("requires SPIR-V version 1.4 or later\n" - " OpDecorateId %int0 UniformId %subgroupscope")); + " OpDecorateId %int0 UniformId %subgroupscope")) + << spirv; } TEST_F(ValidateDecorations, UniformIdDecorationWithScopeIdV13BadTargetV14) { diff --git a/test/val/val_memory_test.cpp b/test/val/val_memory_test.cpp index 54009dfb..5248c066 100644 --- a/test/val/val_memory_test.cpp +++ b/test/val/val_memory_test.cpp @@ -1492,8 +1492,8 @@ OpFunctionEnd getDiagnosticString(), HasSubstr( "Source memory access must not include MakePointerAvailableKHR\n" - " OpCopyMemory %5 %6 MakePointerAvailableKHR|NonPrivatePointerKHR" - " %uint_1 MakePointerAvailableKHR|NonPrivatePointerKHR %uint_1")); + " OpCopyMemory %5 %6 MakePointerAvailable|NonPrivatePointer" + " %uint_1 MakePointerAvailable|NonPrivatePointer %uint_1")); } TEST_F(ValidateMemory, VulkanMemoryModelCopyMemoryTwoAccessSecondWithVisBad) { @@ -1525,10 +1525,9 @@ OpFunctionEnd ValidateInstructions(SPV_ENV_UNIVERSAL_1_4)); EXPECT_THAT( getDiagnosticString(), - HasSubstr( - "Target memory access must not include MakePointerVisibleKHR\n" - " OpCopyMemory %5 %6 MakePointerVisibleKHR|NonPrivatePointerKHR" - " %uint_1 MakePointerVisibleKHR|NonPrivatePointerKHR %uint_1")); + HasSubstr("Target memory access must not include MakePointerVisibleKHR\n" + " OpCopyMemory %5 %6 MakePointerVisible|NonPrivatePointer" + " %uint_1 MakePointerVisible|NonPrivatePointer %uint_1")); } TEST_F(ValidateMemory, VulkanMemoryModelDeviceScopeCopyMemorySizedBad1) { diff --git a/test/val/val_webgpu_test.cpp b/test/val/val_webgpu_test.cpp index c55f9276..1eae0d39 100644 --- a/test/val/val_webgpu_test.cpp +++ b/test/val/val_webgpu_test.cpp @@ -201,7 +201,7 @@ TEST_F(ValidateWebGPU, NonLogicalAddressingModelBad) { EXPECT_THAT(getDiagnosticString(), HasSubstr("Addressing model must be Logical for WebGPU " "environment.\n OpMemoryModel Physical32 " - "VulkanKHR\n")); + "Vulkan\n")); } TEST_F(ValidateWebGPU, NonVulkanKHRMemoryModelBad) { diff --git a/tools/as/as.cpp b/tools/as/as.cpp index acef5b46..f6e96294 100644 --- a/tools/as/as.cpp +++ b/tools/as/as.cpp @@ -48,7 +48,7 @@ Options: argv0, argv0, target_env_list.c_str()); } -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_4; +static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5; int main(int argc, char** argv) { const char* inFile = nullptr; diff --git a/tools/cfg/cfg.cpp b/tools/cfg/cfg.cpp index 411ef883..ce7f1c22 100644 --- a/tools/cfg/cfg.cpp +++ b/tools/cfg/cfg.cpp @@ -44,7 +44,7 @@ Options: argv0, argv0); } -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_4; +static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5; int main(int argc, char** argv) { const char* inFile = nullptr; diff --git a/tools/dis/dis.cpp b/tools/dis/dis.cpp index 2a6f411a..c0ce267d 100644 --- a/tools/dis/dis.cpp +++ b/tools/dis/dis.cpp @@ -60,7 +60,7 @@ Options: argv0, argv0); } -static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_4; +static const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5; int main(int argc, char** argv) { const char* inFile = nullptr; diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 667b0e31..9d2f8e57 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -59,7 +59,7 @@ std::string GetListOfPassesAsString(const spvtools::Optimizer& optimizer) { return ss.str(); } -const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_4; +const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5; std::string GetLegalizationPasses() { spvtools::Optimizer optimizer(kDefaultEnvironment); diff --git a/tools/reduce/reduce.cpp b/tools/reduce/reduce.cpp index be07b204..d439726d 100644 --- a/tools/reduce/reduce.cpp +++ b/tools/reduce/reduce.cpp @@ -217,7 +217,7 @@ void DumpShader(spvtools::opt::IRContext* context, const char* filename) { DumpShader(binary, filename); } -const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_4; +const auto kDefaultEnvironment = SPV_ENV_UNIVERSAL_1_5; int main(int argc, const char** argv) { const char* in_file = nullptr; diff --git a/tools/val/val.cpp b/tools/val/val.cpp index 6a8542d4..19b8c776 100644 --- a/tools/val/val.cpp +++ b/tools/val/val.cpp @@ -74,7 +74,7 @@ Options: int main(int argc, char** argv) { const char* inFile = nullptr; - spv_target_env target_env = SPV_ENV_UNIVERSAL_1_4; + spv_target_env target_env = SPV_ENV_UNIVERSAL_1_5; spvtools::ValidatorOptions options; bool continue_processing = true; int return_code = 0; @@ -108,12 +108,13 @@ int main(int argc, char** argv) { 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", spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_0), spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_1), spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_2), spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_3), spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_4), + spvTargetEnvDescription(SPV_ENV_UNIVERSAL_1_5), spvTargetEnvDescription(SPV_ENV_OPENCL_2_2), spvTargetEnvDescription(SPV_ENV_VULKAN_1_0), spvTargetEnvDescription(SPV_ENV_VULKAN_1_1), diff --git a/utils/generate_grammar_tables.py b/utils/generate_grammar_tables.py index 13f392ac..ed24bd06 100755 --- a/utils/generate_grammar_tables.py +++ b/utils/generate_grammar_tables.py @@ -653,6 +653,30 @@ def generate_all_string_enum_mappings(extensions, operand_kinds): 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 |