Skip to content

Commit

Permalink
Use FILTER_NEAREST if enableHybridFilter is disabled
Browse files Browse the repository at this point in the history
follow up ee0de5e
  • Loading branch information
gonetz committed May 10, 2020
1 parent 2551206 commit eac9523
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,6 @@ void Debugger::_drawFrameBuffer(FrameBuffer * _pBuffer)
float clearColor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
drawer.clearColorBuffer(clearColor);

TextureParam filter = textureParameters::FILTER_LINEAR;

GraphicsDrawer::BlitOrCopyRectParams blitParams;
blitParams.srcX0 = srcCoord[0];
blitParams.srcY0 = srcCoord[3];
Expand All @@ -647,7 +645,9 @@ void Debugger::_drawFrameBuffer(FrameBuffer * _pBuffer)
blitParams.dstY1 = dstCoord[3];
blitParams.dstWidth = wnd.getScreenWidth();
blitParams.dstHeight = wnd.getScreenHeight() + wnd.getHeightOffset();
blitParams.filter = filter;
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;
Expand Down
16 changes: 9 additions & 7 deletions src/FrameBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,6 @@ void FrameBufferList::_renderScreenSizeBuffer()

gfxContext.clearColorBuffer(0.0f, 0.0f, 0.0f, 0.0f);

TextureParam filter = textureParameters::FILTER_LINEAR;

GraphicsDrawer::BlitOrCopyRectParams blitParams;
blitParams.srcX0 = srcCoord[0];
blitParams.srcY0 = srcCoord[3];
Expand All @@ -1024,7 +1022,9 @@ void FrameBufferList::_renderScreenSizeBuffer()
blitParams.dstY1 = dstCoord[3];
blitParams.dstWidth = screenWidth;
blitParams.dstHeight = screenHeight + wndHeightOffset;
blitParams.filter = filter;
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;
Expand Down Expand Up @@ -1348,7 +1348,9 @@ 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 = textureParameters::FILTER_LINEAR;
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;
Expand Down Expand Up @@ -1492,7 +1494,6 @@ void FrameBufferList::renderBuffer()
hOffset + dstX1,
vOffset + (s32)(dstY1*dstScaleY) };

const TextureParam filter = config.generalEmulation.enableHybridFilter > 0 ? textureParameters::FILTER_LINEAR : textureParameters::FILTER_NEAREST;
ObjectHandle readBuffer;

if (pFilteredBuffer->m_pTexture->frameBufferTexture == CachedTexture::fbMultiSample) {
Expand Down Expand Up @@ -1522,7 +1523,9 @@ void FrameBufferList::renderBuffer()
blitParams.dstY1 = dstCoord[3];
blitParams.dstWidth = m_overscan.getBufferWidth();
blitParams.dstHeight = m_overscan.getBufferHeight();
blitParams.filter = filter;
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;
Expand Down Expand Up @@ -1568,7 +1571,6 @@ void FrameBufferList::renderBuffer()
blitParams.dstHeight = m_overscan.getBufferHeight();
blitParams.tex[0] = pBufferTexture;
blitParams.tex[1] = pNextBuffer->m_pDepthTexture;
blitParams.filter = filter;
blitParams.mask = blitMask::COLOR_BUFFER;
blitParams.readBuffer = readBuffer;

Expand Down

0 comments on commit eac9523

Please sign in to comment.