diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-07-20 14:04:20 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-07-21 06:45:08 -0600 |
| commit | 41197d83f466215a04080eaf8a43a7f9e1b9797f (patch) | |
| tree | 926621a0d91e58b9ef6be93c5e080d84f77c0326 /layers/descriptor_sets.cpp | |
| parent | efff6e216a25b8d63deb2f00c92dfb733277bca7 (diff) | |
| download | usermoji-41197d83f466215a04080eaf8a43a7f9e1b9797f.tar.xz | |
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.
Diffstat (limited to 'layers/descriptor_sets.cpp')
| -rw-r--r-- | layers/descriptor_sets.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index fa67b2cb..a149485f 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -600,6 +600,7 @@ bool cvdescriptorset::ValidateImageUpdate(VkImageView image_view, VkImageLayout *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 @@ bool cvdescriptorset::DescriptorSet::ValidateBufferUpdate(VkDescriptorBufferInfo *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() |
