From f8ab45fc4b64064a35b7ff89348d4c121719b882 Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 3 Aug 2017 15:53:04 -0700 Subject: [PATCH] OpenGL Renderer: Fix bug where edge mark and fog would fail if MSAA is used. (Regression from commit fd5d882.) --- desmume/src/OGLRender.cpp | 4 ++-- desmume/src/OGLRender_3_2.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index c987074e6..a1aad3bde 100755 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -3217,10 +3217,10 @@ Render3DError OpenGLRenderer_1_2::DownsampleFBO() if (this->isShaderSupported) { - // Blit the color buffer + // Blit the color and depth buffers glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); - glBlitFramebufferEXT(0, 0, this->_framebufferWidth, this->_framebufferHeight, 0, 0, this->_framebufferWidth, this->_framebufferHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitFramebufferEXT(0, 0, this->_framebufferWidth, this->_framebufferHeight, 0, 0, this->_framebufferWidth, this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); // Blit the polygon ID buffer glReadBuffer(GL_COLOR_ATTACHMENT1_EXT); diff --git a/desmume/src/OGLRender_3_2.cpp b/desmume/src/OGLRender_3_2.cpp index 942058cac..0181d81a4 100644 --- a/desmume/src/OGLRender_3_2.cpp +++ b/desmume/src/OGLRender_3_2.cpp @@ -1241,10 +1241,10 @@ Render3DError OpenGLRenderer_3_2::DownsampleFBO() glBindFramebuffer(GL_READ_FRAMEBUFFER, OGLRef.fboMSIntermediateRenderID); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, OGLRef.fboRenderID); - // Blit the color buffer + // Blit the color and depth buffers glReadBuffer(GL_COLOR_ATTACHMENT0); glDrawBuffer(GL_COLOR_ATTACHMENT0); - glBlitFramebuffer(0, 0, this->_framebufferWidth, this->_framebufferHeight, 0, 0, this->_framebufferWidth, this->_framebufferHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitFramebuffer(0, 0, this->_framebufferWidth, this->_framebufferHeight, 0, 0, this->_framebufferWidth, this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); // Blit the polygon ID buffer glReadBuffer(GL_COLOR_ATTACHMENT1);