1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winevulkan: Use handle map for memory objects.

This commit is contained in:
Jacek Caban 2024-02-21 14:48:13 +01:00 committed by Alexandre Julliard
parent 84e4620706
commit 64914849ac
2 changed files with 4 additions and 0 deletions

View file

@ -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)

View file

@ -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)