From 97d0ff58c8dbe374a1b87e1a72f1f245ed27ed96 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Wed, 13 Apr 2022 16:12:53 -0700 Subject: Convert vertex loader position cache to std::array --- Source/Core/VideoCommon/VertexLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index b01ac961b9..c703c96508 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -23,7 +23,7 @@ static void PosMtx_ReadDirect_UByte(VertexLoader* loader) { u32 posmtx = DataRead() & 0x3f; if (loader->m_counter < 3) - VertexLoaderManager::position_matrix_index[loader->m_counter + 1] = posmtx; + VertexLoaderManager::position_matrix_index_cache[loader->m_counter + 1] = posmtx; DataWrite(posmtx); PRIM_LOG("posmtx: {}, ", posmtx); } -- cgit v1.2.3 From 39b2854b981aadec1576254ad5e4d91dc21c9709 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Thu, 14 Apr 2022 12:01:57 -0700 Subject: VertexLoader: Convert count register to remaining register This more accurately represents what's going on, and also ends at 0 instead of 1, making some indexing operations easier. This also changes it so that position_matrix_index_cache actually starts from index 0 instead of index 1. --- Source/Core/VideoCommon/VertexLoader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index c703c96508..751778dd24 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -22,8 +22,8 @@ u8* g_vertex_manager_write_ptr; static void PosMtx_ReadDirect_UByte(VertexLoader* loader) { u32 posmtx = DataRead() & 0x3f; - if (loader->m_counter < 3) - VertexLoaderManager::position_matrix_index_cache[loader->m_counter + 1] = posmtx; + if (loader->m_remaining < 3) + VertexLoaderManager::position_matrix_index_cache[loader->m_remaining] = posmtx; DataWrite(posmtx); PRIM_LOG("posmtx: {}, ", posmtx); } @@ -257,7 +257,7 @@ int VertexLoader::RunVertices(DataReader src, DataReader dst, int count) m_numLoadedVertices += count; m_skippedVertices = 0; - for (m_counter = count - 1; m_counter >= 0; m_counter--) + for (m_remaining = count - 1; m_remaining >= 0; m_remaining--) { m_tcIndex = 0; m_colIndex = 0; -- cgit v1.2.3