From 234620548fe22f5b2004cc1221b91703466b8b12 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Wed, 16 Nov 2016 09:01:28 -0700 Subject: layers:Check buffer offset against required size Fixes #1030 Use the required memory size instead of bound memory size when validating the offset into a memory buffer. This will correctly handle both sparse and non-sparse cases. --- layers/core_validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index ff340334..a4f0d5a9 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -9257,7 +9257,7 @@ static bool ValidateBarriers(const char *funcName, VkCommandBuffer cmdBuffer, ui auto buffer_node = getBufferNode(dev_data, mem_barrier->buffer); if (buffer_node) { - auto buffer_size = buffer_node->binding.size; + auto buffer_size = buffer_node->requirements.size; if (mem_barrier->offset >= buffer_size) { skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, DRAWSTATE_INVALID_BARRIER, "DS", "%s: Buffer Barrier 0x%" PRIx64 " has offset 0x%" PRIx64 -- cgit v1.2.3