From e8a09e37794ffb3c93f65e9c4a0e4857a7d3ac7a Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 2 May 2016 10:17:07 -0600 Subject: layers: GH463 Fix layout compatibility check After lh and rh layout descriptorCounts were verified to be the same, the next check was testing the descriptor count for each binding in the lh binding against the entire descriptor count for the rh layout. The check should be made just against the descriptor count for the specific binding we're checking in the rh layout. --- layers/descriptor_sets.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/layers/descriptor_sets.h b/layers/descriptor_sets.h index 6112088c..3bd8bc6d 100644 --- a/layers/descriptor_sets.h +++ b/layers/descriptor_sets.h @@ -224,7 +224,7 @@ VkSampler const *DescriptorSetLayout::GetImmutableSamplerPtrFromBinding(const ui assert(binding_to_index_map_.count(binding)); return bindings_[binding_to_index_map_[binding]]->pImmutableSamplers; } -// If our layout is compatible with rh_sd_layout, return true, +// If our layout is compatible with rh_ds_layout, return true, // else return false and fill in error_msg will description of what causes incompatibility bool DescriptorSetLayout::IsCompatible(DescriptorSetLayout *rh_ds_layout, string *error_msg) { // Trivial case @@ -241,14 +241,12 @@ bool DescriptorSetLayout::IsCompatible(DescriptorSetLayout *rh_ds_layout, string // and verify that type and stageFlags match for (auto binding : bindings_) { // TODO : Do we also need to check immutable samplers? - // VkDescriptorSetLayoutBinding *rh_binding; - // rh_ds_layout->FillDescriptorSetLayoutBindingStructFromBinding(binding->binding, rh_binding); - if (binding->descriptorCount != rh_ds_layout->GetTotalDescriptorCount()) { + if (binding->descriptorCount != rh_ds_layout->GetDescriptorCountFromBinding(binding->binding)) { stringstream error_str; error_str << "Binding " << binding->binding << " for DescriptorSetLayout " << layout_ << " has a descriptorCount of " << binding->descriptorCount << " but binding " << binding->binding << " for DescriptorSetLayout " << rh_ds_layout->GetDescriptorSetLayout() << " has a descriptorCount of " - << rh_ds_layout->GetTotalDescriptorCount(); + << rh_ds_layout->GetDescriptorCountFromBinding(binding->binding); *error_msg = error_str.str(); return false; } else if (binding->descriptorType != rh_ds_layout->GetTypeFromBinding(binding->binding)) { -- cgit v1.2.3