aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-11-15 15:37:18 -0700
committerTobin Ehlis <tobine@google.com>2016-11-17 15:34:38 -0700
commit618106078fdbe4b4b38f5be26b372a9126060cba (patch)
tree320fb09524e58fb69e8173eeb016399f8442f810 /layers/descriptor_sets.cpp
parent234620548fe22f5b2004cc1221b91703466b8b12 (diff)
downloadusermoji-618106078fdbe4b4b38f5be26b372a9126060cba.tar.xz
layers:Check all memory bindings
There are a few places in the code where we assume that an image or buffer doesn't have a sparse binding. These cases break with sparse bindings. To fix I added a function to BINDING class to retrieve all memory bindings and then updated a few spots with bad assumption to make use of this new GetBoundMemory() function.
Diffstat (limited to 'layers/descriptor_sets.cpp')
-rw-r--r--layers/descriptor_sets.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index d2315438..4d068458 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -406,14 +406,15 @@ bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::map<uint32_t,
*error = error_str.str();
return false;
} else {
- auto mem_entry = getMemObjInfo(device_data_, buffer_node->binding.mem);
- if (!mem_entry) {
- std::stringstream error_str;
- error_str << "Descriptor in binding #" << binding << " at global descriptor index " << i
- << " uses buffer " << buffer << " that references invalid memory "
- << buffer_node->binding.mem << ".";
- *error = error_str.str();
- return false;
+ for (auto mem_binding : buffer_node->GetBoundMemory()) {
+ if (!getMemObjInfo(device_data_, mem_binding)) {
+ std::stringstream error_str;
+ error_str << "Descriptor in binding #" << binding << " at global descriptor index " << i
+ << " uses buffer " << buffer << " that references invalid memory " << mem_binding
+ << ".";
+ *error = error_str.str();
+ return false;
+ }
}
}
if (descriptors_[i]->IsDynamic()) {