From f5a3e02797842fa5f9d8bbceca48d1c2e99f6453 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Thu, 14 May 2026 01:38:27 +0800 Subject: [PATCH] pvr: implement GetDeviceImageSubresourceLayout It's implemented like GetDeviceImageMemoryRequirements by creating a temporary image. Signed-off-by: Icenowy Zheng Reviewed-by: Frank Binns Part-of: --- src/imagination/vulkan/pvr_image.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/imagination/vulkan/pvr_image.c b/src/imagination/vulkan/pvr_image.c index 1715d554169..654ba7761a0 100644 --- a/src/imagination/vulkan/pvr_image.c +++ b/src/imagination/vulkan/pvr_image.c @@ -440,6 +440,26 @@ void pvr_GetImageSubresourceLayout2(VkDevice device, &pLayout->subresourceLayout); } +void pvr_GetDeviceImageSubresourceLayout( + VkDevice _device, + const VkDeviceImageSubresourceInfo *pInfo, + VkSubresourceLayout2 *pLayout) +{ + VK_FROM_HANDLE(pvr_device, device, _device); + struct pvr_image image = { 0 }; + + vk_image_init(&device->vk, &image.vk, pInfo->pCreateInfo); + pvr_image_init(device, pInfo->pCreateInfo, &image); + + pvr_GetImageSubresourceLayout2(_device, + pvr_image_to_handle(&image), + pInfo->pSubresource, + pLayout); + + pvr_image_fini(device, &image); + vk_image_finish(&image.vk); +} + /* Leave this at the very end, to avoid leakage of HW-defs here */ #define PVR_BUILD_ARCH_ROGUE #include "pvr_csb.h"