Skip to content

Commit 6491484

Browse files
cjacekjulliard
authored andcommitted
winevulkan: Use handle map for memory objects.
1 parent 84e4620 commit 6491484

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

dlls/winevulkan/vulkan.c

+2
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,7 @@ VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *allo
17031703
return result;
17041704
}
17051705

1706+
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING(device->phys_dev->instance, memory, memory->host_memory, memory);
17061707
memory->vm_map = mapping;
17071708
*ret = (VkDeviceMemory)(uintptr_t)memory;
17081709
return VK_SUCCESS;
@@ -1717,6 +1718,7 @@ void wine_vkFreeMemory(VkDevice handle, VkDeviceMemory memory_handle, const VkAl
17171718
return;
17181719
memory = wine_device_memory_from_handle(memory_handle);
17191720

1721+
WINE_VK_REMOVE_HANDLE_MAPPING(device->phys_dev->instance, memory);
17201722
device->funcs.p_vkFreeMemory(device->host_device, memory->host_memory, NULL);
17211723

17221724
if (memory->vm_map)

dlls/winevulkan/vulkan_private.h

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ struct wine_device_memory
176176
{
177177
VkDeviceMemory host_memory;
178178
void *vm_map;
179+
180+
struct wine_vk_mapping mapping;
179181
};
180182

181183
static inline struct wine_device_memory *wine_device_memory_from_handle(VkDeviceMemory handle)

0 commit comments

Comments
 (0)