summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2016-10-21 19:07:37 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-27 11:20:16 +0100
commitfbfc01e654c4afc73bb91030448b02edb7f0efda (patch)
treef3bdda4e44b448184ddf21b94b564b07a6f5ce6c /src/vulkan
parent100851b1f55be508745432eebbd76235ebbdd327 (diff)
downloadexternal_mesa3d-fbfc01e654c4afc73bb91030448b02edb7f0efda.zip
external_mesa3d-fbfc01e654c4afc73bb91030448b02edb7f0efda.tar.gz
external_mesa3d-fbfc01e654c4afc73bb91030448b02edb7f0efda.tar.bz2
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" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 68db0fe0346386c8d231eb81da6340b24b7878b0)
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c5
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 fc13bde..196ee28 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;