summaryrefslogtreecommitdiffstats
path: root/tests/spirv/global-pointer.slang
blob: e373920eb5bce5eb343aff9e13105f241502873f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//TEST:SIMPLE(filecheck=CHECK): -target spirv

// CHECK: OpDecorate %g_Instance AliasedPointer

static int* g_Instance = nullptr;

[vk::push_constant] int* dest;

[numthreads(1)]
void ComputeMain(int tid : SV_DispatchThreadID) {
    // int* g_Instance = nullptr;
    if (tid % 2 == 0) g_Instance = dest;
    if (g_Instance) g_Instance[tid] = 123;
}