diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-06-21 13:04:18 +1200 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-06-23 14:55:21 -0600 |
| commit | 9eb0b524dace8b18bdf73d0dbb6966425a324daa (patch) | |
| tree | ab32a916c38a2ee45d35ecd7e0cb7a6818a48d55 | |
| parent | 9d01cae0197811e32390d3da267b040c86889b78 (diff) | |
| download | usermoji-9eb0b524dace8b18bdf73d0dbb6966425a324daa.tar.xz | |
layers: Move CMD_POOL_INFO to header, rename, add helper
Signed-off-by: Chris Forbes <chrisforbes@google.com>
| -rw-r--r-- | layers/core_validation.cpp | 17 | ||||
| -rw-r--r-- | layers/core_validation.h | 8 |
2 files changed, 17 insertions, 8 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index c3308900..eb3ccc03 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -93,13 +93,6 @@ using std::unordered_set; // Object value will be used to identify them internally. static const VkDeviceMemory MEMTRACKER_SWAP_CHAIN_IMAGE_KEY = (VkDeviceMemory)(-1); -// Track command pools and their command buffers -struct CMD_POOL_INFO { - VkCommandPoolCreateFlags createFlags; - uint32_t queueFamilyIndex; - list<VkCommandBuffer> commandBuffers; // list container of cmd buffers allocated from this pool -}; - struct devExts { bool wsi_enabled; unordered_map<VkSwapchainKHR, unique_ptr<SWAPCHAIN_NODE>> swapchainMap; @@ -129,7 +122,7 @@ struct layer_data { unordered_map<VkBufferView, unique_ptr<VkBufferViewCreateInfo>> bufferViewMap; unordered_map<VkBuffer, unique_ptr<BUFFER_NODE>> bufferMap; unordered_map<VkPipeline, PIPELINE_NODE *> pipelineMap; - unordered_map<VkCommandPool, CMD_POOL_INFO> commandPoolMap; + unordered_map<VkCommandPool, COMMAND_POOL_NODE> commandPoolMap; unordered_map<VkDescriptorPool, DESCRIPTOR_POOL_NODE *> descriptorPoolMap; unordered_map<VkDescriptorSet, cvdescriptorset::DescriptorSet *> setMap; unordered_map<VkDescriptorSetLayout, cvdescriptorset::DescriptorSetLayout *> descriptorSetLayoutMap; @@ -342,6 +335,14 @@ SEMAPHORE_NODE *getSemaphoreNode(layer_data *dev_data, VkSemaphore semaphore) { return &it->second; } +COMMAND_POOL_NODE *getCommandPoolNode(layer_data *dev_data, VkCommandPool pool) { + auto it = dev_data->commandPoolMap.find(pool); + if (it == dev_data->commandPoolMap.end()) { + return nullptr; + } + return &it->second; +} + static VkDeviceMemory *get_object_mem_binding(layer_data *my_data, uint64_t handle, VkDebugReportObjectTypeEXT type) { switch (type) { case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT: { diff --git a/layers/core_validation.h b/layers/core_validation.h index fe5a3d57..93c7e6e7 100644 --- a/layers/core_validation.h +++ b/layers/core_validation.h @@ -268,3 +268,11 @@ typedef struct stencil_data { uint32_t writeMask; uint32_t reference; } CBStencilData; + +// Track command pools and their command buffers +struct COMMAND_POOL_NODE { + VkCommandPoolCreateFlags createFlags; + uint32_t queueFamilyIndex; + // TODO: why is this std::list? + std::list<VkCommandBuffer> commandBuffers; // container of cmd buffers allocated from this pool +}; |
