aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-08-04 09:33:02 -0600
committerTobin Ehlis <tobine@google.com>2016-08-09 10:21:19 -0600
commitccdd8237b8b62d7648cefcc6df16d62e5c684451 (patch)
tree2b3ce54d2c6b81265e2f560a6137dadab4f64d6c /layers/core_validation.cpp
parentce31777dfcd2f56d0d35ac36416a27c3d406d6ed (diff)
downloadusermoji-ccdd8237b8b62d7648cefcc6df16d62e5c684451.tar.xz
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.
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();