From 2c660ee8f5b7e0947a8bb643e4da2b5b64e679b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 22 Jan 2024 16:48:30 +0100 Subject: [PATCH] vkupload: remove unused parameter fetching It's not required to create a vulkan buffer to fetch its size since all this handled by internally by the allocator and it was never needed, so it looks like dead code. Let's delete it. Part-of: --- .../gst-plugins-bad/ext/vulkan/vkupload.c | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c b/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c index 1905f65104..bf12afbadb 100644 --- a/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c +++ b/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c @@ -186,8 +186,6 @@ struct RawToBufferUpload GstVideoInfo in_info; GstVideoInfo out_info; - - gsize alloc_sizes[GST_VIDEO_MAX_PLANES]; }; static gpointer @@ -223,12 +221,6 @@ static gboolean _raw_to_buffer_set_caps (gpointer impl, GstCaps * in_caps, GstCaps * out_caps) { struct RawToBufferUpload *raw = impl; - guint out_width, out_height; - guint i; - VkFormat vk_fmts[4] = { VK_FORMAT_UNDEFINED, }; - VkImageUsageFlags usage = - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; - int n_imgs; if (!gst_video_info_from_caps (&raw->in_info, in_caps)) return FALSE; @@ -236,27 +228,6 @@ _raw_to_buffer_set_caps (gpointer impl, GstCaps * in_caps, GstCaps * out_caps) if (!gst_video_info_from_caps (&raw->out_info, out_caps)) return FALSE; - out_width = GST_VIDEO_INFO_WIDTH (&raw->out_info); - out_height = GST_VIDEO_INFO_HEIGHT (&raw->out_info); - - if (!gst_vulkan_format_from_video_info_2 (raw->upload-> - device->physical_device, &raw->out_info, VK_IMAGE_TILING_OPTIMAL, - FALSE, usage, vk_fmts, &n_imgs, NULL)) - return FALSE; - - for (i = 0; i < n_imgs; i++) { - GstVulkanImageMemory *img_mem; - - img_mem = (GstVulkanImageMemory *) - gst_vulkan_image_memory_alloc (raw->upload->device, vk_fmts[i], - out_width, out_height, VK_IMAGE_TILING_OPTIMAL, usage, - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - - raw->alloc_sizes[i] = img_mem->requirements.size; - - gst_memory_unref (GST_MEMORY_CAST (img_mem)); - } - return TRUE; }