GS/HW: Update vertex trace in ReplaceVerticesWithSprite()

This commit is contained in:
Stenzek 2023-07-27 20:40:40 +10:00 committed by Connor McLaughlin
parent 13c9e0e666
commit 9ce2ae613b
1 changed files with 20 additions and 0 deletions

View File

@ -5964,6 +5964,9 @@ void GSRendererHW::ReplaceVerticesWithSprite(const GSVector4i& unscaled_rect, co
v[0].XYZ.X = static_cast<u16>(m_context->XYOFFSET.OFX + fpr.x);
v[0].XYZ.Y = static_cast<u16>(m_context->XYOFFSET.OFY + fpr.y);
v[0].XYZ.Z = v[1].XYZ.Z;
v[0].RGBAQ = v[1].RGBAQ;
v[0].FOG = v[1].FOG;
v[1].XYZ.X = static_cast<u16>(m_context->XYOFFSET.OFX + fpr.z);
v[1].XYZ.Y = static_cast<u16>(m_context->XYOFFSET.OFY + fpr.w);
@ -5982,6 +5985,23 @@ void GSRendererHW::ReplaceVerticesWithSprite(const GSVector4i& unscaled_rect, co
GSVector4::storeh(&v[1].ST.S, st);
}
// Fix up vertex trace.
m_vt.m_min.p.x = unscaled_rect.x;
m_vt.m_min.p.y = unscaled_rect.y;
m_vt.m_min.p.z = v[0].XYZ.Z;
m_vt.m_max.p.x = unscaled_rect.z;
m_vt.m_max.p.y = unscaled_rect.w;
m_vt.m_max.p.z = v[0].XYZ.Z;
m_vt.m_min.t.x = unscaled_uv_rect.x;
m_vt.m_min.t.y = unscaled_uv_rect.y;
m_vt.m_max.t.x = unscaled_uv_rect.z;
m_vt.m_max.t.y = unscaled_uv_rect.w;
m_vt.m_min.c = GSVector4i(v[0].RGBAQ.U32[0]).u8to32();
m_vt.m_max.c = m_vt.m_min.c;
m_vt.m_eq.rgba = 0xFFFF;
m_vt.m_eq.z = true;
m_vt.m_eq.f = true;
m_vertex.head = m_vertex.tail = m_vertex.next = 2;
m_index.tail = 2;