vkinstance: Don't abort in case that system has no available vulkan device

Specification doesn't have restriction that returned
pPhysicalDeviceCount value must be non-zero

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2304>
This commit is contained in:
Seungha Yang 2021-06-04 01:44:47 +09:00 committed by GStreamer Marge Bot
parent 80b3ba7b36
commit 4d0f136297

View file

@ -975,7 +975,15 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error)
if (gst_vulkan_error_to_g_error (err, error,
"vkEnumeratePhysicalDevices") < 0)
goto error;
g_assert (instance->n_physical_devices > 0);
if (instance->n_physical_devices == 0) {
GST_WARNING_OBJECT (instance, "No available physical device");
g_set_error_literal (error,
GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NOT_FOUND,
"No available physical device");
goto error;
}
instance->physical_devices =
g_new0 (VkPhysicalDevice, instance->n_physical_devices);
err =