mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 01:30:08 +01:00
vulkan/cmd_queue: Simplify freeing cmd_queue entries
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31426>
This commit is contained in:
parent
55f4da7bbf
commit
5543272ceb
1 changed files with 5 additions and 5 deletions
|
|
@ -264,10 +264,6 @@ vk_free_${to_underscore(c.name)}(struct vk_cmd_queue *queue,
|
|||
${' ' * len('vk_free_' + to_underscore(c.name) + '(')}\\
|
||||
struct vk_cmd_queue_entry *cmd)
|
||||
{
|
||||
if (cmd->driver_free_cb)
|
||||
cmd->driver_free_cb(queue, cmd);
|
||||
else
|
||||
vk_free(queue->alloc, cmd->driver_data);
|
||||
% for p in c.params[1:]:
|
||||
% if p.len:
|
||||
vk_free(queue->alloc, (${remove_suffix(p.decl.replace("const", ""), p.name)})cmd->u.${to_struct_field_name(c.name)}.${to_field_name(p.name)});
|
||||
|
|
@ -275,7 +271,6 @@ struct vk_cmd_queue_entry *cmd)
|
|||
${get_struct_free(c, p, types)}
|
||||
% endif
|
||||
% endfor
|
||||
vk_free(queue->alloc, cmd);
|
||||
}
|
||||
|
||||
% if c.name not in manual_commands and c.name not in no_enqueue_commands:
|
||||
|
|
@ -333,6 +328,10 @@ vk_free_queue(struct vk_cmd_queue *queue)
|
|||
{
|
||||
struct vk_cmd_queue_entry *tmp, *cmd;
|
||||
LIST_FOR_EACH_ENTRY_SAFE(cmd, tmp, &queue->cmds, cmd_link) {
|
||||
if (cmd->driver_free_cb)
|
||||
cmd->driver_free_cb(queue, cmd);
|
||||
else
|
||||
vk_free(queue->alloc, cmd->driver_data);
|
||||
switch(cmd->type) {
|
||||
% for c in commands:
|
||||
% if c.guard is not None:
|
||||
|
|
@ -346,6 +345,7 @@ vk_free_queue(struct vk_cmd_queue *queue)
|
|||
% endif
|
||||
% endfor
|
||||
}
|
||||
vk_free(queue->alloc, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue