mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
vkoperation: support for query_result_status
query_result_status can be optional so we should not create the query pool if the queue does not support it, ie, AMD does not support VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR In other use case such as VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, the query pool must be created. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7043>
This commit is contained in:
parent
71ebb20267
commit
f40d947c4a
1 changed files with 12 additions and 1 deletions
|
@ -1202,8 +1202,10 @@ gst_vulkan_operation_enable_query (GstVulkanOperation * self,
|
||||||
VkQueryType query_type, guint n_queries, gpointer pnext, GError ** error)
|
VkQueryType query_type, guint n_queries, gpointer pnext, GError ** error)
|
||||||
{
|
{
|
||||||
GstVulkanOperationPrivate *priv;
|
GstVulkanOperationPrivate *priv;
|
||||||
|
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
|
||||||
GstVulkanPhysicalDevice *device;
|
GstVulkanPhysicalDevice *device;
|
||||||
guint32 queue_family;
|
guint32 queue_family;
|
||||||
|
#endif
|
||||||
VkQueryPoolCreateInfo query_pool_info = {
|
VkQueryPoolCreateInfo query_pool_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
|
||||||
.pNext = pnext,
|
.pNext = pnext,
|
||||||
|
@ -1221,15 +1223,24 @@ gst_vulkan_operation_enable_query (GstVulkanOperation * self,
|
||||||
if (priv->query_pool)
|
if (priv->query_pool)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
|
||||||
queue_family = priv->cmd_pool->queue->family;
|
queue_family = priv->cmd_pool->queue->family;
|
||||||
device = priv->cmd_pool->queue->device->physical_device;
|
device = priv->cmd_pool->queue->device->physical_device;
|
||||||
if (!device->queue_family_ops[queue_family].query_result_status) {
|
/*
|
||||||
|
* The VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR can be optional, so .query_result_status
|
||||||
|
* can be FALSE, see AMD's case.
|
||||||
|
* vkCreateQueryPool needs to be called when the query is
|
||||||
|
* VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR to enable it anyway.
|
||||||
|
*/
|
||||||
|
if (!device->queue_family_ops[queue_family].query_result_status &&
|
||||||
|
query_type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR) {
|
||||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_FEATURE_NOT_PRESENT,
|
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_FEATURE_NOT_PRESENT,
|
||||||
"Queue %" GST_PTR_FORMAT
|
"Queue %" GST_PTR_FORMAT
|
||||||
" doesn't support result status query operations",
|
" doesn't support result status query operations",
|
||||||
priv->cmd_pool->queue);
|
priv->cmd_pool->queue);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
res = vkCreateQueryPool (priv->cmd_pool->queue->device->device,
|
res = vkCreateQueryPool (priv->cmd_pool->queue->device->device,
|
||||||
&query_pool_info, NULL, &priv->query_pool);
|
&query_pool_info, NULL, &priv->query_pool);
|
||||||
|
|
Loading…
Reference in a new issue