diff options
author | Fredrik Höglund <[email protected]> | 2016-10-21 19:07:37 +0200 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-10-26 12:40:39 +1000 |
commit | 68db0fe0346386c8d231eb81da6340b24b7878b0 (patch) | |
tree | 6df90764a0e20e4ee693fb5b8edfab95fe2b71b4 /src/vulkan/wsi/wsi_common_wayland.c | |
parent | 972670c2007c1c5a51b4f0876d31476858f79351 (diff) |
vulkan/wsi/wayland: fix ARGB window support
Use an ARGB format for the DRM buffer when the compositeAlpha field
in VkSwapchainCreateInfoKHR is set to
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR.
Cc: "13.0" <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/vulkan/wsi/wsi_common_wayland.c')
-rw-r--r-- | src/vulkan/wsi/wsi_common_wayland.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index fc13bde4005..196ee28742f 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -702,6 +702,9 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, if (chain == NULL) return VK_ERROR_OUT_OF_HOST_MEMORY; + bool alpha = pCreateInfo->compositeAlpha == + VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR; + chain->base.device = device; chain->base.destroy = wsi_wl_swapchain_destroy; chain->base.get_images = wsi_wl_swapchain_get_images; @@ -711,7 +714,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, chain->surface = surface->surface; chain->extent = pCreateInfo->imageExtent; chain->vk_format = pCreateInfo->imageFormat; - chain->drm_format = wl_drm_format_for_vk_format(chain->vk_format, false); + chain->drm_format = wl_drm_format_for_vk_format(chain->vk_format, alpha); chain->present_mode = pCreateInfo->presentMode; chain->fifo_ready = true; |