diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2016-11-15 07:48:49 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2016-11-16 13:08:07 -0700 |
| commit | e284f6741a45735dc7bee9ddd31e7192783a91b3 (patch) | |
| tree | 347f145409f40cfb73ce04dd1c7a59f8ac310bc2 /layers/core_validation.cpp | |
| parent | d88f030352deb5c7ae65b8c3cd90c04da48e0209 (diff) | |
| download | usermoji-e284f6741a45735dc7bee9ddd31e7192783a91b3.tar.xz | |
layers: Fixup MappedMemory variable names for style
Change-Id: I4f8aae213753dc69ae28a945d7f34cff2af7ccd9
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 50862b6a..e62a3679 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -11213,11 +11213,11 @@ static bool validateMemoryIsMapped(layer_data *dev_data, const char *funcName, u return skip; } -static bool ValidateAndCopyNoncoherentMemoryToDriver(layer_data *dev_data, uint32_t memRangeCount, - const VkMappedMemoryRange *pMemRanges) { - bool skip_call = false; - for (uint32_t i = 0; i < memRangeCount; ++i) { - auto mem_info = getMemObjInfo(dev_data, pMemRanges[i].memory); +static bool ValidateAndCopyNoncoherentMemoryToDriver(layer_data *dev_data, uint32_t mem_range_count, + const VkMappedMemoryRange *mem_ranges) { + bool skip = false; + for (uint32_t i = 0; i < mem_range_count; ++i) { + auto mem_info = getMemObjInfo(dev_data, mem_ranges[i].memory); if (mem_info) { if (mem_info->shadow_copy) { VkDeviceSize size = (mem_info->mem_range.size != VK_WHOLE_SIZE) @@ -11226,30 +11226,29 @@ static bool ValidateAndCopyNoncoherentMemoryToDriver(layer_data *dev_data, uint3 char *data = static_cast<char *>(mem_info->shadow_copy); for (uint64_t j = 0; j < mem_info->shadow_pad_size; ++j) { if (data[j] != NoncoherentMemoryFillValue) { - 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", - "Memory underflow was detected on mem obj 0x%" PRIxLEAST64, (uint64_t)pMemRanges[i].memory); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, (uint64_t)mem_ranges[i].memory, __LINE__, + MEMTRACK_INVALID_MAP, "MEM", "Memory underflow was detected on mem obj 0x%" PRIxLEAST64, + (uint64_t)mem_ranges[i].memory); } } for (uint64_t j = (size + mem_info->shadow_pad_size); j < (2 * mem_info->shadow_pad_size + size); ++j) { if (data[j] != NoncoherentMemoryFillValue) { - 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", - "Memory overflow was detected on mem obj 0x%" PRIxLEAST64, (uint64_t)pMemRanges[i].memory); + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, (uint64_t)mem_ranges[i].memory, __LINE__, + MEMTRACK_INVALID_MAP, "MEM", "Memory overflow was detected on mem obj 0x%" PRIxLEAST64, + (uint64_t)mem_ranges[i].memory); } } memcpy(mem_info->p_driver_data, static_cast<void *>(data + mem_info->shadow_pad_size), (size_t)(size)); } } } - return skip_call; + return skip; } -static void CopyNoncoherentMemoryFromDriver(layer_data *dev_data, uint32_t memory_range_count, - const VkMappedMemoryRange *mem_ranges) { - for (uint32_t i = 0; i < memory_range_count; ++i) { +static void CopyNoncoherentMemoryFromDriver(layer_data *dev_data, uint32_t mem_range_count, const VkMappedMemoryRange *mem_ranges) { + for (uint32_t i = 0; i < mem_range_count; ++i) { auto mem_info = getMemObjInfo(dev_data, mem_ranges[i].memory); if (mem_info && mem_info->shadow_copy) { VkDeviceSize size = (mem_info->mem_range.size != VK_WHOLE_SIZE) @@ -11261,32 +11260,32 @@ static void CopyNoncoherentMemoryFromDriver(layer_data *dev_data, uint32_t memor } } -VKAPI_ATTR VkResult VKAPI_CALL -FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange *pMemRanges) { +VKAPI_ATTR VkResult VKAPI_CALL FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, + const VkMappedMemoryRange *pMemRanges) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - bool skip_call = false; + bool skip = false; layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); std::unique_lock<std::mutex> lock(global_lock); - skip_call |= ValidateAndCopyNoncoherentMemoryToDriver(dev_data, memRangeCount, pMemRanges); - skip_call |= validateMemoryIsMapped(dev_data, "vkFlushMappedMemoryRanges", memRangeCount, pMemRanges); + skip |= ValidateAndCopyNoncoherentMemoryToDriver(dev_data, memRangeCount, pMemRanges); + skip |= validateMemoryIsMapped(dev_data, "vkFlushMappedMemoryRanges", memRangeCount, pMemRanges); lock.unlock(); - if (!skip_call) { + if (!skip) { result = dev_data->dispatch_table.FlushMappedMemoryRanges(device, memRangeCount, pMemRanges); } return result; } -VKAPI_ATTR VkResult VKAPI_CALL -InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange *pMemRanges) { +VKAPI_ATTR VkResult VKAPI_CALL InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, + const VkMappedMemoryRange *pMemRanges) { VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; - bool skip_call = false; + bool skip = false; layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); std::unique_lock<std::mutex> lock(global_lock); - skip_call |= validateMemoryIsMapped(dev_data, "vkInvalidateMappedMemoryRanges", memRangeCount, pMemRanges); + skip |= validateMemoryIsMapped(dev_data, "vkInvalidateMappedMemoryRanges", memRangeCount, pMemRanges); lock.unlock(); - if (!skip_call) { + if (!skip) { result = dev_data->dispatch_table.InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges); // Update our shadow copy with modified driver data CopyNoncoherentMemoryFromDriver(dev_data, memRangeCount, pMemRanges); |
