From b1991fd9137e960c06bc2f691e850015032bf13a Mon Sep 17 00:00:00 2001 From: John Zulauf Date: Mon, 19 Feb 2018 16:32:08 -0700 Subject: 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 --- layers/core_validation.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'layers/core_validation.cpp') 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( -- cgit v1.2.3