summaryrefslogtreecommitdiff
path: root/tests/metal/empty-struct-remove.slang
blob: 5ac1ccb693a6b008d488bcc39c75b232086cbd21 (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=LIB):-target metallib -entry computeMain -stage compute
//TEST:SIMPLE(filecheck=METAL):-target metal -entry computeMain -stage compute

// METAL-NOT: struct emptyStruct
struct emptyStruct
{
    void set(RWStructuredBuffer<int> buffer, int value) {buffer[0] = value;}
}


struct MyStruct
{
    RWStructuredBuffer<int> buffer;
    int value;
    void set()
    {
        e.set(buffer, value);
    }
    emptyStruct e;
}

ParameterBlock<MyStruct> param;

// LIB: @computeMain
[shader("compute")]
[numthreads(1, 1, 1)]
void computeMain(
    uint tid: SV_DispatchThreadID,
)
{
    param.set();
}