From f84a8044999ff8ed797a9753e5d17c86abdbd49b Mon Sep 17 00:00:00 2001 From: rogerman Date: Tue, 13 Aug 2024 19:49:34 -0700 Subject: [PATCH] OpenGL Renderer: Fix bug where clear images were Y-flipped. (Regression from commit 3db6d56.) --- desmume/src/OGLRender.cpp | 6 +++--- desmume/src/OGLRender_3_2.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) mode change 100755 => 100644 desmume/src/OGLRender.cpp mode change 100755 => 100644 desmume/src/OGLRender_3_2.cpp diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp old mode 100755 new mode 100644 index d99c8809d..f9dfb2938 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -4729,17 +4729,17 @@ Render3DError OpenGLRenderer_1_2::ClearUsingImage(const u16 *__restrict colorBuf { glReadBuffer(OGL_CI_FOGATTRIBUTES_ATTACHMENT_ID); glDrawBuffer(OGL_FOGATTRIBUTES_ATTACHMENT_ID); - glBlitFramebufferEXT(0, GPU_FRAMEBUFFER_NATIVE_HEIGHT, GPU_FRAMEBUFFER_NATIVE_WIDTH, 0, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitFramebufferEXT(0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); } // Blit the color buffer. Do this last so that color attachment 0 is set to the read FBO. glReadBuffer(OGL_CI_COLOROUT_ATTACHMENT_ID); glDrawBuffer(OGL_COLOROUT_ATTACHMENT_ID); - glBlitFramebufferEXT(0, GPU_FRAMEBUFFER_NATIVE_HEIGHT, GPU_FRAMEBUFFER_NATIVE_WIDTH, 0, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); + glBlitFramebufferEXT(0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); } else { - glBlitFramebufferEXT(0, GPU_FRAMEBUFFER_NATIVE_HEIGHT, GPU_FRAMEBUFFER_NATIVE_WIDTH, 0, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); + glBlitFramebufferEXT(0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); } if (this->_enableMultisampledRendering) diff --git a/desmume/src/OGLRender_3_2.cpp b/desmume/src/OGLRender_3_2.cpp old mode 100755 new mode 100644 index 7ad0d0148..b9266656c --- a/desmume/src/OGLRender_3_2.cpp +++ b/desmume/src/OGLRender_3_2.cpp @@ -401,7 +401,7 @@ out vec2 texCoord;\n\ \n\ void main()\n\ {\n\ - texCoord = vec2(inTexCoord0.x, 1.0 - inTexCoord0.y);\n\ + texCoord = inTexCoord0;\n\ gl_Position = vec4(inPosition, 0.0, 1.0);\n\ }\n\ "}; @@ -2966,13 +2966,13 @@ Render3DError OpenGLRenderer_3_2::ClearUsingImage(const u16 *__restrict colorBuf // Blit the fog buffer glReadBuffer(OGL_CI_FOGATTRIBUTES_ATTACHMENT_ID); glDrawBuffer(OGL_FOGATTRIBUTES_ATTACHMENT_ID); - glBlitFramebuffer(0, GPU_FRAMEBUFFER_NATIVE_HEIGHT, GPU_FRAMEBUFFER_NATIVE_WIDTH, 0, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitFramebuffer(0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); } // Blit the color and depth/stencil buffers. Do this last so that color attachment 0 is set to the read FBO. glReadBuffer(OGL_CI_COLOROUT_ATTACHMENT_ID); glDrawBuffer(OGL_COLOROUT_ATTACHMENT_ID); - glBlitFramebuffer(0, GPU_FRAMEBUFFER_NATIVE_HEIGHT, GPU_FRAMEBUFFER_NATIVE_WIDTH, 0, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); + glBlitFramebuffer(0, 0, GPU_FRAMEBUFFER_NATIVE_WIDTH, GPU_FRAMEBUFFER_NATIVE_HEIGHT, 0, 0, (GLint)this->_framebufferWidth, (GLint)this->_framebufferHeight, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); if (this->_enableMultisampledRendering) {