From 2f5280c8accefcb25a3ff6fe9a6d85a387190fd6 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 1 Jul 2020 22:01:14 +0700 Subject: [PATCH] Correct texture filters in rendering frame buffer to main color buffer. --- src/FrameBuffer.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index 2cccee8c..ff232494 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -1352,12 +1352,14 @@ void FrameBufferList::OverscanBuffer::draw(u32 _fullHeight, bool _PAL) blitParams.dstY1 = m_vOffset + wnd.getHeight() + wnd.getHeightOffset(); blitParams.dstWidth = wnd.getScreenWidth(); blitParams.dstHeight = wnd.getScreenHeight() + wnd.getHeightOffset(); - blitParams.filter = config.generalEmulation.enableHybridFilter > 0 ? - textureParameters::FILTER_LINEAR : - textureParameters::FILTER_NEAREST; blitParams.mask = blitMask::COLOR_BUFFER; blitParams.tex[0] = m_pTexture; - const bool downscale = blitParams.srcWidth >= blitParams.dstWidth && blitParams.srcHeight >= blitParams.dstHeight; + const bool downscale = config.frameBufferEmulation.nativeResFactor != 1 && + blitParams.srcWidth >= blitParams.dstWidth && + blitParams.srcHeight >= blitParams.dstHeight; + blitParams.filter = downscale || config.generalEmulation.enableHybridFilter == 0 ? + textureParameters::FILTER_NEAREST : + textureParameters::FILTER_LINEAR; if (config.frameBufferEmulation.copyDepthToMainDepthBuffer != 0) { blitParams.tex[1] = m_pDepthTexture; blitParams.combiner = downscale ? CombinerInfo::get().getTexrectColorAndDepthDownscaleCopyProgram() : @@ -1527,15 +1529,17 @@ void FrameBufferList::renderBuffer() blitParams.dstY1 = dstCoord[3]; blitParams.dstWidth = m_overscan.getBufferWidth(); blitParams.dstHeight = m_overscan.getBufferHeight(); - blitParams.filter = config.generalEmulation.enableHybridFilter > 0 ? - textureParameters::FILTER_LINEAR : - textureParameters::FILTER_NEAREST; blitParams.mask = blitMask::COLOR_BUFFER; blitParams.tex[0] = pBufferTexture; - const bool downscale = blitParams.srcWidth >= blitParams.dstWidth && blitParams.srcHeight >= blitParams.dstHeight; + const bool downscale = config.frameBufferEmulation.nativeResFactor != 1 && + blitParams.srcWidth >= blitParams.dstWidth && + blitParams.srcHeight >= blitParams.dstHeight; + blitParams.filter = downscale || config.generalEmulation.enableHybridFilter == 0 ? + textureParameters::FILTER_NEAREST : + textureParameters::FILTER_LINEAR; if (config.frameBufferEmulation.copyDepthToMainDepthBuffer != 0) { blitParams.tex[1] = pBuffer->m_pDepthTexture; - blitParams.combiner = downscale ? CombinerInfo::get().getTexrectColorAndDepthDownscaleCopyProgram(): + blitParams.combiner = downscale ? CombinerInfo::get().getTexrectColorAndDepthDownscaleCopyProgram() : CombinerInfo::get().getTexrectColorAndDepthUpscaleCopyProgram(); } if (blitParams.combiner == nullptr) {