diff options
| author | Chris Forbes <chrisforbes@google.com> | 2017-06-26 17:57:39 -0700 |
|---|---|---|
| committer | Chris Forbes <chrisf@ijw.co.nz> | 2017-06-27 09:41:32 -0700 |
| commit | 21baabc6f066b9470b7c7a6c49576c4e33c7ad22 (patch) | |
| tree | 867e873cfca18d38c9080d194218f8c6476978ff /layers/buffer_validation.cpp | |
| parent | 4d0fce1bdc0e74b80899763d6c7eab5b2dd57dea (diff) | |
| download | usermoji-21baabc6f066b9470b7c7a6c49576c4e33c7ad22.tar.xz | |
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.
Diffstat (limited to 'layers/buffer_validation.cpp')
| -rw-r--r-- | layers/buffer_validation.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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<ImageSubresourcePair, IMAGE_LAYOUT_NODE> &imageLayoutMap) { + std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> const & globalImageLayoutMap, + std::unordered_map<ImageSubresourcePair, IMAGE_LAYOUT_NODE> & 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; |
