vkr: refactor pool child objects to use track_head

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Yiwei Zhang 3 years ago
parent 583961a7ed
commit de46f378cb
  1. 2
      src/venus/vkr_command_buffer.c
  2. 2
      src/venus/vkr_command_buffer.h
  3. 8
      src/venus/vkr_common.h
  4. 4
      src/venus/vkr_descriptor_set.c
  5. 2
      src/venus/vkr_descriptor_set.h
  6. 6
      src/venus/vkr_device.c

@ -33,7 +33,7 @@ vkr_dispatch_vkDestroyCommandPool(struct vn_dispatch_context *dispatch,
DESTROY_OBJECT(pool, command_pool, COMMAND_POOL, vkDestroyCommandPool, commandPool);
struct vkr_command_buffer *cmd, *tmp;
LIST_FOR_EACH_ENTRY_SAFE (cmd, tmp, &pool->command_buffers, head)
LIST_FOR_EACH_ENTRY_SAFE (cmd, tmp, &pool->command_buffers, base.track_head)
util_hash_table_remove_u64(ctx->object_table, cmd->base.id);
util_hash_table_remove_u64(ctx->object_table, pool->base.id);

@ -18,8 +18,6 @@ struct vkr_command_buffer {
struct vkr_object base;
struct vkr_device *device;
struct list_head head;
};
void

@ -125,7 +125,7 @@
obj->device = dev; \
\
/* pool objects are tracked by the pool other than the device */ \
list_add(&obj->head, &pool->vkr_type##s); \
list_add(&obj->base.track_head, &pool->vkr_type##s); \
\
util_hash_table_set_u64(ctx->object_table, obj->base.id, obj); \
} \
@ -148,15 +148,15 @@
return; \
} \
\
list_del(&obj->head); \
list_addtail(&obj->head, &free_list); \
list_del(&obj->base.track_head); \
list_addtail(&obj->base.track_head, &free_list); \
} \
\
vn_replace_##vk_cmd##_args_handle(args); \
vk_cmd(args->device, args->arg_pool, args->arg_count, args->arg_obj); \
\
struct vkr_##vkr_type *obj, *tmp; \
LIST_FOR_EACH_ENTRY_SAFE (obj, tmp, &free_list, head) \
LIST_FOR_EACH_ENTRY_SAFE (obj, tmp, &free_list, base.track_head) \
util_hash_table_remove_u64(ctx->object_table, obj->base.id); \
} while (0)

@ -72,7 +72,7 @@ vkr_dispatch_vkDestroyDescriptorPool(struct vn_dispatch_context *dispatch,
descriptorPool);
struct vkr_descriptor_set *set, *tmp;
LIST_FOR_EACH_ENTRY_SAFE (set, tmp, &pool->descriptor_sets, head)
LIST_FOR_EACH_ENTRY_SAFE (set, tmp, &pool->descriptor_sets, base.track_head)
util_hash_table_remove_u64(ctx->object_table, set->base.id);
util_hash_table_remove_u64(ctx->object_table, pool->base.id);
@ -95,7 +95,7 @@ vkr_dispatch_vkResetDescriptorPool(struct vn_dispatch_context *dispatch,
args->ret = vkResetDescriptorPool(args->device, args->descriptorPool, args->flags);
struct vkr_descriptor_set *set, *tmp;
LIST_FOR_EACH_ENTRY_SAFE (set, tmp, &pool->descriptor_sets, head)
LIST_FOR_EACH_ENTRY_SAFE (set, tmp, &pool->descriptor_sets, base.track_head)
util_hash_table_remove_u64(ctx->object_table, set->base.id);
list_inithead(&pool->descriptor_sets);
}

@ -22,8 +22,6 @@ struct vkr_descriptor_set {
struct vkr_object base;
struct vkr_device *device;
struct list_head head;
};
struct vkr_descriptor_update_template {

@ -243,7 +243,7 @@ vkr_device_object_destroy(struct vkr_context *ctx,
struct vkr_descriptor_set *set, *tmp;
LIST_FOR_EACH_ENTRY_SAFE (
set, tmp, &((struct vkr_descriptor_pool *)obj)->descriptor_sets, head)
set, tmp, &((struct vkr_descriptor_pool *)obj)->descriptor_sets, base.track_head)
util_hash_table_remove_u64(ctx->object_table, set->base.id);
break;
@ -258,8 +258,8 @@ vkr_device_object_destroy(struct vkr_context *ctx,
vkDestroyCommandPool(device, obj->handle.command_pool, NULL);
struct vkr_command_buffer *buf, *tmp;
LIST_FOR_EACH_ENTRY_SAFE (buf, tmp,
&((struct vkr_command_pool *)obj)->command_buffers, head)
LIST_FOR_EACH_ENTRY_SAFE (
buf, tmp, &((struct vkr_command_pool *)obj)->command_buffers, base.track_head)
util_hash_table_remove_u64(ctx->object_table, buf->base.id);
break;

Loading…
Cancel
Save