VideoCommon/IndexGenerator: Eliminate static state

Now that we've extracted all of the stateless functions that can be
hidden, it's time to make the index generator a regular class with
active data members.

This can just be a member that sits within the vertex manager base
class. By deglobalizing the state of the index generator we also get rid
of the wonky dual-initializing that was going on within the OpenGL
backend.

Since the renderer is always initialized before the vertex manager, we
now only call Init() once throughout the execution lifecycle.
This commit is contained in:
Lioncash
2019-12-05 10:01:33 -05:00
parent 159947ab68
commit 10f7674651
12 changed files with 69 additions and 64 deletions

View File

@ -283,8 +283,7 @@ int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bo
count = loader->RunVertices(src, dst, count);
IndexGenerator::AddIndices(primitive, count);
g_vertex_manager->AddIndices(primitive, count);
g_vertex_manager->FlushData(count, loader->m_native_vtx_decl.stride);
ADDSTAT(g_stats.this_frame.num_prims, count);