From 21baabc6f066b9470b7c7a6c49576c4e33c7ad22 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 26 Jun 2017 17:57:39 -0700 Subject: layers: Don't copy all the image subresources every submit The set of subresources touched by this submission is likely to be very small compared to the complete set we're tracking. It doesn't make any sense to copy this entire hashtable in each submit call. Instead, maintain an overlay table with the submission's modifications in it. Saves approx 12s in an internal workload. --- layers/buffer_validation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'layers/buffer_validation.cpp') diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index 7739fe08..6f4440b4 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -2466,13 +2466,15 @@ void PreCallRecordCmdBlitImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, // the IMAGE is the same // as the global IMAGE layout bool ValidateCmdBufImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *pCB, - std::unordered_map &imageLayoutMap) { + std::unordered_map const & globalImageLayoutMap, + std::unordered_map & overlayLayoutMap) { bool skip = false; const debug_report_data *report_data = core_validation::GetReportData(device_data); for (auto cb_image_data : pCB->imageLayoutMap) { VkImageLayout imageLayout; - if (FindLayout(imageLayoutMap, cb_image_data.first, imageLayout)) { + if (FindLayout(overlayLayoutMap, cb_image_data.first, imageLayout) || + FindLayout(globalImageLayoutMap, cb_image_data.first, imageLayout)) { if (cb_image_data.second.initialLayout == VK_IMAGE_LAYOUT_UNDEFINED) { // TODO: Set memory invalid which is in mem_tracker currently } else if (imageLayout != cb_image_data.second.initialLayout) { @@ -2495,7 +2497,7 @@ bool ValidateCmdBufImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *pCB, string_VkImageLayout(cb_image_data.second.initialLayout)); } } - SetLayout(imageLayoutMap, cb_image_data.first, cb_image_data.second.layout); + SetLayout(overlayLayoutMap, cb_image_data.first, cb_image_data.second.layout); } } return skip; -- cgit v1.2.3