GPU: Use max vertex count based on buffer size

This commit is contained in:
Connor McLaughlin
2019-09-15 01:18:58 +10:00
parent a58b687352
commit 1bb794dd39
3 changed files with 10 additions and 11 deletions

View File

@ -379,7 +379,9 @@ void GPU_HW::DispatchRenderCommand(RenderCommand rc, u32 num_vertices)
// flush when the command changes
if (!m_batch_vertices.empty())
{
if (m_batch_vertices.size() >= MAX_BATCH_VERTEX_COUNT || m_batch_command.bits != rc.bits)
// including the degenerate triangles for strips
const u32 max_added_vertices = num_vertices + 2;
if ((m_batch_vertices.size() + max_added_vertices) >= MAX_BATCH_VERTEX_COUNT || m_batch_command.bits != rc.bits)
FlushRender();
}