demos: Remove use of GetExtensionSupport API that's going away
authorTobin Ehlis <tobin@lunarg.com>
Thu, 16 Apr 2015 16:04:35 +0000 (10:04 -0600)
committerTobin Ehlis <tobin@lunarg.com>
Thu, 16 Apr 2015 18:39:27 +0000 (12:39 -0600)
demos/cube.c
demos/tri.c
demos/vulkaninfo.c

index 637cd31..13fc1db 100644 (file)
@@ -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);
 
index f1156d2..299d36b 100644 (file)
@@ -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);
 
index 316a660..2966dfd 100644 (file)
@@ -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];
     }
 }