Open jaebaek opened 5 years ago
I've ran into the same issue. Here's a smaller example that I hand-minimized:
; SPIR-V
; Version: 1.6
; Generator: Khronos; 35
; Bound: 440
; Schema: 0
OpCapability Shader
OpCapability GroupNonUniform
OpCapability GroupNonUniformBallot
OpCapability Linkage
OpMemoryModel Logical Simple
%2 = OpTypeVoid
%4 = OpTypeInt 32 0
%39 = OpTypeStruct %4 %4
%17 = OpTypeFunction %2
%72 = OpConstant %4 3 ; Scope::Subgroup
%35 = OpFunction %2 None %17
%36 = OpLabel
%82 = OpUndef %39 ; undef[(int32, int32)]
%83 = OpGroupNonUniformBroadcastFirst %39 %72 %82 ; should be illegal
OpReturn
OpFunctionEnd
Validator currently checks only Scope \ argument of non-uniform group instructions.
We need validations for them based on the spec e.g., result type.
For example, result type of
OpGroupNonUniformBallot
must be a vector of four components of integer type scalar, whose Signedness operand is 0. However, putting a vector of three components is not validated by SPIRV Validator.