VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT);
layout->ref_cnt = 1;
+ layout->destroy = vk_descriptor_set_layout_destroy;
}
void *
return layout;
}
+void
+vk_descriptor_set_layout_destroy(struct vk_device *device,
+ struct vk_descriptor_set_layout *layout)
+{
+ vk_object_free(device, NULL, layout);
+}
+
VKAPI_ATTR void VKAPI_CALL
vk_common_DestroyDescriptorSetLayout(VkDevice _device,
VkDescriptorSetLayout descriptorSetLayout,
struct vk_descriptor_set_layout {
struct vk_object_base base;
+ void (*destroy)(struct vk_device *device,
+ struct vk_descriptor_set_layout *layout);
+
/** Reference count
*
* It's often necessary to store a pointer to the descriptor set layout in
void *vk_descriptor_set_layout_multizalloc(struct vk_device *device,
struct vk_multialloc *ma);
+void vk_descriptor_set_layout_destroy(struct vk_device *device,
+ struct vk_descriptor_set_layout *layout);
+
static inline struct vk_descriptor_set_layout *
vk_descriptor_set_layout_ref(struct vk_descriptor_set_layout *layout)
{
{
assert(layout && layout->ref_cnt >= 1);
if (p_atomic_dec_zero(&layout->ref_cnt))
- vk_object_free(device, NULL, layout);
+ layout->destroy(device, layout);
}
#ifdef __cplusplus