GS/HW: Properly scale depth up if required when native scaling is in use

This commit is contained in:
refractionpcsx2
2026-01-16 21:17:46 +00:00
committed by lightningterror
parent bb4ee5f0fb
commit 2c7a168029
3 changed files with 4 additions and 4 deletions

View File

@@ -3892,7 +3892,7 @@ void GSRendererHW::Draw()
{
const GSVector2i unscaled_size(ds->m_unscaled_size.x, ds->m_unscaled_size.y);
ds->m_scale = 1;
ds->ResizeTexture(ds->m_unscaled_size.x * target_scale, ds->m_unscaled_size.y * target_scale, true);
ds->ResizeTexture(ds->m_unscaled_size.x * target_scale, ds->m_unscaled_size.y * target_scale, true, true, GSVector4i::loadh(ds->m_unscaled_size * target_scale));
// Slightly abusing the texture resize.
ds->m_scale = target_scale;
ds->m_unscaled_size = unscaled_size;

View File

@@ -1722,7 +1722,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
if (found_t && (bw != t->m_TEX0.TBW || t->m_TEX0.PSM != psm))
match = false;
//if (!t_clean && can_convert)
// Different swizzle, different width, and dirty, so probably not what we want.
// DevCon.Warning("Expected %x Got %x shuffle %d draw %d", psm, t_psm, possible_shuffle, GSState::s_n);
if (match)
{
@@ -2775,7 +2775,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(GIFRegTEX0 TEX0, const GSVe
if (!tex)
return nullptr;
if (scale == 1.0f)
if (scale == 1.0f && type == RenderTarget)
{
// When using native HPO, the top-left column/row of pixels are often not drawn. Clamp these away to avoid sampling black,
// causing bleeding into the edges of the downsampled texture.

View File

@@ -268,7 +268,7 @@ public:
void UpdateValidChannels(u32 psm, u32 fbmsk);
/// Resizes target texture, DOES NOT RESCALE.
bool ResizeTexture(int new_unscaled_width, int new_unscaled_height, bool recycle_old = true, bool require_offset = false, GSVector4i offset = GSVector4i::zero(), bool keep_old = false);
bool ResizeTexture(int new_unscaled_width, int new_unscaled_height, bool recycle_old = true, bool require_new_rect = false, GSVector4i new_rect = GSVector4i::zero(), bool keep_old = false);
private:
void UpdateTextureDebugName();