From cd4f180e6199e21d03143ca3f1e32d06e11d339c Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 3 Sep 2015 20:53:27 +0200 Subject: [PATCH] Free buffer created for pixel picking --- renderdoc/driver/vulkan/vk_replay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index c1e358e97..485496da9 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -289,6 +289,7 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_ const VulkanFunctions &vk = m_pDriver->m_Real; VkDeviceMemory readbackmem = VK_NULL_HANDLE; + VkBuffer destbuf = VK_NULL_HANDLE; { VkMemoryAllocInfo allocInfo = { @@ -307,8 +308,6 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_ VK_SHARING_MODE_EXCLUSIVE, 0, NULL, }; - VkBuffer destbuf; - res = vk.vkCreateBuffer(dev, &bufInfo, &destbuf); RDCASSERT(res == VK_SUCCESS); @@ -365,6 +364,7 @@ void VulkanReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_ vk.vkDeviceWaitIdle(dev); + vk.vkDestroyBuffer(dev, destbuf); vk.vkFreeMemory(dev, readbackmem); }