[FIXED] VK_LOD_CLAMP_NONE computed mipmap levels#876
[FIXED] VK_LOD_CLAMP_NONE computed mipmap levels#876robertosfield merged 2 commits intovsg-dev:masterfrom
Conversation
|
I have just done quick review, as I wasn't familiar with VK_LOD_CLAMP_NONE so looked it up: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_LOD_CLAMP_NONE.html I noticed the use of float so looked up the specs on samplers: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkSamplerCreateInfo.html The relevant part is: float minLod;
float maxLod;The vsg::computeNumMipMapLevels(...) function uses the maxLod value to help guide the number of mipLevels: uint32_t vsg::computeNumMipMapLevels(const Data* data, const Sampler* sampler) It does so via a cast to uin32_t, and you changes compare this against the float VK_LOD_CLAMP_NONE which may work but it's not something I'd recommend. Might I suggest comparing sampler->maxLod to VK_LOD_CLAMP_NONE would be more reliable. Given this check would also need an additional sampler not null check it may be better to restructure the function so the logic is all clearer w.r.t how mipLevels is set. I can have a bash at this, but I'm in the middle of other work so can't do this right away. |
Pull Request Template
Description
Fixed incorrect value returned by vsg::computeNumMipMapLevels when maxLod is set to VK_LOD_CLAMP_NONE.
Type of change
How Has This Been Tested?
Before:
After:
Checklist: