summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/array-parameterblock-struct.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/diagnostics/array-parameterblock-struct.slang')
-rw-r--r--tests/diagnostics/array-parameterblock-struct.slang21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/diagnostics/array-parameterblock-struct.slang b/tests/diagnostics/array-parameterblock-struct.slang
new file mode 100644
index 000000000..5723ce709
--- /dev/null
+++ b/tests/diagnostics/array-parameterblock-struct.slang
@@ -0,0 +1,21 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+
+// Test: Array of struct containing ParameterBlock - should error
+
+struct StructWithParameterBlock
+{
+ ParameterBlock<float> pb;
+ int other;
+}
+
+RWStructuredBuffer<float> outputBuffer;
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ // Force usage of the array to prevent optimization
+ outputBuffer[dispatchThreadID.x] = arrayOfStructWithPB[dispatchThreadID.x % 3].pb;
+}
+
+//CHECK: ([[# @LINE+1]]): error 30027
+uniform StructWithParameterBlock arrayOfStructWithPB[3]; \ No newline at end of file