Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.08k stars 513 forks source link

maxSamplerAnisotropy limits not verified #216

Closed maltekliemann closed 3 years ago

maltekliemann commented 3 years ago

In Texture mapping > Image view and sampler, you're using a fixed maxSamplerAnisotropy = 16.0f. But VUID-VkSamplerCreateInfo-anisotropyEnable-01071 of Vulkan 1.2 states:

If anisotropyEnable is VK_TRUE, maxAnisotropy must be between 1.0 and VkPhysicalDeviceLimits::maxSamplerAnisotropy`, inclusive

So it should either be maxSamplerAnisotropy = properties.limits.maxSamplerAnisotropy (assuming 16.0f is the maximum), or you check during physical device selection if 16.0f is available. The former makes a lot more sense to me, but I wasn't sure which one you would prefer.

Overv commented 3 years ago

Ah, right, will fix that tomorrow!