From 3aa6c27c264fbcb1a6c7c6d6b5ee71b59d2d0977 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 24 Apr 2024 17:21:51 -0300 Subject: [PATCH] vulkan/image: Use GENERAL for initial layout of DMA-BUF textures The VK_IMAGE_LAYOUT_UNDEFINED layout means that the data hold by the texture can be discarded, and we don't want to discard it. Because the Vulkan spec is unclear (see [1] for a discussion), err on the side of caution and use VK_IMAGE_LAYOUT_GENERAL. Fixes import failures with WebKit. [1] https://github.com/ValveSoftware/gamescope/issues/356 --- gsk/gpu/gskvulkanimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/gpu/gskvulkanimage.c b/gsk/gpu/gskvulkanimage.c index c58b6c570c..ad024594f5 100644 --- a/gsk/gpu/gskvulkanimage.c +++ b/gsk/gpu/gskvulkanimage.c @@ -825,7 +825,7 @@ gsk_vulkan_image_new_for_dmabuf (GskVulkanDevice *device, self->vk_tiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT; self->vk_format = vk_format; self->vk_pipeline_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - self->vk_image_layout = VK_IMAGE_LAYOUT_UNDEFINED; + self->vk_image_layout = VK_IMAGE_LAYOUT_GENERAL; self->vk_access = 0; res = vkCreateImage (vk_device,