From 0e339c7a6411995bb051f0c87019ba26ca9c3726 Mon Sep 17 00:00:00 2001 From: Aksel Hjerpbakk Date: Mon, 11 Aug 2025 08:48:13 +0000 Subject: [PATCH] panvk: clear big_bos on cmd pool reset with release bit Clear big bos cache if the the user calls vkResetCommandPool with VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT. Reviewed-by: Christoph Pillmayer Reviewed-by: Eric R. Smith Part-of: --- src/panfrost/vulkan/panvk_cmd_pool.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/panfrost/vulkan/panvk_cmd_pool.c b/src/panfrost/vulkan/panvk_cmd_pool.c index a0b89f747d9..358b5bfcbbe 100644 --- a/src/panfrost/vulkan/panvk_cmd_pool.c +++ b/src/panfrost/vulkan/panvk_cmd_pool.c @@ -12,6 +12,7 @@ #include "panvk_cmd_pool.h" #include "panvk_device.h" #include "panvk_entrypoints.h" +#include "vk_common_entrypoints.h" #include "vk_alloc.h" #include "vk_log.h" @@ -73,3 +74,18 @@ panvk_DestroyCommandPool(VkDevice _device, VkCommandPool commandPool, vk_free2(&device->vk.alloc, pAllocator, pool); } + +VKAPI_ATTR VkResult VKAPI_CALL +panvk_ResetCommandPool(VkDevice _device, VkCommandPool commandPool, + VkCommandPoolResetFlags flags) +{ + VK_FROM_HANDLE(panvk_cmd_pool, pool, commandPool); + + const bool release_resources = + (flags & VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT) != 0; + if (release_resources) { + panvk_bo_pool_cleanup(&pool->tls_big_bo_pool); + } + + return vk_common_ResetCommandPool(_device, commandPool, flags); +}