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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6028>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-01-22 16:48:30 +01:00 committed by GStreamer Marge Bot
parent 0fd76c2848
commit 2c660ee8f5

View file

@ -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;
}