-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-zero default framebuffer is completely overridden at certain points #2803
Comments
Is it still actual?
GLideN64 can reset attachments only for those FBOs which it allocated. If you use the same GL context as the plugin and allocates a FBO for your needs, you should be safe, because GL won't create another FBO with the same id. |
I can confirm this is happening as well. I thought it was a bug on my side since it works in RMG, but apparently looks like the default fbo there is just 0: https://doc.qt.io/qt-6/qopenglcontext.html#defaultFramebufferObject VidExt_GL_GetDefaultFramebuffer() is definitely called - a debug print inside it works. |
Looks like the culprit is this line: https://github.com/gonetz/GLideN64/blob/master/src/FrameBuffer.cpp#L53 combined with this: https://github.com/gonetz/GLideN64/blob/master/src/FrameBuffer.cpp#L35 In other words, it's deleting the default framebuffer. diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp
index 68cf2bf4..9d6ba513 100644
--- a/src/FrameBuffer.cpp
+++ b/src/FrameBuffer.cpp
@@ -50,7 +50,8 @@ FrameBuffer::~FrameBuffer()
gfxContext.deleteFramebuffer(m_depthFBO);
gfxContext.deleteFramebuffer(m_resolveFBO);
gfxContext.deleteFramebuffer(m_SubFBO);
- gfxContext.deleteFramebuffer(m_copyFBO);
+ if (m_copyFBO != ObjectHandle::defaultFramebuffer)
+ gfxContext.deleteFramebuffer(m_copyFBO);
textureCache().removeFrameBufferTexture(m_pTexture);
textureCache().removeFrameBufferTexture(m_pDepthTexture); So this fixes it for me. I don't know enough to say if it's a good solution or not, so I'll just leave it here. |
Ping? Would be nice to stop shipping the patch ^^ |
I'm writing a custom frontend for Mupen64Plus. I have overridden
VidExt_GL_GetDefaultFramebuffer
to use an FBO I create. It seems that GLideN64 will somehow override this FBO, resetting all of its attachments. If I try naively to setup the framebuffer again, it seems to be fairly inconsistent on whether it wants to work or not.Config settings:
The text was updated successfully, but these errors were encountered: