Issue 144747
Summary [DirectX] Downgrading raw to typed buffer accesses for SM6.2 and earlier happens too late
Labels backend:DirectX
Assignees
Reporter bogner
    We currently handle downgrading buffer accesses to use the "typedbuffer" loads and stores in SM6.2 and earlier very late, in DXILOpLowering. This is mostly fine, except that we handle typed buffer loads and stores for 64 bit operations, like double, by expanding them into integer operations in DXILIntrinsicExpansion, which is much earlier.

This means that in SM6.2 and earlier, `RWStructuredBuffer<double>` loads and stores fail to generate DXIL.

This is observable with `clang-dxc -Tcs_6_2` and a simple shader like https://hlsl.godbolt.org/z/41MnGsqP1:
```hlsl
StructuredBuffer<double> In : register(t0);
RWStructuredBuffer<double> Out : register(u0);

[numthreads(1,1,4)]
void main(uint DTid : SV_GroupIndex) {
  Out[DTid] = In[DTid];
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to