From adaed2df8ce76fa03de7f487c4dd7de18b575506 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sat, 17 Oct 2026 07:30:36 +0100 Subject: [PATCH] GS/HW: Keep valid width calculation in TBW range --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 1c1cff4472..2f9eda56fa 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -1554,6 +1554,8 @@ GSVector2i GSRendererHW::GetValidSize(const GSTextureCache::Source* tex, const b src_width >>= 1; src_height >>= 1; } + else if (m_cached_ctx.FRAME.FBW != 1 && src_width > static_cast(m_cached_ctx.FRAME.FBW * 64)) + src_width = (m_cached_ctx.FRAME.FBW * 64); width = (std::max(src_width, width) + page_x) & ~page_x; height = (std::max(src_height, height) + page_y) & ~page_y; @@ -10133,7 +10135,7 @@ bool GSRendererHW::DetectDoubleHalfClear(bool& no_rt, bool& no_ds) int half_point_pages = 0; half_point_pages = (half_point->m_valid.z + (zbuf_psm.pgs.x - 1)) / zbuf_psm.pgs.x; half_point_pages *= (half_point->m_valid.w + (zbuf_psm.pgs.y - 1)) / zbuf_psm.pgs.y; - half_point = (half_point && half_point->m_valid_rgb && half_point->HasValidAlpha() == req_valid_alpha && half_point_pages >= written_pages) ? half_point : nullptr; + half_point = (half_point && half_point->m_valid_rgb && half_point->HasValidAlpha() == req_valid_alpha && half_point_pages >= static_cast(written_pages)) ? half_point : nullptr; } if (half_point && half_point->m_age <= 1) return false;