diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.c index b7caff612b..a1ae7c9572 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkoperation.c @@ -1202,8 +1202,10 @@ gst_vulkan_operation_enable_query (GstVulkanOperation * self, VkQueryType query_type, guint n_queries, gpointer pnext, GError ** error) { GstVulkanOperationPrivate *priv; +#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS GstVulkanPhysicalDevice *device; guint32 queue_family; +#endif VkQueryPoolCreateInfo query_pool_info = { .sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO, .pNext = pnext, @@ -1221,15 +1223,24 @@ gst_vulkan_operation_enable_query (GstVulkanOperation * self, if (priv->query_pool) return TRUE; +#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS queue_family = priv->cmd_pool->queue->family; 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, "Queue %" GST_PTR_FORMAT " doesn't support result status query operations", priv->cmd_pool->queue); return FALSE; } +#endif res = vkCreateQueryPool (priv->cmd_pool->queue->device->device, &query_pool_info, NULL, &priv->query_pool);