summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/zero-initialize/static-struct-field-init-list.slang
blob: ca9f59b5ec26f1dc139c6d27347c3ecca8a1acf4 (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
//DISABLE_TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -entry computeMain -allow-glsl -xslang -zero-initialize

//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
RWStructuredBuffer<uint> outputBuffer;

struct structData
{
    uint data;
};

struct structOuterData
{
    static structData data1 = { 1 };
};

[numthreads(1,1,1)]
void computeMain()
{
    // BUF: 1
    structOuterData mat;
    outputBuffer[0] = true
        && mat.data1.data == 1
        ;
}