diff options
| author | Ian Elliott <ian@LunarG.com> | 2015-05-15 17:52:29 -0600 |
|---|---|---|
| committer | Ian Elliott <ian@LunarG.com> | 2015-05-15 17:54:02 -0600 |
| commit | d414a8f58bdf35e45bcda8887c30507ddaae7ce8 (patch) | |
| tree | 5dbe90d0040bfd1b59c518238a9ef4e68ec74ad0 | |
| parent | e4602cd9e6cc3a806338c6a06c8ef77a4175076f (diff) | |
| download | usermoji-d414a8f58bdf35e45bcda8887c30507ddaae7ce8.tar.xz | |
wsi: Deal with drivers that don't allow query of swap-chain VkFormat.
| -rw-r--r-- | demos/cube.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/demos/cube.c b/demos/cube.c index 4406911f..0d1ee872 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1973,7 +1973,14 @@ static void demo_init_vk(struct demo *demo) 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); |
