Issue |
146735
|
Summary |
[DirectX] Incorrect format metadata when using `Buffer<double>` or `Buffer<int64_t>`
|
Labels |
backend:DirectX
|
Assignees |
|
Reporter |
bogner
|
HLSL allows `Buffer` and `RWBuffer` of `double`, `int64`, or 2-element vectors of the same, but when lowering these to DXIL they use 32-bit accesses to the buffer itself and convert the value as needed.
However, we emit the format metadata for a buffer based on what's stored there, not how we use it, so for `Buffer<double2> In` we currently see from clang:
```
; Name Type Format Dim ID HLSL Bind Count
; ------------------------------ ---------- ------- ----------- ------- -------------- ---------
; In texture f64 buf T0 t0 1
```
This does not match dxc, which gives:
```
; Name Type Format Dim ID HLSL Bind Count
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
; In texture u32 buf T0 t0 1
```
Note the `u32` format here.
We need to make sure that `dxil::ResourceTypeInfo::getTyped()` has the correct `ElementTy` in these cases.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs