yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie HermaszewskaDiagnose on structured buffers containing resources (#8222)a766d2744

master
550 B21 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv
2
3struct RecursiveFoo
4{
5    float value;
6    //CHECK-DAG: ([[# @LINE+1]]): error 38205
7    StructuredBuffer<RecursiveFoo> children;
8}
9
10StructuredBuffer<RecursiveFoo> recursiveRoot;
11RWStructuredBuffer<float> output;
12
13[numthreads(4, 1, 1)]
14void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
15{
16    uint i = dispatchThreadID.x;
17    RecursiveFoo foo = recursiveRoot[i];
18    float result = foo.value + foo.children[0].value + foo.children[0].children[0].value;
19    output[i] = result;
20}
21