As stated in documentation possible values for layout qualifiers of image formats are (for example floating point):Floating-point layout image formats:rgba32frgba16frg32frg16fr11f_g11f_b10fr32fr16frgba16rgb10_a2rgba8rg16rg8r16r8rgba16_snormrgba8_snormrg16_snormrg8_snormr16_snormr8_snormSo we can use R, RG and RGBA formats. But why RGB (except r11f_g11f_b10f) is not allowed?
Using RGB texture format for image load/store
opengl;texture
RGB8 format and similar are often not supported by GPUs (or only supported for a subset of GPU operations) because they don't have a power-of-two number of bytes per pixel. RGB8 would be 24 bits or 3 bytes per pixel. All the formats in that list have 1, 2, 4, 8, or 16 bytes per pixel.Using a power of two simplifies addressing calculations in the hardware, because it can be implemented using a shift instead of a full multiply. (A shift by a fixed value such as 2 bits can even be implemented in hardware without any actual calculations at all, just by routing wires.) It also means that pixels are always nicely aligned with respect to boundaries of memory pages, cache lines, etc., which no doubt simplifies many things in the hardware.