diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 049c2edfd3c..185e2409b34 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3052,8 +3052,8 @@ VkResult anv_init_sparse_bindings(struct anv_device *device, enum anv_bo_alloc_flags alloc_flags, uint64_t client_address, struct anv_address *out_address); -VkResult anv_free_sparse_bindings(struct anv_device *device, - struct anv_sparse_binding_data *sparse); +void anv_free_sparse_bindings(struct anv_device *device, + struct anv_sparse_binding_data *sparse); VkResult anv_sparse_bind_buffer(struct anv_device *device, struct anv_buffer *buffer, const VkSparseMemoryBind *vk_bind, diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index a4fa29462f4..09e57d353d5 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -658,12 +658,12 @@ anv_init_sparse_bindings(struct anv_device *device, return VK_SUCCESS; } -VkResult +void anv_free_sparse_bindings(struct anv_device *device, struct anv_sparse_binding_data *sparse) { if (!sparse->address) - return VK_SUCCESS; + return; sparse_debug("%s: address:0x%016"PRIx64" size:0x%08"PRIx64"\n", __func__, sparse->address, sparse->size); @@ -686,12 +686,16 @@ anv_free_sparse_bindings(struct anv_device *device, .signal_count = 0, }; VkResult res = anv_sparse_bind(device, &submit); + + /* Our callers don't have a way to signal failure to the upper layers, so + * just keep the vma if we fail to unbind it. Still, let's have an + * assertion because this really shouldn't be happening. + */ + assert(res == VK_SUCCESS); if (res != VK_SUCCESS) - return res; + return; anv_vma_free(device, sparse->vma_heap, sparse->address, sparse->size); - - return VK_SUCCESS; } static VkExtent3D