anv: implement vkGetDeviceImageMemoryRequirementsKHR

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>
This commit is contained in:
Lionel Landwerlin 2021-07-28 14:36:45 +03:00 committed by Marge Bot
parent 9058fd8979
commit 4075dd16ab
1 changed files with 21 additions and 2 deletions

View File

@ -53,8 +53,8 @@ memory_range_end(struct anv_image_memory_range memory_range)
}
/**
* Get binding for VkImagePlaneMemoryRequirementsInfo and
* VkBindImagePlaneMemoryInfo.
* Get binding for VkImagePlaneMemoryRequirementsInfo,
* VkBindImagePlaneMemoryInfo and VkDeviceImageMemoryRequirementsKHR.
*/
static struct anv_image_binding *
image_aspect_to_binding(struct anv_image *image, VkImageAspectFlags aspect)
@ -1687,6 +1687,25 @@ void anv_GetImageMemoryRequirements2(
pMemoryRequirements);
}
void anv_GetDeviceImageMemoryRequirementsKHR(
VkDevice _device,
const VkDeviceImageMemoryRequirementsKHR* pInfo,
VkMemoryRequirements2* pMemoryRequirements)
{
ANV_FROM_HANDLE(anv_device, device, _device);
struct anv_image image = { 0 };
ASSERTED VkResult result =
anv_image_init_from_create_info(device, &image, pInfo->pCreateInfo);
assert(result == VK_SUCCESS);
VkImageAspectFlags aspects =
image.disjoint ? pInfo->planeAspect : image.vk.aspects;
anv_image_get_memory_requirements(device, &image, aspects,
pMemoryRequirements);
}
void anv_GetImageSparseMemoryRequirements(
VkDevice device,
VkImage image,