@@ -9452,6 +9452,48 @@ TEST_F(ValidateMemory, CoopMatMatrixFloat8FAdd) {
9452
9452
HasSubstr (" FAdd doesn't support FP8 E4M3/E5M2 types" ));
9453
9453
}
9454
9454
9455
+ TEST_F (ValidateMemory, PhysicalStorageBufferArray) {
9456
+ const std::string body =
9457
+ R"(
9458
+ OpCapability Shader
9459
+ OpCapability Int64
9460
+ OpCapability PhysicalStorageBufferAddresses
9461
+ OpExtension "SPV_KHR_storage_buffer_storage_class"
9462
+ OpExtension "SPV_KHR_physical_storage_buffer"
9463
+ OpMemoryModel PhysicalStorageBuffer64 GLSL450
9464
+ OpEntryPoint GLCompute %18 "main"
9465
+ OpExecutionMode %18 LocalSize 1 1 1
9466
+ OpSource OpenCL_C 120
9467
+ OpMemberDecorate %S 0 Offset 0
9468
+ OpMemberDecorate %S 1 Offset 256
9469
+ OpDecorate %array ArrayStride 16
9470
+ %uint = OpTypeInt 32 0
9471
+ %void = OpTypeVoid
9472
+ %ulong = OpTypeInt 64 0
9473
+ %float = OpTypeFloat 32
9474
+ %v4float = OpTypeVector %float 4
9475
+ %17 = OpTypeFunction %void
9476
+ %ulong_0 = OpConstant %ulong 0
9477
+ %uint_3 = OpConstant %uint 3
9478
+ %array = OpTypeArray %v4float %uint_3
9479
+ %S = OpTypeStruct %array %uint
9480
+ %ptr_S = OpTypePointer PhysicalStorageBuffer %S
9481
+ %float_0 = OpConstant %float 0
9482
+ %v4float_0 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
9483
+ %23 = OpConstantComposite %array %v4float_0 %v4float_0 %v4float_0
9484
+ %24 = OpConstantComposite %S %23 %uint_3
9485
+ %18 = OpFunction %void None %17
9486
+ %19 = OpLabel
9487
+ %58 = OpConvertUToPtr %ptr_S %ulong_0
9488
+ OpStore %58 %24 Aligned 4
9489
+ OpReturn
9490
+ OpFunctionEnd
9491
+ )" ;
9492
+
9493
+ CompileSuccessfully (body.c_str (), SPV_ENV_VULKAN_1_0);
9494
+ ASSERT_EQ (SPV_SUCCESS, ValidateInstructions (SPV_ENV_VULKAN_1_0));
9495
+ }
9496
+
9455
9497
} // namespace
9456
9498
} // namespace val
9457
9499
} // namespace spvtools
0 commit comments