Fix a resource leak. Request COHERENT memory for pushbuffers.

This commit is contained in:
Henrik Rydgard committed 2016-03-20 19:35:03 +01:00
1 parent 8e9acff6aa
commit 5d45413dab
3 files changed
+13 -1

No files matched your search

+2 -1
View File
@@ -37,7 +37,8 @@ VulkanPushBuffer::VulkanPushBuffer(VulkanContext *vulkan, size_t size) : offset_
VkMemoryAllocateInfo alloc = {};
alloc.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
alloc.pNext = nullptr;
vulkan->MemoryTypeFromProperties(0xFFFFFFFF, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, &alloc.memoryTypeIndex);
vulkan->MemoryTypeFromProperties(0xFFFFFFFF, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &alloc.memoryTypeIndex);
alloc.allocationSize = size;
res = vkAllocateMemory(device, &alloc, nullptr, &deviceMemory_);