From 7330cdf3a9cdf109a5368ab36cc0543a945b08ee Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Mon, 29 Dec 2025 13:38:19 +0100 Subject: [PATCH] Vulkan: Reuse pipeline layout for DRC to fix layout object leak --- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index 0e29acca..0a7c635c 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -2655,9 +2655,13 @@ VkPipeline VulkanRenderer::backbufferBlit_createGraphicsPipeline(VkDescriptorSet pipelineLayoutInfo.pushConstantRangeCount = 1; pipelineLayoutInfo.pPushConstantRanges = &pushConstantRange; - VkResult result = vkCreatePipelineLayout(m_logicalDevice, &pipelineLayoutInfo, nullptr, &m_pipelineLayout); - if (result != VK_SUCCESS) - throw std::runtime_error(fmt::format("Failed to create pipeline layout: {}", result)); + VkResult result; + if (m_pipelineLayout == VK_NULL_HANDLE) + { + result = vkCreatePipelineLayout(m_logicalDevice, &pipelineLayoutInfo, nullptr, &m_pipelineLayout); + if (result != VK_SUCCESS) + throw std::runtime_error(fmt::format("Failed to create pipeline layout: {}", result)); + } VkGraphicsPipelineCreateInfo pipelineInfo = {}; pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;