GS: Skip draws when scissor is invalid

i.e. the bottom-right is greater than the top-left.

tombraidertitle.gs.xz hits this.
This commit is contained in:
Stenzek 2023-05-08 22:23:12 +10:00 committed by refractionpcsx2
parent 159d0c060f
commit 828e86bdf4
2 changed files with 5 additions and 0 deletions

View File

@ -2600,6 +2600,7 @@ void GSState::UpdateScissor()
{ {
m_scissor = m_context->scissor.ex; m_scissor = m_context->scissor.ex;
m_ofxy = m_context->scissor.ofxy; m_ofxy = m_context->scissor.ofxy;
m_scissor_invalid = !m_context->scissor.in.gt32(m_context->scissor.in.zwzw()).allfalse();
} }
void GSState::UpdateVertexKick() void GSState::UpdateVertexKick()
@ -3110,6 +3111,9 @@ __forceinline void GSState::VertexKick(u32 skip)
if (m < n) if (m < n)
return; return;
// Skip draws when scissor is out of range (i.e. bottom-right is less than top-left), since everything will get clipped.
skip |= static_cast<u32>(m_scissor_invalid);
if (skip == 0 && (prim != GS_TRIANGLEFAN || m <= 4)) // m_vertex.xy only knows about the last 4 vertices, head could be far behind for fan if (skip == 0 && (prim != GS_TRIANGLEFAN || m <= 4)) // m_vertex.xy only knows about the last 4 vertices, head could be far behind for fan
{ {
GSVector4i pmin, pmax; GSVector4i pmin, pmax;

View File

@ -222,6 +222,7 @@ public:
u32 m_crc = 0; u32 m_crc = 0;
CRC::Game m_game = {}; CRC::Game m_game = {};
std::unique_ptr<GSDumpBase> m_dump; std::unique_ptr<GSDumpBase> m_dump;
bool m_scissor_invalid = false;
bool m_nativeres = false; bool m_nativeres = false;
bool m_mipmap = false; bool m_mipmap = false;
bool m_texflush_flag = false; bool m_texflush_flag = false;