Issue 130191
Summary [HLSL] Typed buffer with signed int vector is translated as unsigned
Labels bug, HLSL
Assignees hekota
Reporter hekota
    The target type generated for `RWBuffer<int4>` does not have its `isSigned` field set to `1` and the resource is treated as unsigned. This probably applies for all typed buffers with integer vector element types.

```
RWBuffer<int4> Buf : register(u0);

[numthreads(4,1,1)]
void main() {
    Buf[0].x = 42;
}
```
Clang:
```
%"class.hlsl::RWBuffer" = type { target("dx.TypedBuffer", <4 x i32>, 1, 0, 0) }
@Buf = internal global %"class.hlsl::RWBuffer" poison, align 4

; Resource Bindings:
;
; Name Type  Format         Dim      ID      HLSL Bind     Count
; ------------------------------ ---------- ------- ----------- ------- -------------- ---------
; UAV     u32         buf      U0             u0 1
```
DXC:
```
; Resource Bindings:
;
; Name Type  Format         Dim      ID      HLSL Bind  Count
; ------------------------------ ---------- ------- ----------- ------- -------------- ------
; Buf                                   UAV     i32 buf      U0             u0     1
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to