aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-05-05 14:33:42 +0200
committerSimon Ser <contact@emersion.fr>2023-05-24 08:58:59 +0000
commitfe7c9986662582edfe86bc11067253ea526adf38 (patch)
treec832ac042236a09da6c3f556d28c577d8abab9db /render
parent091aa5582a228e1117b74f8d8ec12c7c12376742 (diff)
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.
Diffstat (limited to 'render')
-rw-r--r--render/vulkan/texture.c2
1 files changed, 1 insertions, 1 deletions
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,