diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c index 3a00d9cb68..80e7b87c3c 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkformat.c @@ -602,11 +602,11 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device, gboolean basics_primary = FALSE, basics_secondary = FALSE; guint64 feats_primary = 0, feats_secondary = 0; + if (vk_formats_map[i].format != GST_VIDEO_INFO_FORMAT (info)) + continue; + #if (defined(VK_VERSION_1_3) || defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 195) if (gst_vkGetPhysicalDeviceFormatProperties2) { - if (vk_formats_map[i].format != GST_VIDEO_INFO_FORMAT (info)) - continue; - gst_vkGetPhysicalDeviceFormatProperties2 (gpu, vk_formats_map[i].vkfrmt, &prop); @@ -626,8 +626,16 @@ gst_vulkan_format_from_video_info_2 (GstVulkanPhysicalDevice * physical_device, } else { basics_secondary = basics_primary; } - } + } else #endif + { + /* XXX: VkFormatFeatureFlagBits and VkFormatFeatureFlagBits2 are the same + * values for basic_flags' symbols and they are defined in + * VK_VERSION_1_0 */ + basics_primary = basics_secondary = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT + | VK_FORMAT_FEATURE_TRANSFER_SRC_BIT + | VK_FORMAT_FEATURE_TRANSFER_DST_BIT; + } if (GST_VIDEO_INFO_IS_RGB (info)) { if (basics_primary && GST_VIDEO_INFO_COLORIMETRY (info).transfer !=