From fe7c9986662582edfe86bc11067253ea526adf38 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 5 May 2023 14:33:42 +0200 Subject: [PATCH] render/vulkan: use identity swizzle for YCbCr formats Fixes the following validation error: [ VUID-VkImageViewCreateInfo-pNext-01970 ] Object 0: handle = 0x62e00003c400, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xf378e14b | vkCreateImageView(): If there is a VkSamplerYcbcrConversion, the imageView must be created with the identity swizzle. --- render/vulkan/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c index 296afc25..75679ecc 100644 --- a/render/vulkan/texture.c +++ b/render/vulkan/texture.c @@ -681,7 +681,7 @@ static struct wlr_vk_texture *vulkan_texture_from_dmabuf( .components.r = VK_COMPONENT_SWIZZLE_IDENTITY, .components.g = VK_COMPONENT_SWIZZLE_IDENTITY, .components.b = VK_COMPONENT_SWIZZLE_IDENTITY, - .components.a = texture->has_alpha + .components.a = texture->has_alpha || fmt->format.is_ycbcr ? VK_COMPONENT_SWIZZLE_IDENTITY : VK_COMPONENT_SWIZZLE_ONE,