Issue 136809
Summary [HLSL] Report error when register binding range overflows UINT32_MAX value
Labels HLSL
Assignees
Reporter hekota
    The compiler should report an error when the upper bound of register binding is larger than UINT32_MAX:

```
RWBuffer<float> Buf[10] : register(u4294967294); // UINT32_MAX - 1

[numthreads(1, 1, 1)]
void main() {
  Buf[1][0] = 0;
}
```
https://godbolt.org/z/KM3fPoY74

**Current behavior:**
Clang with `-Od` ignores the binding (resource is not bound).
Clang without `-Od` crashes in `OpLowerer`.
DXC does not report an error if the register range starts at `UINT32_MAX - 1` and it overflows the register slot.
DXC with register range starting at `UINT32_MAX` ignores the binding and assigns the resource `u0`.


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to