From 7452589ff864fc16ce23a451525ab8a386e8101f Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 25 Feb 2025 21:04:35 +1100 Subject: [PATCH] vulkan/instance: allow the requested api version to be larger than the supported Since Vulkan 1.1, the requested API version is the maximum API version that the application is expecting to use. It is also possible for individual devices (backed by potentially different drivers) may support a higher or lower API version than the instance. Both cases (higher and lower) should be supported and as such, it is not an error to request an API version that is larger than the instance supported API version. Part-of: --- .../gst-plugins-bad/gst-libs/gst/vulkan/gstvkinstance.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkinstance.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkinstance.c index 2b5d948452..af2bfc33aa 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkinstance.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkinstance.c @@ -882,7 +882,12 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error) requested_instance_api = priv->supported_instance_api; } - if (requested_instance_api > priv->supported_instance_api) { + /* Since Vulkan 1.1, it is possible to have an instance API version that is + * less than a device supported API. As such, requesting a higher API version + * is no longer an error. + */ + if (priv->supported_instance_api < VK_MAKE_VERSION (1, 1, 0) + && requested_instance_api > priv->supported_instance_api) { g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED, "Requested API version (%u.%u) is larger than the maximum supported " "version (%u.%u)", VK_VERSION_MAJOR (requested_instance_api),