unordered_map<VkImage, unique_ptr<IMAGE_STATE>> imageMap;
unordered_map<VkBufferView, unique_ptr<BUFFER_VIEW_STATE>> bufferViewMap;
unordered_map<VkBuffer, unique_ptr<BUFFER_STATE>> bufferMap;
- unordered_map<VkPipeline, PIPELINE_STATE *> pipelineMap;
+ unordered_map<VkPipeline, unique_ptr<PIPELINE_STATE>> pipelineMap;
unordered_map<VkCommandPool, COMMAND_POOL_NODE> commandPoolMap;
unordered_map<VkDescriptorPool, DESCRIPTOR_POOL_STATE *> descriptorPoolMap;
unordered_map<VkDescriptorSet, cvdescriptorset::DescriptorSet *> setMap;
if (it == dev_data->pipelineMap.end()) {
return nullptr;
}
- return it->second;
+ return it->second.get();
}
RENDER_PASS_STATE *GetRenderPassState(layer_data const *dev_data, VkRenderPass renderpass) {
return skip;
}
-// Free the Pipeline nodes
-static void deletePipelines(layer_data *dev_data) {
- if (dev_data->pipelineMap.size() <= 0) return;
- for (auto &pipe_map_pair : dev_data->pipelineMap) {
- delete pipe_map_pair.second;
- }
- dev_data->pipelineMap.clear();
-}
-
// Block of code at start here specifically for managing/tracking DSs
// Return Pool node ptr for specified pool or else NULL
layer_data *dev_data = GetLayerDataPtr(key, layer_data_map);
// Free all the memory
unique_lock_t lock(global_lock);
- deletePipelines(dev_data);
+ dev_data->pipelineMap.clear();
dev_data->renderPassMap.clear();
for (auto ii = dev_data->commandBufferMap.begin(); ii != dev_data->commandBufferMap.end(); ++ii) {
delete (*ii).second;
VK_OBJECT obj_struct) {
// Any bound cmd buffers are now invalid
invalidateCommandBuffers(dev_data, pipeline_state->cb_bindings, obj_struct);
- delete getPipelineState(dev_data, pipeline);
dev_data->pipelineMap.erase(pipeline);
}
for (i = 0; i < count; i++) {
if (pPipelines[i] != VK_NULL_HANDLE) {
pipe_state[i]->pipeline = pPipelines[i];
- dev_data->pipelineMap[pPipelines[i]] = pipe_state[i].release();
+ dev_data->pipelineMap[pPipelines[i]] = std::move(pipe_state[i]);
}
}
for (i = 0; i < count; i++) {
if (pPipelines[i] != VK_NULL_HANDLE) {
pPipeState[i]->pipeline = pPipelines[i];
- dev_data->pipelineMap[pPipelines[i]] = pPipeState[i].release();
+ dev_data->pipelineMap[pPipelines[i]] = std::move(pPipeState[i]);
}
}