GPU: Cap batch sizes at 1024 vertices, flush if exceeded

This commit is contained in:
Connor McLaughlin 2019-09-15 01:13:23 +10:00
parent 4ca3b4b570
commit a58b687352
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -11,6 +11,8 @@ public:
virtual ~GPU_HW();
protected:
static constexpr u32 MAX_BATCH_VERTEX_COUNT = 1024;
struct HWVertex
{
s32 x;