wsi/win32: Don't require buffer blits for software drivers
authorJesse Natalie <jenatali@microsoft.com>
Wed, 1 Feb 2023 20:48:24 +0000 (12:48 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 2 Feb 2023 19:48:00 +0000 (19:48 +0000)
Lavapipe can directly render to a linear CPU image and then BitBlit
straight from there.

Fixes: 2f462105 ("vulkan/wsi: Hook-up DXGI swapchains and DComp")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8085
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21049>

src/vulkan/wsi/wsi_common_win32.cpp

index 859839b..afe1cf5 100644 (file)
@@ -494,7 +494,7 @@ wsi_win32_image_init(VkDevice device_h,
    chain->chain_dc = GetDC(chain->wnd);
    image->chain = chain;
 
-   if (chain->base.blit.type != WSI_SWAPCHAIN_BUFFER_BLIT)
+   if (chain->dxgi)
       return VK_SUCCESS;
 
    image->sw.dc = CreateCompatibleDC(chain->chain_dc);
@@ -663,8 +663,6 @@ wsi_win32_queue_present(struct wsi_swapchain *drv_chain,
    if (chain->dxgi)
       return wsi_win32_queue_present_dxgi(chain, image, damage);
 
-   assert(chain->base.blit.type == WSI_SWAPCHAIN_BUFFER_BLIT);
-
    char *ptr = (char *)image->base.cpu_map;
    char *dptr = (char *)image->sw.ppvBits;