mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Vulkan: Only create imgui renderpass once (#972)
This commit is contained in:
parent
1d398551e2
commit
b4aa10bee4
@ -1507,6 +1507,8 @@ void VulkanRenderer::DeleteNullObjects()
|
||||
}
|
||||
|
||||
void VulkanRenderer::ImguiInit()
|
||||
{
|
||||
if (m_imguiRenderPass == VK_NULL_HANDLE)
|
||||
{
|
||||
// TODO: renderpass swapchain format may change between srgb and rgb -> need reinit
|
||||
VkAttachmentDescription colorAttachment = {};
|
||||
@ -1536,6 +1538,7 @@ void VulkanRenderer::ImguiInit()
|
||||
const auto result = vkCreateRenderPass(m_logicalDevice, &renderPassInfo, nullptr, &m_imguiRenderPass);
|
||||
if (result != VK_SUCCESS)
|
||||
throw VkException(result, "can't create imgui renderpass");
|
||||
}
|
||||
|
||||
ImGui_ImplVulkan_InitInfo info{};
|
||||
info.Instance = m_instance;
|
||||
@ -1564,6 +1567,12 @@ void VulkanRenderer::Shutdown()
|
||||
Renderer::Shutdown();
|
||||
SubmitCommandBuffer();
|
||||
WaitDeviceIdle();
|
||||
|
||||
if (m_imguiRenderPass != VK_NULL_HANDLE)
|
||||
{
|
||||
vkDestroyRenderPass(m_logicalDevice, m_imguiRenderPass, nullptr);
|
||||
m_imguiRenderPass = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanRenderer::UnrecoverableError(const char* errMsg) const
|
||||
|
@ -441,7 +441,7 @@ private:
|
||||
bool m_destroyPadSwapchainNextAcquire = false;
|
||||
bool IsSwapchainInfoValid(bool mainWindow) const;
|
||||
|
||||
VkRenderPass m_imguiRenderPass = nullptr;
|
||||
VkRenderPass m_imguiRenderPass = VK_NULL_HANDLE;
|
||||
|
||||
VkDescriptorPool m_descriptorPool;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user