From 618106078fdbe4b4b38f5be26b372a9126060cba Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 15 Nov 2016 15:37:18 -0700 Subject: 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. --- layers/descriptor_sets.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'layers/descriptor_sets.cpp') 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::mapbinding.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()) { -- cgit v1.2.3