vulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path

Fixes: 4bdf8547f4 "vulkan/wsi: Implement VK_KHR_swapchain_mutable_format"

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>
(cherry picked from commit 8299d5f37f)
This commit is contained in:
Jason Ekstrand 2021-07-22 18:38:20 -05:00 committed by Eric Engestrom
parent d594032257
commit 675c2dabd3
2 changed files with 6 additions and 2 deletions

View file

@ -3064,7 +3064,7 @@
"description": "vulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "4bdf8547f4dc1a383bf4e67110f44610a3790189"
},

View file

@ -531,7 +531,7 @@ wsi_create_prime_image(const struct wsi_swapchain *chain,
.sType = VK_STRUCTURE_TYPE_WSI_IMAGE_CREATE_INFO_MESA,
.prime_blit_src = true,
};
const VkImageCreateInfo image_info = {
VkImageCreateInfo image_info = {
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
.pNext = &image_wsi_info,
.flags = 0,
@ -552,6 +552,10 @@ wsi_create_prime_image(const struct wsi_swapchain *chain,
.pQueueFamilyIndices = pCreateInfo->pQueueFamilyIndices,
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
};
if (pCreateInfo->flags & VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR) {
image_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT |
VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR;
}
result = wsi->CreateImage(chain->device, &image_info,
&chain->alloc, &image->image);
if (result != VK_SUCCESS)