1 /* 2 * Copyright 2020 Google LLC 3 * SPDX-License-Identifier: MIT 4 */ 5 6 #ifndef VKR_COMMAND_BUFFER_H 7 #define VKR_COMMAND_BUFFER_H 8 9 #include "vkr_common.h" 10 11 #include "vkr_context.h" 12 13 struct vkr_command_pool { 14 struct vkr_object base; 15 16 struct list_head command_buffers; 17 }; 18 VKR_DEFINE_OBJECT_CAST(command_pool, VK_OBJECT_TYPE_COMMAND_POOL, VkCommandPool) 19 20 struct vkr_command_buffer { 21 struct vkr_object base; 22 23 struct vkr_device *device; 24 }; 25 VKR_DEFINE_OBJECT_CAST(command_buffer, VK_OBJECT_TYPE_COMMAND_BUFFER, VkCommandBuffer) 26 27 void 28 vkr_context_init_command_pool_dispatch(struct vkr_context *ctx); 29 30 void 31 vkr_context_init_command_buffer_dispatch(struct vkr_context *ctx); 32 33 static inline void vkr_command_pool_release(struct vkr_context * ctx,struct vkr_command_pool * pool)34vkr_command_pool_release(struct vkr_context *ctx, struct vkr_command_pool *pool) 35 { 36 vkr_context_remove_objects(ctx, &pool->command_buffers); 37 } 38 39 #endif /* VKR_COMMAND_BUFFER_H */ 40