Free buffer created for pixel picking

This commit is contained in:
baldurk
2016-02-07 18:38:57 +01:00
parent 4321141aee
commit cd4f180e61
+2 -2
View File
@@ -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);
}