vulkan: log extension/layers available/enabled on instance/device creation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1341>
This commit is contained in:
Matthew Waters 2020-06-15 01:38:03 +10:00 committed by GStreamer Merge Bot
parent 09613696a6
commit c21aefbfb0
3 changed files with 64 additions and 9 deletions

View file

@ -294,6 +294,17 @@ gst_vulkan_device_open (GstVulkanDevice * device, GError ** error)
priv->queue_family_id = i;
priv->n_queues = 1;
GST_INFO_OBJECT (device, "Creating a device from physical %" GST_PTR_FORMAT
" with %u layers and %u extensions", device->physical_device,
priv->enabled_layers->len, priv->enabled_extensions->len);
for (i = 0; i < priv->enabled_layers->len; i++)
GST_DEBUG_OBJECT (device, "layer %u: %s", i,
(gchar *) g_ptr_array_index (priv->enabled_layers, i));
for (i = 0; i < priv->enabled_extensions->len; i++)
GST_DEBUG_OBJECT (device, "extension %u: %s", i,
(gchar *) g_ptr_array_index (priv->enabled_extensions, i));
{
VkDeviceQueueCreateInfo queue_info = { 0, };
VkDeviceCreateInfo device_info = { 0, };

View file

@ -713,6 +713,7 @@ gst_vulkan_instance_fill_info_unlocked (GstVulkanInstance * instance,
{
GstVulkanInstancePrivate *priv;
VkResult err;
guint i;
priv = GET_PRIV (instance);
@ -756,6 +757,16 @@ gst_vulkan_instance_fill_info_unlocked (GstVulkanInstance * instance,
return FALSE;
}
GST_INFO_OBJECT (instance, "found %u layers and %u extensions",
priv->n_available_layers, priv->n_available_extensions);
for (i = 0; i < priv->n_available_layers; i++)
GST_DEBUG_OBJECT (instance, "available layer %u: %s", i,
priv->available_layers[i].layerName);
for (i = 0; i < priv->n_available_extensions; i++)
GST_DEBUG_OBJECT (instance, "available extension %u: %s", i,
priv->available_extensions[i].extensionName);
/* configure default extensions */
{
GstVulkanDisplayType display_type;
@ -854,15 +865,8 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error)
requested_instance_api =
VK_MAKE_VERSION (priv->requested_api_major, priv->requested_api_minor,
0);
GST_INFO_OBJECT (instance, "requesting Vulkan API %u.%u, max supported "
"%u.%u", priv->requested_api_major, priv->requested_api_minor,
VK_VERSION_MAJOR (priv->supported_instance_api),
VK_VERSION_MINOR (priv->supported_instance_api));
} else {
requested_instance_api = priv->supported_instance_api;
GST_INFO_OBJECT (instance, "requesting maximum supported API %u.%u",
VK_VERSION_MAJOR (priv->supported_instance_api),
VK_VERSION_MINOR (priv->supported_instance_api));
}
if (requested_instance_api > priv->supported_instance_api) {
@ -875,6 +879,37 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error)
goto error;
}
/* list of known vulkan loader environment variables taken from:
* https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md#table-of-debug-environment-variables */
GST_DEBUG_OBJECT (instance, "VK_ICD_FILENAMES: %s",
g_getenv ("VK_ICD_FILENAMES"));
GST_DEBUG_OBJECT (instance, "VK_INSTANCE_LAYERS: %s",
g_getenv ("VK_INSTANCE_LAYERS"));
GST_DEBUG_OBJECT (instance, "VK_LAYER_PATH: %s", g_getenv ("VK_LAYER_PATH"));
GST_DEBUG_OBJECT (instance, "VK_LOADER_DISABLE_INST_EXT_FILTER: %s",
g_getenv ("VK_LOADER_DISABLE_INST_EXT_FILTER"));
GST_DEBUG_OBJECT (instance, "VK_LOADER_DEBUG: %s",
g_getenv ("VK_LOADER_DEBUG"));
{
guint i;
GST_INFO_OBJECT (instance, "attempting to create instance for Vulkan API "
"%u.%u, max supported %u.%u with %u layers and %u extensions",
VK_VERSION_MAJOR (requested_instance_api),
VK_VERSION_MINOR (requested_instance_api),
VK_VERSION_MAJOR (priv->supported_instance_api),
VK_VERSION_MINOR (priv->supported_instance_api),
priv->enabled_layers->len, priv->enabled_extensions->len);
for (i = 0; i < priv->enabled_layers->len; i++)
GST_DEBUG_OBJECT (instance, "layer %u: %s", i,
(gchar *) g_ptr_array_index (priv->enabled_layers, i));
for (i = 0; i < priv->enabled_extensions->len; i++)
GST_DEBUG_OBJECT (instance, "extension %u: %s", i,
(gchar *) g_ptr_array_index (priv->enabled_extensions, i));
}
{
VkApplicationInfo app = { 0, };
VkInstanceCreateInfo inst_info = { 0, };

View file

@ -802,6 +802,7 @@ gst_vulkan_physical_device_fill_info (GstVulkanPhysicalDevice * device,
{
GstVulkanPhysicalDevicePrivate *priv = GET_PRIV (device);
VkResult err;
guint i;
device->device = gst_vulkan_physical_device_get_handle (device);
if (!device->device) {
@ -833,8 +834,6 @@ gst_vulkan_physical_device_fill_info (GstVulkanPhysicalDevice * device,
"vkEnumerateDeviceExtensionProperties") < 0) {
goto error;
}
GST_DEBUG_OBJECT (device, "Found %u extensions",
priv->n_available_extensions);
priv->available_extensions =
g_new0 (VkExtensionProperties, priv->n_available_extensions);
@ -846,6 +845,16 @@ gst_vulkan_physical_device_fill_info (GstVulkanPhysicalDevice * device,
goto error;
}
GST_INFO_OBJECT (device, "found %u layers and %u extensions",
priv->n_available_layers, priv->n_available_extensions);
for (i = 0; i < priv->n_available_layers; i++)
GST_DEBUG_OBJECT (device, "available layer %u: %s", i,
priv->available_layers[i].layerName);
for (i = 0; i < priv->n_available_extensions; i++)
GST_DEBUG_OBJECT (device, "available extension %u: %s", i,
priv->available_extensions[i].extensionName);
vkGetPhysicalDeviceProperties (device->device, &device->properties);
#if defined (VK_API_VERSION_1_2)
if (gst_vulkan_instance_check_version (device->instance, 1, 2, 0)) {