diff options
| author | Tilka <tilkax@gmail.com> | 2024-10-12 19:49:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-12 19:49:48 +0100 |
| commit | d43c6dc555fea0b0ec84d05779a62dc876b70bf4 (patch) | |
| tree | f7e24ca237cdda8cde7e611ee52806fdea96292a /Source/UnitTests/VideoCommon/VertexLoaderTest.cpp | |
| parent | 35ec2e97a8ea90730cb33eceec701f81597f98f7 (diff) | |
| parent | 937bb2aa2e12b635ba328af8de7c9a5d5963d084 (diff) | |
Merge pull request #13074 from Pokechu22/normal-cache
Cache normals in addition to binormals and tangents
Diffstat (limited to 'Source/UnitTests/VideoCommon/VertexLoaderTest.cpp')
| -rw-r--r-- | Source/UnitTests/VideoCommon/VertexLoaderTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp b/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp index 83b1f813da..675be35355 100644 --- a/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp +++ b/Source/UnitTests/VideoCommon/VertexLoaderTest.cpp @@ -702,6 +702,7 @@ TEST_P(VertexLoaderNormalTest, NormalAll) input_with_expected_type(i / 32.f); // Pre-fill these values to detect if they're modified + VertexLoaderManager::normal_cache = {-42.f, -43.f, -44.f, -45.f}; VertexLoaderManager::binormal_cache = {42.f, 43.f, 44.f, 45.f}; VertexLoaderManager::tangent_cache = {46.f, 47.f, 48.f, 49.f}; @@ -738,6 +739,9 @@ TEST_P(VertexLoaderNormalTest, NormalAll) ExpectOut(10 / 32.f); ExpectOut(11 / 32.f); ExpectOut(12 / 32.f); + EXPECT_EQ(VertexLoaderManager::normal_cache[0], 10 / 32.f); + EXPECT_EQ(VertexLoaderManager::normal_cache[1], 11 / 32.f); + EXPECT_EQ(VertexLoaderManager::normal_cache[2], 12 / 32.f); if (elements == NormalComponentCount::NTB) { // Tangent @@ -759,6 +763,14 @@ TEST_P(VertexLoaderNormalTest, NormalAll) } } + if (addr == VertexComponentFormat::NotPresent) + { + // Expect these to not be written + EXPECT_EQ(VertexLoaderManager::normal_cache[0], -42.f); + EXPECT_EQ(VertexLoaderManager::normal_cache[1], -43.f); + EXPECT_EQ(VertexLoaderManager::normal_cache[2], -44.f); + EXPECT_EQ(VertexLoaderManager::normal_cache[3], -45.f); + } if (addr == VertexComponentFormat::NotPresent || elements == NormalComponentCount::N) { // Expect these to not be written |
