mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-04-29 14:59:26 -04:00
Vulkan: Fix imgui validation error when sRGB framebuffer is used
This commit is contained in:
parent
cd6eb1097b
commit
4972381edc
1 changed files with 30 additions and 29 deletions
|
@ -1595,9 +1595,8 @@ void VulkanRenderer::DeleteNullObjects()
|
||||||
|
|
||||||
void VulkanRenderer::ImguiInit()
|
void VulkanRenderer::ImguiInit()
|
||||||
{
|
{
|
||||||
if (m_imguiRenderPass == VK_NULL_HANDLE)
|
VkRenderPass prevRenderPass = m_imguiRenderPass;
|
||||||
{
|
|
||||||
// TODO: renderpass swapchain format may change between srgb and rgb -> need reinit
|
|
||||||
VkAttachmentDescription colorAttachment = {};
|
VkAttachmentDescription colorAttachment = {};
|
||||||
colorAttachment.format = m_mainSwapchainInfo->m_surfaceFormat.format;
|
colorAttachment.format = m_mainSwapchainInfo->m_surfaceFormat.format;
|
||||||
colorAttachment.samples = VK_SAMPLE_COUNT_1_BIT;
|
colorAttachment.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
|
@ -1625,7 +1624,6 @@ void VulkanRenderer::ImguiInit()
|
||||||
const auto result = vkCreateRenderPass(m_logicalDevice, &renderPassInfo, nullptr, &m_imguiRenderPass);
|
const auto result = vkCreateRenderPass(m_logicalDevice, &renderPassInfo, nullptr, &m_imguiRenderPass);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
throw VkException(result, "can't create imgui renderpass");
|
throw VkException(result, "can't create imgui renderpass");
|
||||||
}
|
|
||||||
|
|
||||||
ImGui_ImplVulkan_InitInfo info{};
|
ImGui_ImplVulkan_InitInfo info{};
|
||||||
info.Instance = m_instance;
|
info.Instance = m_instance;
|
||||||
|
@ -1639,6 +1637,9 @@ void VulkanRenderer::ImguiInit()
|
||||||
info.ImageCount = info.MinImageCount;
|
info.ImageCount = info.MinImageCount;
|
||||||
|
|
||||||
ImGui_ImplVulkan_Init(&info, m_imguiRenderPass);
|
ImGui_ImplVulkan_Init(&info, m_imguiRenderPass);
|
||||||
|
|
||||||
|
if (prevRenderPass != VK_NULL_HANDLE)
|
||||||
|
vkDestroyRenderPass(GetLogicalDevice(), prevRenderPass, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanRenderer::Initialize()
|
void VulkanRenderer::Initialize()
|
||||||
|
|
Loading…
Add table
Reference in a new issue