summaryrefslogtreecommitdiffstats
path: root/tests/spirv/ptr-vector-member.slang
blob: 6e493b4c7b45e6a6bc76567b953ed85d405c10d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//DISABLE_TEST:SIMPLE(filecheck=SPIRV):-stage compute -entry computeMain -target spirv
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly

// SPIRV: OpEntryPoint
// SPIRV-NOT: error

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
uniform int4* output;

[shader("compute")]
[numthreads(1, 1, 1)]
void computeMain()
{
    // CHECK: 1
    int* v = __getAddress(output[0].x);
    InterlockedAdd(*v, 1);
}