GS/HW: Fix downscales on target regions

This commit is contained in:
refractionpcsx2 2024-06-29 20:27:00 +01:00
parent 7ab494ca31
commit f6ce7b9ede
1 changed files with 6 additions and 1 deletions

View File

@ -5295,7 +5295,12 @@ __ri void GSRendererHW::HandleTextureHazards(const GSTextureCache::Target* rt, c
const GSVector2i clamp_min = (GSConfig.UserHacks_HalfPixelOffset != GSHalfPixelOffset::Native) ? const GSVector2i clamp_min = (GSConfig.UserHacks_HalfPixelOffset != GSHalfPixelOffset::Native) ?
GSVector2i(0, 0) : GSVector2i(0, 0) :
GSVector2i(downsample_factor, downsample_factor); GSVector2i(downsample_factor, downsample_factor);
const GSVector4 dRect = GSVector4((tmm.coverage + GSVector4i(-1, 1).xxyy()).rintersect(src_target->GetUnscaledRect())); GSVector4i copy_rect = tmm.coverage;
if (target_region)
{
copy_rect += GSVector4i(source_region.GetMinX(), source_region.GetMinY()).xyxy();
}
const GSVector4 dRect = GSVector4((copy_rect + GSVector4i(-1, 1).xxyy()).rintersect(src_target->GetUnscaledRect()));
g_gs_device->FilteredDownsampleTexture(src_target->m_texture, src_copy.get(), downsample_factor, clamp_min, dRect); g_gs_device->FilteredDownsampleTexture(src_target->m_texture, src_copy.get(), downsample_factor, clamp_min, dRect);
} }
} }