aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Elliott <ian@LunarG.com>2015-05-20 14:54:42 -0600
committerIan Elliott <ian@LunarG.com>2015-05-20 14:54:42 -0600
commitf31e9658dde4df64f8917e98613ea2e3f620ceb8 (patch)
treea5595fde6713ad44d8b02d2c0a995a476c41d68e
parentd414a8f58bdf35e45bcda8887c30507ddaae7ce8 (diff)
downloadusermoji-f31e9658dde4df64f8917e98613ea2e3f620ceb8.tar.xz
wsi: Deal with drivers that don't allow query of swap-chain VkFormat.
-rw-r--r--demos/tri.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/demos/tri.c b/demos/tri.c
index 18f420ce..b18434ca 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -1469,7 +1469,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);