diff options
| author | John Zulauf <jzulauf@lunarg.com> | 2018-02-19 16:32:08 -0700 |
|---|---|---|
| committer | jzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com> | 2018-02-21 07:37:25 -0700 |
| commit | b1991fd9137e960c06bc2f691e850015032bf13a (patch) | |
| tree | 21ae994c04f1f644fcddf2e30671586f34c4a4c5 /layers/core_validation.cpp | |
| parent | 5fa4791843d7bb9df449e243e17731d72bebb436 (diff) | |
| download | usermoji-b1991fd9137e960c06bc2f691e850015032bf13a.tar.xz | |
layers: A memory binding validation for barriers
Add validation to ensure non-sparse resources are bound to memory before
being referenced in a barrier command.
Change-Id: I007200833d19a96e92ef61a91851c6395b8b9c57
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 475accf3..7216d8e1 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -7599,6 +7599,12 @@ static bool ValidateBarriers(layer_data *device_data, const char *funcName, GLOB } if (image_data) { + // There is no VUID for this, but there is blanket text: + // "Non-sparse resources must be bound completely and contiguously to a single VkDeviceMemory object before + // recording commands in a command buffer." + // TODO: Update this when VUID is defined + skip |= ValidateMemoryIsBoundToImage(device_data, image_data, funcName, VALIDATION_ERROR_UNDEFINED); + auto aspect_mask = mem_barrier->subresourceRange.aspectMask; skip |= ValidateImageAspectMask(device_data, image_data->image, image_data->createInfo.format, aspect_mask, funcName); @@ -7629,6 +7635,12 @@ static bool ValidateBarriers(layer_data *device_data, const char *funcName, GLOB skip |= ValidateBarrierQueueFamilies(device_data, funcName, cb_state, mem_barrier, buffer_state); if (buffer_state) { + // There is no VUID for this, but there is blanket text: + // "Non-sparse resources must be bound completely and contiguously to a single VkDeviceMemory object before + // recording commands in a command buffer" + // TODO: Update this when VUID is defined + skip |= ValidateMemoryIsBoundToBuffer(device_data, buffer_state, funcName, VALIDATION_ERROR_UNDEFINED); + auto buffer_size = buffer_state->requirements.size; if (mem_barrier->offset >= buffer_size) { skip |= log_msg( |
