mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 03:08:36 +12:00
vk: Catch leaking imageview refs on resize
This commit is contained in:
parent
650c1c64f1
commit
531b03e7af
1 changed files with 15 additions and 5 deletions
|
@ -913,7 +913,7 @@ namespace vk
|
||||||
swap_info.imageFormat = m_surface_format;
|
swap_info.imageFormat = m_surface_format;
|
||||||
swap_info.imageColorSpace = m_color_space;
|
swap_info.imageColorSpace = m_color_space;
|
||||||
|
|
||||||
swap_info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
swap_info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||||
swap_info.preTransform = pre_transform;
|
swap_info.preTransform = pre_transform;
|
||||||
swap_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
swap_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||||
swap_info.imageArrayLayers = 1;
|
swap_info.imageArrayLayers = 1;
|
||||||
|
@ -928,7 +928,17 @@ namespace vk
|
||||||
createSwapchainKHR(dev, &swap_info, nullptr, &m_vk_swapchain);
|
createSwapchainKHR(dev, &swap_info, nullptr, &m_vk_swapchain);
|
||||||
|
|
||||||
if (old_swapchain)
|
if (old_swapchain)
|
||||||
|
{
|
||||||
|
if (m_swap_images.size())
|
||||||
|
{
|
||||||
|
for (auto &img : m_swap_images)
|
||||||
|
img.discard(dev);
|
||||||
|
|
||||||
|
m_swap_images.resize(0);
|
||||||
|
}
|
||||||
|
|
||||||
destroySwapchainKHR(dev, old_swapchain, nullptr);
|
destroySwapchainKHR(dev, old_swapchain, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
nb_swap_images = 0;
|
nb_swap_images = 0;
|
||||||
getSwapchainImagesKHR(dev, m_vk_swapchain, &nb_swap_images, nullptr);
|
getSwapchainImagesKHR(dev, m_vk_swapchain, &nb_swap_images, nullptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue