summaryrefslogtreecommitdiffstats
path: root/tests/spirv/atomic-memory-class.slang
blob: 8b46f74a6da45002b357ec8057d51fc01119da0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//TEST:SIMPLE(filecheck=CHECK): -target spirv

uniform Atomic<int>* pInt;
RWStructuredBuffer<Atomic<int>> bInt;
static groupshared Atomic<int> sInt;

[numthreads(4,1,1)]
void computeMain()
{
    // CHECK: OpAtomicLoad {{.*}} %uint_258
    // CHECK: OpAtomicStore {{.*}} %uint_68
    // CHECK: OpAtomicStore {{.*}} %uint_260
    let v = sInt.load(MemoryOrder.Acquire);
    pInt->store(v, MemoryOrder.Release);
    sInt.store(v, MemoryOrder.Release);
}