Enable sampler anisotropy only if enabled on device
This commit is contained in:
parent
c210820c70
commit
4959985a17
1 changed files with 3 additions and 1 deletions
|
|
@ -344,7 +344,7 @@ namespace vks
|
||||||
samplerCreateInfo.maxLod = (useStaging) ? (float)mipLevels : 0.0f;
|
samplerCreateInfo.maxLod = (useStaging) ? (float)mipLevels : 0.0f;
|
||||||
// Only enable anisotropic filtering if enabled on the devicec
|
// Only enable anisotropic filtering if enabled on the devicec
|
||||||
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
||||||
samplerCreateInfo.anisotropyEnable = VK_TRUE;
|
samplerCreateInfo.anisotropyEnable = device->enabledFeatures.samplerAnisotropy;
|
||||||
samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
|
samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
|
||||||
VK_CHECK_RESULT(vkCreateSampler(device->logicalDevice, &samplerCreateInfo, nullptr, &sampler));
|
VK_CHECK_RESULT(vkCreateSampler(device->logicalDevice, &samplerCreateInfo, nullptr, &sampler));
|
||||||
|
|
||||||
|
|
@ -731,6 +731,7 @@ namespace vks
|
||||||
samplerCreateInfo.addressModeW = samplerCreateInfo.addressModeU;
|
samplerCreateInfo.addressModeW = samplerCreateInfo.addressModeU;
|
||||||
samplerCreateInfo.mipLodBias = 0.0f;
|
samplerCreateInfo.mipLodBias = 0.0f;
|
||||||
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
||||||
|
samplerCreateInfo.anisotropyEnable = device->enabledFeatures.samplerAnisotropy;
|
||||||
samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER;
|
samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER;
|
||||||
samplerCreateInfo.minLod = 0.0f;
|
samplerCreateInfo.minLod = 0.0f;
|
||||||
samplerCreateInfo.maxLod = (float)mipLevels;
|
samplerCreateInfo.maxLod = (float)mipLevels;
|
||||||
|
|
@ -945,6 +946,7 @@ namespace vks
|
||||||
samplerCreateInfo.addressModeW = samplerCreateInfo.addressModeU;
|
samplerCreateInfo.addressModeW = samplerCreateInfo.addressModeU;
|
||||||
samplerCreateInfo.mipLodBias = 0.0f;
|
samplerCreateInfo.mipLodBias = 0.0f;
|
||||||
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
||||||
|
samplerCreateInfo.anisotropyEnable = device->enabledFeatures.samplerAnisotropy;
|
||||||
samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER;
|
samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER;
|
||||||
samplerCreateInfo.minLod = 0.0f;
|
samplerCreateInfo.minLod = 0.0f;
|
||||||
samplerCreateInfo.maxLod = (float)mipLevels;
|
samplerCreateInfo.maxLod = (float)mipLevels;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue