KhronosGroup / KhronosGroup/SPIRV-Tools

validation: missing checks for SampledCubeArray and ImageCubeArray capabilities

Open
#4,037 1 comment 0 reactions 0 assignees View on GitHub
component:validation
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

Here's a module that should require SampledCubeArray capability, but passes validation:

```
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %t "t"
OpName %s "s"
OpName %main "main"
OpDecorate %t DescriptorSet 0
OpDecorate %t Binding 0
OpDecorate %s DescriptorSet 0
OpDecorate %s Binding 1
%float = OpTypeFloat 32
%3 = OpTypeImage %float Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%t = OpVariable %_ptr_UniformConstant_3 UniformConstant
%7 = OpTypeSampler
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%s = OpVariable %_ptr_UniformConstant_7 UniformConstant
%void = OpTypeVoid
%8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
%16 = OpTypeSampledImage %3
%v3float = OpTypeVector %float 3
%float_1 = OpConstant %float 1
%20 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%main = OpFunction %void None %8
%11 = OpLabel
%14 = OpLoad %7 %s
%15 = OpLoad %3 %t
%17 = OpSampledImage %16 %15 %14
%21 = OpCompositeExtract %float %20 0
%22 = OpCompositeExtract %float %20 1
%23 = OpCompositeExtract %float %20 2
%24 = OpConvertSToF %float %int_0
%27 = OpCompositeConstruct %v4float %21 %22 %23 %24
%12 = OpImageSampleImplicitLod %v4float %17 %27
OpReturn
OpFunctionEnd
```

I couldn't find tests for these two capabilities.

I'm also not sure if Sampled1D and Image1D are checked.

Contributor guide

Open the contributing guide

Research direction

No source file or test path is named. Start with the supplied SPIR-V module and locate existing capability-validation tests; done means validation rejects the missing SampledCubeArray and ImageCubeArray capabilities, with coverage for the noted 1D cases if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.