From 6fe5129d3db36b230a3b7d86bfbbdfee47081856 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 29 May 2024 15:54:30 +0200 Subject: [PATCH] panvk: Override the default GetRender[in]AreaGranularityKHR() Expose the real optimal render area granularity to users, so they can optimize their rendering operations accordingly. Signed-off-by: Boris Brezillon Suggested-by: Erik Faye-Lund Acked-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/panvk_vX_device.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/panfrost/vulkan/panvk_vX_device.c b/src/panfrost/vulkan/panvk_vX_device.c index cb7573bc9e6..744dd045173 100644 --- a/src/panfrost/vulkan/panvk_vX_device.c +++ b/src/panfrost/vulkan/panvk_vX_device.c @@ -217,3 +217,19 @@ panvk_per_arch(destroy_device)(struct panvk_device *device, pan_kmod_dev_destroy(device->kmod.dev); vk_free(&device->vk.alloc, device); } + +VKAPI_ATTR void VKAPI_CALL +panvk_per_arch(GetRenderAreaGranularity)(VkDevice device, + VkRenderPass renderPass, + VkExtent2D *pGranularity) +{ + *pGranularity = (VkExtent2D){32, 32}; +} + +VKAPI_ATTR void VKAPI_CALL +panvk_per_arch(GetRenderingAreaGranularityKHR)( + VkDevice _device, const VkRenderingAreaInfoKHR *pRenderingAreaInfo, + VkExtent2D *pGranularity) +{ + *pGranularity = (VkExtent2D){32, 32}; +}