2022-05-31 13:20:28 +00:00
|
|
|
RWByteAddressBuffer sb_rw : register(u0, space0);
|
|
|
|
|
|
|
|
int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) {
|
2021-08-26 15:26:25 +00:00
|
|
|
int original_value = 0;
|
|
|
|
buffer.InterlockedAdd(offset, -value, original_value);
|
|
|
|
return original_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void atomicSub_051100() {
|
2022-05-31 13:20:28 +00:00
|
|
|
int res = tint_atomicSub(sb_rw, 0u, 1);
|
2021-08-26 15:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void fragment_main() {
|
|
|
|
atomicSub_051100();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void compute_main() {
|
|
|
|
atomicSub_051100();
|
|
|
|
return;
|
|
|
|
}
|