Merge pull request #611 from chrisforbes/bug_610

Only use anisotropic sampling if the device supports it
This commit is contained in:
Sascha Willems 2019-09-06 17:33:13 +02:00 committed by GitHub
commit 90c1cb85f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -374,9 +374,14 @@ public:
samplerCreateInfo.minLod = 0.0f; samplerCreateInfo.minLod = 0.0f;
// Both particle textures have the same number of mip maps // Both particle textures have the same number of mip maps
samplerCreateInfo.maxLod = float(textures.particles.fire.mipLevels); samplerCreateInfo.maxLod = float(textures.particles.fire.mipLevels);
// Enable anisotropic filtering
samplerCreateInfo.maxAnisotropy = 8.0f; if (vulkanDevice->features.samplerAnisotropy)
samplerCreateInfo.anisotropyEnable = VK_TRUE; {
// Enable anisotropic filtering
samplerCreateInfo.maxAnisotropy = 8.0f;
samplerCreateInfo.anisotropyEnable = VK_TRUE;
}
// Use a different border color (than the normal texture loader) for additive blending // Use a different border color (than the normal texture loader) for additive blending
samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
VK_CHECK_RESULT(vkCreateSampler(device, &samplerCreateInfo, nullptr, &textures.particles.sampler)); VK_CHECK_RESULT(vkCreateSampler(device, &samplerCreateInfo, nullptr, &textures.particles.sampler));