From 6515291a9aac41da004878edfe8bd09fb01c5cd3 Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Tue, 28 Apr 2015 13:22:33 -0600 Subject: demos: tri/cube give error if can't find WSI extension. --- demos/cube.c | 15 +++++++++++---- demos/tri.c | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index b126a7a0..b451bbf1 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1844,7 +1844,14 @@ static void demo_init_vk(struct demo *demo) if (!strcmp(ext_names[0], extProp.extName)) extFound = 1; } - assert(extFound); + if (!extFound) { + ERR_EXIT("vkGetGlobalExtensionInfo failed to find the " + "\"VK_WSI_LunarG\" extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); + } const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, @@ -1884,12 +1891,12 @@ static void demo_init_vk(struct demo *demo) err = vkCreateInstance(&inst_info, &demo->inst); if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { ERR_EXIT("Cannot find a compatible Vulkan installable client driver " - "(ICD).\nPlease look at the Getting Started guide for " + "(ICD).\n\nPlease look at the Getting Started guide for " "additional information.\n", "vkCreateInstance Failure"); } else if (err) { - ERR_EXIT("vkCreateInstance failed. Do you have a compatible Vulkan " - "installable client driver (ICD) installed. Please look at " + ERR_EXIT("vkCreateInstance failed.\n\nDo you have a compatible Vulkan " + "installable client driver (ICD) installed?\nPlease look at " "the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); } diff --git a/demos/tri.c b/demos/tri.c index 00392613..9140be00 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1390,7 +1390,14 @@ static void demo_init_vk(struct demo *demo) if (!strcmp(ext_names[0], extProp.extName)) extFound = 1; } - assert(extFound); + if (!extFound) { + ERR_EXIT("vkGetGlobalExtensionInfo failed to find the " + "\"VK_WSI_LunarG\" extension.\n\nDo you have a compatible " + "Vulkan installable client driver (ICD) installed?\nPlease " + "look at the Getting Started guide for additional " + "information.\n", + "vkCreateInstance Failure"); + } const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, @@ -1429,12 +1436,12 @@ static void demo_init_vk(struct demo *demo) err = vkCreateInstance(&inst_info, &demo->inst); if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { ERR_EXIT("Cannot find a compatible Vulkan installable client driver " - "(ICD).\nPlease look at the Getting Started guide for " + "(ICD).\n\nPlease look at the Getting Started guide for " "additional information.\n", "vkCreateInstance Failure"); } else if (err) { - ERR_EXIT("vkCreateInstance failed. Do you have a compatible Vulkan " - "installable client driver (ICD) installed. Please look at " + ERR_EXIT("vkCreateInstance failed.\n\nDo you have a compatible Vulkan " + "installable client driver (ICD) installed?\nPlease look at " "the Getting Started guide for additional information.\n", "vkCreateInstance Failure"); } -- cgit v1.2.3