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

Hello,

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!

1 Like

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.

Hi @malcolm my boids project used this trick and worked despite the error in the info DAT. Now in the 2022.24200 windows build it’s not working.

You can navigate to /project1/Boids/sop_to_gradient_sdf_voxels

Change /project1/Boids/sop_to_gradient_sdf_voxels/text1 to #extension GL_EXT_shader_atomic_float : enable

Then /project1/Boids/sop_to_gradient_sdf_voxels/renderselect1 is all RGBA(1,1,1,1) even though in 2021.16410 it was working correctly.

Image Output is actually just busted in the Render Select TOP in the current builds. It’s been fixed for the next one. Nothing to do with the GLSL happily.

1 Like