From eb5f90027dc374057595c88f69bcbec3779eca44 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Wed, 5 Jun 2024 19:53:28 +0100 Subject: [PATCH] GS/HW: Don't downscale if draw is the same or larger than final output --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 8bb29fc9b4..7e9f6b5351 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -5936,7 +5936,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta float sx, sy, ox2, oy2; const float ox = static_cast(static_cast(m_context->XYOFFSET.OFX)); const float oy = static_cast(static_cast(m_context->XYOFFSET.OFY)); - if (GSConfig.UserHacks_HalfPixelOffset != GSHalfPixelOffset::Native && rt->GetScale() > 1.0f) + if (GSConfig.UserHacks_HalfPixelOffset != GSHalfPixelOffset::Native && (!rt || rt->GetScale() > 1.0f)) { sx = 2.0f * rtscale / (rtsize.x << 4); sy = 2.0f * rtscale / (rtsize.y << 4); @@ -7185,11 +7185,18 @@ bool GSRendererHW::TextureCoversWithoutGapsNotEqual() bool GSRendererHW::isDownscaleDraw(GSTextureCache::Source* src, bool no_gaps) { + const GSVector2i draw_size = GSVector2i(m_vt.m_max.p.x - m_vt.m_min.p.x, m_vt.m_max.p.y - m_vt.m_min.p.y); + + if (draw_size.x >= PCRTCDisplays.GetResolution().x) + return false; + + const GSVector2i tex_size = GSVector2i(m_vt.m_max.t.x - m_vt.m_min.t.x, m_vt.m_max.t.y - m_vt.m_min.t.y); + if (no_gaps && m_vt.m_primclass >= GS_TRIANGLE_CLASS && m_cached_ctx.FRAME.Block() != m_cached_ctx.TEX0.TBP0 && !IsMipMapDraw() && IsDiscardingDstColor() && src && src->m_from_target && m_context->TEX1.MMAG == 1 && - ((m_vt.m_max.t.x - m_vt.m_min.t.x) / 2.0f) >= (m_vt.m_max.p.x - m_vt.m_min.p.x) && ((m_vt.m_max.t.y - m_vt.m_min.t.y) / 2.0f) >= (m_vt.m_max.p.y - m_vt.m_min.p.y)) + (tex_size.x / 2.0f) >= draw_size.x && (tex_size.y / 2.0f) >= draw_size.y) { - DevCon.Warning("Draw %d is a downscale draw", s_n); + DevCon.Warning("Draw %d is a downscale draw from %dx%d to %dx%d", s_n, tex_size.x, tex_size.y, draw_size.x, draw_size.y); return true; }