vkr: remove FREE_POOL_OBJECTS

Expand the macro at the call sites because it is short enough.

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

@ -64,9 +64,10 @@ vkr_dispatch_vkFreeCommandBuffers(struct vn_dispatch_context *dispatch,
struct vn_command_vkFreeCommandBuffers *args)
{
struct vkr_context *ctx = dispatch->data;
struct list_head free_list;
FREE_POOL_OBJECTS(command_buffer, COMMAND_BUFFER, vkFreeCommandBuffers,
pCommandBuffers, commandBufferCount, commandPool);
vkr_command_buffer_destroy_driver_handles(ctx, args, &free_list);
vkr_context_remove_objects(ctx, &free_list);
}
static void

@ -102,14 +102,6 @@
vkr_##vkr_type##_add_array(ctx, dev, pool, &arr); \
} while (0)
#define FREE_POOL_OBJECTS(vkr_type, vk_type, vk_cmd, arg_obj, arg_count, arg_pool) \
do { \
struct list_head free_list; \
vkr_##vkr_type##_destroy_driver_handles(ctx, args, &free_list); \
\
vkr_context_remove_objects(ctx, &free_list); \
} while (0)
struct vkr_context;
struct vkr_instance;
struct vkr_physical_device;

@ -105,9 +105,10 @@ vkr_dispatch_vkFreeDescriptorSets(struct vn_dispatch_context *dispatch,
struct vn_command_vkFreeDescriptorSets *args)
{
struct vkr_context *ctx = dispatch->data;
struct list_head free_list;
FREE_POOL_OBJECTS(descriptor_set, DESCRIPTOR_SET, vkFreeDescriptorSets,
pDescriptorSets, descriptorSetCount, descriptorPool);
vkr_descriptor_set_destroy_driver_handles(ctx, args, &free_list);
vkr_context_remove_objects(ctx, &free_list);
args->ret = VK_SUCCESS;
}

Loading…
Cancel
Save