textureSize is a handy function to get texture dimensions in a shader without having to pass them in by hand as uniforms.
Is there a similar API for image units?
textureSize is a handy function to get texture dimensions in a shader without having to pass them in by hand as uniforms.
Is there a similar API for image units?
Yes, it's in OpenGL 4.3:
Example:
layout(rgba32f) uniform image2D myImage;
...
ivec2 size = imageSize(myImage);