From 7a018eb9c62b7bf7ec4d931e5eeb01d1c129d831 Mon Sep 17 00:00:00 2001 From: rogerman Date: Mon, 31 Jul 2017 07:03:27 -0700 Subject: [PATCH] OpenGL Renderer: Fix bug where rendering will fail for GPU drivers that support FBOs, but not Multisampled FBOs. (Regression from commit 5deec25.) --- desmume/src/OGLRender.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index eac6737ad..4e9a8c983 100755 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -3163,7 +3163,7 @@ Render3DError OpenGLRenderer_1_2::DownsampleFBO() { OGLRenderRef &OGLRef = *this->ref; - if (this->isMultisampledFBOSupported && OGLRef.selectedRenderingFBO == OGLRef.fboMSIntermediateRenderID) + if (this->isMultisampledFBOSupported && (OGLRef.selectedRenderingFBO == OGLRef.fboMSIntermediateRenderID)) { glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, OGLRef.fboMSIntermediateRenderID); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, OGLRef.fboRenderID); @@ -3900,9 +3900,9 @@ Render3DError OpenGLRenderer_1_2::ClearUsingValues(const FragmentColor &clearCol { OGLRenderRef &OGLRef = *this->ref; - if (this->isMultisampledFBOSupported) + if (this->isFBOSupported) { - OGLRef.selectedRenderingFBO = (CommonSettings.GFX3D_Renderer_Multisample) ? OGLRef.fboMSIntermediateRenderID : OGLRef.fboRenderID; + OGLRef.selectedRenderingFBO = (CommonSettings.GFX3D_Renderer_Multisample && this->isMultisampledFBOSupported) ? OGLRef.fboMSIntermediateRenderID : OGLRef.fboRenderID; glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, OGLRef.selectedRenderingFBO); }