Skip to content

Commit 7ea3fb5

Browse files
committed
Only use anisotropic sampling if the device supports it
Fixes SaschaWillems#610
1 parent 2f985f2 commit 7ea3fb5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/particlefire/particlefire.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,14 @@ class VulkanExample : public VulkanExampleBase
374374
samplerCreateInfo.minLod = 0.0f;
375375
// Both particle textures have the same number of mip maps
376376
samplerCreateInfo.maxLod = float(textures.particles.fire.mipLevels);
377-
// Enable anisotropic filtering
378-
samplerCreateInfo.maxAnisotropy = 8.0f;
379-
samplerCreateInfo.anisotropyEnable = VK_TRUE;
377+
378+
if (vulkanDevice->features.samplerAnisotropy)
379+
{
380+
// Enable anisotropic filtering
381+
samplerCreateInfo.maxAnisotropy = 8.0f;
382+
samplerCreateInfo.anisotropyEnable = VK_TRUE;
383+
}
384+
380385
// Use a different border color (than the normal texture loader) for additive blending
381386
samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
382387
VK_CHECK_RESULT(vkCreateSampler(device, &samplerCreateInfo, nullptr, &textures.particles.sampler));

0 commit comments

Comments
 (0)