aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-05-02 10:17:07 -0600
committerTobin Ehlis <tobine@google.com>2016-05-02 10:47:15 -0600
commite8a09e37794ffb3c93f65e9c4a0e4857a7d3ac7a (patch)
treee2a82312fc247217819fdd8c67a732660f51044e
parent581486877ffd5b51ce0e8eefa5b63692aaf6d531 (diff)
downloadusermoji-e8a09e37794ffb3c93f65e9c4a0e4857a7d3ac7a.tar.xz
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.
-rw-r--r--layers/descriptor_sets.h8
1 files 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)) {