@@ -3481,6 +3481,52 @@ OpFunctionEnd
34813481 " capabilities: TileImageStencilReadAccessEXT" ));
34823482}
34833483
3484+ // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/11860#issuecomment-4047435834
3485+ TEST_F (ValidateCapability, InputAttachmentArrayDynamicIndexingVulkan12) {
3486+ const std::string spirv = R"(
3487+ OpCapability Shader
3488+ OpCapability InputAttachment
3489+ OpCapability InputAttachmentArrayDynamicIndexing
3490+ OpMemoryModel Logical GLSL450
3491+ OpEntryPoint Fragment %main "main" %color %xs
3492+ OpExecutionMode %main OriginUpperLeft
3493+ OpDecorate %color Location 0
3494+ OpDecorate %xs Binding 0
3495+ OpDecorate %xs DescriptorSet 0
3496+ OpDecorate %xs InputAttachmentIndex 0
3497+ OpDecorate %index SpecId 0
3498+ %void = OpTypeVoid
3499+ %4 = OpTypeFunction %void
3500+ %float = OpTypeFloat 32
3501+ %v4float = OpTypeVector %float 4
3502+ %_ptr_Output_v4float = OpTypePointer Output %v4float
3503+ %color = OpVariable %_ptr_Output_v4float Output
3504+ %11 = OpTypeImage %float SubpassData 0 0 0 2 Unknown
3505+ %uint = OpTypeInt 32 0
3506+ %uint_4 = OpConstant %uint 4
3507+ %_arr_11_uint_4 = OpTypeArray %11 %uint_4
3508+ %_ptr_UniformConstant__arr_11_uint_4 = OpTypePointer UniformConstant %_arr_11_uint_4
3509+ %xs = OpVariable %_ptr_UniformConstant__arr_11_uint_4 UniformConstant
3510+ %int = OpTypeInt 32 1
3511+ %index = OpSpecConstant %int 3
3512+ %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
3513+ %int_0 = OpConstant %int 0
3514+ %v2int = OpTypeVector %int 2
3515+ %24 = OpConstantComposite %v2int %int_0 %int_0
3516+ %main = OpFunction %void None %4
3517+ %6 = OpLabel
3518+ %20 = OpAccessChain %_ptr_UniformConstant_11 %xs %index
3519+ %21 = OpLoad %11 %20
3520+ %25 = OpImageRead %v4float %21 %24
3521+ OpStore %color %25
3522+ OpReturn
3523+ OpFunctionEnd
3524+ )" ;
3525+
3526+ CompileSuccessfully (spirv, SPV_ENV_VULKAN_1_2);
3527+ EXPECT_EQ (SPV_SUCCESS, ValidateInstructions (SPV_ENV_VULKAN_1_2));
3528+ }
3529+
34843530} // namespace
34853531} // namespace val
34863532} // namespace spvtools
0 commit comments