Fix anisotropy being lost when applying bias to sampler

This commit is contained in:
baldurk
2020-05-06 19:35:50 +01:00
parent 863636d243
commit 343944db61
4 changed files with 4 additions and 3 deletions
@@ -829,7 +829,7 @@ QVariantList VulkanPipelineStateViewer::makeSampler(const QString &bindset, cons
filter = ToQStr(descriptor.filter);
if(descriptor.maxAnisotropy > 1.0f)
if(descriptor.maxAnisotropy >= 1.0f)
filter += lit(" Aniso %1x").arg(descriptor.maxAnisotropy);
if(descriptor.filter.filter == FilterFunction::Comparison)
+1 -1
View File
@@ -952,7 +952,7 @@ void VulkanCreationInfo::Sampler::Init(VulkanResourceManager *resourceMan, Vulka
address[1] = pCreateInfo->addressModeV;
address[2] = pCreateInfo->addressModeW;
mipLodBias = pCreateInfo->mipLodBias;
maxAnisotropy = pCreateInfo->anisotropyEnable ? pCreateInfo->maxAnisotropy : 1.0f;
maxAnisotropy = pCreateInfo->anisotropyEnable ? pCreateInfo->maxAnisotropy : 0.0f;
compareEnable = pCreateInfo->compareEnable != 0;
compareOp = pCreateInfo->compareOp;
minLod = pCreateInfo->minLod;
+1 -1
View File
@@ -1742,7 +1742,7 @@ void VulkanReplay::SavePipelineState(uint32_t eventId)
// sampler info
el.filter = MakeFilter(sampl.minFilter, sampl.magFilter, sampl.mipmapMode,
sampl.maxAnisotropy > 1.0f, sampl.compareEnable,
sampl.maxAnisotropy >= 1.0f, sampl.compareEnable,
sampl.reductionMode);
el.addressU = MakeAddressMode(sampl.address[0]);
el.addressV = MakeAddressMode(sampl.address[1]);
@@ -724,6 +724,7 @@ public:
sampInfo.addressModeV = samplerProps.address[1];
sampInfo.addressModeW = samplerProps.address[2];
sampInfo.mipLodBias = samplerProps.mipLodBias;
sampInfo.anisotropyEnable = samplerProps.maxAnisotropy >= 1.0f;
sampInfo.maxAnisotropy = samplerProps.maxAnisotropy;
sampInfo.compareEnable = samplerProps.compareEnable;
sampInfo.compareOp = samplerProps.compareOp;