From 55484d2becdbe11432130809b81b9de41463622a Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 8 May 2017 11:24:57 -0600 Subject: [PATCH] layers:Immutable samplers are updated at creation Fixes #1741 Descriptors with immutable samplers are updated at the time they're created. Set update bool for descriptor sets with immutable samplers at the time they're created. This will prevent false positives. --- layers/descriptor_sets.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 40c280b8..58fc9ac1 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -327,9 +327,10 @@ cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const V case VK_DESCRIPTOR_TYPE_SAMPLER: { auto immut_sampler = p_layout_->GetImmutableSamplerPtrFromIndex(i); for (uint32_t di = 0; di < p_layout_->GetDescriptorCountFromIndex(i); ++di) { - if (immut_sampler) + if (immut_sampler) { descriptors_.emplace_back(new SamplerDescriptor(immut_sampler + di)); - else + some_update_ = true; // Immutable samplers are updated at creation + } else descriptors_.emplace_back(new SamplerDescriptor()); } break; @@ -337,9 +338,10 @@ cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const V case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: { auto immut = p_layout_->GetImmutableSamplerPtrFromIndex(i); for (uint32_t di = 0; di < p_layout_->GetDescriptorCountFromIndex(i); ++di) { - if (immut) + if (immut) { descriptors_.emplace_back(new ImageSamplerDescriptor(immut + di)); - else + some_update_ = true; // Immutable samplers are updated at creation + } else descriptors_.emplace_back(new ImageSamplerDescriptor()); } break; -- 2.34.1