From a8aebe4936415b003b7108d56abcbf3a4ce0ff16 Mon Sep 17 00:00:00 2001 From: purplemarshmallow Date: Sat, 31 Oct 2015 03:27:34 +0100 Subject: [PATCH] auxiliary buffers are rendered in native resulution if copyAuxiliary option is enabled This improves quality. No more need to scale down --- src/FrameBuffer.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index f80172a8..1c7ec9ca 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -193,8 +193,13 @@ void FrameBuffer::init(u32 _address, u32 _endAddress, u16 _format, u16 _size, u1 m_width = _width; m_height = _height; m_size = _size; - m_scaleX = ogl.getScaleX(); - m_scaleY = ogl.getScaleY(); + if (m_width != VI.width && config.frameBufferEmulation.copyAuxToRDRAM != 0) { + m_scaleX = 1.0f; + m_scaleY = 1.0f; + } else { + m_scaleX = ogl.getScaleX(); + m_scaleY = ogl.getScaleY(); + } m_fillcolor = 0; m_cfb = _cfb; m_needHeightCorrection = _width != VI.width && _width != *REG.VI_WIDTH; @@ -980,18 +985,18 @@ void FrameBufferToRDRAM::CopyToRDRAM(u32 _address) glBindFramebuffer(GL_READ_FRAMEBUFFER, pBuffer->m_resolveFBO); } else glBindFramebuffer(GL_READ_FRAMEBUFFER, pBuffer->m_FBO); - glReadBuffer(GL_COLOR_ATTACHMENT0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FBO); - glScissor(0, 0, pBuffer->m_pTexture->realWidth, pBuffer->m_pTexture->realHeight); - glBlitFramebuffer( - 0, 0, video().getWidth(), video().getHeight(), - 0, 0, VI.width, VI.height, - GL_COLOR_BUFFER_BIT, GL_NEAREST - ); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO); - glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO); - glReadBuffer(GL_COLOR_ATTACHMENT0); + if (pBuffer->m_scaleX > 1.0f) { + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FBO); + glScissor(0, 0, pBuffer->m_pTexture->realWidth, pBuffer->m_pTexture->realHeight); + glBlitFramebuffer( + 0, 0, video().getWidth(), video().getHeight(), + 0, 0, VI.width, VI.height, + GL_COLOR_BUFFER_BIT, GL_NEAREST + ); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO); + glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO); + } #ifndef GLES2 // If Sync, read pixels from the buffer, copy them to RDRAM. // If not Sync, read pixels from the buffer, copy pixels from the previous buffer to RDRAM.