1 of 1 people found this helpful
I'll pass on to the OpenGL team.
For the "how do I format code..."
When you reply, toward the upper right of the Reply box you should see "Use Advanced Editor." Click that.
You now have real formatting options, like ability to pick a font.
What I would so is copy and paste the code in place, select it, and apply Courier.
#version 430 core
layout(binding = 1, r16i) uniform iimage2D sampleTexture; //fail
//layout(binding =1, r32i) uniform iimage2D sampleTexture; //success
ivec2 pix = ivec2(gl_GlobalInvocationID.xy);
imageAtomicAdd(sampleTexture, pix, 1); //if this is commented out/removed, success
(I have to go see if there's any way to create a code "style" and make this happen a bit more easily. Probably not, but what the hey... I can dream)
As far as I can read in the OpenGL specification, there is no restriction on imageAtomicAdd() (or any other image functions) based on format.
Referring to the latest GLSL specification, version 4.50, revision 5 (although this language has always existed), section 8.12, bottom of page 175, it says:
Atomic memory operations are supported on only a subset of all image variable types; image must be either:
• a signed integer image variable (type starts “iimage”) and a format qualifier of r32i, used with a data argument of type int, or
• an unsigned image variable (type starts “uimage”) and a format qualifier of r32ui, used with a data argument of type uint.
Image atomics are only accepted on integer image types with a format qualifier of r32i or r32ui.
Oh wow, I didn't even think of reading the GLSL spec.
Thank you very much for the clarification.