summaryrefslogtreecommitdiffstats
path: root/tests/bugs/static-method.slang
blob: 4f2d363f270b31fd72142278ac5e9e5e18db9dac (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
// static-method.slang

//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj

struct S
{
    static void doThing(in out int x, int y)
    {
        x += y;
    }
}

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

int test(int t)
{
    S::doThing(t, 0x10);

    (S::doThing(t, 0x200));

    (S::doThing)(t, 0x4000);

    return t;
}

[numthreads(4)]
void computeMain(uint3 tid : SV_DispatchThreadID)
{
    int val = tid.x;
    val = test(val);
    outputBuffer[tid.x] = val;
}