vkr: rename some macros to be more intuitive

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Yiwei Zhang 3 years ago
parent 3e7dac5835
commit 304f5e1d78
  1. 4
      src/venus/vkr_command_buffer.c
  2. 6
      src/venus/vkr_common.h
  3. 4
      src/venus/vkr_descriptor_set.c
  4. 4
      src/venus/vkr_pipeline.c

@ -59,7 +59,7 @@ vkr_dispatch_vkAllocateCommandBuffers(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
ALLOCATE_OBJECT_ARRAY(cmd, command_buffer, COMMAND_BUFFER, CommandBuffer,
ALLOCATE_POOL_OBJECTS(cmd, command_buffer, COMMAND_BUFFER, CommandBuffer,
vkAllocateCommandBuffers, commandBufferCount, commandPool,
command_pool, COMMAND_POOL);
}
@ -70,7 +70,7 @@ vkr_dispatch_vkFreeCommandBuffers(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
FREE_OBJECT_ARRAY(cmd, command_buffer, COMMAND_BUFFER, vkFreeCommandBuffers,
FREE_POOL_OBJECTS(cmd, command_buffer, COMMAND_BUFFER, vkFreeCommandBuffers,
pCommandBuffers, commandBufferCount, commandPool);
}

@ -87,7 +87,7 @@
\
list_del(&obj->base.track_head)
#define ALLOCATE_OBJECT_ARRAY(obj, vkr_type, vk_type, vk_obj, vk_cmd, arg_count, \
#define ALLOCATE_POOL_OBJECTS(obj, vkr_type, vk_type, vk_obj, vk_cmd, arg_count, \
arg_pool, vkr_pool_type, vk_pool_type) \
do { \
struct vkr_device *dev = (struct vkr_device *)args->device; \
@ -141,7 +141,7 @@
util_hash_table_remove_u64(ctx->object_table, obj->id); \
} while (0)
#define FREE_OBJECT_ARRAY(obj, vkr_type, vk_type, vk_cmd, arg_obj, arg_count, arg_pool) \
#define FREE_POOL_OBJECTS(obj, vkr_type, vk_type, vk_cmd, arg_obj, arg_count, arg_pool) \
do { \
struct list_head free_list; \
\
@ -165,7 +165,7 @@
RELEASE_TRACKED_OBJECTS(&free_list); \
} while (0)
#define CREATE_PIPELINE_ARRAY(vk_cmd) \
#define CREATE_PIPELINES(vk_cmd) \
do { \
struct vkr_device *dev = (struct vkr_device *)args->device; \
if (!dev || dev->base.type != VK_OBJECT_TYPE_DEVICE) { \

@ -103,7 +103,7 @@ vkr_dispatch_vkAllocateDescriptorSets(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
ALLOCATE_OBJECT_ARRAY(set, descriptor_set, DESCRIPTOR_SET, DescriptorSet,
ALLOCATE_POOL_OBJECTS(set, descriptor_set, DESCRIPTOR_SET, DescriptorSet,
vkAllocateDescriptorSets, descriptorSetCount, descriptorPool,
descriptor_pool, DESCRIPTOR_POOL);
}
@ -114,7 +114,7 @@ vkr_dispatch_vkFreeDescriptorSets(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
FREE_OBJECT_ARRAY(set, descriptor_set, DESCRIPTOR_SET, vkFreeDescriptorSets,
FREE_POOL_OBJECTS(set, descriptor_set, DESCRIPTOR_SET, vkFreeDescriptorSets,
pDescriptorSets, descriptorSetCount, descriptorPool);
args->ret = VK_SUCCESS;

@ -107,7 +107,7 @@ vkr_dispatch_vkCreateGraphicsPipelines(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
CREATE_PIPELINE_ARRAY(vkCreateGraphicsPipelines);
CREATE_PIPELINES(vkCreateGraphicsPipelines);
}
static void
@ -116,7 +116,7 @@ vkr_dispatch_vkCreateComputePipelines(struct vn_dispatch_context *dispatch,
{
struct vkr_context *ctx = dispatch->data;
CREATE_PIPELINE_ARRAY(vkCreateComputePipelines);
CREATE_PIPELINES(vkCreateComputePipelines);
}
static void

Loading…
Cancel
Save