[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)
Damyan Pepper via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 14 14:28:49 PDT 2024
================
@@ -0,0 +1,103 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
+
+// TODO: Implement "Buffer", we use a substitute UDT
+// to test the 't' binding type for this test.
+
+template<typename T>
+struct [[hlsl::resource_class(SRV)]] Buffer {
+ T x;
+};
+
+// TODO: Implement "SamplerState", we use a substitute UDT
+// to test the 's' binding type for this test.
+struct [[hlsl::resource_class(Sampler)]] SamplerState {
+ int x;
+};
+
+// TODO: Implement "Texture2D", we use a substitute UDT
+// to test a non-templated 't' binding type for this test.
+struct [[hlsl::resource_class(UAV)]] Texture2D {
----------------
damyanp wrote:
The actual language feature we should be testing here is how the register binding type and the `hlsl::resource_class` attributes interact. I would expect to see a bunch of tests around various resource classes, and nothing really focusing on the higher level HLSL types themselves.
https://github.com/llvm/llvm-project/pull/97103
More information about the cfe-commits
mailing list