vktrash: add mini_object_unref destroy function

This commit is contained in:
Matthew Waters 2019-06-19 15:28:42 +10:00
parent b93de8b0d8
commit dbf60a1738
2 changed files with 32 additions and 13 deletions

View file

@ -156,15 +156,15 @@ G_PASTE(gst_vulkan_trash_new_free_,type_name) (GstVulkanFence * fence, \
return trash; \ return trash; \
} }
FREE_DESTROY_FUNC (vkDestroyDescriptorPool, VkDescriptorPool, descriptor_pool) FREE_DESTROY_FUNC (vkDestroyDescriptorPool, VkDescriptorPool, descriptor_pool);
FREE_DESTROY_FUNC (vkDestroyDescriptorSetLayout, VkDescriptorSetLayout, FREE_DESTROY_FUNC (vkDestroyDescriptorSetLayout, VkDescriptorSetLayout,
descriptor_set_layout) descriptor_set_layout);
FREE_DESTROY_FUNC (vkDestroyFramebuffer, VkFramebuffer, framebuffer) FREE_DESTROY_FUNC (vkDestroyFramebuffer, VkFramebuffer, framebuffer);
FREE_DESTROY_FUNC (vkDestroyPipeline, VkPipeline, pipeline) FREE_DESTROY_FUNC (vkDestroyPipeline, VkPipeline, pipeline);
FREE_DESTROY_FUNC (vkDestroyPipelineLayout, VkPipelineLayout, pipeline_layout) FREE_DESTROY_FUNC (vkDestroyPipelineLayout, VkPipelineLayout, pipeline_layout);
FREE_DESTROY_FUNC (vkDestroyRenderPass, VkRenderPass, render_pass) FREE_DESTROY_FUNC (vkDestroyRenderPass, VkRenderPass, render_pass);
FREE_DESTROY_FUNC (vkDestroySemaphore, VkSemaphore, semaphore) FREE_DESTROY_FUNC (vkDestroySemaphore, VkSemaphore, semaphore)
FREE_DESTROY_FUNC (vkDestroySampler, VkSampler, sampler) FREE_DESTROY_FUNC (vkDestroySampler, VkSampler, sampler);
#define FREE_WITH_GST_PARENT(func, type, type_name, parent_type, parent_resource) \ #define FREE_WITH_GST_PARENT(func, type, type_name, parent_type, parent_resource) \
struct G_PASTE(free_parent_info_,type_name) \ struct G_PASTE(free_parent_info_,type_name) \
{ \ { \
@ -194,7 +194,7 @@ G_PASTE(gst_vulkan_trash_new_free_,type_name) (GstVulkanFence * fence, \
return trash; \ return trash; \
} }
FREE_WITH_GST_PARENT (vkFreeCommandBuffers, VkCommandBuffer, command_buffer, FREE_WITH_GST_PARENT (vkFreeCommandBuffers, VkCommandBuffer, command_buffer,
GstVulkanCommandPool *,->pool) GstVulkanCommandPool *,->pool);
#define FREE_WITH_VK_PARENT(func, type, type_name, parent_type) \ #define FREE_WITH_VK_PARENT(func, type, type_name, parent_type) \
struct G_PASTE(free_parent_info_,type_name) \ struct G_PASTE(free_parent_info_,type_name) \
{ \ { \
@ -224,7 +224,7 @@ G_PASTE(gst_vulkan_trash_new_free_,type_name) (GstVulkanFence * fence, \
return trash; \ return trash; \
} }
FREE_WITH_VK_PARENT (vkFreeDescriptorSets, VkDescriptorSet, descriptor_set, FREE_WITH_VK_PARENT (vkFreeDescriptorSets, VkDescriptorSet, descriptor_set,
VkDescriptorPool) VkDescriptorPool);
static void static void
_trash_object_unref (GstVulkanDevice * device, GstObject * object) _trash_object_unref (GstVulkanDevice * device, GstObject * object)
@ -241,3 +241,20 @@ gst_vulkan_trash_new_object_unref (GstVulkanFence * fence, GstObject * object)
(GstVulkanTrashNotify) _trash_object_unref, object); (GstVulkanTrashNotify) _trash_object_unref, object);
return trash; return trash;
} }
static void
_trash_mini_object_unref (GstVulkanDevice * device, GstMiniObject * object)
{
gst_mini_object_unref (object);
}
GstVulkanTrash *
gst_vulkan_trash_new_mini_object_unref (GstVulkanFence * fence,
GstMiniObject * object)
{
GstVulkanTrash *trash;
g_return_val_if_fail (object != NULL, NULL);
trash = gst_vulkan_trash_new (fence,
(GstVulkanTrashNotify) _trash_mini_object_unref, object);
return trash;
}

View file

@ -67,6 +67,8 @@ GstVulkanTrash * gst_vulkan_trash_new_free_descriptor_set (GstVulkanFe
GstVulkanTrash * gst_vulkan_trash_new_object_unref (GstVulkanFence * fence, GstVulkanTrash * gst_vulkan_trash_new_object_unref (GstVulkanFence * fence,
GstObject * object); GstObject * object);
GstVulkanTrash * gst_vulkan_trash_new_mini_object_unref (GstVulkanFence * fence,
GstMiniObject * object);
void gst_vulkan_trash_free (GstVulkanTrash * trash); void gst_vulkan_trash_free (GstVulkanTrash * trash);