summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/namespaces/namespace-import/test.slang
blob: 285883c69d0ce5269d20b8fecd74fa76192c9ca6 (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=CHECK): -shaderobj

module test;

import m;

namespace ns1.ns2
{
    int f()
    {
        // Should be able to access g() from m.
        return g();
    }
}

using ns1.ns2;

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

[numthreads(4, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
    int tid = dispatchThreadID.x;
    int inVal = tid;
    int outVal = f() + g() + ns1.ns2.g();
    outputBuffer[tid] = outVal;
    // CHECK: 3
}