pvr: implement GetDeviceImageSubresourceLayout

It's implemented like GetDeviceImageMemoryRequirements by creating a
temporary image.

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
This commit is contained in:
Icenowy Zheng 2026-05-14 01:38:27 +08:00 committed by Marge Bot
parent b5a22a43a6
commit f5a3e02797

View file

@ -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"