mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 23:41:18 +12:00
Vulkan: Cleanup backbufferblit pipelines
This commit is contained in:
parent
d6a5693aa0
commit
7dd28f79ed
2 changed files with 10 additions and 4 deletions
|
@ -628,6 +628,12 @@ VulkanRenderer::~VulkanRenderer()
|
||||||
m_pipeline_cache_semaphore.notify();
|
m_pipeline_cache_semaphore.notify();
|
||||||
m_pipeline_cache_save_thread.join();
|
m_pipeline_cache_save_thread.join();
|
||||||
|
|
||||||
|
for(auto& i : m_backbufferBlitPipelineCache)
|
||||||
|
{
|
||||||
|
vkDestroyPipeline(m_logicalDevice, i.second, nullptr);
|
||||||
|
}
|
||||||
|
m_backbufferBlitPipelineCache = {};
|
||||||
|
|
||||||
// shut down imgui
|
// shut down imgui
|
||||||
ImGui_ImplVulkan_Shutdown();
|
ImGui_ImplVulkan_Shutdown();
|
||||||
|
|
||||||
|
@ -2517,9 +2523,8 @@ VkPipeline VulkanRenderer::backbufferBlit_createGraphicsPipeline(VkDescriptorSet
|
||||||
hash += (uint64)(chainInfo.m_usesSRGB);
|
hash += (uint64)(chainInfo.m_usesSRGB);
|
||||||
hash += ((uint64)padView) << 1;
|
hash += ((uint64)padView) << 1;
|
||||||
|
|
||||||
static std::unordered_map<uint64, VkPipeline> s_pipeline_cache;
|
const auto it = m_backbufferBlitPipelineCache.find(hash);
|
||||||
const auto it = s_pipeline_cache.find(hash);
|
if (it != m_backbufferBlitPipelineCache.cend())
|
||||||
if (it != s_pipeline_cache.cend())
|
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
std::vector<VkPipelineShaderStageCreateInfo> shaderStages;
|
std::vector<VkPipelineShaderStageCreateInfo> shaderStages;
|
||||||
|
@ -2615,7 +2620,7 @@ VkPipeline VulkanRenderer::backbufferBlit_createGraphicsPipeline(VkDescriptorSet
|
||||||
throw std::runtime_error(fmt::format("Failed to create graphics pipeline: {}", result));
|
throw std::runtime_error(fmt::format("Failed to create graphics pipeline: {}", result));
|
||||||
}
|
}
|
||||||
|
|
||||||
s_pipeline_cache[hash] = pipeline;
|
m_backbufferBlitPipelineCache[hash] = pipeline;
|
||||||
m_pipeline_cache_semaphore.notify();
|
m_pipeline_cache_semaphore.notify();
|
||||||
|
|
||||||
return pipeline;
|
return pipeline;
|
||||||
|
|
|
@ -582,6 +582,7 @@ private:
|
||||||
std::shared_mutex m_pipeline_cache_save_mutex;
|
std::shared_mutex m_pipeline_cache_save_mutex;
|
||||||
std::thread m_pipeline_cache_save_thread;
|
std::thread m_pipeline_cache_save_thread;
|
||||||
VkPipelineCache m_pipeline_cache{ nullptr };
|
VkPipelineCache m_pipeline_cache{ nullptr };
|
||||||
|
std::unordered_map<uint64, VkPipeline> m_backbufferBlitPipelineCache;
|
||||||
VkPipelineLayout m_pipelineLayout{nullptr};
|
VkPipelineLayout m_pipelineLayout{nullptr};
|
||||||
VkCommandPool m_commandPool{ nullptr };
|
VkCommandPool m_commandPool{ nullptr };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue