demos: Some cleanup, including calling GIPA.
authorIan Elliott <ianelliott@google.com>
Mon, 23 Nov 2015 19:48:15 +0000 (12:48 -0700)
committerJon Ashburn <jon@lunarg.com>
Tue, 1 Dec 2015 17:18:23 +0000 (10:18 -0700)
Includes Calling GIPA instead of GDPA for functions that moved to instance
extension.

demos/cube.c
demos/tri.c

index 66e7245..851ef6b 100644 (file)
@@ -2405,9 +2405,9 @@ static void demo_init_vk(struct demo *demo)
     free(device_layers);
 
     GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceSupportKHR);
-    GET_DEVICE_PROC_ADDR(demo->device, GetPhysicalDeviceSurfaceCapabilitiesKHR);
-    GET_DEVICE_PROC_ADDR(demo->device, GetPhysicalDeviceSurfaceFormatsKHR);
-    GET_DEVICE_PROC_ADDR(demo->device, GetPhysicalDeviceSurfacePresentModesKHR);
+    GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceCapabilitiesKHR);
+    GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfaceFormatsKHR);
+    GET_INSTANCE_PROC_ADDR(demo->inst, GetPhysicalDeviceSurfacePresentModesKHR);
     GET_DEVICE_PROC_ADDR(demo->device, CreateSwapchainKHR);
     GET_DEVICE_PROC_ADDR(demo->device, DestroySwapchainKHR);
     GET_DEVICE_PROC_ADDR(demo->device, GetSwapchainImagesKHR);
@@ -2474,9 +2474,10 @@ static void demo_init_vk_swapchain(struct demo *demo)
     }
 
     // TODO: Add support for separate queues, including presentation,
-    //       synchronization, and appropriate tracking for QueueSubmit
-    // While it is possible for an application to use a separate graphics and a
-    // present queues, this demo program assumes it is only using one:
+    //       synchronization, and appropriate tracking for QueueSubmit.
+    // NOTE: While it is possible for an application to use a separate graphics
+    //       and a present queues, this demo program assumes it is only using
+    //       one:
     if (graphicsQueueNodeIndex != presentQueueNodeIndex) {
         ERR_EXIT("Could not find a common graphics and a present queue\n",
                  "Swapchain Initialization Failure");
@@ -2490,14 +2491,14 @@ static void demo_init_vk_swapchain(struct demo *demo)
     // Get the list of VkFormat's that are supported:
     uint32_t formatCount;
     err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu,
-                                    demo->surface,
-                                    &formatCount, NULL);
+                                                     demo->surface,
+                                                     &formatCount, NULL);
     assert(!err);
     VkSurfaceFormatKHR *surfFormats =
         (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR));
     err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu,
-                                    demo->surface,
-                                    &formatCount, surfFormats);
+                                                     demo->surface,
+                                                     &formatCount, surfFormats);
     assert(!err);
     // If the format list includes just one entry of VK_FORMAT_UNDEFINED,
     // the surface has no preferred format.  Otherwise, at least one
index b9aeaab..64bfe9a 100644 (file)
@@ -2046,9 +2046,10 @@ static void demo_init_vk_swapchain(struct demo *demo)
     }
 
     // TODO: Add support for separate queues, including presentation,
-    //       synchronization, and appropriate tracking for QueueSubmit
-    // While it is possible for an application to use a separate graphics and a
-    // present queues, this demo program assumes it is only using one:
+    //       synchronization, and appropriate tracking for QueueSubmit.
+    // NOTE: While it is possible for an application to use a separate graphics
+    //       and a present queues, this demo program assumes it is only using
+    //       one:
     if (graphicsQueueNodeIndex != presentQueueNodeIndex) {
         ERR_EXIT("Could not find a common graphics and a present queue\n",
                  "Swapchain Initialization Failure");
@@ -2062,14 +2063,14 @@ static void demo_init_vk_swapchain(struct demo *demo)
     // Get the list of VkFormat's that are supported:
     uint32_t formatCount;
     err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu,
-                                    demo->surface,
-                                    &formatCount, NULL);
+                                                     demo->surface,
+                                                     &formatCount, NULL);
     assert(!err);
     VkSurfaceFormatKHR *surfFormats =
         (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR));
     err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu,
-                                    demo->surface,
-                                    &formatCount, surfFormats);
+                                                     demo->surface,
+                                                     &formatCount, surfFormats);
     assert(!err);
     // If the format list includes just one entry of VK_FORMAT_UNDEFINED,
     // the surface has no preferred format.  Otherwise, at least one