From 5c2c60b860571d9e6e4f0157d07c52458d0d1c5e Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 21 Nov 2016 15:23:51 -0700 Subject: [PATCH] layers:Avoid copy of cmd buffer set No need to copy the entire unordered_set in invalidateCommandBuffers(). Change it to take a "const &" instead. --- layers/core_validation.cpp | 2 +- layers/core_validation_types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index f57a403..9cb9fad 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6386,7 +6386,7 @@ VKAPI_ATTR VkResult VKAPI_CALL ResetFences(VkDevice device, uint32_t fenceCount, } // For given cb_nodes, invalidate them and track object causing invalidation -void invalidateCommandBuffers(const layer_data *dev_data, std::unordered_set cb_nodes, VK_OBJECT obj) { +void invalidateCommandBuffers(const layer_data *dev_data, std::unordered_set const &cb_nodes, VK_OBJECT obj) { for (auto cb_node : cb_nodes) { if (cb_node->state == CB_RECORDING) { log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h index 14ed5e7..838a82c 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -656,7 +656,7 @@ SAMPLER_STATE *getSamplerState(const layer_data *, VkSampler); IMAGE_VIEW_STATE *getImageViewState(const layer_data *, VkImageView); VkSwapchainKHR getSwapchainFromImage(const layer_data *, VkImage); SWAPCHAIN_NODE *getSwapchainNode(const layer_data *, VkSwapchainKHR); -void invalidateCommandBuffers(const layer_data *, std::unordered_set, VK_OBJECT); +void invalidateCommandBuffers(const layer_data *, std::unordered_set const &, VK_OBJECT); bool ValidateMemoryIsBoundToBuffer(const layer_data *, const BUFFER_STATE *, const char *); bool ValidateMemoryIsBoundToImage(const layer_data *, const IMAGE_STATE *, const char *); void AddCommandBufferBindingSampler(GLOBAL_CB_NODE *, SAMPLER_STATE *); -- 2.7.4