From 368cd49fb6ec561fdec5309aacd3625c98c53d5c Mon Sep 17 00:00:00 2001 From: rogerman Date: Sat, 20 Jul 2024 22:54:44 -0700 Subject: [PATCH] OpenGL Renderer: Tighten up some code related to clear image. --- desmume/src/OGLRender.cpp | 6 +++--- desmume/src/OGLRender_3_2.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 4ec820319..8bb53eda1 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -2856,8 +2856,8 @@ Render3DError OpenGLRenderer_1_2::CreateFBOs() } // Assign the default read/draw buffers. - glDrawBuffer(OGL_COLOROUT_ATTACHMENT_ID); - glReadBuffer(OGL_COLOROUT_ATTACHMENT_ID); + glReadBuffer(OGL_CI_COLOROUT_ATTACHMENT_ID); + glDrawBuffer(GL_NONE); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, OGLRef.fboRenderMutableID); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, OGL_COLOROUT_ATTACHMENT_ID, GL_TEXTURE_2D, OGLRef.texGColorID, 0); @@ -4804,7 +4804,7 @@ Render3DError OpenGLRenderer_1_2::ClearUsingImage(const u16 *__restrict colorBuf if (this->_enableMultisampledRendering) { - glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, OGLRef.fboRenderID); + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, OGLRef.fboRenderMutableID); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, OGLRef.fboMSIntermediateRenderMutableID); // See above comment for why we need to get clear the stencil buffer separately. diff --git a/desmume/src/OGLRender_3_2.cpp b/desmume/src/OGLRender_3_2.cpp index 1f997cfbe..ff88937ad 100644 --- a/desmume/src/OGLRender_3_2.cpp +++ b/desmume/src/OGLRender_3_2.cpp @@ -1068,8 +1068,8 @@ Render3DError OpenGLRenderer_3_2::CreateFBOs() } // Assign the default read/draw buffers. - glReadBuffer(OGL_COLOROUT_ATTACHMENT_ID); - glDrawBuffer(OGL_COLOROUT_ATTACHMENT_ID); + glReadBuffer(OGL_CI_COLOROUT_ATTACHMENT_ID); + glDrawBuffer(GL_NONE); glBindFramebuffer(GL_FRAMEBUFFER, OGLRef.fboRenderMutableID); glFramebufferTexture2D(GL_FRAMEBUFFER, OGL_COLOROUT_ATTACHMENT_ID, GL_TEXTURE_2D, OGLRef.texGColorID, 0); @@ -2890,7 +2890,7 @@ Render3DError OpenGLRenderer_3_2::ClearUsingImage(const u16 *__restrict colorBuf if (this->_enableMultisampledRendering) { - glBindFramebuffer(GL_READ_FRAMEBUFFER, OGLRef.fboRenderID); + glBindFramebuffer(GL_READ_FRAMEBUFFER, OGLRef.fboRenderMutableID); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, OGLRef.fboMSIntermediateRenderMutableID); if (this->_emulateDepthLEqualPolygonFacing)