From 99b5970eb246955335c6161bc1f80fc0bef6e6a1 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 3 Mar 2025 17:49:14 -0600 Subject: [PATCH] egl/wayland: Pass the original wl_surface to kopper The Vulkan WSI code creates its own proxies so there's no benefit to passing the proxy in. It only screws things up. Fixes: 8ade5588e39d ("zink: add kopper api") Reviewed-by: Mike Blumenkrantz Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 00063ca42b1..e59325e4d81 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2935,7 +2935,13 @@ kopperSetSurfaceCreateInfo(void *_draw, struct kopper_loader_info *out) wlsci->pNext = NULL; wlsci->flags = 0; wlsci->display = dri2_dpy->wl_dpy; - wlsci->surface = dri2_surf->wl_surface_wrapper; + /* Pass the original wl_surface through to Vulkan WSI. If we pass the + * proxy wrapper, kopper won't be able to properly de-duplicate surfaces + * and we may end up creating two VkSurfaceKHRs for the same underlying + * wl_surface. Vulkan WSI (which kopper calls into) will make its own + * queues and proxy wrappers. + */ + wlsci->surface = get_wl_surface(dri2_surf->base.NativeSurface); out->present_opaque = dri2_surf->base.PresentOpaque; /* convert to vulkan constants */ switch (dri2_surf->base.CompressionRate) {