blob: 5ae03a5c7d11b3799429ed2c485644aac7e39dcc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// atomics-buffer.slang
//TEST:SIMPLE(filecheck=CHECK): -target metal -stage compute -entry computeMain
//CHECK: atomic operation on non-scalar texture
RWBuffer<uint2> outputBuffer;
void test(uint val)
{
uint originalValue;
InterlockedAdd(outputBuffer[val][0], val, originalValue);
}
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
test(tid);
}
|