EGLBE: Support additional named framebuffer functions - #286
Conversation
Since the EGL back end emulates GLX Pbuffers with FBOs, the "default framebuffer"
(0) is really a named FBO. Interpose the remaining named framebuffer functions
that accept the default framebuffer (0) as an argument and translate 0 to the
emulating FBO:
glBlitNamedFramebuffer()
glCheckNamedFramebufferStatus[EXT]()
glClearNamedFramebuffer{iv,uiv,fv,fi}()
glGetFramebufferParameterivEXT()
glGetNamedFramebufferAttachmentParameteriv[EXT]()
glInvalidateNamedFramebuffer{Data,SubData}()
glIsFramebuffer[EXT]() is intentionally not interposed: applications that
iterate the framebuffer namespace (e.g. piglit's object-namespace-pollution test)
rely on it reporting the true availability of names.
Also restrict the existing default-FB attachment OBJECT_TYPE fixup (RENDERBUFFER
-> FRAMEBUFFER_DEFAULT) to the attachment-parameter query for which it applies.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Great. I will take a look at this in the coming weeks. Comments/questions:
|
Minecraft (Java Edition) |
|
I'm just now getting around to reviewing the code. Unfortunately, because AI was used to generate the patch, I cannot accept it as-is. Because it's impossible to know the code sources that were used to train Claude and other AI models, it's impossible to know whether relicensing that code under an open source license violates someone else's copyright. It is, at best, a legal gray area. The implementation also seems unnecessarily complex, at least on the surface. I will need to revisit it, but this project is a high priority. |
I can understand where you're coming from. Do you think it'd still be usable somehow? Would the patch need to be rewritten black-box? I guess that's not possible for you and me because we've seen this patch, right? I'm not sure how licensing strictly works.
Any particular part you're referring to? Most of the functions are thin wrappers, no? There is the bit with the enum remapping, but I do believe it should be necessary? |
A clean room isn't required. I just need to revisit the code from first principles and make sure that every coding decision flows from human experience. Some of the code I come up with may be "obvious", i.e. the only reasonable way that it can be implemented, and thus look very similar to the PR. That's fine. I just need to be able to justify it. |
Fixes #136.
This interposes the majority of the remaining named framebuffer functions (as enumerated in the issue) by checking for framebuffer 0.
One minor behavioral change is in
getFramebufferAttachmentParameteriv(), which now checks forpname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, since it might replace the parameter value if the original value collides withGL_RENDERBUFFER(which is admittedly pathological). I changed it here since this check also applies togetNamedFramebufferAttachmentParameteriv().