Skip to content

Commit bf94a9b

Browse files
committed
GS: Refactor texture shuffle detection and quad conversion.
1 parent 078f149 commit bf94a9b

File tree

4 files changed

+1062
-648
lines changed

4 files changed

+1062
-648
lines changed

pcsx2/GS/Renderers/Common/GSRenderer.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ class GSRenderer : public GSState
2626

2727
protected:
2828
GSVector2i m_real_size{0, 0};
29-
bool m_texture_shuffle = false;
30-
bool m_process_texture = false;
31-
bool m_copy_16bit_to_target_shuffle = false;
32-
bool m_same_group_texture_shuffle = false;
33-
bool m_downscale_source = false;
3429

3530
virtual GSTexture* GetOutput(int i, float& scale, int& y_offset) = 0;
3631
virtual GSTexture* GetFeedbackOutput(float& scale) { return nullptr; }

pcsx2/GS/Renderers/HW/GSHwHack.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -671,30 +671,19 @@ bool GSHwHack::GSC_NFSUndercover(GSRendererHW& r, int& skip)
671671
// NFS Undercover does a weird texture shuffle by page, which really isn't supported by our TC.
672672
// This causes it to spam creating new sources, severely destroying the speed.
673673
// The CRC hack bypasses the entire shuffle and does it in one go.
674+
// This is detected as a GappedSwizzle shuffle in texture shuffle detection.
674675
const GIFRegTEX0& Texture = RTEX0;
675676
const GIFRegFRAME& Frame = RFRAME;
676677

677678
if (RPRIM->TME && Frame.PSM == PSMCT16S && Frame.FBMSK != 0 && Frame.FBW == 10 && Texture.TBW == 1 && Texture.TBP0 == 0x02800 && Texture.PSM == PSMZ16S)
678679
{
679-
GSVertex* v = &r.m_vertex.buff[1];
680-
v[0].XYZ.X = static_cast<u16>(RCONTEXT->XYOFFSET.OFX + ((r.m_r.z * 2) << 4));
681-
v[0].XYZ.Y = static_cast<u16>(RCONTEXT->XYOFFSET.OFY + (r.m_r.w << 4));
682-
v[0].U = r.m_r.z << 4;
683-
v[0].V = r.m_r.w << 4;
684-
RCONTEXT->scissor.in.z = r.m_r.z * 2;
685-
RCONTEXT->scissor.in.w = r.m_r.w;
686-
r.m_vt.m_max.p.x = r.m_r.z * 2;
687-
r.m_vt.m_max.p.y = r.m_r.w;
688-
r.m_vt.m_max.t.x = r.m_r.z;
689-
r.m_vt.m_max.t.y = r.m_r.w;
690-
r.m_vertex.head = r.m_vertex.tail = r.m_vertex.next = 2;
691-
r.m_index.tail = 2;
692680
skip = 79;
681+
return false;
693682
}
694683
else
684+
{
695685
return skip > 0;
696-
697-
return false;
686+
}
698687
}
699688

700689
bool GSHwHack::GSC_PolyphonyDigitalGames(GSRendererHW& r, int& skip)

0 commit comments

Comments
 (0)