From c1b9d6d28618ccd48a7fd07501dfe62a610b272f Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Fri, 27 Jan 2017 14:25:32 -0700 Subject: [PATCH] layers: Update PostCallRecordCreateImage Changed to use layer_data accessor functions instead of passing in items individually. Change-Id: I55b92a4e0a6fff0e74516b9249c213f7d514cc8e --- layers/buffer_validation.cpp | 11 ++++------- layers/buffer_validation.h | 5 +---- layers/core_validation.cpp | 3 +-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index 76a743fc..8fca611d 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -185,17 +185,14 @@ bool PreCallValidateCreateImage(core_validation::layer_data *device_data, const return skip_call; } -void PostCallRecordCreateImage(std::unordered_map> *imageMap, - std::unordered_map> *imageSubresourceMap, - std::unordered_map *imageLayoutMap, - const VkImageCreateInfo *pCreateInfo, VkImage *pImage) { +void PostCallRecordCreateImage(core_validation::layer_data *device_data, const VkImageCreateInfo *pCreateInfo, VkImage *pImage) { IMAGE_LAYOUT_NODE image_state; image_state.layout = pCreateInfo->initialLayout; image_state.format = pCreateInfo->format; - (*imageMap).insert(std::make_pair(*pImage, std::unique_ptr(new IMAGE_STATE(*pImage, pCreateInfo)))); + GetImageMap(device_data)->insert(std::make_pair(*pImage, std::unique_ptr(new IMAGE_STATE(*pImage, pCreateInfo)))); ImageSubresourcePair subpair{*pImage, false, VkImageSubresource()}; - (*imageSubresourceMap)[*pImage].push_back(subpair); - (*imageLayoutMap)[subpair] = image_state; + (*core_validation::GetImageSubresourceMap(device_data))[*pImage].push_back(subpair); + (*core_validation::GetImageLayoutMap(device_data))[subpair] = image_state; } bool PreCallValidateDestroyImage(core_validation::layer_data *device_data, VkImage image, IMAGE_STATE **image_state, diff --git a/layers/buffer_validation.h b/layers/buffer_validation.h index dab6ac2f..b2d52749 100644 --- a/layers/buffer_validation.h +++ b/layers/buffer_validation.h @@ -32,10 +32,7 @@ bool PreCallValidateCreateImage(core_validation::layer_data *device_data, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage); -void PostCallRecordCreateImage(std::unordered_map> *imageMap, - std::unordered_map> *imageSubresourceMap, - std::unordered_map *imageLayoutMap, - const VkImageCreateInfo *pCreateInfo, VkImage *pImage); +void PostCallRecordCreateImage(core_validation::layer_data *device_data, const VkImageCreateInfo *pCreateInfo, VkImage *pImage); void PostCallRecordDestroyImage(core_validation::layer_data *device_data, VkImage image, IMAGE_STATE *image_state, VK_OBJECT obj_struct); diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 01d6f41e..ed456339 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6402,8 +6402,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateI } if (VK_SUCCESS == result) { std::lock_guard lock(global_lock); - PostCallRecordCreateImage(&dev_data->imageMap, &dev_data->imageSubresourceMap, &dev_data->imageLayoutMap, pCreateInfo, - pImage); + PostCallRecordCreateImage(dev_data, pCreateInfo, pImage); } return result; } -- 2.34.1