diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-04-22 23:24:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-22 23:24:22 -0400 |
| commit | 56bb965ab944bd01bf511df31b7c9d91f8e62bd4 (patch) | |
| tree | a6078a76e52a86d89ec2f53b94bab9aeb0894bd0 /Source/Core/VideoCommon/VertexLoaderManager.cpp | |
| parent | 2e01dc0c82b5f73215e3425ab45ff6c7ee50b389 (diff) | |
| parent | 784079853d9daa4d5e4de0b49b610ec0e58a2b0c (diff) | |
Merge pull request #10584 from Pokechu22/emboss-single-normal-v2
VideoCommon: Handle emboss texgen with only a single normal
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderManager.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp index b0922e5a6e..7710b7cc20 100644 --- a/Source/Core/VideoCommon/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp @@ -31,11 +31,12 @@ namespace VertexLoaderManager { -float position_cache[3][4]; - -// The counter added to the address of the array is 1, 2, or 3, but never zero. -// So only index 1 - 3 are used. -u32 position_matrix_index[4]; +// Used by zfreeze +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; +alignas(sizeof(std::array<float, 4>)) std::array<float, 4> tangent_cache; +alignas(sizeof(std::array<float, 4>)) std::array<float, 4> binormal_cache; static NativeVertexFormatMap s_native_vertex_map; static NativeVertexFormat* s_current_vtx_fmt; @@ -251,8 +252,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); |
