From f1c4c646b8a3b0c930c1fcb376761b4561c759e3 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Mon, 12 Dec 2022 15:13:06 -0800 Subject: [PATCH] anv: remove anv_reloc_list_grow() The last commit made it clear that anv_reloc_list_grow() only ever gets called with zero as num_additional_relocs, which means it will always immediately return VK_SUCCESS without doing anything. That means we can remove it. Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_batch_chain.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 071c8a1990d..08cac73723d 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -91,31 +91,6 @@ anv_reloc_list_finish(struct anv_reloc_list *list, vk_free(alloc, list->deps); } -static VkResult -anv_reloc_list_grow(struct anv_reloc_list *list, - const VkAllocationCallbacks *alloc, - size_t num_additional_relocs) -{ - if (num_additional_relocs <= list->array_length) - return VK_SUCCESS; - - size_t new_length = MAX2(16, list->array_length * 2); - while (new_length < num_additional_relocs) - new_length *= 2; - - struct anv_bo **new_reloc_bos = - vk_realloc(alloc, list->reloc_bos, - new_length * sizeof(*list->reloc_bos), 8, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - if (new_reloc_bos == NULL) - return vk_error(NULL, VK_ERROR_OUT_OF_HOST_MEMORY); - list->reloc_bos = new_reloc_bos; - - list->array_length = new_length; - - return VK_SUCCESS; -} - static VkResult anv_reloc_list_grow_deps(struct anv_reloc_list *list, const VkAllocationCallbacks *alloc, @@ -173,10 +148,6 @@ anv_reloc_list_append(struct anv_reloc_list *list, const VkAllocationCallbacks *alloc, struct anv_reloc_list *other) { - VkResult result = anv_reloc_list_grow(list, alloc, 0); - if (result != VK_SUCCESS) - return result; - anv_reloc_list_grow_deps(list, alloc, other->dep_words); for (uint32_t w = 0; w < other->dep_words; w++) list->deps[w] |= other->deps[w];