[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

Tex Riddell via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 17:35:10 PDT 2024


================
@@ -44,7 +44,7 @@ void foo2() {
   // expected-warning at +1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}}
   extern RWBuffer<float> U2 : register(u5);
 }
-// FIXME: expect-error once fix https://github.com/llvm/llvm-project/issues/57886.
+// expected-error at +1 {{invalid register name prefix 'u' for 'float' (expected 't')}}
----------------
tex3d wrote:

We should consider deprecating the register binding of this style: `float b : register(c0);`, since it's not supported by DXC, and was only supported by FXC for DX9 targets.  Register binding should only be applicable to global resource/sampler declarations and cbuffer/tbuffer declarations.  So the answer to "what prefix should that be" is: we don't support register bindings on values that go into the constant buffer, so there is no valid prefix to use here.  The closest equivalent to these legacy register bindings that we do support are `packoffset` annotations.

https://github.com/llvm/llvm-project/pull/87578


More information about the llvm-commits mailing list