summaryrefslogtreecommitdiff
path: root/tests/slang-extension/atomic-int64-add.slang
blob: 20057a0bf964a23bf34a90364abe2078c62ee680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//TEST:SIMPLE(filecheck=CHECK_HLSL): -stage compute -entry computeMain -target hlsl
//TEST:SIMPLE(filecheck=CHECK_GLSL): -stage compute -entry computeMain -target glsl

RWByteAddressBuffer outputBuffer;

// CHECK_GLSL: atomicAdd
// CHECK_GLSL: atomicAdd
// CHECK_HLSL: InterlockedAdd64
// CHECK_HLSL: InterlockedAdd64

[numthreads(16, 1, 1)]
void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
    uint64_t indata1;
    int64_t indata2;
    outputBuffer.InterlockedAdd64(0, 1, indata1);
    outputBuffer.InterlockedAdd64(8, 1, indata2);
}