From 6d1e80031b5e8cf4a2336a5c2063359694fd90b9 Mon Sep 17 00:00:00 2001 From: Laura Hermanns Date: Mon, 24 Jun 2024 20:48:01 -0400 Subject: [PATCH] [Testbed] Fixed condition when to use higher diff-threshold in MipMaps test. The condition for the difference threshold depends on the texture extent being a non-power-of-two (NPOT) texture. This condition was erroneously always true. --- tests/Testbed/UnitTests/TestMipMaps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Testbed/UnitTests/TestMipMaps.cpp b/tests/Testbed/UnitTests/TestMipMaps.cpp index 97f9a81fcd..2e428ebe37 100644 --- a/tests/Testbed/UnitTests/TestMipMaps.cpp +++ b/tests/Testbed/UnitTests/TestMipMaps.cpp @@ -26,7 +26,7 @@ static bool IsPowerOfTwo(std::uint32_t x) static bool IsPowerOfTwoExtent(const Extent3D& extent) { - return (IsPowerOfTwo(extent.width) || IsPowerOfTwo(extent.height) || IsPowerOfTwo(extent.depth)); + return (IsPowerOfTwo(extent.width) && IsPowerOfTwo(extent.height) && IsPowerOfTwo(extent.depth)); } DEF_TEST( MipMaps ) @@ -45,8 +45,8 @@ DEF_TEST( MipMaps ) For future improvements, these backends could provide MIP-map generation via image-blit functionality to compute a perfect reduction filter (i.e. no undersampling). This could be enabled via a new MiscFlags entry, for example: MiscFlags::HighQualityMipFilter. */ - const bool isNpotTexture = IsPowerOfTwoExtent(texDesc.extent); - const int diffThreshold = (isNpotTexture ? 170 : 2); + const bool isNpotTexture = !IsPowerOfTwoExtent(texDesc.extent); + const int diffThreshold = (isNpotTexture ? 170 : 10); for_subrange(mip, 1, texDesc.mipLevels) {