winevulkan: Use handle map for memory objects.
This commit is contained in:
parent
84e4620706
commit
64914849ac
2 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue