vkphysicaldevice: dump if video maintenance1 is supported
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Mon, 29 Jul 2024 11:49:05 +0000 (13:49 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 4 Dec 2024 22:01:02 +0000 (22:01 +0000)
Dump if VK_KHR_video_maintenance1 features is supported by the driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7995>

subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkphysicaldevice.c

index a5ef27c9b25c46184c4eb8c9925072df782e990a..97d5458f4643960366a0023a2e0af54525778d1a 100644 (file)
@@ -70,6 +70,9 @@ struct _GstVulkanPhysicalDevicePrivate
 #if defined (VK_API_VERSION_1_3)
   VkPhysicalDeviceVulkan13Features features13;
   VkPhysicalDeviceVulkan13Properties properties13;
+#if defined (VK_KHR_video_maintenance1)
+  VkPhysicalDeviceVideoMaintenance1FeaturesKHR videomaintenance1;
+#endif
 #endif
 };
 
@@ -200,6 +203,11 @@ gst_vulkan_physical_device_init (GstVulkanPhysicalDevice * device)
   priv->features13.sType =
       VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES;
   priv->features12.pNext = &priv->features13;
+#if defined (VK_KHR_video_maintenance1)
+  priv->videomaintenance1.sType =
+      VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR;
+  priv->features13.pNext = &priv->videomaintenance1;
+#endif
 #endif
 }
 
@@ -476,7 +484,16 @@ dump_features13 (GstVulkanPhysicalDevice * device,
   DEBUG_BOOL_STRUCT ("support for (1.3)", features, maintenance4);
   /* *INDENT-ON* */
 }
+
+#if defined(VK_KHR_video_maintenance1)
+static void
+dump_videomaintenance1 (GstVulkanPhysicalDevice * device,
+    VkPhysicalDeviceVideoMaintenance1FeaturesKHR * features)
+{
+  DEBUG_BOOL_STRUCT ("support for (1.3)", features, videoMaintenance1);
+}
 #endif
+#endif /* defined (VK_API_VERSION_1_3) */
 
 static gboolean
 dump_features (GstVulkanPhysicalDevice * device, GError ** error)
@@ -502,6 +519,13 @@ dump_features (GstVulkanPhysicalDevice * device, GError ** error)
           && iter->sType ==
           VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES)
         dump_features13 (device, (VkPhysicalDeviceVulkan13Features *) iter);
+#if defined(VK_KHR_video_maintenance1)
+      else if (gst_vulkan_instance_check_version (device->instance, 1, 3, 283)
+          && iter->sType ==
+          VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR)
+        dump_videomaintenance1 (device,
+            (VkPhysicalDeviceVideoMaintenance1FeaturesKHR *) iter);
+#endif
 #endif
     }
   } else