summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderBase.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp
index 3284a2ccdb..a3597b53e5 100644
--- a/Source/Core/VideoCommon/VertexLoaderBase.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp
@@ -68,6 +68,7 @@ public:
VertexLoaderManager::position_matrix_index_cache;
const std::array<std::array<float, 4>, 3> old_position_cache =
VertexLoaderManager::position_cache;
+ const std::array<float, 4> old_normal_cache = VertexLoaderManager::normal_cache;
const std::array<float, 4> old_tangent_cache = VertexLoaderManager::tangent_cache;
const std::array<float, 4> old_binormal_cache = VertexLoaderManager::binormal_cache;
@@ -77,12 +78,14 @@ public:
VertexLoaderManager::position_matrix_index_cache;
const std::array<std::array<float, 4>, 3> a_position_cache =
VertexLoaderManager::position_cache;
+ const std::array<float, 4> a_normal_cache = VertexLoaderManager::normal_cache;
const std::array<float, 4> a_tangent_cache = VertexLoaderManager::tangent_cache;
const std::array<float, 4> a_binormal_cache = VertexLoaderManager::binormal_cache;
// Reset state before running b
VertexLoaderManager::position_matrix_index_cache = old_position_matrix_index_cache;
VertexLoaderManager::position_cache = old_position_cache;
+ VertexLoaderManager::normal_cache = old_normal_cache;
VertexLoaderManager::tangent_cache = old_tangent_cache;
VertexLoaderManager::binormal_cache = old_binormal_cache;
@@ -92,6 +95,7 @@ public:
VertexLoaderManager::position_matrix_index_cache;
const std::array<std::array<float, 4>, 3> b_position_cache =
VertexLoaderManager::position_cache;
+ const std::array<float, 4> b_normal_cache = VertexLoaderManager::normal_cache;
const std::array<float, 4> b_tangent_cache = VertexLoaderManager::tangent_cache;
const std::array<float, 4> b_binormal_cache = VertexLoaderManager::binormal_cache;
@@ -141,6 +145,12 @@ public:
// The last element is allowed to be garbage for SIMD overwrites
ASSERT_MSG(VIDEO,
+ std::equal(a_normal_cache.begin(), a_normal_cache.begin() + 3,
+ b_normal_cache.begin(), b_normal_cache.begin() + 3, bit_equal),
+ "Expected matching normal caches after loading (a: {}; b: {})",
+ fmt::join(a_normal_cache, ", "), fmt::join(b_normal_cache, ", "));
+
+ ASSERT_MSG(VIDEO,
std::equal(a_tangent_cache.begin(), a_tangent_cache.begin() + 3,
b_tangent_cache.begin(), b_tangent_cache.begin() + 3, bit_equal),
"Expected matching tangent caches after loading (a: {}; b: {})",