Skip to content

Conversation

slipher
Copy link
Member

@slipher slipher commented Sep 18, 2025

  • Clean up unused code
  • Fix an instance where GL_fboShim was not used
  • Add optional target argument for R_BindFBO (lifted from Implement MSAA #1480)
  • Add BlitFramebuffer function to FBO shim

The last 2 things are needed for FBO blitting. I need FBO blitting to fix #1783, while it is also used in #1480 so I'm trying to reuse the code from there. But I've tried to make R_BindFBO more robust by making GL_DRAW_FRAMEBUFFER the default instead of GL_FRAMEBUFFER because with the latter, you get issues that it matters what order you do the bindings in because it overwrites both READ and DRAW framebuffers.

slipher and others added 6 commits September 17, 2025 07:50
We don't use renderbuffers. The renderbuffer size limit does not apply
to an FBO.
Replace GL_FRAMEBUFFER with GL_DRAW_FRAMEBUFFER everywhere. Binding
GL_FRAMEBUFFER to x is defined as binding GL_DRAW_FRAMEBUFFER to x then
binding GL_READ_FRAMEBUFFER to x. Currently we only use the DRAW aspect.
The double binding can be a nuisance when adding functionality (blit)
that needs the read aspect.
Strangely, we didn't use any functions from EXT_framebuffer_blit before
this, despite it being a required extension (if ARB_framebuffer_blit is
unavailable) and a comment saying "our code is known to require
EXT_framebuffer_blit".
Provide the alternative function to use if GL_ARB_framebuffer_object is
not available but GL_EXT_framebuffer_object is. The missing shim could
result in a crash if the former extension is not available and dynamic
lights are enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Depth fade broken on Apple Silicon
1 participant