Skip to content

Commit 48a4dcc

Browse files
GS/HW/NS: Detect fake bilinear jiggle effect
1 parent 1198000 commit 48a4dcc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

pcsx2/GS/GSRegs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ REG_END2
531531
__forceinline bool IsOpaque() const { return ((A == B || (C == 2 && FIX == 0)) && D == 0) || (A == 0 && B == D && C == 2 && FIX == 0x80); }
532532
__forceinline bool IsOpaque(int amin, int amax) const { return ((A == B || amax == 0) && D == 0) || (A == 0 && B == D && amin == 0x80 && amax == 0x80); }
533533
__forceinline bool IsCd() const { return (A == B) && (D == 1); }
534+
__forceinline bool IsAdditive() const { return (A == 0 && B == 2 && (C != 2 || FIX != 0) && D == 1); }
534535

535536
// output will be Cd, Cs is discarded
536537
__forceinline bool IsCdOutput() const { return (C == 2 && D != 1 && FIX == 0x00); }

pcsx2/GS/Renderers/HW/GSRendererHW.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10748,7 +10748,10 @@ int GSRendererHW::IsScalingDraw(GSTextureCache::Source* src, bool no_gaps)
1074810748
const int first_x = (v[1].XYZ.X - v[0].XYZ.X) >> 4;
1074910749
const int first_y = (v[1].XYZ.Y - v[0].XYZ.Y) >> 4;
1075010750

10751-
if (first_x >= first_u && first_y >= first_v && !no_resize && ((draw_size.x != first_x && draw_size.y != first_y) || (tex_size.x != first_u && tex_size.y != first_v)) && std::abs(draw_size.x - first_x) <= 4 && std::abs(draw_size.y - first_y) <= 4)
10751+
const u32 half_color_mask = (m_vt.m_min.c == GSVector4i(64, 64, 64, 64)).mask() & 0xfff;
10752+
const bool possible_fake_bilinear = PRIM->ABE && m_context->ALPHA.IsAdditive() && m_cached_ctx.TEX0.TFX == TFX_MODULATE && m_vt.m_eq.rgba && half_color_mask == 0xfff;
10753+
10754+
if (first_x >= first_u && first_y >= first_v && (!no_resize || possible_fake_bilinear) && ((draw_size.x != first_x && draw_size.y != first_y) || (tex_size.x != first_u && tex_size.y != first_v)) && std::abs(draw_size.x - first_x) <= 4 && std::abs(draw_size.y - first_y) <= 4)
1075210755
{
1075310756
for (u32 i = 2; i < m_index->tail; i += 2)
1075410757
{

0 commit comments

Comments
 (0)