vulkan/wsi/wayland: Only memcpy if the swapchain is actually software

Otherwise, we'll segfault. :-(

Fixes: aca545d616 ("vulkan/wsi/wayland: Use host pointer import when available")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17434>
This commit is contained in:
Jason Ekstrand 2022-07-08 15:48:53 -05:00 committed by Marge Bot
parent e0e2294f47
commit a084ee7209
1 changed files with 1 additions and 1 deletions

View File

@ -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);