summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/constants/static-array-indexing.slang
blob: 0a7963b345ed5616c6805d57c8e584b3b26fd50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): 

int check<int v>()
{
    return v;
}

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

[numthreads(1, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
    int tid = dispatchThreadID.x;
    const int a[] = { 1, 2, 3, 4 };
    // CHECK: 4
    outputBuffer[tid] = check<a[3]>();
}