Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9
-
None
Description
Render target outputs only support textures at the moment. This is pretty bad when it comes to depth/stencil and OpenGL ES: there the traditional way to do depth/stencil attachments is to use a packed D24S8 renderbuffer. Using a combined depth/stencil texture is not possible before ES 3.2 (since there is no glFramebufferTexture, and glFramebufferTexture2D does not take GL_DEPTH_STENCIL_ATTACHMENT). What's more, creating a separate stencil texture is not really possible either due to lacking a suitable format before 3.2/3.1+extension.
Therefore, it would be beneficial if the FBO handling in GraphicsContext & friends could internally fall back to using a renderbuffer on OpenGL ES <= 3.1 when the attachment point is RenderTargetOutput::DepthStencil. This would then lead to a Texture2D that cannot be used as a texture (sampled, etc.) but that's usually ok for a combined depth-stencil.