Let me pose the question in the form of an example:
Suppose you have a cache of 100 color textures (same res, internal format) to be rendered via FBOs, and you might need to re-render 1-60 of those in one frame.
Suppose also that you need depth and/or stencil FBO attachments to render these color textures properly, and that you don’t care about the final depth/stencil result.
The question is: Can we avoid the needless memory consumption for 60-100 depth/stencil attachments (one per color texture) to avoid depth/stencil texture/renderbuffer ghosting IF we merely:
- Call gl{Discard,Invalidate}Framebuffer on the DEPTH/STENCIL attachment(s) at the end of the frame, and
- Allocate/share "one" depth/stencil attachment across all FBOs.
Given that we may be talking up to 100MB for 100 depth/stencil attachments (depending on PowerVR’s internal depth and/or stencil renderbuffer/texture representation), I’m very motivated to avoid this waste if possible.
Thanks!