summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/initializer-lists/inheritance-generic.slang
blob: 71de21c47940e70d1d1324888255693af8486dfa (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
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUFFER):-shaderobj -vk
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=BUFFER):-shaderobj

#pragma warning(disable:30816)


struct Base<let ND:int>
{
    int a = 1;
}

struct Derived<let ND:int>: Base<ND>
{
    bool x;
    bool y;
}

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

[shader("compute")]
[numthreads(1, 1, 1)]
void computeMain()
{
    // Previously, this test is just test we can handle the base constructor invoke correctly,
    // so we don't construct the Derived object, since #6058, there will not be implicit constructor
    // to construct the struct, we will have to invoke the constructor explicitly.
    Derived<3> d = {1,1,1};

    // BUFFER: 1
    result[0] = d.a;
}