Skip to content

Commit

Permalink
Merge pull request #911 from siystar/lod_clamp
Browse files Browse the repository at this point in the history
[FIXED] VK_LOD_CLAMP_NONE off-by-one error
  • Loading branch information
vsg-dev authored Aug 15, 2023
2 parents 1bfabd8 + 90ad807 commit 2c37379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vsg/state/ImageInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ uint32_t vsg::computeNumMipMapLevels(const Data* data, const Sampler* sampler)
uint32_t maxDimension = std::max({data->width(), data->height(), data->depth()});
if (sampler->maxLod == VK_LOD_CLAMP_NONE)
{
while ((1u << (mipLevels - 1)) < maxDimension)
while ((1u << mipLevels) <= maxDimension)
{
++mipLevels;
}
Expand Down

0 comments on commit 2c37379

Please sign in to comment.