Skip to content

Commit b8ad063

Browse files
spirv-val: Add missing SPV_EXT_descriptor_indexing caps (KhronosGroup#6589)
(from KhronosGroup/Vulkan-ValidationLayers#11860) Adds two missing `SPV_EXT_descriptor_indexing` from being allowed in Vulkan1.2
1 parent 334a9b7 commit b8ad063

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

source/val/validate_capability.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ bool IsSupportOptionalVulkan_1_2(uint32_t capability) {
212212
case spv::Capability::InputAttachmentArrayNonUniformIndexing:
213213
case spv::Capability::UniformTexelBufferArrayNonUniformIndexing:
214214
case spv::Capability::StorageTexelBufferArrayNonUniformIndexing:
215+
case spv::Capability::InputAttachmentArrayDynamicIndexing:
216+
case spv::Capability::ShaderNonUniform:
215217
return true;
216218
default:
217219
break;

test/val/val_capability_test.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)