Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

layers:Identify layout from pipelineLayout #1934

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions layers/descriptor_sets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ bool cvdescriptorset::DescriptorSetLayout::IsCompatible(DescriptorSetLayout cons
if (descriptor_count_ != rh_ds_layout->descriptor_count_) {
std::stringstream error_str;
error_str << "DescriptorSetLayout " << layout_ << " has " << descriptor_count_ << " descriptors, but DescriptorSetLayout "
<< rh_ds_layout->GetDescriptorSetLayout() << " has " << rh_ds_layout->descriptor_count_ << " descriptors.";
<< rh_ds_layout->GetDescriptorSetLayout() << ", which comes from pipelineLayout, has "
<< rh_ds_layout->descriptor_count_ << " descriptors.";
*error_msg = error_str.str();
return false; // trivial fail case
}
Expand All @@ -229,23 +230,24 @@ bool cvdescriptorset::DescriptorSetLayout::IsCompatible(DescriptorSetLayout cons
std::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->GetDescriptorSetLayout() << ", which comes from pipelineLayout, has a descriptorCount of "
<< rh_ds_layout->GetDescriptorCountFromBinding(binding.binding);
*error_msg = error_str.str();
return false;
} else if (binding.descriptorType != rh_ds_layout->GetTypeFromBinding(binding.binding)) {
std::stringstream error_str;
error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << layout_ << " is type '"
<< string_VkDescriptorType(binding.descriptorType) << "' but binding " << binding.binding
<< " for DescriptorSetLayout " << rh_ds_layout->GetDescriptorSetLayout() << " is type '"
<< " for DescriptorSetLayout " << rh_ds_layout->GetDescriptorSetLayout()
<< ", which comes from pipelineLayout, is type '"
<< string_VkDescriptorType(rh_ds_layout->GetTypeFromBinding(binding.binding)) << "'";
*error_msg = error_str.str();
return false;
} else if (binding.stageFlags != rh_ds_layout->GetStageFlagsFromBinding(binding.binding)) {
std::stringstream error_str;
error_str << "Binding " << binding.binding << " for DescriptorSetLayout " << layout_ << " has stageFlags "
<< binding.stageFlags << " but binding " << binding.binding << " for DescriptorSetLayout "
<< rh_ds_layout->GetDescriptorSetLayout() << " has stageFlags "
<< rh_ds_layout->GetDescriptorSetLayout() << ", which comes from pipelineLayout, has stageFlags "
<< rh_ds_layout->GetStageFlagsFromBinding(binding.binding);
*error_msg = error_str.str();
return false;
Expand Down
2 changes: 1 addition & 1 deletion layers/descriptor_sets.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class DescriptorSetLayout {
void FillBindingSet(std::unordered_set<uint32_t> *) const;
// Return true if given binding is present in this layout
bool HasBinding(const uint32_t binding) const { return binding_to_index_map_.count(binding) > 0; };
// Return true if this layout is compatible with passed in layout,
// Return true if this layout is compatible with passed in layout from a pipelineLayout,
// else return false and update error_msg with description of incompatibility
bool IsCompatible(DescriptorSetLayout const *const, std::string *) const;
// Return true if binding 1 beyond given exists and has same type, stageFlags & immutable sampler use
Expand Down