Skip to content

Commit

Permalink
OpenGL Renderer: Tighten up some code related to clear image.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerman committed Jul 21, 2024
1 parent 3ef9271 commit 368cd49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions desmume/src/OGLRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions desmume/src/OGLRender_3_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 368cd49

Please sign in to comment.