Description
A compute shader like this mis-compiles the read. It requires a fairly
particular setup as described in comments below
struct Box { float4x4 m; }; // a struct whose SOLE member is a float4x4
ByteAddressBuffer src : register(t0);
RWByteAddressBuffer dst : register(u0);
[numthreads(1, 1, 1)]
void csmain()
{
Box b = src.Load<Box>(0); // 64-byte struct at offset 0
// read the first matrix column through the struct member.
// DXC loads byte 0 for all four.
dst.Store(0, asuint(b.m._m00));
dst.Store(4, asuint(b.m._m10));
dst.Store(8, asuint(b.m._m20));
dst.Store(12, asuint(b.m._m30));
// CORRECT: copy the matrix to a local float4x4 first, then read. Offsets are right.
float4x4 m = b.m;
dst.Store(16, asuint(m._m00));
dst.Store(20, asuint(m._m10));
dst.Store(24, asuint(m._m20));
dst.Store(28, asuint(m._m30));
}
Steps to Reproduce
https://godbolt.org/z/bG5reh3rh
Actual Behavior
The DXIL produced by dxc performs the first 4 reads at offset 0
Environment
I reproduced on Mac and Windows. I verified that it reproduces in v1.10.2605.24 and current HEAD.
Please see #8568 for reproducing test and a potential way to address it.
Description
A compute shader like this mis-compiles the read. It requires a fairly
particular setup as described in comments below
Steps to Reproduce
https://godbolt.org/z/bG5reh3rh
Actual Behavior
The DXIL produced by dxc performs the first 4 reads at offset 0
Environment
I reproduced on Mac and Windows. I verified that it reproduces in v1.10.2605.24 and current HEAD.
Please see #8568 for reproducing test and a potential way to address it.