Have demos give a useful error if no compatible ICD found.
diff --git a/demos/cube.c b/demos/cube.c
index dca5432..920a542 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1700,7 +1700,14 @@
uint32_t i;
err = xglCreateInstance(&app, NULL, &demo->inst);
- assert(!err);
+ if (err == XGL_ERROR_INCOMPATIBLE_DRIVER) {
+ printf("Cannot find a compatible Vulkan installable client driver "
+ "(ICD).\nExiting ...\n");
+ fflush(stdout);
+ exit(1);
+ } else {
+ assert(!err);
+ }
err = xglEnumerateGpus(demo->inst, 1, &gpu_count, &demo->gpu);
assert(!err && gpu_count == 1);
@@ -1727,6 +1734,12 @@
int scr;
demo->connection = xcb_connect(NULL, &scr);
+ if (demo->connection == NULL) {
+ printf("Cannot find a compatible Vulkan installable client driver "
+ "(ICD).\nExiting ...\n");
+ fflush(stdout);
+ exit(1);
+ }
setup = xcb_get_setup(demo->connection);
iter = xcb_setup_roots_iterator(setup);