Skip to content

Commit

Permalink
[Testbed] Fixed condition when to use higher diff-threshold in MipMap…
Browse files Browse the repository at this point in the history
…s 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.
  • Loading branch information
LukasBanana committed Jun 25, 2024
1 parent cbb251f commit 9052c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Testbed/UnitTests/TestMipMaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -45,7 +45,7 @@ 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 bool isNpotTexture = !IsPowerOfTwoExtent(texDesc.extent);
const int diffThreshold = (isNpotTexture ? 170 : 2);

for_subrange(mip, 1, texDesc.mipLevels)
Expand Down

0 comments on commit 9052c6c

Please sign in to comment.