aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-05-08 11:24:57 -0600
committerTobin Ehlis <tobine@google.com>2017-05-08 14:19:45 -0600
commit55484d2becdbe11432130809b81b9de41463622a (patch)
tree858ba18ffbc5020883abd3851e816acb23384020 /layers/descriptor_sets.cpp
parent61f22e844a29726ce3915171c9e0e26579d67fec (diff)
downloadusermoji-55484d2becdbe11432130809b81b9de41463622a.tar.xz
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.
Diffstat (limited to 'layers/descriptor_sets.cpp')
-rw-r--r--layers/descriptor_sets.cpp10
1 files 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;