vulkan: expose various flags to string methods
authorMatthew Waters <matthew@centricular.com>
Mon, 16 Sep 2019 01:24:13 +0000 (11:24 +1000)
committerMatthew Waters <matthew@centricular.com>
Tue, 17 Sep 2019 03:02:44 +0000 (13:02 +1000)
gst-libs/gst/vulkan/gstvkdebug-private.h
gst-libs/gst/vulkan/gstvkdebug.c
gst-libs/gst/vulkan/gstvkdebug.h
gst-libs/gst/vulkan/gstvkdevice.c

index 899749e..08a8c82 100644 (file)
 
 G_BEGIN_DECLS
 
-gchar *                     gst_vulkan_memory_property_flags_to_string      (VkMemoryPropertyFlags prop_bits);
-gchar *                     gst_vulkan_memory_heap_flags_to_string          (VkMemoryHeapFlags prop_bits);
-gchar *                     gst_vulkan_queue_flags_to_string                (VkQueueFlags queue_bits);
-gchar *                     gst_vulkan_sample_count_flags_to_string         (VkSampleCountFlags sample_count_bits);
-
 G_END_DECLS
 
 #endif /* __GST_VULKAN_DEBUG_PRIVATE_H__ */
index e587a23..99069c2 100644 (file)
@@ -25,6 +25,7 @@
 #include <glib/gprintf.h>
 
 #include "gstvkerror.h"
+#include "gstvkdebug.h"
 #include "gstvkdebug-private.h"
 
 #define FLAGS_TO_STRING(under_name, VkType)                                     \
@@ -108,3 +109,22 @@ static const struct
 };
 FLAGS_TO_STRING(sample_count, VkSampleCountFlags);
 /* *INDENT-ON* */
+
+const gchar *
+gst_vulkan_device_type_to_string (VkPhysicalDeviceType type)
+{
+  switch (type) {
+    case VK_PHYSICAL_DEVICE_TYPE_OTHER:
+      return "other";
+    case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
+      return "integrated";
+    case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
+      return "discrete";
+    case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
+      return "virtual";
+    case VK_PHYSICAL_DEVICE_TYPE_CPU:
+      return "CPU";
+    default:
+      return "unknown";
+  }
+}
index 04345c0..7d4da91 100644 (file)
@@ -30,6 +30,18 @@ G_BEGIN_DECLS
 #define GST_VULKAN_EXTENT3D_FORMAT G_GUINT32_FORMAT ", %" G_GUINT32_FORMAT ", %" G_GUINT32_FORMAT
 #define GST_VULKAN_EXTENT3D_ARGS(var) (var).width, (var).height, (var).depth
 
+GST_VULKAN_API
+const gchar *           gst_vulkan_device_type_to_string            (VkPhysicalDeviceType type);
+
+GST_VULKAN_API
+gchar *                     gst_vulkan_memory_property_flags_to_string      (VkMemoryPropertyFlags prop_bits);
+GST_VULKAN_API
+gchar *                     gst_vulkan_memory_heap_flags_to_string          (VkMemoryHeapFlags prop_bits);
+GST_VULKAN_API
+gchar *                     gst_vulkan_queue_flags_to_string                (VkQueueFlags queue_bits);
+GST_VULKAN_API
+gchar *                     gst_vulkan_sample_count_flags_to_string         (VkSampleCountFlags sample_count_bits);
+
 G_END_DECLS
 
 #endif /* __GST_VULKAN_DEBUG_H__ */
index c1e20df..925eada 100644 (file)
@@ -511,25 +511,6 @@ dump_sparse_properties (GstVulkanDevice * device, GError ** error)
   return TRUE;
 }
 
-static const gchar *
-_device_type_to_string (VkPhysicalDeviceType type)
-{
-  switch (type) {
-    case VK_PHYSICAL_DEVICE_TYPE_OTHER:
-      return "other";
-    case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
-      return "integrated";
-    case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
-      return "discrete";
-    case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
-      return "virtual";
-    case VK_PHYSICAL_DEVICE_TYPE_CPU:
-      return "CPU";
-    default:
-      return "unknown";
-  }
-}
-
 static gboolean
 _physical_device_info (GstVulkanDevice * device, GError ** error)
 {
@@ -548,7 +529,7 @@ _physical_device_info (GstVulkanDevice * device, GError ** error)
   GST_INFO_OBJECT (device, "pyhsical device %i name \'%s\' type \'%s\' "
       "api version %u.%u.%u, driver version %u.%u.%u vendor ID 0x%x, "
       "device ID 0x%x", device->device_index, props.deviceName,
-      _device_type_to_string (props.deviceType),
+      gst_vulkan_device_type_to_string (props.deviceType),
       VK_VERSION_MAJOR (props.apiVersion), VK_VERSION_MINOR (props.apiVersion),
       VK_VERSION_PATCH (props.apiVersion),
       VK_VERSION_MAJOR (props.driverVersion),