diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2016-11-15 08:56:03 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2016-11-16 13:07:55 -0700 |
| commit | c7d1fd22e1e41178184f3acfe98b7a1cfa503b59 (patch) | |
| tree | 2e6b66fb60997dc3fc8ae7eebe9e4fb7091c3a79 | |
| parent | 0215eaacc4e19bc4b8d37644c10838900ec2297a (diff) | |
| download | usermoji-c7d1fd22e1e41178184f3acfe98b7a1cfa503b59.tar.xz | |
layers: Update ValidateMemIsMapped error enums
Plumbed in VU error enums, updated tests and database.
Change-Id: I114d269c686cddd6b1d3acb098d0b2f5fe4fdc17
| -rw-r--r-- | layers/core_validation.cpp | 46 | ||||
| -rw-r--r-- | layers/vk_validation_error_database.txt | 4 |
2 files changed, 28 insertions, 22 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 2a8f3820..aceb326f 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11181,26 +11181,32 @@ static bool validateMemoryIsMapped(layer_data *dev_data, const char *funcName, u for (uint32_t i = 0; i < memRangeCount; ++i) { auto mem_info = getMemObjInfo(dev_data, pMemRanges[i].memory); if (mem_info) { - if (mem_info->mem_range.offset > pMemRanges[i].offset) { - skip_call |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - (uint64_t)pMemRanges[i].memory, __LINE__, MEMTRACK_INVALID_MAP, "MEM", - "%s: Flush/Invalidate offset (" PRINTF_SIZE_T_SPECIFIER ") is less than Memory Object's offset " - "(" PRINTF_SIZE_T_SPECIFIER ").", - funcName, static_cast<size_t>(pMemRanges[i].offset), static_cast<size_t>(mem_info->mem_range.offset)); - } - - const uint64_t dev_dataTerminus = (mem_info->mem_range.size == VK_WHOLE_SIZE) - ? mem_info->alloc_info.allocationSize - : (mem_info->mem_range.offset + mem_info->mem_range.size); - if (pMemRanges[i].size != VK_WHOLE_SIZE && (dev_dataTerminus < (pMemRanges[i].offset + pMemRanges[i].size))) { - skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, (uint64_t)pMemRanges[i].memory, __LINE__, - MEMTRACK_INVALID_MAP, "MEM", "%s: Flush/Invalidate upper-bound (" PRINTF_SIZE_T_SPECIFIER - ") exceeds the Memory Object's upper-bound " - "(" PRINTF_SIZE_T_SPECIFIER ").", - funcName, static_cast<size_t>(pMemRanges[i].offset + pMemRanges[i].size), - static_cast<size_t>(dev_dataTerminus)); + if (pMemRanges[i].size == VK_WHOLE_SIZE) { + if (mem_info->mem_range.offset > pMemRanges[i].offset) { + skip_call |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, + (uint64_t)pMemRanges[i].memory, __LINE__, VALIDATION_ERROR_00643, "MEM", + "%s: Flush/Invalidate offset (" PRINTF_SIZE_T_SPECIFIER ") is less than Memory Object's offset " + "(" PRINTF_SIZE_T_SPECIFIER "). %s", + funcName, static_cast<size_t>(pMemRanges[i].offset), + static_cast<size_t>(mem_info->mem_range.offset), validation_error_map[VALIDATION_ERROR_00643]); + } + } else { + const uint64_t data_end = (mem_info->mem_range.size == VK_WHOLE_SIZE) + ? mem_info->alloc_info.allocationSize + : (mem_info->mem_range.offset + mem_info->mem_range.size); + if ((mem_info->mem_range.offset > pMemRanges[i].offset) || + (data_end < (pMemRanges[i].offset + pMemRanges[i].size))) { + skip_call |= + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, + (uint64_t)pMemRanges[i].memory, __LINE__, VALIDATION_ERROR_00642, "MEM", + "%s: Flush/Invalidate size or offset (" PRINTF_SIZE_T_SPECIFIER ", " PRINTF_SIZE_T_SPECIFIER + ") exceed the Memory Object's upper-bound " + "(" PRINTF_SIZE_T_SPECIFIER "). %s", + funcName, static_cast<size_t>(pMemRanges[i].offset + pMemRanges[i].size), + static_cast<size_t>(pMemRanges[i].offset), static_cast<size_t>(data_end), + validation_error_map[VALIDATION_ERROR_00642]); + } } } } diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index b988e3b6..f1e08fff 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -632,8 +632,8 @@ VALIDATION_ERROR_00638~^~Y~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more VALIDATION_ERROR_00639~^~Y~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'pMemoryRanges must be a pointer to an array of memoryRangeCount valid VkMappedMemoryRange structures' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkInvalidateMappedMemoryRanges)~^~ VALIDATION_ERROR_00640~^~U~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'memoryRangeCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkInvalidateMappedMemoryRanges)~^~ VALIDATION_ERROR_00641~^~U~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'memory must currently be mapped' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ -VALIDATION_ERROR_00642~^~U~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'If size is not equal to VK_WHOLE_SIZE, offset and size must specify a range contained within the currently mapped range of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ -VALIDATION_ERROR_00643~^~U~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'If size is equal to VK_WHOLE_SIZE, offset must be within the currently mapped range of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ +VALIDATION_ERROR_00642~^~Y~^~InvalidMemoryMapping~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'If size is not equal to VK_WHOLE_SIZE, offset and size must specify a range contained within the currently mapped range of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ +VALIDATION_ERROR_00643~^~Y~^~InvalidMemoryMapping~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'If size is equal to VK_WHOLE_SIZE, offset must be within the currently mapped range of memory' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ VALIDATION_ERROR_00644~^~U~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'offset must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ VALIDATION_ERROR_00645~^~U~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'If size is not equal to VK_WHOLE_SIZE, size must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~ VALIDATION_ERROR_00646~^~N~^~Unknown~^~vkInvalidateMappedMemoryRanges~^~For more information refer to Vulkan Spec Section '10.2.1. Host Access to Device Memory Objects' which states 'sType must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkMappedMemoryRange)~^~TBD in parameter validation layer. |
