summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2022-04-14 12:01:57 -0700
committerPokechu22 <Pokechu022@gmail.com>2022-04-22 16:54:38 -0700
commit39b2854b981aadec1576254ad5e4d91dc21c9709 (patch)
tree8be38dc8dddec79964a2448f8697dc60cc595e5f /Source/Core/VideoCommon/VertexLoaderManager.cpp
parent97d0ff58c8dbe374a1b87e1a72f1f245ed27ed96 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index e2881a8e3d..f5c9578a70 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -32,10 +32,9 @@
namespace VertexLoaderManager
{
// Used by zfreeze
-std::array<std::array<float, 4>, 3> position_cache;
-// The counter added to the address of the array is 1, 2, or 3, but never zero.
-// So only index 1 - 3 are used.
-std::array<u32, 4> position_matrix_index_cache;
+std::array<u32, 3> position_matrix_index_cache;
+// 3 vertices, 4 floats each to allow SIMD overwrite
+alignas(sizeof(std::array<float, 4>)) std::array<std::array<float, 4>, 3> position_cache;
static NativeVertexFormatMap s_native_vertex_map;
static NativeVertexFormat* s_current_vtx_fmt;
@@ -251,8 +250,9 @@ static VertexLoaderBase* RefreshLoader(int vtx_attr_group, bool preprocess = fal
int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, DataReader src,
bool is_preprocess)
{
- if (!count)
+ if (count == 0)
return 0;
+ ASSERT(count > 0);
VertexLoaderBase* loader = RefreshLoader(vtx_attr_group, is_preprocess);