From 6be3cdfac51fd153b8039803ce38c31af4384fcd Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 6 Sep 2016 18:46:55 -0600 Subject: layers: Add MEMTRACK_INVALID_MEM_REGION error Add new enum value "MEMTRACK_INVALID_MEM_REGION" to track case when a region of an allocation bound to an image or buffer is not valid due to the memory not being correctly updated. This was previously aliased to USAGE_FLAG case which was masking the fact that there are no tests written for this invalid mem region case. --- layers/core_validation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e687cf79..12a8ee7e 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -474,7 +474,7 @@ static bool ValidateMemoryIsValid(layer_data *dev_data, VkDeviceMemory mem, uint if (mem_info) { if (!mem_info->bound_ranges[bound_object_handle].valid) { return log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - reinterpret_cast(mem), __LINE__, MEMTRACK_INVALID_USAGE_FLAG, "MEM", + reinterpret_cast(mem), __LINE__, MEMTRACK_INVALID_MEM_REGION, "MEM", "%s: Cannot read invalid region of memory allocation 0x%" PRIx64 " for bound %s object 0x%" PRIx64 ", please fill the memory before using.", functionName, reinterpret_cast(mem), object_type_to_string(type), bound_object_handle); @@ -489,7 +489,7 @@ static bool ValidateImageMemoryIsValid(layer_data *dev_data, IMAGE_NODE *image_n if (image_node->mem == MEMTRACKER_SWAP_CHAIN_IMAGE_KEY) { if (!image_node->valid) { return log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - reinterpret_cast(image_node->mem), __LINE__, MEMTRACK_INVALID_USAGE_FLAG, "MEM", + reinterpret_cast(image_node->mem), __LINE__, MEMTRACK_INVALID_MEM_REGION, "MEM", "%s: Cannot read invalid swapchain image 0x%" PRIx64 ", please fill the memory before using.", functionName, reinterpret_cast(image_node->image)); } -- cgit v1.2.3