From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winevulkan/make_vulkan | 2 +- dlls/winevulkan/vulkan.c | 30 +++++++++++------------ dlls/winevulkan/vulkan_private.h | 9 ++++--- dlls/winevulkan/vulkan_thunks.c | 42 ++++++++++++++++---------------- include/wine/vulkan_driver.h | 10 ++++++++ 5 files changed, 52 insertions(+), 41 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 5fa168d9727..4982e965963 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1203,7 +1203,7 @@ class VkHandle(object): if self.name == "VkSurfaceKHR": return "vulkan_surface_from_handle({0})->host.surface".format(name) if self.name == "VkSwapchainKHR": - return "wine_swapchain_from_handle({0})->host_swapchain".format(name) + return "vulkan_swapchain_from_handle({0})->host.swapchain".format(name) if self.is_dispatchable(): LOGGER.error("Unhandled host handle for: {0}".format(self.name)) return None diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index f49ad41048e..4c3f0a4aaca 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1761,7 +1761,7 @@ VkResult wine_vkAcquireNextImage2KHR(VkDevice client_device, const VkAcquireNext RECT client_rect; VkResult res;
- acquire_info_host.swapchain = swapchain->host_swapchain; + acquire_info_host.swapchain = swapchain->obj.host.swapchain; res = device->p_vkAcquireNextImage2KHR(device->host.device, &acquire_info_host, image_index);
if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect, NtUserGetDpiForWindow(surface->hwnd)) && @@ -1775,16 +1775,16 @@ VkResult wine_vkAcquireNextImage2KHR(VkDevice client_device, const VkAcquireNext return res; }
-VkResult wine_vkAcquireNextImageKHR(VkDevice client_device, VkSwapchainKHR swapchain_handle, uint64_t timeout, +VkResult wine_vkAcquireNextImageKHR(VkDevice client_device, VkSwapchainKHR client_swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *image_index) { - struct wine_swapchain *swapchain = wine_swapchain_from_handle(swapchain_handle); + struct wine_swapchain *swapchain = wine_swapchain_from_handle(client_swapchain); struct vulkan_device *device = vulkan_device_from_handle(client_device); struct wine_surface *surface = swapchain->surface; RECT client_rect; VkResult res;
- res = device->p_vkAcquireNextImageKHR(device->host.device, swapchain->host_swapchain, timeout, + res = device->p_vkAcquireNextImageKHR(device->host.device, swapchain->obj.host.swapchain, timeout, semaphore, fence, image_index);
if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect, NtUserGetDpiForWindow(surface->hwnd)) && @@ -1799,7 +1799,7 @@ VkResult wine_vkAcquireNextImageKHR(VkDevice client_device, VkSwapchainKHR swapc }
VkResult wine_vkCreateSwapchainKHR(VkDevice client_device, const VkSwapchainCreateInfoKHR *create_info, - const VkAllocationCallbacks *allocator, VkSwapchainKHR *swapchain_handle) + const VkAllocationCallbacks *allocator, VkSwapchainKHR *ret) { struct wine_swapchain *object, *old_swapchain = wine_swapchain_from_handle(create_info->oldSwapchain); struct wine_surface *surface = wine_surface_from_handle(create_info->surface); @@ -1818,7 +1818,7 @@ VkResult wine_vkCreateSwapchainKHR(VkDevice client_device, const VkSwapchainCrea }
if (surface) create_info_host.surface = surface->obj.host.surface; - if (old_swapchain) create_info_host.oldSwapchain = old_swapchain->host_swapchain; + if (old_swapchain) create_info_host.oldSwapchain = old_swapchain->obj.host.swapchain;
/* update the host surface to commit any pending size change */ vk_funcs->p_vulkan_surface_update( surface->driver_surface ); @@ -1839,26 +1839,26 @@ VkResult wine_vkCreateSwapchainKHR(VkDevice client_device, const VkSwapchainCrea return res; }
- object->host_swapchain = host_swapchain; + object->obj.host.swapchain = host_swapchain; object->surface = surface; object->extents = create_info->imageExtent;
- *swapchain_handle = wine_swapchain_to_handle(object); - add_handle_mapping(instance, *swapchain_handle, object->host_swapchain, &object->wrapper_entry); + *ret = wine_swapchain_to_handle(object); + add_handle_mapping(instance, *ret, object->obj.host.swapchain, &object->wrapper_entry); return VK_SUCCESS; }
-void wine_vkDestroySwapchainKHR(VkDevice client_device, VkSwapchainKHR swapchain_handle, +void wine_vkDestroySwapchainKHR(VkDevice client_device, VkSwapchainKHR client_swapchain, const VkAllocationCallbacks *allocator) { struct vulkan_device *device = vulkan_device_from_handle(client_device); struct vulkan_instance *instance = device->physical_device->instance; - struct wine_swapchain *swapchain = wine_swapchain_from_handle(swapchain_handle); + struct wine_swapchain *swapchain = wine_swapchain_from_handle(client_swapchain);
if (allocator) FIXME("Support for allocation callbacks not implemented yet\n"); if (!swapchain) return;
- device->p_vkDestroySwapchainKHR(device->host.device, swapchain->host_swapchain, NULL); + device->p_vkDestroySwapchainKHR(device->host.device, swapchain->obj.host.swapchain, NULL); remove_handle_mapping(instance, &swapchain->wrapper_entry);
free(swapchain); @@ -1885,7 +1885,7 @@ VkResult wine_vkQueuePresentKHR(VkQueue client_queue, const VkPresentInfoKHR *pr { struct wine_swapchain *swapchain = wine_swapchain_from_handle(present_info->pSwapchains[i]); struct wine_surface *surface = swapchain->surface; - swapchains[i] = swapchain->host_swapchain; + swapchains[i] = swapchain->obj.host.swapchain; surfaces[i] = surface->driver_surface; }
@@ -2283,11 +2283,11 @@ static void adjust_surface_capabilities(struct vulkan_instance *instance, struct capabilities->currentExtent.height = client_rect.bottom - client_rect.top; }
-VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice client_physical_device, VkSurfaceKHR surface_handle, +VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice client_physical_device, VkSurfaceKHR client_surface, VkSurfaceCapabilitiesKHR *capabilities) { struct vulkan_physical_device *physical_device = vulkan_physical_device_from_handle(client_physical_device); - struct wine_surface *surface = wine_surface_from_handle(surface_handle); + struct wine_surface *surface = wine_surface_from_handle(client_surface); struct vulkan_instance *instance = physical_device->instance; VkResult res;
diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 66d8fdd0326..411d294e021 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -217,8 +217,8 @@ static inline VkSurfaceKHR wine_surface_to_handle(struct wine_surface *surface)
struct wine_swapchain { - struct wine_surface *surface; /* parent */ - VkSwapchainKHR host_swapchain; + struct vulkan_swapchain obj; + struct wine_surface *surface; VkExtent2D extents;
struct wrapper_entry wrapper_entry; @@ -226,12 +226,13 @@ struct wine_swapchain
static inline struct wine_swapchain *wine_swapchain_from_handle(VkSwapchainKHR handle) { - return (struct wine_swapchain *)(uintptr_t)handle; + struct vulkan_swapchain *obj = vulkan_swapchain_from_handle(handle); + return CONTAINING_RECORD(obj, struct wine_swapchain, obj); }
static inline VkSwapchainKHR wine_swapchain_to_handle(struct wine_swapchain *surface) { - return (VkSwapchainKHR)(uintptr_t)surface; + return (VkSwapchainKHR)(uintptr_t)&surface->obj; }
BOOL wine_vk_device_extension_supported(const char *name); diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 78b038a14df..3a31756a5d4 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -8879,7 +8879,7 @@ static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle) case VK_OBJECT_TYPE_SURFACE_KHR: return (uint64_t) vulkan_surface_from_handle(handle)->host.surface; case VK_OBJECT_TYPE_SWAPCHAIN_KHR: - return (uint64_t) wine_swapchain_from_handle(handle)->host_swapchain; + return (uint64_t) vulkan_swapchain_from_handle(handle)->host.swapchain; default: return handle; } @@ -9524,7 +9524,7 @@ static inline void convert_VkBindImageMemoryInfo_win64_to_host(struct conversion const VkBindImageMemorySwapchainInfoKHR *in_ext = (const VkBindImageMemorySwapchainInfoKHR *)in_header; out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR; out_ext->pNext = NULL; - out_ext->swapchain = wine_swapchain_from_handle(in_ext->swapchain)->host_swapchain; + out_ext->swapchain = vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain; out_ext->imageIndex = in_ext->imageIndex; out_header->pNext = (void *)out_ext; out_header = (void *)out_ext; @@ -9597,7 +9597,7 @@ static inline void convert_VkBindImageMemoryInfo_win32_to_host(struct conversion const VkBindImageMemorySwapchainInfoKHR32 *in_ext = (const VkBindImageMemorySwapchainInfoKHR32 *)in_header; out_ext->sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR; out_ext->pNext = NULL; - out_ext->swapchain = wine_swapchain_from_handle(in_ext->swapchain)->host_swapchain; + out_ext->swapchain = vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain; out_ext->imageIndex = in_ext->imageIndex; out_header->pNext = (void *)out_ext; out_header = (void *)out_ext; @@ -20997,7 +20997,7 @@ static inline void convert_VkImageCreateInfo_win64_to_host(struct conversion_con const VkImageSwapchainCreateInfoKHR *in_ext = (const VkImageSwapchainCreateInfoKHR *)in_header; out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR; out_ext->pNext = NULL; - out_ext->swapchain = in_ext->swapchain ? wine_swapchain_from_handle(in_ext->swapchain)->host_swapchain : 0; + out_ext->swapchain = in_ext->swapchain ? vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain : 0; out_header->pNext = (void *)out_ext; out_header = (void *)out_ext; break; @@ -21146,7 +21146,7 @@ static inline void convert_VkImageCreateInfo_win32_to_host(struct conversion_con const VkImageSwapchainCreateInfoKHR32 *in_ext = (const VkImageSwapchainCreateInfoKHR32 *)in_header; out_ext->sType = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR; out_ext->pNext = NULL; - out_ext->swapchain = in_ext->swapchain ? wine_swapchain_from_handle(in_ext->swapchain)->host_swapchain : 0; + out_ext->swapchain = in_ext->swapchain ? vulkan_swapchain_from_handle(in_ext->swapchain)->host.swapchain : 0; out_header->pNext = (void *)out_ext; out_header = (void *)out_ext; break; @@ -36064,7 +36064,7 @@ static inline void convert_VkReleaseSwapchainImagesInfoEXT_win64_to_host(const V
out->sType = in->sType; out->pNext = in->pNext; - out->swapchain = wine_swapchain_from_handle(in->swapchain)->host_swapchain; + out->swapchain = vulkan_swapchain_from_handle(in->swapchain)->host.swapchain; out->imageIndexCount = in->imageIndexCount; out->pImageIndices = in->pImageIndices; } @@ -36076,7 +36076,7 @@ static inline void convert_VkReleaseSwapchainImagesInfoEXT_win32_to_host(const V
out->sType = in->sType; out->pNext = NULL; - out->swapchain = wine_swapchain_from_handle(in->swapchain)->host_swapchain; + out->swapchain = vulkan_swapchain_from_handle(in->swapchain)->host.swapchain; out->imageIndexCount = in->imageIndexCount; out->pImageIndices = UlongToPtr(in->pImageIndices); if (in->pNext) @@ -36150,7 +36150,7 @@ static inline const VkSwapchainKHR *convert_VkSwapchainKHR_array_win64_to_host(s out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - out[i] = wine_swapchain_from_handle(in[i])->host_swapchain; + out[i] = vulkan_swapchain_from_handle(in[i])->host.swapchain; }
return out; @@ -36167,7 +36167,7 @@ static inline const VkSwapchainKHR *convert_VkSwapchainKHR_array_win32_to_host(s out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - out[i] = wine_swapchain_from_handle(in[i])->host_swapchain; + out[i] = vulkan_swapchain_from_handle(in[i])->host.swapchain; }
return out; @@ -49358,7 +49358,7 @@ static NTSTATUS thunk64_vkGetLatencyTimingsNV(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo);
- vulkan_device_from_handle(params->device)->p_vkGetLatencyTimingsNV(vulkan_device_from_handle(params->device)->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->pLatencyMarkerInfo); + vulkan_device_from_handle(params->device)->p_vkGetLatencyTimingsNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pLatencyMarkerInfo); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -49379,7 +49379,7 @@ static NTSTATUS thunk32_vkGetLatencyTimingsNV(void *args)
init_conversion_context(ctx); convert_VkGetLatencyMarkerInfoNV_win32_to_host(ctx, (VkGetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo), &pLatencyMarkerInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetLatencyTimingsNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, &pLatencyMarkerInfo_host); + vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetLatencyTimingsNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pLatencyMarkerInfo_host); convert_VkGetLatencyMarkerInfoNV_host_to_win32(&pLatencyMarkerInfo_host, (VkGetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo)); free_conversion_context(ctx); return STATUS_SUCCESS; @@ -52021,7 +52021,7 @@ static NTSTATUS thunk64_vkGetSwapchainImagesKHR(void *args)
TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSwapchainImageCount, params->pSwapchainImages);
- params->result = vulkan_device_from_handle(params->device)->p_vkGetSwapchainImagesKHR(vulkan_device_from_handle(params->device)->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->pSwapchainImageCount, params->pSwapchainImages); + params->result = vulkan_device_from_handle(params->device)->p_vkGetSwapchainImagesKHR(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pSwapchainImageCount, params->pSwapchainImages); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -52039,7 +52039,7 @@ static NTSTATUS thunk32_vkGetSwapchainImagesKHR(void *args)
TRACE("%#x, 0x%s, %#x, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSwapchainImageCount, params->pSwapchainImages);
- params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetSwapchainImagesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, (uint32_t *)UlongToPtr(params->pSwapchainImageCount), (VkImage *)UlongToPtr(params->pSwapchainImages)); + params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkGetSwapchainImagesKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, (uint32_t *)UlongToPtr(params->pSwapchainImageCount), (VkImage *)UlongToPtr(params->pSwapchainImages)); return STATUS_SUCCESS; }
@@ -52187,7 +52187,7 @@ static NTSTATUS thunk64_vkLatencySleepNV(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepInfo);
- params->result = vulkan_device_from_handle(params->device)->p_vkLatencySleepNV(vulkan_device_from_handle(params->device)->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->pSleepInfo); + params->result = vulkan_device_from_handle(params->device)->p_vkLatencySleepNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pSleepInfo); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -52206,7 +52206,7 @@ static NTSTATUS thunk32_vkLatencySleepNV(void *args) TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepInfo);
convert_VkLatencySleepInfoNV_win32_to_host((const VkLatencySleepInfoNV32 *)UlongToPtr(params->pSleepInfo), &pSleepInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkLatencySleepNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, &pSleepInfo_host); + params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkLatencySleepNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pSleepInfo_host); return STATUS_SUCCESS; }
@@ -53170,7 +53170,7 @@ static NTSTATUS thunk64_vkSetLatencyMarkerNV(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo);
- vulkan_device_from_handle(params->device)->p_vkSetLatencyMarkerNV(vulkan_device_from_handle(params->device)->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->pLatencyMarkerInfo); + vulkan_device_from_handle(params->device)->p_vkSetLatencyMarkerNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pLatencyMarkerInfo); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -53188,7 +53188,7 @@ static NTSTATUS thunk32_vkSetLatencyMarkerNV(void *args) TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pLatencyMarkerInfo);
convert_VkSetLatencyMarkerInfoNV_win32_to_host((const VkSetLatencyMarkerInfoNV32 *)UlongToPtr(params->pLatencyMarkerInfo), &pLatencyMarkerInfo_host); - vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetLatencyMarkerNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, &pLatencyMarkerInfo_host); + vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetLatencyMarkerNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pLatencyMarkerInfo_host); return STATUS_SUCCESS; }
@@ -53199,7 +53199,7 @@ static NTSTATUS thunk64_vkSetLatencySleepModeNV(void *args)
TRACE("%p, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepModeInfo);
- params->result = vulkan_device_from_handle(params->device)->p_vkSetLatencySleepModeNV(vulkan_device_from_handle(params->device)->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->pSleepModeInfo); + params->result = vulkan_device_from_handle(params->device)->p_vkSetLatencySleepModeNV(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->pSleepModeInfo); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -53218,7 +53218,7 @@ static NTSTATUS thunk32_vkSetLatencySleepModeNV(void *args) TRACE("%#x, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), params->pSleepModeInfo);
convert_VkLatencySleepModeInfoNV_win32_to_host((const VkLatencySleepModeInfoNV32 *)UlongToPtr(params->pSleepModeInfo), &pSleepModeInfo_host); - params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetLatencySleepModeNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, &pSleepModeInfo_host); + params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkSetLatencySleepModeNV(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, &pSleepModeInfo_host); return STATUS_SUCCESS; }
@@ -53768,7 +53768,7 @@ static NTSTATUS thunk64_vkWaitForPresentKHR(void *args)
TRACE("%p, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->presentId), wine_dbgstr_longlong(params->timeout));
- params->result = vulkan_device_from_handle(params->device)->p_vkWaitForPresentKHR(vulkan_device_from_handle(params->device)->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->presentId, params->timeout); + params->result = vulkan_device_from_handle(params->device)->p_vkWaitForPresentKHR(vulkan_device_from_handle(params->device)->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->presentId, params->timeout); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -53786,7 +53786,7 @@ static NTSTATUS thunk32_vkWaitForPresentKHR(void *args)
TRACE("%#x, 0x%s, 0x%s, 0x%s\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->presentId), wine_dbgstr_longlong(params->timeout));
- params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWaitForPresentKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->presentId, params->timeout); + params->result = vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->p_vkWaitForPresentKHR(vulkan_device_from_handle((VkDevice)UlongToPtr(params->device))->host.device, vulkan_swapchain_from_handle(params->swapchain)->host.swapchain, params->presentId, params->timeout); return STATUS_SUCCESS; }
diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index af829b04fdc..cdc44c8d61c 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -127,6 +127,16 @@ static inline struct vulkan_surface *vulkan_surface_from_handle( VkSurfaceKHR ha return (struct vulkan_surface *)(UINT_PTR)handle; }
+struct vulkan_swapchain +{ + VULKAN_OBJECT_HEADER( VkSwapchainKHR, swapchain ); +}; + +static inline struct vulkan_swapchain *vulkan_swapchain_from_handle( VkSwapchainKHR handle ) +{ + return (struct vulkan_swapchain *)(UINT_PTR)handle; +} + struct vulkan_funcs { /* Vulkan global functions. These are the only calls at this point a graphics driver