layers: Validation buffer descriptor updates for bound memory
When updating buffer descriptors, make sure that there is memory bound to any
non-sparse buffer.
Add comment that we don't need to do this for image descriptor updates
because they require the imageView (not just image) and we already validate
at imageView creation that memory is bound to image.
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index fa67b2c..a149485 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -600,6 +600,7 @@
*error = error_str.str();
return false;
}
+ // Note that when an imageview is created, we validated that memory is bound so no need to re-check here
// Validate that imageLayout is compatible with aspect_mask and image format
// and validate that image usage bits are correct for given usage
VkImageAspectFlags aspect_mask = iv_data->subresourceRange.aspectMask;
@@ -1055,6 +1056,8 @@
*error = error_str.str();
return false;
}
+ if (ValidateMemoryIsBoundToBuffer(device_data_, buffer_node, "vkUpdateDescriptorSets()"))
+ return false;
// Verify usage bits
if (!ValidateBufferUsage(buffer_node, type, error)) {
// error will have been updated by ValidateBufferUsage()