From f12e052e54309fc34c273efcf7b8a3494fbe0883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 27 Apr 2023 11:37:34 +0200 Subject: [PATCH] vulkan: use VK_QUEUE_FAMILY_IGNORED in barriers Instead of using the valid queue family 0 (zero) if there aren't queue transfers there's no need to specify a not validated queue family, but just VK_QUEUE_FAMILY_IGNORED. Part-of: --- .../gst-plugins-bad/ext/vulkan/vkcolorconvert.c | 8 ++++---- .../gst-plugins-bad/ext/vulkan/vkdownload.c | 8 ++++---- .../ext/vulkan/vkoverlaycompositor.c | 8 ++++---- .../gst-plugins-bad/ext/vulkan/vkupload.c | 16 ++++++++-------- .../gst-libs/gst/vulkan/gstvkfullscreenquad.c | 8 ++++---- .../gst-libs/gst/vulkan/gstvkswapper.c | 12 ++++++------ 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/vulkan/vkcolorconvert.c b/subprojects/gst-plugins-bad/ext/vulkan/vkcolorconvert.c index 82ad5982b9..1e1c0e21b8 100644 --- a/subprojects/gst-plugins-bad/ext/vulkan/vkcolorconvert.c +++ b/subprojects/gst-plugins-bad/ext/vulkan/vkcolorconvert.c @@ -1367,8 +1367,8 @@ gst_vulkan_color_convert_transform (GstBaseTransform * bt, GstBuffer * inbuf, .oldLayout = render_img_mems[i]->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = render_img_mems[i]->image, .subresourceRange = render_img_mems[i]->barrier.subresource_range }; @@ -1380,8 +1380,8 @@ gst_vulkan_color_convert_transform (GstBaseTransform * bt, GstBuffer * inbuf, .oldLayout = out_img_mems[i]->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = out_img_mems[i]->image, .subresourceRange = out_img_mems[i]->barrier.subresource_range }; diff --git a/subprojects/gst-plugins-bad/ext/vulkan/vkdownload.c b/subprojects/gst-plugins-bad/ext/vulkan/vkdownload.c index c513cabd91..b1ff89bf7c 100644 --- a/subprojects/gst-plugins-bad/ext/vulkan/vkdownload.c +++ b/subprojects/gst-plugins-bad/ext/vulkan/vkdownload.c @@ -248,8 +248,8 @@ _image_to_raw_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf) .oldLayout = img_mem->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = img_mem->image, .subresourceRange = img_mem->barrier.subresource_range }; @@ -260,8 +260,8 @@ _image_to_raw_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf) .srcAccessMask = buf_mem->barrier.parent.access_flags, .dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .buffer = buf_mem->buffer, .offset = region.bufferOffset, .size = region.bufferRowLength * region.bufferImageHeight diff --git a/subprojects/gst-plugins-bad/ext/vulkan/vkoverlaycompositor.c b/subprojects/gst-plugins-bad/ext/vulkan/vkoverlaycompositor.c index bdc7e703b4..5879ac258c 100644 --- a/subprojects/gst-plugins-bad/ext/vulkan/vkoverlaycompositor.c +++ b/subprojects/gst-plugins-bad/ext/vulkan/vkoverlaycompositor.c @@ -204,8 +204,8 @@ vk_overlay_upload (struct vk_overlay *overlay, GstVideoInfo * out_info, .srcAccessMask = buf_mem->barrier.parent.access_flags, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .buffer = buf_mem->buffer, .offset = region.bufferOffset, .size = region.bufferRowLength * region.bufferImageHeight, @@ -219,8 +219,8 @@ vk_overlay_upload (struct vk_overlay *overlay, GstVideoInfo * out_info, .oldLayout = img_mem->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = img_mem->image, .subresourceRange = img_mem->barrier.subresource_range, }; diff --git a/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c b/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c index f49ac0140e..8c984bcba2 100644 --- a/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c +++ b/subprojects/gst-plugins-bad/ext/vulkan/vkupload.c @@ -539,8 +539,8 @@ _buffer_to_image_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf) .oldLayout = img_mem->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = img_mem->image, .subresourceRange = img_mem->barrier.subresource_range }; @@ -551,8 +551,8 @@ _buffer_to_image_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf) .srcAccessMask = buf_mem->barrier.parent.access_flags, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .buffer = buf_mem->buffer, .offset = region.bufferOffset, .size = region.bufferRowLength * region.bufferImageHeight @@ -922,8 +922,8 @@ _raw_to_image_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf) .srcAccessMask = buf_mem->barrier.parent.access_flags, .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .buffer = buf_mem->buffer, .offset = region.bufferOffset, .size = region.bufferRowLength * region.bufferImageHeight, @@ -937,8 +937,8 @@ _raw_to_image_perform (gpointer impl, GstBuffer * inbuf, GstBuffer ** outbuf) .oldLayout = img_mem->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = img_mem->image, .subresourceRange = img_mem->barrier.subresource_range, }; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkfullscreenquad.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkfullscreenquad.c index 1d72ce4214..38b8d6a83a 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkfullscreenquad.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkfullscreenquad.c @@ -1504,8 +1504,8 @@ gst_vulkan_full_screen_quad_fill_command_buffer (GstVulkanFullScreenQuad * self, .oldLayout = in_views[i]->image->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = in_views[i]->image->image, .subresourceRange = in_views[i]->image->barrier.subresource_range }; @@ -1534,8 +1534,8 @@ gst_vulkan_full_screen_quad_fill_command_buffer (GstVulkanFullScreenQuad * self, .oldLayout = out_views[i]->image->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = out_views[i]->image->image, .subresourceRange = out_views[i]->image->barrier.subresource_range }; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkswapper.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkswapper.c index 7aa3671e48..f4cd4bccec 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkswapper.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkswapper.c @@ -1077,8 +1077,8 @@ _build_render_buffer_cmd (GstVulkanSwapper * swapper, guint32 swap_idx, .oldLayout = swap_img->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = swap_img->image, .subresourceRange = swap_img->barrier.subresource_range }; @@ -1149,8 +1149,8 @@ _build_render_buffer_cmd (GstVulkanSwapper * swapper, guint32 swap_idx, .oldLayout = img_mem->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = img_mem->image, .subresourceRange = img_mem->barrier.subresource_range }; @@ -1188,8 +1188,8 @@ _build_render_buffer_cmd (GstVulkanSwapper * swapper, guint32 swap_idx, .oldLayout = swap_img->barrier.image_layout, .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, /* FIXME: implement exclusive transfers */ - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = 0, + .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, + .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, .image = swap_img->image, .subresourceRange = swap_img->barrier.subresource_range };