[PATCH 6/7] winex11: Implement vkDestroySurfaceKHR.
Józef Kucia
joseph.kucia at gmail.com
Mon Mar 12 09:59:58 CDT 2018
On Mon, Mar 12, 2018 at 1:22 AM, Roderick Colenbrander
<thunderbird2k at gmail.com> wrote:
> Signed-off-by: Roderick Colenbrander <thunderbird2k at gmail.com>
> ---
> dlls/winex11.drv/vulkan.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
> index 515806e421..40d4f608e9 100644
> --- a/dlls/winex11.drv/vulkan.c
> +++ b/dlls/winex11.drv/vulkan.c
> @@ -52,6 +52,8 @@ struct wine_vk_surface
> Window window;
> VkSurfaceKHR surface; /* native surface */
> };
> +/* Macro to help conversion from VkSurfaceKHR (uint64_t) to a surface pointer. */
> +#define SURFACE_FROM_HANDLE(surface) ((struct wine_vk_surface *)(uintptr_t)surface)
An inline function would be preferred.
>
> typedef struct VkXlibSurfaceCreateInfoKHR
> {
> @@ -65,6 +67,7 @@ typedef struct VkXlibSurfaceCreateInfoKHR
> static VkResult (*pvkCreateInstance)(const VkInstanceCreateInfo *, const VkAllocationCallbacks *, VkInstance *);
> static VkResult (*pvkCreateXlibSurfaceKHR)(VkInstance, const VkXlibSurfaceCreateInfoKHR *, const VkAllocationCallbacks *, VkSurfaceKHR *);
> static void (*pvkDestroyInstance)(VkInstance, const VkAllocationCallbacks *);
> +static void (*pvkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *);
> static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *);
> static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *);
> static VkBool32 (*pvkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice, uint32_t, Display *, VisualID);
> @@ -89,6 +92,7 @@ static BOOL wine_vk_init(void)
> LOAD_FUNCPTR(vkCreateInstance)
> LOAD_FUNCPTR(vkCreateXlibSurfaceKHR)
> LOAD_FUNCPTR(vkDestroyInstance)
> +LOAD_FUNCPTR(vkDestroySurfaceKHR)
> LOAD_FUNCPTR(vkGetDeviceProcAddr)
> LOAD_FUNCPTR(vkGetInstanceProcAddr)
> LOAD_FUNCPTR(vkGetPhysicalDeviceXlibPresentationSupportKHR)
> @@ -252,7 +256,15 @@ static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCall
> static void X11DRV_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface,
> const VkAllocationCallbacks *allocator)
> {
> - FIXME("stub: %p 0x%s %p\n", instance, wine_dbgstr_longlong(surface), allocator);
> + struct wine_vk_surface *x11_surface = SURFACE_FROM_HANDLE(surface);
> +
> + TRACE("%p 0x%s %p\n", instance, wine_dbgstr_longlong(surface), allocator);
> +
> + if (allocator)
> + FIXME("Support for allocation callbacks not implemented yet\n");
> +
> + pvkDestroySurfaceKHR(instance, x11_surface->surface, NULL /* allocator */);
> + heap_free(x11_surface);
> }
I think we may need to destroy the client window.
>
> static void X11DRV_vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain,
> --
> 2.14.3
>
>
>
More information about the wine-devel
mailing list