vkr: add vkr_command_pool_release

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Yiwei Zhang 3 years ago
parent 25bbf4b020
commit 4068624e5c
  1. 3
      src/venus/vkr_command_buffer.c
  2. 8
      src/venus/vkr_command_buffer.h
  3. 8
      src/venus/vkr_device.c

@ -28,8 +28,7 @@ vkr_dispatch_vkDestroyCommandPool(struct vn_dispatch_context *dispatch,
if (!pool)
return;
vkr_context_remove_objects(ctx, &pool->command_buffers);
vkr_command_pool_release(ctx, pool);
vkr_command_pool_destroy_and_remove(ctx, args);
}

@ -8,6 +8,8 @@
#include "vkr_common.h"
#include "vkr_context.h"
struct vkr_command_pool {
struct vkr_object base;
@ -28,4 +30,10 @@ vkr_context_init_command_pool_dispatch(struct vkr_context *ctx);
void
vkr_context_init_command_buffer_dispatch(struct vkr_context *ctx);
static inline void
vkr_command_pool_release(struct vkr_context *ctx, struct vkr_command_pool *pool)
{
vkr_context_remove_objects(ctx, &pool->command_buffers);
}
#endif /* VKR_COMMAND_BUFFER_H */

@ -295,13 +295,9 @@ vkr_device_object_destroy(struct vkr_context *ctx,
vkDestroyFramebuffer(device, obj->handle.framebuffer, NULL);
break;
case VK_OBJECT_TYPE_COMMAND_POOL: {
/* Destroying VkCommandPool frees all VkCommandBuffer objects that were allocated
* from it.
*/
/* Destroying VkCommandPool frees all VkCommandBuffer allocated inside. */
vkDestroyCommandPool(device, obj->handle.command_pool, NULL);
struct vkr_command_pool *pool = (struct vkr_command_pool *)obj;
vkr_context_remove_objects(ctx, &pool->command_buffers);
vkr_command_pool_release(ctx, (struct vkr_command_pool *)obj);
break;
}
case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION:

Loading…
Cancel
Save