I have a RX 5700 XT running newest driver (23.12.1). When performing atomicAdd like this
#version 460 core
layout(local_size_x = 64) in;
struct WavefrontPTHeader {
uint Counts[2];
uint AccumulatedSamples;
};
layout(std430, binding = 9) restrict buffer WavefrontPTSSBO {
WavefrontPTHeader Header;
uint RayIndices[];
} wavefrontPTSSBO;
void main() {
atomicAdd(wavefrontPTSSBO.Header.Counts[1], 1u);
}
I get a compile error:
ERROR: 0:19: 'atomicAdd' : atomic operations only can perform on buffer or shared storage.
It only compiles when the variable that atomics are performed on is not nested inside structs. As far as I understand this code should be allowed by the spec and it works on other vendors.