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

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;
}