GS/HW: Fix offset Z channel shuffle hazard. Adjust Tekken 5 CRC

This commit is contained in:
refractionpcsx2 2025-01-14 13:47:18 +00:00 committed by Ty
parent 5b93d2642b
commit 710b07a857
3 changed files with 28 additions and 10 deletions

View File

@ -1973,6 +1973,7 @@ SCAJ-20125:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -1983,6 +1984,7 @@ SCAJ-20126:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -2460,6 +2462,7 @@ SCAJ-20199:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -4162,6 +4165,7 @@ SCED-53538:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -5787,6 +5791,7 @@ SCES-53202:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -7238,6 +7243,7 @@ SCKA-20049:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -7463,6 +7469,7 @@ SCKA-20081:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -57880,6 +57887,7 @@ SLPS-25510:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -61052,6 +61060,7 @@ SLPS-73223:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -67063,6 +67072,7 @@ SLUS-21059:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.
@ -67612,6 +67622,7 @@ SLUS-21160:
clampModes:
eeClampMode: 2 # Fixes camera and stops constant coin noises on Pirates Cove.
gsHWFixes:
textureInsideRT: 1 # Fixes heat haze half screen problem.
alignSprite: 1 # Fixes vertical lines.
halfPixelOffset: 4 # Align post.
nativeScaling: 1 # Fixes depth of field effect.

View File

@ -248,19 +248,25 @@ bool GSHwHack::GSC_Tekken5(GSRendererHW& r, int& skip)
if (!s_nativeres && r.PRIM->PRIM == GS_SPRITE && RTME && RTEX0.TFX == 1 && RFPSM == RTPSM && RTPSM == PSMCT32 && RFBMSK == 0xFF000000 && r.m_index.tail > 2)
{
GSVertex* v = &r.m_vertex.buff[0];
// Don't enable hack on native res.
// Fixes ghosting/blur effect and white lines appearing in stages: Moonfit Wilderness, Acid Rain - caused by upscaling.
// Game copies the framebuffer as individual page rects with slight offsets (like 1/16 of a pixel etc) which doesn't wokr well with upscaling.
// This should catch all the scenarios, maybe overdoes it, but it's for 1 game and it's non-detrimental, it's better than squares all over the screen.
const GSVector4i draw_size(r.m_vt.m_min.p.x, r.m_vt.m_min.p.y, r.m_vt.m_max.p.x + 1.0f, r.m_vt.m_max.p.y + 1.0f);
const GSVector4i read_size(r.m_vt.m_min.t.x, r.m_vt.m_min.t.y, r.m_vt.m_max.t.x + 0.5f, r.m_vt.m_max.t.y + 0.5f);
r.ReplaceVerticesWithSprite(draw_size, read_size, GSVector2i(read_size.width(), read_size.height()), draw_size);
}
else if (RZTST == 1 && RTME && (RFBP == 0x02bc0 || RFBP == 0x02be0 || RFBP == 0x02d00 || RFBP == 0x03480 || RFBP == 0x034a0) && RFPSM == RTPSM && RTBP0 == 0x00000 && RTPSM == PSMCT32)
{
// The moving display effect(flames) is not emulated properly in the entire screen so let's remove the effect in the stage: Burning Temple. Related to half screen bottom issue.
// Fixes black lines in the stage: Burning Temple - caused by upscaling. Note the black lines can also be fixed with Merge Sprite hack.
skip = 2;
if (v[0].XYZ.X & 0xF)
{
const GSVector4i draw_size(r.m_vt.m_min.p.x, r.m_vt.m_min.p.y, r.m_vt.m_max.p.x + 1.0f, r.m_vt.m_max.p.y + 1.0f);
const GSVector4i read_size(r.m_vt.m_min.t.x, r.m_vt.m_min.t.y, r.m_vt.m_max.t.x + 0.5f, r.m_vt.m_max.t.y + 0.5f);
r.ReplaceVerticesWithSprite(draw_size, read_size, GSVector2i(read_size.width(), read_size.height()), draw_size);
}
else
{
// Fixes the alignment of the two halves for the heat haze on the temple stage.
for (int i = 0; i < r.m_index.tail; i+=2)
{
v[i].XYZ.Y -= 0x8;
}
}
}
}

View File

@ -5860,7 +5860,8 @@ __ri void GSRendererHW::HandleTextureHazards(const GSTextureCache::Target* rt, c
GL_CACHE("Source is render target, taking copy.");
src_target = rt;
}
else if (ds && m_conf.tex == m_conf.ds)
// Be careful of single page channel shuffles where depth is the source but it's not going to the same place, we can't read this directly.
else if (ds && m_conf.tex == m_conf.ds && (!m_channel_shuffle || static_cast<int>(m_cached_ctx.FRAME.Block() - rt->m_TEX0.TBP0) == static_cast<int>(m_cached_ctx.ZBUF.Block() - ds->m_TEX0.TBP0)))
{
// GL, Vulkan (in General layout), not DirectX!
const bool can_read_current_depth_buffer = g_gs_device->Features().test_and_sample_depth;