wsi: Deal with drivers that don't allow query of swap-chain VkFormat.
diff --git a/demos/cube.c b/demos/cube.c
index 4406911..0d1ee87 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1973,7 +1973,14 @@
VkDisplayWSI display;
err = vkGetPhysicalDeviceInfo(demo->gpu, VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI,
&data_size, NULL);
- assert(!err);
+ if (err != VK_SUCCESS) {
+ printf("The Vulkan installable client driver (ICD) does not support "
+ "querying\nfor the swap-chain image format. Therefore, am "
+ "hardcoding this\nformat to VK_FORMAT_B8G8R8A8_UNORM.\n");
+ fflush(stdout);
+ demo->format = VK_FORMAT_B8G8R8A8_UNORM;
+ return;
+ }
demo->display_props = (VkDisplayPropertiesWSI *) malloc(data_size);
err = vkGetPhysicalDeviceInfo(demo->gpu, VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI,
&data_size, demo->display_props);