From a084ee720990d020668f39ce6bd2d14f5b74d57a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 8 Jul 2022 15:48:53 -0500 Subject: [PATCH] vulkan/wsi/wayland: Only memcpy if the swapchain is actually software Otherwise, we'll segfault. :-( Fixes: aca545d616d8 ("vulkan/wsi/wayland: Use host pointer import when available") Reviewed-by: Jesse Natalie Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 1c87f1dfb90..4deac2ad8b7 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -1044,7 +1044,7 @@ wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, { struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; - if (!chain->base.wsi->has_import_memory_host) { + if (chain->display->sw && !chain->base.wsi->has_import_memory_host) { struct wsi_wl_image *image = &chain->images[image_index]; memcpy(image->shm_ptr, image->base.cpu_map, image->base.row_pitches[0] * chain->extent.height);