Skip to content

Commit

Permalink
[Testbed] Use tolerance of 20 for NPOT textures in "MipMaps" test.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBanana committed Feb 8, 2025
1 parent ab1822f commit b353740
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/Testbed/UnitTests/TestMipMaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ 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 : 10);
const bool isNpotTexture = !IsPowerOfTwoExtent(texDesc.extent);
const int diffThreshold = (isNpotTexture ? 170 : 10);
const unsigned diffTolerance = (isNpotTexture ? 20 : 0);

for_subrange(mip, 1, texDesc.mipLevels)
{
Expand Down Expand Up @@ -79,7 +80,7 @@ DEF_TEST( MipMaps )
const std::string mipName = name + "_Mip" + std::to_string(mip);
SaveColorImage(mipData, Extent2D{ mipExtent.width, mipExtent.height }, mipName);

const DiffResult diff = DiffImages(mipName, diffThreshold);
const DiffResult diff = DiffImages(mipName, diffThreshold, diffTolerance);

TestResult intermediateResult = diff.Evaluate(mipName.c_str());
if (intermediateResult != TestResult::Passed)
Expand Down

0 comments on commit b353740

Please sign in to comment.