From: Tobin Ehlis Date: Thu, 16 Apr 2015 16:04:35 +0000 (-0600) Subject: demos: Remove use of GetExtensionSupport API that's going away X-Git-Tag: upstream/1.1.92~5744 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7537db97c30e73648d2d8270451b4d0b06b13693;p=platform%2Fupstream%2FVulkan-Tools.git demos: Remove use of GetExtensionSupport API that's going away --- diff --git a/demos/cube.c b/demos/cube.c index 637cd31..13fc1db 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1664,6 +1664,7 @@ static void demo_create_window(struct demo *demo) static void demo_init_vk(struct demo *demo) { + // TODO : Should query count w/ GetGlobalExtensionInfo, then enable via CreateInstance const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, @@ -1690,15 +1691,17 @@ static void demo_init_vk(struct demo *demo) .queueNodeIndex = 0, .queueCount = 1, }; + const char *ext_names[] = { "VK_WSI_X11", }; + const VkDeviceCreateInfo device = { .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, .pNext = NULL, .queueRecordCount = 1, .pRequestedQueues = &queue, - .extensionCount = 1, + .extensionCount = 1, // TODO : Should query count w/ GetGlobalExtensionInfo .ppEnabledExtensionNames = ext_names, .flags = VK_DEVICE_CREATE_VALIDATION_BIT, }; @@ -1721,11 +1724,6 @@ static void demo_init_vk(struct demo *demo) err = vkEnumerateGpus(demo->inst, 1, &gpu_count, &demo->gpu); assert(!err && gpu_count == 1); - for (i = 0; i < device.extensionCount; i++) { - err = vkGetExtensionSupport(demo->gpu, ext_names[i]); - assert(!err); - } - err = vkWsiX11AssociateConnection(demo->gpu, &connection); assert(!err); diff --git a/demos/tri.c b/demos/tri.c index f1156d2..299d36b 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1205,6 +1205,7 @@ static void demo_create_window(struct demo *demo) static void demo_init_vk(struct demo *demo) { + // TODO : Should query count w/ GetGlobalExtensionInfo, then enable via CreateInstance const VkApplicationInfo app = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, .pNext = NULL, @@ -1239,7 +1240,7 @@ static void demo_init_vk(struct demo *demo) .pNext = NULL, .queueRecordCount = 1, .pRequestedQueues = &queue, - .extensionCount = 1, + .extensionCount = 1, // TODO : Should query count w/ GetGlobalExtensionInfo .ppEnabledExtensionNames = ext_names, .flags = VK_DEVICE_CREATE_VALIDATION_BIT, }; @@ -1262,11 +1263,6 @@ static void demo_init_vk(struct demo *demo) err = vkEnumerateGpus(demo->inst, 1, &gpu_count, &demo->gpu); assert(!err && gpu_count == 1); - for (i = 0; i < device.extensionCount; i++) { - err = vkGetExtensionSupport(demo->gpu, ext_names[i]); - assert(!err); - } - err = vkWsiX11AssociateConnection(demo->gpu, &connection); assert(!err); diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c index 316a660..2966dfd 100644 --- a/demos/vulkaninfo.c +++ b/demos/vulkaninfo.c @@ -364,17 +364,21 @@ static void app_dev_destroy(struct app_dev *dev) static void app_gpu_init_extensions(struct app_gpu *gpu) { - VkResult err; + //VkResult err; uint32_t i; + // TODO : Should query count w/ GetGlobalExtensionInfo, + // Then dynamically set extensions based on returned count static char *known_extensions[] = { "VK_WSI_X11", }; for (i = 0; i < ARRAY_SIZE(known_extensions); i++) { +/* err = vkGetExtensionSupport(gpu->obj, known_extensions[i]); if (!err) - gpu->extension_count++; +*/ + gpu->extension_count++; } gpu->extensions = @@ -384,9 +388,11 @@ static void app_gpu_init_extensions(struct app_gpu *gpu) gpu->extension_count = 0; for (i = 0; i < ARRAY_SIZE(known_extensions); i++) { +/* err = vkGetExtensionSupport(gpu->obj, known_extensions[i]); if (!err) - gpu->extensions[gpu->extension_count++] = known_extensions[i]; +*/ + gpu->extensions[gpu->extension_count++] = known_extensions[i]; } }