You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPIR-V] QuadReadLaneAt with a matrix input generates invalid SPIR-V #9134
QuadReadLaneAt accepts a float2x3 input, but DXC generates invalid
SPIR-V. It emits OpGroupNonUniformQuadBroadcast with a matrix result.
That instruction permits only scalar and vector results.
The same source compiles successfully for DXIL. That output contains six
scalar quad reads, one for each matrix element.
Reproducer
Save this as repro.hlsl:
StructuredBuffer<float2x3> In : register(t0);
RWStructuredBuffer<float2x3> Out : register(u1);
[numthreads(4, 1, 1)]
voidmain(uint3 ID : SV_DispatchThreadID) {
Out[ID.x] = QuadReadLaneAt(In[ID.x], 0);
}
Compile with:
dxc -spirv -T cs_6_5 -E main -fspv-target-env=vulkan1.3 repro.hlsl
Actual result
Compilation fails during SPIR-V validation:
fatal error: generated SPIR-V is invalid: Result must be a scalar or vector of integer, floating-point, or boolean type
%28 = OpGroupNonUniformQuadBroadcast %mat2v3float %uint_3 %27 %uint_0
Expected result
Compilation succeeds. DXC splits the matrix operation into valid scalar
or vector quad reads. Each result element comes from the same matrix
element in the selected source lane.
Activity