vulkaninfo: Set missing sType and pNext in surf_formats2 array.
authorRafael Ristovski <rafael.ristovski@gmail.com>
Sun, 16 Dec 2018 12:51:40 +0000 (13:51 +0100)
committerjeremyk-lunarg <jeremyk@lunarg.com>
Mon, 17 Dec 2018 17:01:35 +0000 (10:01 -0700)
This fixes #109

vulkaninfo/vulkaninfo.c

index 2fc3259..7a730b2 100644 (file)
@@ -1377,6 +1377,10 @@ static int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu, F
         surf_formats2 = (VkSurfaceFormat2KHR *)malloc(format_count * sizeof(VkSurfaceFormat2KHR));
         if (!surf_formats2)
             ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
+        for (uint32_t i = 0; i < format_count; ++i) {
+            surf_formats2[i].sType = VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR;
+            surf_formats2[i].pNext = NULL;
+        }
         err = inst->vkGetPhysicalDeviceSurfaceFormats2KHR(gpu->obj, &inst->surface_info2, &format_count, surf_formats2);
         assert(!err);
     } else {