From: Matthew Waters Date: Mon, 16 Sep 2019 01:24:13 +0000 (+1000) Subject: vulkan: expose various flags to string methods X-Git-Tag: 1.19.3~507^2~2835 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=863e78577010129d2c5061f6ef14b4dfa3f477a2;p=platform%2Fupstream%2Fgstreamer.git vulkan: expose various flags to string methods --- diff --git a/gst-libs/gst/vulkan/gstvkdebug-private.h b/gst-libs/gst/vulkan/gstvkdebug-private.h index 899749e..08a8c82 100644 --- a/gst-libs/gst/vulkan/gstvkdebug-private.h +++ b/gst-libs/gst/vulkan/gstvkdebug-private.h @@ -27,11 +27,6 @@ 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__ */ diff --git a/gst-libs/gst/vulkan/gstvkdebug.c b/gst-libs/gst/vulkan/gstvkdebug.c index e587a23..99069c2 100644 --- a/gst-libs/gst/vulkan/gstvkdebug.c +++ b/gst-libs/gst/vulkan/gstvkdebug.c @@ -25,6 +25,7 @@ #include #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"; + } +} diff --git a/gst-libs/gst/vulkan/gstvkdebug.h b/gst-libs/gst/vulkan/gstvkdebug.h index 04345c0..7d4da91 100644 --- a/gst-libs/gst/vulkan/gstvkdebug.h +++ b/gst-libs/gst/vulkan/gstvkdebug.h @@ -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__ */ diff --git a/gst-libs/gst/vulkan/gstvkdevice.c b/gst-libs/gst/vulkan/gstvkdevice.c index c1e20df..925eada 100644 --- a/gst-libs/gst/vulkan/gstvkdevice.c +++ b/gst-libs/gst/vulkan/gstvkdevice.c @@ -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),