summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/nested-constant-buffer-in-parameter-block.slang
blob: 9fb83f0340f7bc69bf6423267285adfca6e63be8 (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
27
28
29
30
31
32
33
//TEST:SIMPLE(filecheck=CHECK): -target metal

struct T
{
    RWStructuredBuffer<int> buf;
}
    
struct U
{
    ConstantBuffer<T> t;
}

struct S
{
    ConstantBuffer<RWStructuredBuffer<int>> cb;
}

// CHECK-DAG: ([[# @LINE+1]]): error 56101:
ParameterBlock<S> s1;

// CHECK-DAG: ([[# @LINE+1]]): error 56101:
ParameterBlock<U> s2;

// CHECK-DAG: ([[# @LINE+1]]): error 56101:
ParameterBlock<ConstantBuffer<RWStructuredBuffer<int>>> s3;

RWStructuredBuffer<int> outputBuffer;

[numthreads(1,1,1)]
void kernelMain()
{
    outputBuffer[0] = s1.cb[0] + s2.t.buf[0] + s3[0];
}