Suppose I'm making a VkSampler, or possibly a set of VkSamplers, that I'm planning on using with several textures. Each texture has multiple mip levels, and the number of mip levels varies from texture to texture. I want all sampler options to be the same for all the textures, with the possible exception of maxLod
.
I don't actually want maxLod
to block any particular mip levels from being used; I only want all of each texture's levels to be used in an ordinary, non-erroneous way. So can I just throw in an absurdly high upper bound and use the same sampler for all the textures:
VkSamplerCreateInfo samplerCreateInfo;
...
samplerCreateInfo.minLod = 0;
samplerCreateInfo.maxLod = 1048576;
...or do I need to create a different sampler for each texture and set maxLod
for the sampler to that texture's unique maximal mip index?
I think the answer is probably that I can count on reasonable clamping to happen even if my sampler's maxLod
is very high - even if I then explicitly pass a uselessly high value to textureLod
in a shader - but I'm not totally sure I've correctly interpreted the relevant sections in the Vulkan and GLSL specifications.