diff --git a/src/pse/gpu_hw.cpp b/src/pse/gpu_hw.cpp index 023510254..60f1e8145 100644 --- a/src/pse/gpu_hw.cpp +++ b/src/pse/gpu_hw.cpp @@ -377,8 +377,11 @@ void GPU_HW::DispatchRenderCommand(RenderCommand rc, u32 num_vertices) } // flush when the command changes - if (!m_batch_vertices.empty() && m_batch_command.bits != rc.bits) - FlushRender(); + if (!m_batch_vertices.empty()) + { + if (m_batch_vertices.size() >= MAX_BATCH_VERTEX_COUNT || m_batch_command.bits != rc.bits) + FlushRender(); + } m_batch_command = rc; LoadVertices(rc, num_vertices); diff --git a/src/pse/gpu_hw.h b/src/pse/gpu_hw.h index 32225f73c..a84c3a99e 100644 --- a/src/pse/gpu_hw.h +++ b/src/pse/gpu_hw.h @@ -11,6 +11,8 @@ public: virtual ~GPU_HW(); protected: + static constexpr u32 MAX_BATCH_VERTEX_COUNT = 1024; + struct HWVertex { s32 x;