aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp8
1 files changed, 6 insertions, 2 deletions
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();