diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-09-21 09:19:15 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-09-22 07:55:28 -0600 |
| commit | ec6045e72ebf8804d8550cae98aa2e05e0a5fba1 (patch) | |
| tree | 71cd7c9bb230da636803bb6287af052a34277327 | |
| parent | a866a6cfcbae45d851200259ea1ce0c62efc1183 (diff) | |
| download | usermoji-ec6045e72ebf8804d8550cae98aa2e05e0a5fba1.tar.xz | |
layers: Verify memory is bound to images used to update descriptors
Fixes #663
For vkUpdateDescriptorSets() calls that include an image, verify that memory is bound to the image.
| -rw-r--r-- | layers/core_validation_types.h | 1 | ||||
| -rw-r--r-- | layers/descriptor_sets.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h index 5d38a1a4..52aad3df 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -676,6 +676,7 @@ VkSwapchainKHR getSwapchainFromImage(const layer_data *, VkImage); SWAPCHAIN_NODE *getSwapchainNode(const layer_data *, VkSwapchainKHR); void invalidateCommandBuffers(std::unordered_set<GLOBAL_CB_NODE *>, VK_OBJECT); bool ValidateMemoryIsBoundToBuffer(const layer_data *, const BUFFER_NODE *, const char *); +bool ValidateMemoryIsBoundToImage(const layer_data *, const IMAGE_NODE *, const char *); void AddCommandBufferBindingSampler(GLOBAL_CB_NODE *, SAMPLER_NODE *); void AddCommandBufferBindingImage(const layer_data *, GLOBAL_CB_NODE *, IMAGE_NODE *); void AddCommandBufferBindingImageView(const layer_data *, GLOBAL_CB_NODE *, IMAGE_VIEW_STATE *); diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index f02da6b1..e017f0e0 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -689,6 +689,9 @@ bool cvdescriptorset::ValidateImageUpdate(VkImageView image_view, VkImageLayout if (image_node) { format = image_node->createInfo.format; usage = image_node->createInfo.usage; + // Validate that memory is bound to image + if (ValidateMemoryIsBoundToImage(dev_data, image_node, "vkUpdateDescriptorSets()")) + return false; } else { // Also need to check the swapchains. auto swapchain = getSwapchainFromImage(dev_data, image); |
