diff options
Diffstat (limited to 'tests/diagnostics/array-parameterblock-nested.slang')
| -rw-r--r-- | tests/diagnostics/array-parameterblock-nested.slang | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/diagnostics/array-parameterblock-nested.slang b/tests/diagnostics/array-parameterblock-nested.slang new file mode 100644 index 000000000..f2c30ea88 --- /dev/null +++ b/tests/diagnostics/array-parameterblock-nested.slang @@ -0,0 +1,26 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + +// Test: Array of nested struct containing ParameterBlock - should error + +struct Inner +{ + ParameterBlock<float> pb; +} + +struct NestedStruct +{ + Inner nested; + float value; +} + +RWStructuredBuffer<float> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + // Force usage of the array to prevent optimization + outputBuffer[dispatchThreadID.x] = arrayOfNestedStruct[dispatchThreadID.x % 2].nested.pb; +} + +//CHECK: ([[# @LINE+1]]): error 30027 +uniform NestedStruct arrayOfNestedStruct[2];
\ No newline at end of file |
