Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS/HW: Keep real rect before draw to avoid bad valid rect update #11419

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/resources/GameIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,7 @@ SCAJ-20177:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SCAJ-20178:
name: "Ape Escape - Million Monkeys"
region: "NTSC-Unk"
Expand Down Expand Up @@ -2098,6 +2099,7 @@ SCAJ-20197:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SCAJ-20198:
name: "Everybody's Tennis [PlayStation 2 the Best]"
region: "NTSC-Unk"
Expand Down Expand Up @@ -6981,6 +6983,7 @@ SCKA-20079:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SCKA-20081:
name: "Tekken 5 [PlayStation 2 Big Hit Series]"
region: "NTSC-K"
Expand Down Expand Up @@ -24809,6 +24812,7 @@ SLES-54644:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLES-54645:
name: "Valkyrie Profile 2 - Silmeria"
region: "PAL-F"
Expand All @@ -24819,6 +24823,7 @@ SLES-54645:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLES-54646:
name: "Valkyrie Profile 2 - Silmeria"
region: "PAL-G"
Expand All @@ -24830,6 +24835,7 @@ SLES-54646:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLES-54647:
name: "Valkyrie Profile 2 - Silmeria"
region: "PAL-I"
Expand All @@ -24841,6 +24847,7 @@ SLES-54647:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLES-54648:
name: "Valkyrie Profile 2 - Silmeria"
region: "PAL-S"
Expand All @@ -24851,6 +24858,7 @@ SLES-54648:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLES-54653:
name: "Freak Out - Extreme Freeride"
region: "PAL-M5"
Expand Down Expand Up @@ -43947,6 +43955,7 @@ SLPM-66419:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLPM-66420:
name: フロントミッション4 [アルティメットヒッツ]
name-sort: ふろんとみっしょん4 [あるてぃめっとひっつ]
Expand Down Expand Up @@ -46167,6 +46176,7 @@ SLPM-66782:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLPM-66783:
name: アイドル雀士 スーチーパイIV 「完全限定版・コレクターズエディション」
name-sort: あいどるじゃんし すーちーぱい4 [かんぜんげんていばん・これくたーずえでぃしょん]
Expand Down Expand Up @@ -64793,6 +64803,7 @@ SLUS-21452:
textureInsideRT: 1 # Required for swirl battle transition.
nativePaletteDraw: 1
nativeScaling: 2 # Fixes depth of field effects and bloom.
roundSprite: 1 # Fixes lines in transitions.
SLUS-21453:
name: "Disney's Meet the Robinsons"
region: "NTSC-U"
Expand Down
11 changes: 6 additions & 5 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3339,6 +3339,7 @@ void GSRendererHW::Draw()
}

//
const GSVector4i real_rect = m_r;

if (!skip_draw)
DrawPrims(rt, ds, src, tmm);
Expand All @@ -3358,9 +3359,9 @@ void GSRendererHW::Draw()
{
//rt->m_valid = rt->m_valid.runion(r);
// Limit to 2x the vertical height of the resolution (for double buffering)
rt->UpdateValidity(m_r, can_update_size || (m_r.w <= (resolution.y * 2) && !m_texture_shuffle));
rt->UpdateValidity(real_rect, can_update_size || (real_rect.w <= (resolution.y * 2) && !m_texture_shuffle));

g_texture_cache->InvalidateVideoMem(context->offset.fb, m_r, false);
g_texture_cache->InvalidateVideoMem(context->offset.fb, real_rect, false);

// Remove overwritten Zs at the FBP.
g_texture_cache->InvalidateVideoMemType(GSTextureCache::DepthStencil, m_cached_ctx.FRAME.Block(),
Expand All @@ -3371,9 +3372,9 @@ void GSRendererHW::Draw()
{
//ds->m_valid = ds->m_valid.runion(r);
// Limit to 2x the vertical height of the resolution (for double buffering)
ds->UpdateValidity(m_r, can_update_size || (m_r.w <= (resolution.y * 2) && !m_texture_shuffle));
ds->UpdateValidity(real_rect, can_update_size || (real_rect.w <= (resolution.y * 2) && !m_texture_shuffle));

g_texture_cache->InvalidateVideoMem(context->offset.zb, m_r, false);
g_texture_cache->InvalidateVideoMem(context->offset.zb, real_rect, false);

// Remove overwritten RTs at the ZBP.
g_texture_cache->InvalidateVideoMemType(
Expand Down Expand Up @@ -3415,7 +3416,7 @@ void GSRendererHW::Draw()

#ifdef DISABLE_HW_TEXTURE_CACHE
if (rt)
g_texture_cache->Read(rt, m_r);
g_texture_cache->Read(rt, real_rect);
#endif

//
Expand Down