aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-11-16 09:01:28 -0700
committerTobin Ehlis <tobine@google.com>2016-11-17 15:34:38 -0700
commit234620548fe22f5b2004cc1221b91703466b8b12 (patch)
tree9f3fdb51775056ccb5a4e1937a443417c4202d5f /layers/core_validation.cpp
parent9812cc645dabc5e71b5fa5bffed61851e46973dd (diff)
downloadusermoji-234620548fe22f5b2004cc1221b91703466b8b12.tar.xz
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.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp2
1 files changed, 1 insertions, 1 deletions
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