vkr: add vkr_descriptor_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 4068624e5c
commit c2e77fce08
  1. 5
      src/venus/vkr_descriptor_set.c
  2. 8
      src/venus/vkr_descriptor_set.h
  3. 8
      src/venus/vkr_device.c

@ -57,8 +57,7 @@ vkr_dispatch_vkDestroyDescriptorPool(struct vn_dispatch_context *dispatch,
if (!pool)
return;
vkr_context_remove_objects(ctx, &pool->descriptor_sets);
vkr_descriptor_pool_release(ctx, pool);
vkr_descriptor_pool_destroy_and_remove(ctx, args);
}
@ -78,7 +77,7 @@ vkr_dispatch_vkResetDescriptorPool(struct vn_dispatch_context *dispatch,
vn_replace_vkResetDescriptorPool_args_handle(args);
args->ret = vkResetDescriptorPool(args->device, args->descriptorPool, args->flags);
vkr_context_remove_objects(ctx, &pool->descriptor_sets);
vkr_descriptor_pool_release(ctx, pool);
list_inithead(&pool->descriptor_sets);
}

@ -8,6 +8,8 @@
#include "vkr_common.h"
#include "vkr_context.h"
struct vkr_descriptor_set_layout {
struct vkr_object base;
};
@ -50,4 +52,10 @@ vkr_context_init_descriptor_set_dispatch(struct vkr_context *ctx);
void
vkr_context_init_descriptor_update_template_dispatch(struct vkr_context *ctx);
static inline void
vkr_descriptor_pool_release(struct vkr_context *ctx, struct vkr_descriptor_pool *pool)
{
vkr_context_remove_objects(ctx, &pool->descriptor_sets);
}
#endif /* VKR_DESCRIPTOR_SET_H */

@ -282,13 +282,9 @@ vkr_device_object_destroy(struct vkr_context *ctx,
vkDestroySampler(device, obj->handle.sampler, NULL);
break;
case VK_OBJECT_TYPE_DESCRIPTOR_POOL: {
/* Destroying VkDescriptorPool frees all VkDescriptorSet objects that were allocated
* from it.
*/
/* Destroying VkDescriptorPool frees all VkDescriptorSet allocated inside. */
vkDestroyDescriptorPool(device, obj->handle.descriptor_pool, NULL);
struct vkr_descriptor_pool *pool = (struct vkr_descriptor_pool *)obj;
vkr_context_remove_objects(ctx, &pool->descriptor_sets);
vkr_descriptor_pool_release(ctx, (struct vkr_descriptor_pool *)obj);
break;
}
case VK_OBJECT_TYPE_FRAMEBUFFER:

Loading…
Cancel
Save