Commit 64914849 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winevulkan: Use handle map for memory objects.

parent 84e46207
......@@ -1703,6 +1703,7 @@ VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *allo
return result;
}
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, memory, memory->host_memory, memory);
memory->vm_map = mapping;
*ret = (VkDeviceMemory)(uintptr_t)memory;
return VK_SUCCESS;
......@@ -1717,6 +1718,7 @@ void wine_vkFreeMemory(VkDevice handle, VkDeviceMemory memory_handle, const VkAl
return;
memory = wine_device_memory_from_handle(memory_handle);
WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, memory);
device->funcs.p_vkFreeMemory(device->host_device, memory->host_memory, NULL);
if (memory->vm_map)
......
......@@ -176,6 +176,8 @@ struct wine_device_memory
{
VkDeviceMemory host_memory;
void *vm_map;
struct wine_vk_mapping mapping;
};
static inline struct wine_device_memory *wine_device_memory_from_handle(VkDeviceMemory handle)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment