v3dv: add a get_image_memory_requirements helper

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
This commit is contained in:
Iago Toral Quiroga 2022-08-25 09:22:46 +02:00 committed by Marge Bot
parent c354ca69c6
commit 3aa623ae03

View file

@ -2459,13 +2459,10 @@ v3dv_InvalidateMappedMemoryRanges(VkDevice _device,
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL
v3dv_GetImageMemoryRequirements2(VkDevice device,
const VkImageMemoryRequirementsInfo2 *pInfo,
static void
get_image_memory_requirements(struct v3dv_image *image,
VkMemoryRequirements2 *pMemoryRequirements)
{
V3DV_FROM_HANDLE(v3dv_image, image, pInfo->image);
pMemoryRequirements->memoryRequirements = (VkMemoryRequirements) {
.memoryTypeBits = 0x1,
.alignment = image->alignment,
@ -2488,6 +2485,15 @@ v3dv_GetImageMemoryRequirements2(VkDevice device,
}
}
VKAPI_ATTR void VKAPI_CALL
v3dv_GetImageMemoryRequirements2(VkDevice device,
const VkImageMemoryRequirementsInfo2 *pInfo,
VkMemoryRequirements2 *pMemoryRequirements)
{
V3DV_FROM_HANDLE(v3dv_image, image, pInfo->image);
get_image_memory_requirements(image, pMemoryRequirements);
}
static void
bind_image_memory(const VkBindImageMemoryInfo *info)
{