SPIRV-Cross/shaders-msl/comp/coherent-image-atomic.msl31.comp
2024-01-23 13:09:41 +01:00

21 lines
425 B
Plaintext

#version 450
layout (set = 1, binding = 0, r32ui) coherent uniform uimage2D rw_spd_global_atomic;
void SPD_IncreaseAtomicCounter(inout uint spdCounter)
{
spdCounter = imageAtomicAdd(rw_spd_global_atomic, ivec2(0,0), 1);
}
void ComputeAutoExposure() {
uint v = 0;
SPD_IncreaseAtomicCounter(v);
}
layout (local_size_x = 256, local_size_y = 1, local_size_z = 1) in;
void main()
{
ComputeAutoExposure();
}