summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/array-parameterblock-nested.slang
blob: f2c30ea8897edb76489cf435c9d3818a74513373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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];