mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
vulkan/swapper: add some debug logging for surface size and present modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1219>
This commit is contained in:
parent
be3c60eb1f
commit
9f79ab8b0b
3 changed files with 39 additions and 0 deletions
|
@ -163,3 +163,27 @@ gst_vulkan_physical_device_type_to_string (VkPhysicalDeviceType type)
|
|||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_present_mode_to_string:
|
||||
* @present_mode: a `VkPresentModeKHR`
|
||||
*
|
||||
* Returns: name of @present_mode
|
||||
*
|
||||
* Since: 1.20
|
||||
*/
|
||||
const gchar *
|
||||
gst_vulkan_present_mode_to_string (VkPresentModeKHR present_mode)
|
||||
{
|
||||
switch (present_mode) {
|
||||
case VK_PRESENT_MODE_FIFO_KHR:
|
||||
return "FIFO";
|
||||
case VK_PRESENT_MODE_IMMEDIATE_KHR:
|
||||
return "immediate";
|
||||
case VK_PRESENT_MODE_MAILBOX_KHR:
|
||||
return "mailbox";
|
||||
/* XXX: add other values as necessary */
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,8 @@ 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);
|
||||
GST_VULKAN_API
|
||||
const gchar * gst_vulkan_present_mode_to_string (VkPresentModeKHR present_mode);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -753,10 +753,15 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
|||
swapchain_dims.width = width;
|
||||
swapchain_dims.height = height;
|
||||
priv->any_current_extent = TRUE;
|
||||
GST_DEBUG_OBJECT (swapper, "using requested swapchain dimensions %ux%u "
|
||||
"from window", width, height);
|
||||
} else {
|
||||
/* If the surface size is defined, the swap chain size must match */
|
||||
swapchain_dims = priv->surf_props.currentExtent;
|
||||
priv->any_current_extent = FALSE;
|
||||
GST_DEBUG_OBJECT (swapper, "using current swapchain dimensions %ux%u",
|
||||
priv->surf_props.currentExtent.width,
|
||||
priv->surf_props.currentExtent.height);
|
||||
}
|
||||
priv->surface_location.w = swapchain_dims.width;
|
||||
priv->surface_location.h = swapchain_dims.height;
|
||||
|
@ -767,6 +772,12 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
|||
* always available. */
|
||||
present_mode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
for (i = 0; i < priv->n_surf_present_modes; i++) {
|
||||
GST_TRACE_OBJECT (swapper,
|
||||
"surface %" GST_VULKAN_NON_DISPATCHABLE_HANDLE_FORMAT
|
||||
" has present mode \'%s\' (0x%x)", priv->surface,
|
||||
gst_vulkan_present_mode_to_string (priv->surf_present_modes[i]),
|
||||
priv->surf_present_modes[i]);
|
||||
|
||||
if (priv->surf_present_modes[i] == VK_PRESENT_MODE_MAILBOX_KHR) {
|
||||
present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
|
||||
break;
|
||||
|
@ -776,6 +787,8 @@ _allocate_swapchain (GstVulkanSwapper * swapper, GstCaps * caps,
|
|||
present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR;
|
||||
}
|
||||
}
|
||||
GST_DEBUG_OBJECT (swapper, "using present mode \'%s\'",
|
||||
gst_vulkan_present_mode_to_string (present_mode));
|
||||
|
||||
/* Determine the number of VkImage's to use in the swap chain (we desire to
|
||||
* own only 1 image at a time, besides the images being displayed and
|
||||
|
|
Loading…
Reference in a new issue