Module: Mesa
Branch: main
Commit: 2170ec28452ec3507f0da3e75c86e11386203a2c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2170ec28452ec3507f0da3e75c86e11386203a2c

Author: Jason Ekstrand <[email protected]>
Date:   Mon Feb  7 15:25:38 2022 -0600

anv: Don't use vk_alloc/free2 for command buffers

The pool will always have a valid allocator.

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14917>

---

 src/intel/vulkan/anv_cmd_buffer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_cmd_buffer.c 
b/src/intel/vulkan/anv_cmd_buffer.c
index a2647a4a622..0aae0eac1c2 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -270,8 +270,8 @@ static VkResult anv_create_cmd_buffer(
    struct anv_cmd_buffer *cmd_buffer;
    VkResult result;
 
-   cmd_buffer = vk_alloc2(&device->vk.alloc, &pool->vk.alloc, 
sizeof(*cmd_buffer),
-                          8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+   cmd_buffer = vk_alloc(&pool->vk.alloc, sizeof(*cmd_buffer), 8,
+                         VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (cmd_buffer == NULL)
       return vk_error(pool, VK_ERROR_OUT_OF_HOST_MEMORY);
 
@@ -365,8 +365,7 @@ anv_cmd_buffer_destroy(struct anv_cmd_buffer *cmd_buffer)
    vk_free(&cmd_buffer->pool->vk.alloc, cmd_buffer->self_mod_locations);
 
    vk_command_buffer_finish(&cmd_buffer->vk);
-   vk_free2(&cmd_buffer->device->vk.alloc, &cmd_buffer->pool->vk.alloc,
-            cmd_buffer);
+   vk_free(&cmd_buffer->pool->vk.alloc, cmd_buffer);
 }
 
 void anv_FreeCommandBuffers(

Reply via email to