Fix: Build error with MSVC

the bots seem to struggle with this test after 7e916474db
doesn't make a whole lot of sense, and i can't repro the
issue locally, but helping it a little to pick the right
template wouldn't hurt.

Pull Request: https://projects.blender.org/blender/blender/pulls/115916
This commit is contained in:
Ray Molenkamp
2023-12-08 00:23:07 +01:00
committed by Ray molenkamp
parent ee57ad334e
commit df94b2ef1b

View File

@@ -166,7 +166,9 @@ TEST(math_matrix, MatrixPseudoInverse)
{0.389669f, 0.647565f, 0.168130f, 0.200000f},
{-0.536231f, 0.330541f, 0.443163f, 0.300000f},
{0.000000f, 0.000000f, 0.000000f, 1.000000f}));
float4x4 inv = pseudo_invert(mat);
/* MSVC 2019 has issues deducing the right template paramters, use an explicit template
* instanciation to sidestep the issue. */
float4x4 inv = pseudo_invert<float, 4>(mat);
pseudoinverse_m4_m4(expect.ptr(), mat.ptr(), 1e-8f);
EXPECT_M4_NEAR(inv, expect, 1e-5f);
@@ -178,7 +180,9 @@ TEST(math_matrix, MatrixPseudoInverse)
{-0.51311f, 1.02638f, 0.496437f, -0.302896f},
{0.952803f, 0.221885f, 0.527413f, -0.297881f},
{-0.0275438f, -0.0477073f, 0.0656508f, 0.9926f}));
float4x4 inv2 = pseudo_invert(mat2);
/* MSVC 2019 has issues deducing the right template paramters, use an explicit template
* instanciation to sidestep the issue. */
float4x4 inv2 = pseudo_invert<float, 4>(mat2);
EXPECT_M4_NEAR(inv2, expect2, 1e-5f);
}