From 10f76746515a9a7bd8122f40c33b65813aa17b38 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 5 Dec 2019 10:01:33 -0500 Subject: 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. --- Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/Software/SWVertexLoader.cpp') diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index 266f1046a1..9d273bb1cf 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -64,7 +64,7 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_ Rasterizer::SetTevReg(i, Tev::ALP_C, PixelShaderManager::constants.kcolors[i][3]); } - for (u32 i = 0; i < IndexGenerator::GetIndexLen(); i++) + for (u32 i = 0; i < m_index_generator.GetIndexLen(); i++) { const u16 index = m_cpu_index_buffer[i]; memset(static_cast(&m_vertex), 0, sizeof(m_vertex)); -- cgit v1.2.3