From 562e9bfebbca489e42bb3a0e6171e45816f1cae8 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sun, 31 Jul 2022 17:41:19 -0500 Subject: [PATCH] GS:FindMinMax: sprites use flat Z and color --- pcsx2/GS/Renderers/Common/GSVertexTrace.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp b/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp index 31818c2a8e..46cd1262a8 100644 --- a/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp +++ b/pcsx2/GS/Renderers/Common/GSVertexTrace.cpp @@ -154,14 +154,15 @@ void GSVertexTrace::Update(const void* vertex, const u32* index, int v_count, in template GSVertexTrace::FindMinMaxPtr GSVertexTrace::GetFMM(bool provoking_vertex_first) { + constexpr bool real_iip = primclass == GS_SPRITE_CLASS ? false : iip; constexpr bool real_fst = tme ? fst : false; constexpr bool provoking_vertex_first_class = primclass == GS_LINE_CLASS || primclass == GS_TRIANGLE_CLASS; const bool swap = provoking_vertex_first_class && !iip && provoking_vertex_first; if (swap) - return &GSVertexTrace::FindMinMax; + return &GSVertexTrace::FindMinMax; else - return &GSVertexTrace::FindMinMax; + return &GSVertexTrace::FindMinMax; } template @@ -260,12 +261,12 @@ void GSVertexTrace::FindMinMax(const void* vertex, const u32* index, int count) GSVector4i xyzf1(v1.m[1]); GSVector4i xy0 = xyzf0.upl16(); - GSVector4i z0 = xyzf0.yyyy(); + GSVector4i zf0 = xyzf0.ywyw(); GSVector4i xy1 = xyzf1.upl16(); - GSVector4i z1 = xyzf1.yyyy(); + GSVector4i zf1 = xyzf1.ywyw(); - GSVector4i p0 = xy0.blend16<0xf0>(z0.uph32(primclass == GS_SPRITE_CLASS ? xyzf1 : xyzf0)); - GSVector4i p1 = xy1.blend16<0xf0>(z1.uph32(xyzf1)); + GSVector4i p0 = xy0.blend32<0xc>(primclass == GS_SPRITE_CLASS ? zf1 : zf0); + GSVector4i p1 = xy1.blend32<0xc>(zf1); pmin = pmin.min_u32(p0.min_u32(p1)); pmax = pmax.max_u32(p0.max_u32(p1));