-
Notifications
You must be signed in to change notification settings - Fork 294
Description
The OpenGL ES 2.0 spec says this about color-renderable formats:
The internal formats of the attached images can affect the completeness of
the framebuffer, so it is useful to first define the relationship between the internal
format of an image and the attachment points to which it can be attached. Image
internal formats are summarized in table 4.5. Color-renderable formats contain
red, green, blue, and possibly alpha components; depth-renderable formats contain
depth components; and stencil-renderable formats contain stencil components.Formats not listed in table 4.5, including compressed internal formats. are not
color-, depth-, or stencil-renderable, no matter which components they contain.
However, in the OpenGL ES 3.0 spec, this was changed to say:
The internal formats of the attached images can affect the completeness of
the framebuffer, so it is useful to first define the relationship between the internal
format of an image and the attachment points to which it can be attached.
- An internal format is color-renderable if it is one of the formats from ta-
ble 3.13 noted as color-renderable or if it is unsized format RGBA or RGB. No
other formats, including compressed internal formats, are color-renderable.
It's a bit unclear to me if the "Color-renderable formats contain red, green, blue, and possibly alpha components"-bit is meant to convey the same thing as in the ES3 spec; unsized RGB and RGBA being color-renderable. Especially because of the phrasing "Formats not listed in table 4.5, including compressed internal formats. are not color-, depth-, or stencil-renderable, no matter which components they contain.". And table 4.5 does not contain any unsized formats.
This seems a bit unclear to me. I expect that the intent is to behave like specified in the ES 3.0 spec, and that the intent is that table 4.5 is only supposed to list sized internal formats.
In reality, it seems most (all?) implementations treat unsized RGB and RGBA as color-renderable, and most ES2 example code I can find that's using FBOs seems to expect unsized RGB or RGBA to be color-renderable. The CTS also seems to assume that RGB and RGBA are color-renderable, although there's a comment about a spec-bug with a link to the old, retired bugzilla (https://cvs.khronos.org/bugzilla/show_bug.cgi?id=7333). So in that respect, it seems like the cat is long out of the bag in terms of allowing unsized RGB and RGBA anyway.
By the way, that ticket mentioned that the WG concluded that the intended behavior was that the unsized format and type should map to a "implicit" sized internal format, and the color-renderable property should be based on that. But it was then closed as WONTFIX without changing the wording, due to the age of the ticket.
However, it seems to me that the idea of this implicit mapping seems to be contradicted by the CTS (claims that RGB/RGBA + FLOAT can't be color-renderable, even if EXT_color_buffer_float is supported), as well as several extensions specs (like https://registry.khronos.org/OpenGL/extensions/EXT/EXT_color_buffer_half_float.txt, which explicitly states that RGBA + HALF_FLOAT_OES is renderable, but that also implies that RGB + HALF_FLOAT_OES isn't?)...
Perhaps we should update the spec to be a bit clearer and match reality here? It seems I'm not the only one confused here...