diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2025-09-04 04:05:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 20:05:26 +0000 |
| commit | a766d27447aa0fcf69334c0467d9b1124892e180 (patch) | |
| tree | 67ca5615e4a8c94d7454ee43375eeffc8c8a7d4c /tests/diagnostics/structuredbuffer-resource-struct-recursive.slang | |
| parent | bf607e2f3fa183e9a2b18c7a98438a05247d6ed3 (diff) | |
Diagnose on structured buffers containing resources (#8222)
closes https://github.com/shader-slang/slang/issues/3313
Diffstat (limited to 'tests/diagnostics/structuredbuffer-resource-struct-recursive.slang')
| -rw-r--r-- | tests/diagnostics/structuredbuffer-resource-struct-recursive.slang | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/diagnostics/structuredbuffer-resource-struct-recursive.slang b/tests/diagnostics/structuredbuffer-resource-struct-recursive.slang new file mode 100644 index 000000000..ae8f916dd --- /dev/null +++ b/tests/diagnostics/structuredbuffer-resource-struct-recursive.slang @@ -0,0 +1,21 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv + +struct RecursiveFoo +{ + float value; + //CHECK-DAG: ([[# @LINE+1]]): error 38205 + StructuredBuffer<RecursiveFoo> children; +} + +StructuredBuffer<RecursiveFoo> recursiveRoot; +RWStructuredBuffer<float> output; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint i = dispatchThreadID.x; + RecursiveFoo foo = recursiveRoot[i]; + float result = foo.value + foo.children[0].value + foo.children[0].children[0].value; + output[i] = result; +} + |
