2019.33020 and 2019.19160 Win 10 - Image Output format on render TOP doesn't seem to actually change the format - issue with imageAtomicAdd and GL_NV_shader_atomic_float extension


trying to do something like
imageAtomicAdd(mTD2DImageOutputs[0], ivec2(0), float(0.0));
in a GLSL Mat with the image format for the image output on the render TOP set to 32 bit float mono and adding
#extension GL_NV_shader_atomic_float : enable to the preprocessing directive, similar to what is working with a GLSL TOP, but still getting the error :

0(102) : error C1115: unable to find compatible overloaded function “imageAtomicAdd(struct unimage2D4x8_bindless, ivec2, float)”

It seems it should work? See attached toe.

atomicFloatAdd_bug.4.toe (7.2 KB)

Thank you!

It actually does work in the Render TOP. The issue is that the GLSL MAT itself doesn’t know what image format/type will be made available during the render (you could have different ones for different Render TOPs), so it just defaults to a simple rgba8 image. This causes a compile error for the GLSL MAT’s base compile but when the shader is compiled for the Render TOP itself it’ll be given the correct image output format, and the compile works. So for this case you can ignore the compile error in the GLSL MAT.

Not entirely sure what the best way to solve this would be. I can’t predict which version of the image operations you will be calling so I can’t pre-declare the correct format for the image…

I see, thanks for the explanation, I remember running into the same issue naively writing to multiple color buffers and the actual render being fine, but hadn’t actually checked the render this time.