nir_lower_explicit_io: build_explicit_io_atomic needs to handle function_temp for use with generic address space
That said, I still think you're right that there's a bug in
build_explicit_io_atomicif you do call it on a generic pointer that may point to function-local. I think we probably need to add a path for converting
function_temp"atomics" to just plain non-atomic ops. So then this "atomic" add on function-temp would just turn into
store_scratch. Or I guess with the
addr_format_is_global()path, we could convert these into global atomics.
Note that the OpenCL spec for generic address space says:
The behavior of atomic operations where pointer arguments to the atomic functions refers to an atomic type in the private address space is undefined.
So, we can do whatever we want, but we should successfully compile the shaders at least.