imageStore on RGB formats

What is the rationale for GLSL’s imageStore being unable to store in RGB formats? (e.g RGB8, RGB16, etc)
is there any workaround to this which doesn’t require changing texture format?
cheers.

From ARB_shader_image_load_store

This doesn’t really answer your question though.

I suspect the reason is that some desktop GPUs do not support 24-bit RGB8 textures (or so I’ve read). They are internally converted to 32-bit by the driver, at the cost of app performance uploading content to them. This is probably due to the fact that the memory alignment of 3-byte texels isn’t as nice as 4-byte. 3-component formats in general just don’t fit as nicely into power-of-2-sized cache pages.

Also, on some drivers, if you query (via glGetInternalFormat()) the recommended internal formats to use (GL_INTERNAL_FORMAT_PREFERRED) for the non-packed non-compressed 2- and 3-component internal formats (e.g. GL_RGB8), the driver will suggest that you use the 4-component formats instead (e.g. GL_RGBA8).

Try asking your GL driver what it prefers for different internal formats (see this section for a glGetInternalFormat() usage example). Try querying for the values of these parameters:

[ul]
[li]GL_INTERNALFORMAT_SUPPORTED [/li][li]GL_INTERNALFORMAT_PREFERRED [/li][li]GL_SHADER_IMAGE_STORE [/li][/ul]