From: Jacek Caban jacek@codeweavers.com
--- dlls/winevulkan/make_vulkan | 5 + dlls/winevulkan/vulkan.c | 49 +++- dlls/winevulkan/vulkan_private.h | 10 + dlls/winevulkan/vulkan_thunks.c | 434 ++++++++++++++++++++++++++++--- dlls/winevulkan/vulkan_thunks.h | 3 + 5 files changed, 467 insertions(+), 34 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 34c95b9b620..adc662cfbc0 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -209,7 +209,10 @@ FUNCTION_OVERRIDES = { "vkGetDeviceProcAddr" : {"dispatch" : False, "driver" : True, "thunk" : ThunkType.NONE, "loader_thunk" : ThunkType.NONE}, "vkGetDeviceQueue" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.NONE}, "vkGetDeviceQueue2" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.NONE}, + "vkAllocateMemory" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.PRIVATE}, + "vkFreeMemory" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.PRIVATE}, "vkMapMemory" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.PRIVATE}, + "vkUnmapMemory" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.PRIVATE},
# VK_KHR_surface "vkDestroySurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.NONE}, @@ -1079,6 +1082,8 @@ class VkHandle(object): return "wine_device_from_handle({0})->device".format(name) if self.name == "VkInstance": return "wine_instance_from_handle({0})->instance".format(name) + if self.name == "VkDeviceMemory": + return "wine_device_memory_from_handle({0})->memory".format(name) if self.name == "VkPhysicalDevice": return "wine_phys_dev_from_handle({0})->phys_dev".format(name) if self.name == "VkQueue": diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index bd02edde4b6..b092756fd4e 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1441,19 +1441,54 @@ void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface, free(object); }
-VkResult wine_vkMapMemory(VkDevice handle, VkDeviceMemory memory, VkDeviceSize offset, +VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *alloc_info, + const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory; + VkResult result; + + if (!(memory = malloc(sizeof(*memory)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + result = device->funcs.p_vkAllocateMemory(device->device, alloc_info, NULL, &memory->memory); + if (result != VK_SUCCESS) + { + free(memory); + return result; + } + + *ret = (VkDeviceMemory)(uintptr_t)memory; + return VK_SUCCESS; +} + +void wine_vkFreeMemory(VkDevice handle, VkDeviceMemory memory_handle, const VkAllocationCallbacks *allocator) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory; + + if (!memory_handle) + return; + memory = wine_device_memory_from_handle(memory_handle); + + device->funcs.p_vkFreeMemory(device->device, memory->memory, NULL); + free(memory); +} + +VkResult wine_vkMapMemory(VkDevice handle, VkDeviceMemory memory_handle, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **data) { struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory = wine_device_memory_from_handle(memory_handle); VkResult result;
- result = device->funcs.p_vkMapMemory(device->device, memory, offset, size, flags, data); + result = device->funcs.p_vkMapMemory(device->device, memory->memory, offset, size, flags, data);
#ifdef _WIN64 if (NtCurrentTeb()->WowTebOffset && result == VK_SUCCESS && (UINT_PTR)*data >> 32) { FIXME("returned mapping %p does not fit 32-bit pointer\n", *data); - device->funcs.p_vkUnmapMemory(device->device, memory); + device->funcs.p_vkUnmapMemory(device->device, memory->memory); *data = NULL; result = VK_ERROR_OUT_OF_HOST_MEMORY; } @@ -1462,6 +1497,14 @@ VkResult wine_vkMapMemory(VkDevice handle, VkDeviceMemory memory, VkDeviceSize o return result; }
+void wine_vkUnmapMemory(VkDevice handle, VkDeviceMemory memory_handle) +{ + struct wine_device *device = wine_device_from_handle(handle); + struct wine_device_memory *memory = wine_device_memory_from_handle(memory_handle); + + device->funcs.p_vkUnmapMemory(device->device, memory->memory); +} + static inline void adjust_max_image_count(struct wine_phys_dev *phys_dev, VkSurfaceCapabilitiesKHR* capabilities) { /* Many Windows games, for example Strange Brigade, No Man's Sky, Path of Exile diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index a895b848156..8055b2380fd 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -169,6 +169,16 @@ static inline struct wine_cmd_pool *wine_cmd_pool_from_handle(VkCommandPool hand return (struct wine_cmd_pool *)(uintptr_t)client_ptr->unix_handle; }
+struct wine_device_memory +{ + VkDeviceMemory memory; +}; + +static inline struct wine_device_memory *wine_device_memory_from_handle(VkDeviceMemory handle) +{ + return (struct wine_device_memory *)(uintptr_t)handle; +} + struct wine_debug_utils_messenger { struct wine_instance *instance; /* parent */ diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 57962c91917..d0356cf4b54 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -6036,6 +6036,8 @@ static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle) return (uint64_t) wine_debug_utils_messenger_from_handle(handle)->debug_messenger; case VK_OBJECT_TYPE_DEVICE: return (uint64_t) (uintptr_t) wine_device_from_handle(((VkDevice) (uintptr_t) handle))->device; + case VK_OBJECT_TYPE_DEVICE_MEMORY: + return (uint64_t) wine_device_memory_from_handle(handle)->memory; case VK_OBJECT_TYPE_INSTANCE: return (uint64_t) (uintptr_t) wine_instance_from_handle(((VkInstance) (uintptr_t) handle))->instance; case VK_OBJECT_TYPE_PHYSICAL_DEVICE: @@ -6437,6 +6439,21 @@ static inline void convert_VkCommandBufferBeginInfo_win32_to_host(struct convers } }
+#ifdef _WIN64 +static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win64_to_host(const VkBindAccelerationStructureMemoryInfoNV *in, VkBindAccelerationStructureMemoryInfoNV *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->accelerationStructure = in->accelerationStructure; + out->memory = wine_device_memory_from_handle(in->memory)->memory; + out->memoryOffset = in->memoryOffset; + out->deviceIndexCount = in->deviceIndexCount; + out->pDeviceIndices = in->pDeviceIndices; +} +#endif /* _WIN64 */ + static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host(const VkBindAccelerationStructureMemoryInfoNV32 *in, VkBindAccelerationStructureMemoryInfoNV *out) { if (!in) return; @@ -6444,7 +6461,7 @@ static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host out->sType = in->sType; out->pNext = NULL; out->accelerationStructure = in->accelerationStructure; - out->memory = in->memory; + out->memory = wine_device_memory_from_handle(in->memory)->memory; out->memoryOffset = in->memoryOffset; out->deviceIndexCount = in->deviceIndexCount; out->pDeviceIndices = (const uint32_t *)UlongToPtr(in->pDeviceIndices); @@ -6452,6 +6469,24 @@ static inline void convert_VkBindAccelerationStructureMemoryInfoNV_win32_to_host FIXME("Unexpected pNext\n"); }
+#ifdef _WIN64 +static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccelerationStructureMemoryInfoNV_array_win64_to_host(struct conversion_context *ctx, const VkBindAccelerationStructureMemoryInfoNV *in, uint32_t count) +{ + VkBindAccelerationStructureMemoryInfoNV *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkBindAccelerationStructureMemoryInfoNV_win64_to_host(&in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccelerationStructureMemoryInfoNV_array_win32_to_host(struct conversion_context *ctx, const VkBindAccelerationStructureMemoryInfoNV32 *in, uint32_t count) { VkBindAccelerationStructureMemoryInfoNV *out; @@ -6468,6 +6503,19 @@ static inline const VkBindAccelerationStructureMemoryInfoNV *convert_VkBindAccel return out; }
+#ifdef _WIN64 +static inline void convert_VkBindBufferMemoryInfo_win64_to_host(const VkBindBufferMemoryInfo *in, VkBindBufferMemoryInfo *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->buffer = in->buffer; + out->memory = wine_device_memory_from_handle(in->memory)->memory; + out->memoryOffset = in->memoryOffset; +} +#endif /* _WIN64 */ + static inline void convert_VkBindBufferMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo32 *in, VkBindBufferMemoryInfo *out) { const VkBaseInStructure32 *in_header; @@ -6478,7 +6526,7 @@ static inline void convert_VkBindBufferMemoryInfo_win32_to_host(struct conversio out->sType = in->sType; out->pNext = NULL; out->buffer = in->buffer; - out->memory = in->memory; + out->memory = wine_device_memory_from_handle(in->memory)->memory; out->memoryOffset = in->memoryOffset;
for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) @@ -6504,6 +6552,24 @@ static inline void convert_VkBindBufferMemoryInfo_win32_to_host(struct conversio } }
+#ifdef _WIN64 +static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo *in, uint32_t count) +{ + VkBindBufferMemoryInfo *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkBindBufferMemoryInfo_win64_to_host(&in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindBufferMemoryInfo32 *in, uint32_t count) { VkBindBufferMemoryInfo *out; @@ -6520,6 +6586,19 @@ static inline const VkBindBufferMemoryInfo *convert_VkBindBufferMemoryInfo_array return out; }
+#ifdef _WIN64 +static inline void convert_VkBindImageMemoryInfo_win64_to_host(const VkBindImageMemoryInfo *in, VkBindImageMemoryInfo *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->image = in->image; + out->memory = wine_device_memory_from_handle(in->memory)->memory; + out->memoryOffset = in->memoryOffset; +} +#endif /* _WIN64 */ + static inline void convert_VkBindImageMemoryInfo_win32_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo32 *in, VkBindImageMemoryInfo *out) { const VkBaseInStructure32 *in_header; @@ -6530,7 +6609,7 @@ static inline void convert_VkBindImageMemoryInfo_win32_to_host(struct conversion out->sType = in->sType; out->pNext = NULL; out->image = in->image; - out->memory = in->memory; + out->memory = wine_device_memory_from_handle(in->memory)->memory; out->memoryOffset = in->memoryOffset;
for (in_header = UlongToPtr(in->pNext); in_header; in_header = UlongToPtr(in_header->pNext)) @@ -6581,6 +6660,24 @@ static inline void convert_VkBindImageMemoryInfo_win32_to_host(struct conversion } }
+#ifdef _WIN64 +static inline const VkBindImageMemoryInfo *convert_VkBindImageMemoryInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo *in, uint32_t count) +{ + VkBindImageMemoryInfo *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkBindImageMemoryInfo_win64_to_host(&in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkBindImageMemoryInfo *convert_VkBindImageMemoryInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindImageMemoryInfo32 *in, uint32_t count) { VkBindImageMemoryInfo *out; @@ -16401,19 +16498,50 @@ static inline void convert_VkPerformanceCounterDescriptionKHR_array_host_to_win3 } }
+#ifdef _WIN64 +static inline void convert_VkMappedMemoryRange_win64_to_host(const VkMappedMemoryRange *in, VkMappedMemoryRange *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->memory = wine_device_memory_from_handle(in->memory)->memory; + out->offset = in->offset; + out->size = in->size; +} +#endif /* _WIN64 */ + static inline void convert_VkMappedMemoryRange_win32_to_host(const VkMappedMemoryRange32 *in, VkMappedMemoryRange *out) { if (!in) return;
out->sType = in->sType; out->pNext = NULL; - out->memory = in->memory; + out->memory = wine_device_memory_from_handle(in->memory)->memory; out->offset = in->offset; out->size = in->size; if (in->pNext) FIXME("Unexpected pNext\n"); }
+#ifdef _WIN64 +static inline const VkMappedMemoryRange *convert_VkMappedMemoryRange_array_win64_to_host(struct conversion_context *ctx, const VkMappedMemoryRange *in, uint32_t count) +{ + VkMappedMemoryRange *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkMappedMemoryRange_win64_to_host(&in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkMappedMemoryRange *convert_VkMappedMemoryRange_array_win32_to_host(struct conversion_context *ctx, const VkMappedMemoryRange32 *in, uint32_t count) { VkMappedMemoryRange *out; @@ -17067,13 +17195,24 @@ static inline void convert_VkSparseImageMemoryRequirements2_array_host_to_win32( } }
+#ifdef _WIN64 +static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo *in, VkDeviceMemoryOpaqueCaptureAddressInfo *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->memory = wine_device_memory_from_handle(in->memory)->memory; +} +#endif /* _WIN64 */ + static inline void convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win32_to_host(const VkDeviceMemoryOpaqueCaptureAddressInfo32 *in, VkDeviceMemoryOpaqueCaptureAddressInfo *out) { if (!in) return;
out->sType = in->sType; out->pNext = NULL; - out->memory = in->memory; + out->memory = wine_device_memory_from_handle(in->memory)->memory; if (in->pNext) FIXME("Unexpected pNext\n"); } @@ -23920,17 +24059,48 @@ static inline void convert_VkInitializePerformanceApiInfoINTEL_win32_to_host(con FIXME("Unexpected pNext\n"); }
+#ifdef _WIN64 +static inline void convert_VkSparseMemoryBind_win64_to_host(const VkSparseMemoryBind *in, VkSparseMemoryBind *out) +{ + if (!in) return; + + out->resourceOffset = in->resourceOffset; + out->size = in->size; + out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->memory : 0; + out->memoryOffset = in->memoryOffset; + out->flags = in->flags; +} +#endif /* _WIN64 */ + static inline void convert_VkSparseMemoryBind_win32_to_host(const VkSparseMemoryBind32 *in, VkSparseMemoryBind *out) { if (!in) return;
out->resourceOffset = in->resourceOffset; out->size = in->size; - out->memory = in->memory; + out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->memory : 0; out->memoryOffset = in->memoryOffset; out->flags = in->flags; }
+#ifdef _WIN64 +static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win64_to_host(struct conversion_context *ctx, const VkSparseMemoryBind *in, uint32_t count) +{ + VkSparseMemoryBind *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkSparseMemoryBind_win64_to_host(&in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win32_to_host(struct conversion_context *ctx, const VkSparseMemoryBind32 *in, uint32_t count) { VkSparseMemoryBind *out; @@ -23947,6 +24117,17 @@ static inline const VkSparseMemoryBind *convert_VkSparseMemoryBind_array_win32_t return out; }
+#ifdef _WIN64 +static inline void convert_VkSparseBufferMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo *in, VkSparseBufferMemoryBindInfo *out) +{ + if (!in) return; + + out->buffer = in->buffer; + out->bindCount = in->bindCount; + out->pBinds = convert_VkSparseMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); +} +#endif /* _WIN64 */ + static inline void convert_VkSparseBufferMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo32 *in, VkSparseBufferMemoryBindInfo *out) { if (!in) return; @@ -23956,6 +24137,24 @@ static inline void convert_VkSparseBufferMemoryBindInfo_win32_to_host(struct con out->pBinds = convert_VkSparseMemoryBind_array_win32_to_host(ctx, (const VkSparseMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); }
+#ifdef _WIN64 +static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo *in, uint32_t count) +{ + VkSparseBufferMemoryBindInfo *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkSparseBufferMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseBufferMemoryBindInfo32 *in, uint32_t count) { VkSparseBufferMemoryBindInfo *out; @@ -23972,6 +24171,17 @@ static inline const VkSparseBufferMemoryBindInfo *convert_VkSparseBufferMemoryBi return out; }
+#ifdef _WIN64 +static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo *in, VkSparseImageOpaqueMemoryBindInfo *out) +{ + if (!in) return; + + out->image = in->image; + out->bindCount = in->bindCount; + out->pBinds = convert_VkSparseMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); +} +#endif /* _WIN64 */ + static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo32 *in, VkSparseImageOpaqueMemoryBindInfo *out) { if (!in) return; @@ -23981,6 +24191,24 @@ static inline void convert_VkSparseImageOpaqueMemoryBindInfo_win32_to_host(struc out->pBinds = convert_VkSparseMemoryBind_array_win32_to_host(ctx, (const VkSparseMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); }
+#ifdef _WIN64 +static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaqueMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo *in, uint32_t count) +{ + VkSparseImageOpaqueMemoryBindInfo *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkSparseImageOpaqueMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaqueMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageOpaqueMemoryBindInfo32 *in, uint32_t count) { VkSparseImageOpaqueMemoryBindInfo *out; @@ -23997,6 +24225,20 @@ static inline const VkSparseImageOpaqueMemoryBindInfo *convert_VkSparseImageOpaq return out; }
+#ifdef _WIN64 +static inline void convert_VkSparseImageMemoryBind_win64_to_host(const VkSparseImageMemoryBind *in, VkSparseImageMemoryBind *out) +{ + if (!in) return; + + out->subresource = in->subresource; + out->offset = in->offset; + out->extent = in->extent; + out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->memory : 0; + out->memoryOffset = in->memoryOffset; + out->flags = in->flags; +} +#endif /* _WIN64 */ + static inline void convert_VkSparseImageMemoryBind_win32_to_host(const VkSparseImageMemoryBind32 *in, VkSparseImageMemoryBind *out) { if (!in) return; @@ -24004,11 +24246,29 @@ static inline void convert_VkSparseImageMemoryBind_win32_to_host(const VkSparseI out->subresource = in->subresource; out->offset = in->offset; out->extent = in->extent; - out->memory = in->memory; + out->memory = in->memory ? wine_device_memory_from_handle(in->memory)->memory : 0; out->memoryOffset = in->memoryOffset; out->flags = in->flags; }
+#ifdef _WIN64 +static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBind *in, uint32_t count) +{ + VkSparseImageMemoryBind *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkSparseImageMemoryBind_win64_to_host(&in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBind32 *in, uint32_t count) { VkSparseImageMemoryBind *out; @@ -24025,6 +24285,17 @@ static inline const VkSparseImageMemoryBind *convert_VkSparseImageMemoryBind_arr return out; }
+#ifdef _WIN64 +static inline void convert_VkSparseImageMemoryBindInfo_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo *in, VkSparseImageMemoryBindInfo *out) +{ + if (!in) return; + + out->image = in->image; + out->bindCount = in->bindCount; + out->pBinds = convert_VkSparseImageMemoryBind_array_win64_to_host(ctx, in->pBinds, in->bindCount); +} +#endif /* _WIN64 */ + static inline void convert_VkSparseImageMemoryBindInfo_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo32 *in, VkSparseImageMemoryBindInfo *out) { if (!in) return; @@ -24034,6 +24305,24 @@ static inline void convert_VkSparseImageMemoryBindInfo_win32_to_host(struct conv out->pBinds = convert_VkSparseImageMemoryBind_array_win32_to_host(ctx, (const VkSparseImageMemoryBind32 *)UlongToPtr(in->pBinds), in->bindCount); }
+#ifdef _WIN64 +static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBindInfo_array_win64_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo *in, uint32_t count) +{ + VkSparseImageMemoryBindInfo *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkSparseImageMemoryBindInfo_win64_to_host(ctx, &in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBindInfo_array_win32_to_host(struct conversion_context *ctx, const VkSparseImageMemoryBindInfo32 *in, uint32_t count) { VkSparseImageMemoryBindInfo *out; @@ -24050,6 +24339,26 @@ static inline const VkSparseImageMemoryBindInfo *convert_VkSparseImageMemoryBind return out; }
+#ifdef _WIN64 +static inline void convert_VkBindSparseInfo_win64_to_host(struct conversion_context *ctx, const VkBindSparseInfo *in, VkBindSparseInfo *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->waitSemaphoreCount = in->waitSemaphoreCount; + out->pWaitSemaphores = in->pWaitSemaphores; + out->bufferBindCount = in->bufferBindCount; + out->pBufferBinds = convert_VkSparseBufferMemoryBindInfo_array_win64_to_host(ctx, in->pBufferBinds, in->bufferBindCount); + out->imageOpaqueBindCount = in->imageOpaqueBindCount; + out->pImageOpaqueBinds = convert_VkSparseImageOpaqueMemoryBindInfo_array_win64_to_host(ctx, in->pImageOpaqueBinds, in->imageOpaqueBindCount); + out->imageBindCount = in->imageBindCount; + out->pImageBinds = convert_VkSparseImageMemoryBindInfo_array_win64_to_host(ctx, in->pImageBinds, in->imageBindCount); + out->signalSemaphoreCount = in->signalSemaphoreCount; + out->pSignalSemaphores = in->pSignalSemaphores; +} +#endif /* _WIN64 */ + static inline void convert_VkBindSparseInfo_win32_to_host(struct conversion_context *ctx, const VkBindSparseInfo32 *in, VkBindSparseInfo *out) { const VkBaseInStructure32 *in_header; @@ -24107,6 +24416,24 @@ static inline void convert_VkBindSparseInfo_win32_to_host(struct conversion_cont } }
+#ifdef _WIN64 +static inline const VkBindSparseInfo *convert_VkBindSparseInfo_array_win64_to_host(struct conversion_context *ctx, const VkBindSparseInfo *in, uint32_t count) +{ + VkBindSparseInfo *out; + unsigned int i; + + if (!in || !count) return NULL; + + out = conversion_context_alloc(ctx, count * sizeof(*out)); + for (i = 0; i < count; i++) + { + convert_VkBindSparseInfo_win64_to_host(ctx, &in[i], &out[i]); + } + + return out; +} +#endif /* _WIN64 */ + static inline const VkBindSparseInfo *convert_VkBindSparseInfo_array_win32_to_host(struct conversion_context *ctx, const VkBindSparseInfo32 *in, uint32_t count) { VkBindSparseInfo *out; @@ -24945,7 +25272,7 @@ static NTSTATUS thunk64_vkAllocateMemory(void *args)
TRACE("%p, %p, %p, %p\n", params->device, params->pAllocateInfo, params->pAllocator, params->pMemory);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkAllocateMemory(wine_device_from_handle(params->device)->device, params->pAllocateInfo, NULL, params->pMemory); + params->result = wine_vkAllocateMemory(params->device, params->pAllocateInfo, params->pAllocator, params->pMemory); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -24967,7 +25294,7 @@ static NTSTATUS thunk32_vkAllocateMemory(void *args)
init_conversion_context(&ctx); convert_VkMemoryAllocateInfo_win32_to_host(&ctx, (const VkMemoryAllocateInfo32 *)UlongToPtr(params->pAllocateInfo), &pAllocateInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAllocateMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, &pAllocateInfo_host, NULL, (VkDeviceMemory *)UlongToPtr(params->pMemory)); + params->result = wine_vkAllocateMemory((VkDevice)UlongToPtr(params->device), &pAllocateInfo_host, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator), (VkDeviceMemory *)UlongToPtr(params->pMemory)); free_conversion_context(&ctx); return STATUS_SUCCESS; } @@ -25008,10 +25335,15 @@ static NTSTATUS thunk32_vkBeginCommandBuffer(void *args) static NTSTATUS thunk64_vkBindAccelerationStructureMemoryNV(void *args) { struct vkBindAccelerationStructureMemoryNV_params *params = args; + const VkBindAccelerationStructureMemoryInfoNV *pBindInfos_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindAccelerationStructureMemoryNV(wine_device_from_handle(params->device)->device, params->bindInfoCount, params->pBindInfos); + init_conversion_context(&ctx); + pBindInfos_host = convert_VkBindAccelerationStructureMemoryInfoNV_array_win64_to_host(&ctx, params->pBindInfos, params->bindInfoCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindAccelerationStructureMemoryNV(wine_device_from_handle(params->device)->device, params->bindInfoCount, pBindInfos_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -25044,7 +25376,7 @@ static NTSTATUS thunk64_vkBindBufferMemory(void *args)
TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->buffer), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset));
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory(wine_device_from_handle(params->device)->device, params->buffer, params->memory, params->memoryOffset); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory(wine_device_from_handle(params->device)->device, params->buffer, wine_device_memory_from_handle(params->memory)->memory, params->memoryOffset); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -25062,7 +25394,7 @@ static NTSTATUS thunk32_vkBindBufferMemory(void *args)
TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->buffer), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset));
- params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindBufferMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->buffer, params->memory, params->memoryOffset); + params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindBufferMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->buffer, wine_device_memory_from_handle(params->memory)->memory, params->memoryOffset); return STATUS_SUCCESS; }
@@ -25070,10 +25402,15 @@ static NTSTATUS thunk32_vkBindBufferMemory(void *args) static NTSTATUS thunk64_vkBindBufferMemory2(void *args) { struct vkBindBufferMemory2_params *params = args; + const VkBindBufferMemoryInfo *pBindInfos_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory2(wine_device_from_handle(params->device)->device, params->bindInfoCount, params->pBindInfos); + init_conversion_context(&ctx); + pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win64_to_host(&ctx, params->pBindInfos, params->bindInfoCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory2(wine_device_from_handle(params->device)->device, params->bindInfoCount, pBindInfos_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -25103,10 +25440,15 @@ static NTSTATUS thunk32_vkBindBufferMemory2(void *args) static NTSTATUS thunk64_vkBindBufferMemory2KHR(void *args) { struct vkBindBufferMemory2KHR_params *params = args; + const VkBindBufferMemoryInfo *pBindInfos_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory2KHR(wine_device_from_handle(params->device)->device, params->bindInfoCount, params->pBindInfos); + init_conversion_context(&ctx); + pBindInfos_host = convert_VkBindBufferMemoryInfo_array_win64_to_host(&ctx, params->pBindInfos, params->bindInfoCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindBufferMemory2KHR(wine_device_from_handle(params->device)->device, params->bindInfoCount, pBindInfos_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -25139,7 +25481,7 @@ static NTSTATUS thunk64_vkBindImageMemory(void *args)
TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->image), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset));
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory(wine_device_from_handle(params->device)->device, params->image, params->memory, params->memoryOffset); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory(wine_device_from_handle(params->device)->device, params->image, wine_device_memory_from_handle(params->memory)->memory, params->memoryOffset); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -25157,7 +25499,7 @@ static NTSTATUS thunk32_vkBindImageMemory(void *args)
TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->image), wine_dbgstr_longlong(params->memory), wine_dbgstr_longlong(params->memoryOffset));
- params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindImageMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->image, params->memory, params->memoryOffset); + params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkBindImageMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->image, wine_device_memory_from_handle(params->memory)->memory, params->memoryOffset); return STATUS_SUCCESS; }
@@ -25165,10 +25507,15 @@ static NTSTATUS thunk32_vkBindImageMemory(void *args) static NTSTATUS thunk64_vkBindImageMemory2(void *args) { struct vkBindImageMemory2_params *params = args; + const VkBindImageMemoryInfo *pBindInfos_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory2(wine_device_from_handle(params->device)->device, params->bindInfoCount, params->pBindInfos); + init_conversion_context(&ctx); + pBindInfos_host = convert_VkBindImageMemoryInfo_array_win64_to_host(&ctx, params->pBindInfos, params->bindInfoCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory2(wine_device_from_handle(params->device)->device, params->bindInfoCount, pBindInfos_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -25198,10 +25545,15 @@ static NTSTATUS thunk32_vkBindImageMemory2(void *args) static NTSTATUS thunk64_vkBindImageMemory2KHR(void *args) { struct vkBindImageMemory2KHR_params *params = args; + const VkBindImageMemoryInfo *pBindInfos_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->bindInfoCount, params->pBindInfos);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory2KHR(wine_device_from_handle(params->device)->device, params->bindInfoCount, params->pBindInfos); + init_conversion_context(&ctx); + pBindInfos_host = convert_VkBindImageMemoryInfo_array_win64_to_host(&ctx, params->pBindInfos, params->bindInfoCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkBindImageMemory2KHR(wine_device_from_handle(params->device)->device, params->bindInfoCount, pBindInfos_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -35002,10 +35354,15 @@ static NTSTATUS thunk32_vkEnumeratePhysicalDevices(void *args) static NTSTATUS thunk64_vkFlushMappedMemoryRanges(void *args) { struct vkFlushMappedMemoryRanges_params *params = args; + const VkMappedMemoryRange *pMemoryRanges_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->memoryRangeCount, params->pMemoryRanges);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkFlushMappedMemoryRanges(wine_device_from_handle(params->device)->device, params->memoryRangeCount, params->pMemoryRanges); + init_conversion_context(&ctx); + pMemoryRanges_host = convert_VkMappedMemoryRange_array_win64_to_host(&ctx, params->pMemoryRanges, params->memoryRangeCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkFlushMappedMemoryRanges(wine_device_from_handle(params->device)->device, params->memoryRangeCount, pMemoryRanges_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -35100,7 +35457,7 @@ static NTSTATUS thunk64_vkFreeMemory(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->memory), params->pAllocator);
- wine_device_from_handle(params->device)->funcs.p_vkFreeMemory(wine_device_from_handle(params->device)->device, params->memory, NULL); + wine_vkFreeMemory(params->device, params->memory, params->pAllocator); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -35116,7 +35473,7 @@ static NTSTATUS thunk32_vkFreeMemory(void *args)
TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->memory), params->pAllocator);
- wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkFreeMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->memory, NULL); + wine_vkFreeMemory((VkDevice)UlongToPtr(params->device), params->memory, (const VkAllocationCallbacks *)UlongToPtr(params->pAllocator)); return STATUS_SUCCESS; }
@@ -36262,7 +36619,7 @@ static NTSTATUS thunk64_vkGetDeviceMemoryCommitment(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->memory), params->pCommittedMemoryInBytes);
- wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryCommitment(wine_device_from_handle(params->device)->device, params->memory, params->pCommittedMemoryInBytes); + wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryCommitment(wine_device_from_handle(params->device)->device, wine_device_memory_from_handle(params->memory)->memory, params->pCommittedMemoryInBytes); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -36278,7 +36635,7 @@ static NTSTATUS thunk32_vkGetDeviceMemoryCommitment(void *args)
TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->memory), params->pCommittedMemoryInBytes);
- wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceMemoryCommitment(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->memory, (VkDeviceSize *)UlongToPtr(params->pCommittedMemoryInBytes)); + wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkGetDeviceMemoryCommitment(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, wine_device_memory_from_handle(params->memory)->memory, (VkDeviceSize *)UlongToPtr(params->pCommittedMemoryInBytes)); return STATUS_SUCCESS; }
@@ -36286,10 +36643,12 @@ static NTSTATUS thunk32_vkGetDeviceMemoryCommitment(void *args) static NTSTATUS thunk64_vkGetDeviceMemoryOpaqueCaptureAddress(void *args) { struct vkGetDeviceMemoryOpaqueCaptureAddress_params *params = args; + VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host;
TRACE("%p, %p\n", params->device, params->pInfo);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddress(wine_device_from_handle(params->device)->device, params->pInfo); + convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(params->pInfo, &pInfo_host); + params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddress(wine_device_from_handle(params->device)->device, &pInfo_host); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -36315,10 +36674,12 @@ static NTSTATUS thunk32_vkGetDeviceMemoryOpaqueCaptureAddress(void *args) static NTSTATUS thunk64_vkGetDeviceMemoryOpaqueCaptureAddressKHR(void *args) { struct vkGetDeviceMemoryOpaqueCaptureAddressKHR_params *params = args; + VkDeviceMemoryOpaqueCaptureAddressInfo pInfo_host;
TRACE("%p, %p\n", params->device, params->pInfo);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddressKHR(wine_device_from_handle(params->device)->device, params->pInfo); + convert_VkDeviceMemoryOpaqueCaptureAddressInfo_win64_to_host(params->pInfo, &pInfo_host); + params->result = wine_device_from_handle(params->device)->funcs.p_vkGetDeviceMemoryOpaqueCaptureAddressKHR(wine_device_from_handle(params->device)->device, &pInfo_host); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -39275,10 +39636,15 @@ static NTSTATUS thunk32_vkInitializePerformanceApiINTEL(void *args) static NTSTATUS thunk64_vkInvalidateMappedMemoryRanges(void *args) { struct vkInvalidateMappedMemoryRanges_params *params = args; + const VkMappedMemoryRange *pMemoryRanges_host; + struct conversion_context ctx;
TRACE("%p, %u, %p\n", params->device, params->memoryRangeCount, params->pMemoryRanges);
- params->result = wine_device_from_handle(params->device)->funcs.p_vkInvalidateMappedMemoryRanges(wine_device_from_handle(params->device)->device, params->memoryRangeCount, params->pMemoryRanges); + init_conversion_context(&ctx); + pMemoryRanges_host = convert_VkMappedMemoryRange_array_win64_to_host(&ctx, params->pMemoryRanges, params->memoryRangeCount); + params->result = wine_device_from_handle(params->device)->funcs.p_vkInvalidateMappedMemoryRanges(wine_device_from_handle(params->device)->device, params->memoryRangeCount, pMemoryRanges_host); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -39425,10 +39791,15 @@ static NTSTATUS thunk32_vkQueueBeginDebugUtilsLabelEXT(void *args) static NTSTATUS thunk64_vkQueueBindSparse(void *args) { struct vkQueueBindSparse_params *params = args; + const VkBindSparseInfo *pBindInfo_host; + struct conversion_context ctx;
TRACE("%p, %u, %p, 0x%s\n", params->queue, params->bindInfoCount, params->pBindInfo, wine_dbgstr_longlong(params->fence));
- params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueBindSparse(wine_queue_from_handle(params->queue)->queue, params->bindInfoCount, params->pBindInfo, params->fence); + init_conversion_context(&ctx); + pBindInfo_host = convert_VkBindSparseInfo_array_win64_to_host(&ctx, params->pBindInfo, params->bindInfoCount); + params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueueBindSparse(wine_queue_from_handle(params->queue)->queue, params->bindInfoCount, pBindInfo_host, params->fence); + free_conversion_context(&ctx); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -40025,7 +40396,7 @@ static NTSTATUS thunk64_vkSetDeviceMemoryPriorityEXT(void *args)
TRACE("%p, 0x%s, %f\n", params->device, wine_dbgstr_longlong(params->memory), params->priority);
- wine_device_from_handle(params->device)->funcs.p_vkSetDeviceMemoryPriorityEXT(wine_device_from_handle(params->device)->device, params->memory, params->priority); + wine_device_from_handle(params->device)->funcs.p_vkSetDeviceMemoryPriorityEXT(wine_device_from_handle(params->device)->device, wine_device_memory_from_handle(params->memory)->memory, params->priority); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -40041,7 +40412,7 @@ static NTSTATUS thunk32_vkSetDeviceMemoryPriorityEXT(void *args)
TRACE("%#x, 0x%s, %f\n", params->device, wine_dbgstr_longlong(params->memory), params->priority);
- wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetDeviceMemoryPriorityEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->memory, params->priority); + wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkSetDeviceMemoryPriorityEXT(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, wine_device_memory_from_handle(params->memory)->memory, params->priority); return STATUS_SUCCESS; }
@@ -40314,7 +40685,7 @@ static NTSTATUS thunk64_vkUnmapMemory(void *args)
TRACE("%p, 0x%s\n", params->device, wine_dbgstr_longlong(params->memory));
- wine_device_from_handle(params->device)->funcs.p_vkUnmapMemory(wine_device_from_handle(params->device)->device, params->memory); + wine_vkUnmapMemory(params->device, params->memory); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -40329,7 +40700,7 @@ static NTSTATUS thunk32_vkUnmapMemory(void *args)
TRACE("%#x, 0x%s\n", params->device, wine_dbgstr_longlong(params->memory));
- wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkUnmapMemory(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->device, params->memory); + wine_vkUnmapMemory((VkDevice)UlongToPtr(params->device), params->memory); return STATUS_SUCCESS; }
@@ -40895,6 +41266,7 @@ BOOL wine_vk_is_type_wrapped(VkObjectType type) type == VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT || type == VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT || type == VK_OBJECT_TYPE_DEVICE || + type == VK_OBJECT_TYPE_DEVICE_MEMORY || type == VK_OBJECT_TYPE_INSTANCE || type == VK_OBJECT_TYPE_PHYSICAL_DEVICE || type == VK_OBJECT_TYPE_QUEUE || diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 89f741ad062..b893f15a9f3 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -16,6 +16,7 @@
/* Functions for which we have custom implementations outside of the thunks. */ VkResult wine_vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers) DECLSPEC_HIDDEN; +VkResult wine_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) DECLSPEC_HIDDEN; VkResult wine_vkCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkCommandPool *pCommandPool, void *client_ptr) DECLSPEC_HIDDEN; VkResult wine_vkCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugReportCallbackEXT *pCallback) DECLSPEC_HIDDEN; VkResult wine_vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger) DECLSPEC_HIDDEN; @@ -36,6 +37,7 @@ VkResult wine_vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPh VkResult wine_vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) DECLSPEC_HIDDEN; VkResult wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices) DECLSPEC_HIDDEN; void wine_vkFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) DECLSPEC_HIDDEN; +void wine_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks *pAllocator) DECLSPEC_HIDDEN; VkResult wine_vkGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT *pTimestampInfos, uint64_t *pTimestamps, uint64_t *pMaxDeviation) DECLSPEC_HIDDEN; void wine_vkGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) DECLSPEC_HIDDEN; void wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) DECLSPEC_HIDDEN; @@ -51,6 +53,7 @@ VkResult wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice phys VkResult wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities) DECLSPEC_HIDDEN; VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) DECLSPEC_HIDDEN; VkResult wine_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData) DECLSPEC_HIDDEN; +void wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory) DECLSPEC_HIDDEN;
/* For use by vkDevice and children */ struct vulkan_device_funcs