From ccdd8237b8b62d7648cefcc6df16d62e5c684451 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 4 Aug 2016 09:33:02 -0600 Subject: layers: Rename validateMemRange() This function is only used in MapMemory case so renamed to ValidateMapMemRange() and added a header comment to make use more clear. --- layers/core_validation.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e0951122..837a69a7 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -4885,7 +4885,11 @@ FreeMemory(VkDevice device, VkDeviceMemory mem, const VkAllocationCallbacks *pAl } } -static bool validateMemRange(layer_data *my_data, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size) { +// Validate that given Map memory range is valid. This means that the memory should not already be mapped, +// and that the size of the map range should be: +// 1. Not zero +// 2. Within the size of the memory allocation +static bool ValidateMapMemRange(layer_data *my_data, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size) { bool skip_call = false; if (size == 0) { @@ -10080,7 +10084,7 @@ MapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize "Mapping Memory without VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set: mem obj 0x%" PRIxLEAST64, (uint64_t)mem); } } - skip_call |= validateMemRange(dev_data, mem, offset, size); + skip_call |= ValidateMapMemRange(dev_data, mem, offset, size); #endif skip_call |= ValidateMapImageLayouts(device, mem); lock.unlock(); -- cgit v1.2.3