sRGB Renderbuffers in GL2.1+

I just ask myself, if it is possible (allowed) to create sRGB renderbuffers just by the means of EXT/ARB_framebuffer_object, EXT/ARB_framebuffer_sRGB and EXT_texture_sRGB (which is already in core 2.1)

By just reading the specs, I could not find any wordening that would allow to create GL_SRGB8[_ALPHA8] renderbuffers.

GL3.0+ specifies it very clearly, though…

By just reading the specs, I could not find any wordening that would allow to create GL_SRGB8[_ALPHA8] renderbuffers.

Sure they do.

From EXT_framebuffer_object:

The definition of “color-renderable” is:

Now, from EXT_texture_sRGB:


    Add 4 new rows to Table 3.16 (page 154).

        Sized                  Base             R     G     B     A     L     I     D
        Internal Format        Internal Format  bits  bits  bits  bits  bits  bits  bits
        ---------------------  ---------------  ----  ----  ----  ----  ----  ----  ----
        SRGB8_EXT              RGB              8     8     8
        SRGB8_ALPHA8_EXT       RGBA             8     8     8     8

The base internal format of GL_SRGB8_EXT and GL_SRGB8_ALPHA8_EXT are RGB and RGBA. Both of these are on the “color-renderable” list and therefore both of them can be used to create FBOs.

I understand that there’s technically no reason to not provide it, but consider:

EXT_framebuffer_object is written against GL1.5, which doesn’t contain sRGB stuff yet, so the table EXT_fbo refers to doesn’t contain any sRGB formats.

EXT_texture_sRGB was written against GL2.0, but at a time when FBOs were already very well established. But yet, they left anything out that would describe interactions with EXT_fbo.

ARB_framebuffer_object is written against GL2.1, so you’re right, in this case table 3.16 would already contain the sRGB formats.

Sometimes this whole extension business is driving me crazy :wink:

EXT_framebuffer_object is written against GL1.5, which doesn’t contain sRGB stuff yet, so the table EXT_fbo refers to doesn’t contain any sRGB formats.

EXT_texture_sRGB was written against GL2.0, but at a time when FBOs were already very well established. But yet, they left anything out that would describe interactions with EXT_fbo.

That’s how extensions interact. EXT_texture_sRGB changes a table that EXT_framebuffer_object uses. Therefore, if you have both, then the changes to the table that sRGB makes must be used by EXT_FBO. That’s why EXT_FBO doesn’t just create a list of color-renderable formats. It refers to a table, which future extensions can update and therefore seamlessly interact with EXT_FBO.

Or, to put it another way, it just works, without either extension having to know about the other. They all interact exactly as the user expects, and it is all well-specified.