From 3ef5b47152f596ab04bf92aaa6e28b7cbb4cbe48 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 20 Nov 2024 10:07:41 +0100 Subject: [PATCH] panvk: wire up swapchain image creation This is also needed to properly support VK_KHR_swapchain, so we should implement it. Fixes: d970fe2e9d6 ("panfrost: Add a Vulkan driver for Midgard/Bifrost GPUs") Reviewed-by: Boris Brezillon Part-of: (cherry picked from commit 3305f772fa91fe70fb7ed80038b20fefd1b7f75e) --- .pick_status.json | 2 +- src/panfrost/vulkan/panvk_image.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index bd312f51253..131ec811fbf 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1074,7 +1074,7 @@ "description": "panvk: wire up swapchain image creation", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d970fe2e9d6a8e9997a0ce212146d62013b3b455", "notes": null diff --git a/src/panfrost/vulkan/panvk_image.c b/src/panfrost/vulkan/panvk_image.c index ec2e692b137..f58185df986 100644 --- a/src/panfrost/vulkan/panvk_image.c +++ b/src/panfrost/vulkan/panvk_image.c @@ -279,6 +279,17 @@ panvk_CreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) { VK_FROM_HANDLE(panvk_device, dev, device); + struct panvk_physical_device *phys_dev = + to_panvk_physical_device(dev->vk.physical); + + const VkImageSwapchainCreateInfoKHR *swapchain_info = + vk_find_struct_const(pCreateInfo->pNext, IMAGE_SWAPCHAIN_CREATE_INFO_KHR); + if (swapchain_info && swapchain_info->swapchain != VK_NULL_HANDLE) { + return wsi_common_create_swapchain_image(&phys_dev->wsi_device, + pCreateInfo, + swapchain_info->swapchain, + pImage); + } struct panvk_image *image = vk_image_create(&dev->vk, pCreateInfo, pAllocator, sizeof(*image));