From 2fa32fa284c7313c40fee00ac13674bd24460433 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 9 May 2017 08:51:38 -0700 Subject: layers: Remove default ctors for {Image,}SamplerDescriptor These just added confusion; we already support the !immut case in the other ctor. V2: ImageSamplerDescriptor remaining ctor was buggy. --- layers/descriptor_sets.cpp | 17 +++-------------- layers/descriptor_sets.h | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index b4dcfcfb..3539a831 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -331,7 +331,7 @@ cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const V descriptors_.emplace_back(new SamplerDescriptor(immut_sampler + di)); some_update_ = true; // Immutable samplers are updated at creation } else - descriptors_.emplace_back(new SamplerDescriptor()); + descriptors_.emplace_back(new SamplerDescriptor(nullptr)); } break; } @@ -342,7 +342,7 @@ cvdescriptorset::DescriptorSet::DescriptorSet(const VkDescriptorSet set, const V descriptors_.emplace_back(new ImageSamplerDescriptor(immut + di)); some_update_ = true; // Immutable samplers are updated at creation } else - descriptors_.emplace_back(new ImageSamplerDescriptor()); + descriptors_.emplace_back(new ImageSamplerDescriptor(nullptr)); } break; } @@ -742,11 +742,6 @@ void cvdescriptorset::DescriptorSet::BindCommandBuffer(GLOBAL_CB_NODE *cb_node, } } -cvdescriptorset::SamplerDescriptor::SamplerDescriptor() : sampler_(VK_NULL_HANDLE), immutable_(false) { - updated = false; - descriptor_class = PlainSampler; -}; - cvdescriptorset::SamplerDescriptor::SamplerDescriptor(const VkSampler *immut) : sampler_(VK_NULL_HANDLE), immutable_(false) { updated = false; descriptor_class = PlainSampler; @@ -951,14 +946,8 @@ void cvdescriptorset::SamplerDescriptor::BindCommandBuffer(const layer_data *dev } } -cvdescriptorset::ImageSamplerDescriptor::ImageSamplerDescriptor() - : sampler_(VK_NULL_HANDLE), immutable_(false), image_view_(VK_NULL_HANDLE), image_layout_(VK_IMAGE_LAYOUT_UNDEFINED) { - updated = false; - descriptor_class = ImageSampler; -} - cvdescriptorset::ImageSamplerDescriptor::ImageSamplerDescriptor(const VkSampler *immut) - : sampler_(VK_NULL_HANDLE), immutable_(true), image_view_(VK_NULL_HANDLE), image_layout_(VK_IMAGE_LAYOUT_UNDEFINED) { + : sampler_(VK_NULL_HANDLE), immutable_(false), image_view_(VK_NULL_HANDLE), image_layout_(VK_IMAGE_LAYOUT_UNDEFINED) { updated = false; descriptor_class = ImageSampler; if (immut) { diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h index de47dc91..396082b8 100644 --- a/layers/descriptor_sets.h +++ b/layers/descriptor_sets.h @@ -193,7 +193,6 @@ bool ValidateImageUpdate(VkImageView, VkImageLayout, VkDescriptorType, const cor class SamplerDescriptor : public Descriptor { public: - SamplerDescriptor(); SamplerDescriptor(const VkSampler *); void WriteUpdate(const VkWriteDescriptorSet *, const uint32_t) override; void CopyUpdate(const Descriptor *) override; @@ -209,7 +208,6 @@ class SamplerDescriptor : public Descriptor { class ImageSamplerDescriptor : public Descriptor { public: - ImageSamplerDescriptor(); ImageSamplerDescriptor(const VkSampler *); void WriteUpdate(const VkWriteDescriptorSet *, const uint32_t) override; void CopyUpdate(const Descriptor *) override; -- cgit v1.2.3