146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu/*
2481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz * Copyright (c) 2015-2016 The Khronos Group Inc.
3481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz * Copyright (c) 2015-2016 Valve Corporation
4481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz * Copyright (c) 2015-2016 LunarG, Inc.
546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu *
643b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * Licensed under the Apache License, Version 2.0 (the "License");
743b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * you may not use this file except in compliance with the License.
843b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * You may obtain a copy of the License at
946c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu *
1043b53e83705f02245da6ae61e31273866a35b833Jon Ashburn *     http://www.apache.org/licenses/LICENSE-2.0
1146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu *
1243b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * Unless required by applicable law or agreed to in writing, software
1343b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * distributed under the License is distributed on an "AS IS" BASIS,
1443b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1543b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * See the License for the specific language governing permissions and
1643b53e83705f02245da6ae61e31273866a35b833Jon Ashburn * limitations under the License.
1796cd795bb585711057cd90d37a2251419384c937Courtney Goeltzenleuchter *
1896cd795bb585711057cd90d37a2251419384c937Courtney Goeltzenleuchter * Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
1996cd795bb585711057cd90d37a2251419384c937Courtney Goeltzenleuchter * Author: David Pinedo <david@lunarg.com>
2096cd795bb585711057cd90d37a2251419384c937Courtney Goeltzenleuchter * Author: Mark Lobodzinski <mark@lunarg.com>
21a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay * Author: Rene Lindsay <rene@lunarg.com>
225d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager * Author: Jeremy Kniager <jeremyk@lunarg.com>
2397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson * Author: Shannon McPherson <shannon@lunarg.com>
2446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu */
25bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus
26bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#ifdef __GNUC__
27bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#ifndef _POSIX_C_SOURCE
28bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#define _POSIX_C_SOURCE 200809L
29bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#endif
30bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#else
31bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#define strndup(p, n) strdup(p)
32bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#endif
33bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus
3446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu#include <assert.h>
35825cc51df04b93f130e48788ced8e63937272b4dMark Lobodzinski#include <inttypes.h>
367fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay#include <stdbool.h>
377fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay#include <stdio.h>
387fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay#include <stdlib.h>
397fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay#include <string.h>
40d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
41ea95f5c3967480a57ceb03a98e8370225094ce42Ian Elliott#ifdef _WIN32
4218fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo#include <fcntl.h>
4318fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo#include <io.h>
44cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#endif  // _WIN32
4564070a88a7a4411e0eb0d7148bd1a1598e74a88cIan Elliott
46787b627282489b56b4ed111f152008fe66d33488Mun Gwan-gyeong#if defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_XCB_KHR)
47a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#include <X11/Xutil.h>
48a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#endif
49a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
500394191ea288611bb919194d46fde101947df54aTony Barbour#if defined(VK_USE_PLATFORM_MIR_KHR)
510394191ea288611bb919194d46fde101947df54aTony Barbour#warning "Vulkaninfo does not have code for Mir at this time"
520394191ea288611bb919194d46fde101947df54aTony Barbour#endif
530394191ea288611bb919194d46fde101947df54aTony Barbour
54329ca9eb16cdbee7a7644fb08ade7b3d3bb32e23David Pinedo#include <vulkan/vulkan.h>
5546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
56bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski#define ERR(err) printf("%s:%d: failed with %s\n", __FILE__, __LINE__, VkResultString(err));
5746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
5818fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo#ifdef _WIN32
5918fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo
607c83aa210365e148877f0f3698292a1b509018ffIan Elliott#define snprintf _snprintf
6197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson#define strdup _strdup
627c83aa210365e148877f0f3698292a1b509018ffIan Elliott
63a3b7170656404199592bb65040621772f299a7f3Hugo Landau// Returns nonzero if the console is used only for this process. Will return
64a3b7170656404199592bb65040621772f299a7f3Hugo Landau// zero if another process (such as cmd.exe) is also attached.
65a3b7170656404199592bb65040621772f299a7f3Hugo Landaustatic int ConsoleIsExclusive(void) {
66a3b7170656404199592bb65040621772f299a7f3Hugo Landau    DWORD pids[2];
67a3b7170656404199592bb65040621772f299a7f3Hugo Landau    DWORD num_pids = GetConsoleProcessList(pids, ARRAYSIZE(pids));
68a3b7170656404199592bb65040621772f299a7f3Hugo Landau    return num_pids <= 1;
69a3b7170656404199592bb65040621772f299a7f3Hugo Landau}
7018fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo
71cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#define WAIT_FOR_CONSOLE_DESTROY                   \
72cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    do {                                           \
73cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        if (ConsoleIsExclusive()) Sleep(INFINITE); \
7418fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo    } while (0)
7518fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo#else
76481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz#define WAIT_FOR_CONSOLE_DESTROY
7718fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo#endif
7818fb9239e51c9449fa072e3a398a55777f5c3c62David Pinedo
79cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#define ERR_EXIT(err)             \
80cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    do {                          \
81cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        ERR(err);                 \
82cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        fflush(stdout);           \
83cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        WAIT_FOR_CONSOLE_DESTROY; \
84cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        exit(-1);                 \
85481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    } while (0)
8646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
8722a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour#if defined(NDEBUG) && defined(__GNUC__)
8822a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour#define U_ASSERT_ONLY __attribute__((unused))
8922a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour#else
9022a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour#define U_ASSERT_ONLY
9122a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour#endif
9222a30866de6210d780995dfaaae39f1a73115aa0Tony Barbour
9346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
9446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
9546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu#define MAX_QUEUE_TYPES 5
964e19ed0ed322e45993bac7917a1a253dbaaf88f9Ian Elliott#define APP_SHORT_NAME "vulkaninfo"
9746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
9897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic bool html_output;
9997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
1005d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniagerstruct VkStructureHeader {
1015d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkStructureType sType;
1025d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    void *pNext;
1035d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager};
1045d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
105f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstruct AppGpu;
10646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
107f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstruct AppDev {
108f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    struct AppGpu *gpu; /* point back to the GPU */
10946c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
110382489d723fd0d3935da0dc7e1021c56c7b721d3Courtney Goeltzenleuchter    VkDevice obj;
11146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
112d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt    VkFormatProperties format_props[VK_FORMAT_RANGE_SIZE];
113d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt    VkFormatProperties2KHR format_props2[VK_FORMAT_RANGE_SIZE];
11446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu};
11546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
116f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstruct LayerExtensionList {
11718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    VkLayerProperties layer_properties;
11818061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    uint32_t extension_count;
11918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    VkExtensionProperties *extension_properties;
12018061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter};
12118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
122f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstruct AppInstance {
123481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    VkInstance instance;
12418061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    uint32_t global_layer_count;
125f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    struct LayerExtensionList *global_layers;
1263c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    uint32_t global_extension_count;
127cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    VkExtensionProperties *global_extensions;  // Instance Extensions
128a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1295d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    const char **inst_extensions;
1305d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    uint32_t inst_extensions_count;
1315d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
132bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
133bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
134bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
135bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
1365d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR;
1375d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR;
1385d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR;
1395d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR;
1405d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR;
1415d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR;
1425d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT;
1435d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
1445d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkSurfaceCapabilitiesKHR surface_capabilities;
1455d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkSurfaceCapabilities2KHR surface_capabilities2;
1465d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkSharedPresentSurfaceCapabilitiesKHR shared_surface_capabilities;
1475d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkSurfaceCapabilities2EXT surface_capabilities2_ext;
148a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
149a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkSurfaceKHR surface;
150a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    int width, height;
151a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
152a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#ifdef VK_USE_PLATFORM_WIN32_KHR
153cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    HINSTANCE h_instance;  // Windows Instance
154cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    HWND h_wnd;            // window handle
155b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XCB_KHR
1567fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    xcb_connection_t *xcb_connection;
1577fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    xcb_screen_t *xcb_screen;
1587fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    xcb_window_t xcb_window;
159b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XLIB_KHR
1607fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    Display *xlib_display;
1617fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    Window xlib_window;
162cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#elif VK_USE_PLATFORM_ANDROID_KHR  // TODO
1637fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    ANativeWindow *window;
164a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#endif
1653c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter};
1663c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter
167f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstruct AppGpu {
168e2d07a5a3810d83d0ea7ecb396d61477893b74a4Mark Lobodzinski    uint32_t id;
1698205d901f17b1c76d89c956be235cf4e7a20a546Tony Barbour    VkPhysicalDevice obj;
17046c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
1718205d901f17b1c76d89c956be235cf4e7a20a546Tony Barbour    VkPhysicalDeviceProperties props;
1725d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkPhysicalDeviceProperties2KHR props2;
17346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
174e2d07a5a3810d83d0ea7ecb396d61477893b74a4Mark Lobodzinski    uint32_t queue_count;
175ef72e2a7cf4fa5708fdbfbc1c972a24ad0dbf809Cody Northrop    VkQueueFamilyProperties *queue_props;
1765d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkQueueFamilyProperties2KHR *queue_props2;
177ddcb6192458d696a106f48eeb12fd0390a3ca63fCourtney Goeltzenleuchter    VkDeviceQueueCreateInfo *queue_reqs;
17846c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
1795d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    struct AppInstance *inst;
1805d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
1818205d901f17b1c76d89c956be235cf4e7a20a546Tony Barbour    VkPhysicalDeviceMemoryProperties memory_props;
1825d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkPhysicalDeviceMemoryProperties2KHR memory_props2;
1835d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
184a048b3146ed9bc094adf4d6ba7355cd8a5ef7008Chris Forbes    VkPhysicalDeviceFeatures features;
1855d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkPhysicalDeviceFeatures2KHR features2;
1867dae6868682383bb8370d45784cbc94f357e745bMark Lobodzinski    VkPhysicalDevice limits;
18746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
1883c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    uint32_t device_extension_count;
1893c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    VkExtensionProperties *device_extensions;
19046c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
191f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    struct AppDev dev;
19246c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu};
19346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
194bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinskistatic VKAPI_ATTR VkBool32 VKAPI_CALL DbgCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject,
195bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski                                                  size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg,
196bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski                                                  void *pUserData) {
197481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    char *message = (char *)malloc(strlen(pMsg) + 100);
198f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter
199481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    assert(message);
200f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter
201acb1359c8e1528e5d67bb0101c94c48a07785098Courtney Goeltzenleuchter    if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) {
202bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        sprintf(message, "ERROR: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
2035c13d4d87fd0356003a3441e887a172b991e880fMark Lobodzinski    } else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) {
204bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        sprintf(message, "WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
2055c13d4d87fd0356003a3441e887a172b991e880fMark Lobodzinski    } else if (msgFlags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT) {
206bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        sprintf(message, "INFO: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
207acb1359c8e1528e5d67bb0101c94c48a07785098Courtney Goeltzenleuchter    } else if (msgFlags & VK_DEBUG_REPORT_DEBUG_BIT_EXT) {
208bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        sprintf(message, "DEBUG: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
209f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    }
210f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter
211481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    printf("%s\n", message);
212f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    fflush(stdout);
213f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    free(message);
214f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter
215f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    /*
216f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter     * false indicates that layer should not bail-out of an
217f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter     * API call that had validation failures. This may mean that the
218f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter     * app dies inside the driver due to invalid parameter(s).
219f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter     * That's what would happen without validation layers, so we'll
220f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter     * keep that behavior here.
221f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter     */
222f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    return false;
223f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter}
224f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter
225f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic const char *VkResultString(VkResult err) {
22646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    switch (err) {
227cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#define STR(r) \
228cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    case r:    \
229481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        return #r
230481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_SUCCESS);
231481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_NOT_READY);
232481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_TIMEOUT);
233481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_EVENT_SET);
234481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_EVENT_RESET);
235481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_INITIALIZATION_FAILED);
236481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_OUT_OF_HOST_MEMORY);
237481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_OUT_OF_DEVICE_MEMORY);
238481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_DEVICE_LOST);
239481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_LAYER_NOT_PRESENT);
240481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_EXTENSION_NOT_PRESENT);
241481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_MEMORY_MAP_FAILED);
242481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VK_ERROR_INCOMPATIBLE_DRIVER);
24346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu#undef STR
244cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        default:
245cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski            return "UNKNOWN_RESULT";
24646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    }
24746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
248d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
249f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic const char *VkPhysicalDeviceTypeString(VkPhysicalDeviceType type) {
250190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    switch (type) {
251cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#define STR(r)                        \
252cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    case VK_PHYSICAL_DEVICE_TYPE_##r: \
253481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        return #r
254481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(OTHER);
255481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(INTEGRATED_GPU);
256481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(DISCRETE_GPU);
257481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(VIRTUAL_GPU);
25855016b83baf512e5590d4ed265081fa33eb4d4ffChris Forbes        STR(CPU);
259d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu#undef STR
260cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        default:
261cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski            return "UNKNOWN_DEVICE";
262190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    }
263d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
264d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
265f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic const char *VkFormatString(VkFormat fmt) {
2662b7e88a1fdefc49d78e80765745e87e00034c2a0Jeremy Hayes    switch (fmt) {
267cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#define STR(r)          \
268cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    case VK_FORMAT_##r: \
269481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        return #r
270481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(UNDEFINED);
271481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R4G4_UNORM_PACK8);
272481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R4G4B4A4_UNORM_PACK16);
273481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B4G4R4A4_UNORM_PACK16);
274481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R5G6B5_UNORM_PACK16);
275481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B5G6R5_UNORM_PACK16);
276481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R5G5B5A1_UNORM_PACK16);
277481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B5G5R5A1_UNORM_PACK16);
278481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A1R5G5B5_UNORM_PACK16);
279481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_UNORM);
280481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_SNORM);
281481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_USCALED);
282481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_SSCALED);
283481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_UINT);
284481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_SINT);
285481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8_SRGB);
286481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_UNORM);
287481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_SNORM);
288481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_USCALED);
289481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_SSCALED);
290481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_UINT);
291481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_SINT);
292481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8_SRGB);
293481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_UNORM);
294481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_SNORM);
295481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_USCALED);
296481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_SSCALED);
297481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_UINT);
298481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_SINT);
299481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8_SRGB);
300481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_UNORM);
301481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_SNORM);
302481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_USCALED);
303481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_SSCALED);
304481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_UINT);
305481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_SINT);
306481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8_SRGB);
307481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_UNORM);
308481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_SNORM);
309481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_USCALED);
310481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_SSCALED);
311481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_UINT);
312481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_SINT);
313481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R8G8B8A8_SRGB);
314481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_UNORM);
315481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_SNORM);
316481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_USCALED);
317481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_SSCALED);
318481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_UINT);
319481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_SINT);
320481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B8G8R8A8_SRGB);
321481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_UNORM_PACK32);
322481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_SNORM_PACK32);
323481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_USCALED_PACK32);
324481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_SSCALED_PACK32);
325481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_UINT_PACK32);
326481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_SINT_PACK32);
327481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A8B8G8R8_SRGB_PACK32);
328481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2R10G10B10_UNORM_PACK32);
329481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2R10G10B10_SNORM_PACK32);
330481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2R10G10B10_USCALED_PACK32);
331481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2R10G10B10_SSCALED_PACK32);
332481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2R10G10B10_UINT_PACK32);
333481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2R10G10B10_SINT_PACK32);
334481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2B10G10R10_UNORM_PACK32);
335481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2B10G10R10_SNORM_PACK32);
336481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2B10G10R10_USCALED_PACK32);
337481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2B10G10R10_SSCALED_PACK32);
338481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2B10G10R10_UINT_PACK32);
339481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(A2B10G10R10_SINT_PACK32);
340481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_UNORM);
341481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_SNORM);
342481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_USCALED);
343481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_SSCALED);
344481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_UINT);
345481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_SINT);
346481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16_SFLOAT);
347481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_UNORM);
348481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_SNORM);
349481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_USCALED);
350481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_SSCALED);
351481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_UINT);
352481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_SINT);
353481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16_SFLOAT);
354481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_UNORM);
355481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_SNORM);
356481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_USCALED);
357481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_SSCALED);
358481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_UINT);
359481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_SINT);
360481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16_SFLOAT);
361481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_UNORM);
362481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_SNORM);
363481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_USCALED);
364481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_SSCALED);
365481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_UINT);
366481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_SINT);
367481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R16G16B16A16_SFLOAT);
368481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32_UINT);
369481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32_SINT);
370481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32_SFLOAT);
371481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32_UINT);
372481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32_SINT);
373481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32_SFLOAT);
374481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32B32_UINT);
375481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32B32_SINT);
376481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32B32_SFLOAT);
377481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32B32A32_UINT);
378481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32B32A32_SINT);
379481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R32G32B32A32_SFLOAT);
380481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64_UINT);
381481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64_SINT);
382481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64_SFLOAT);
383481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64_UINT);
384481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64_SINT);
385481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64_SFLOAT);
386481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64B64_UINT);
387481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64B64_SINT);
388481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64B64_SFLOAT);
389481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64B64A64_UINT);
390481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64B64A64_SINT);
391481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(R64G64B64A64_SFLOAT);
392481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(B10G11R11_UFLOAT_PACK32);
393481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(E5B9G9R9_UFLOAT_PACK32);
394481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(D16_UNORM);
395481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(X8_D24_UNORM_PACK32);
396481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(D32_SFLOAT);
397481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(S8_UINT);
398481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(D16_UNORM_S8_UINT);
399481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(D24_UNORM_S8_UINT);
400481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(D32_SFLOAT_S8_UINT);
401481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC1_RGB_UNORM_BLOCK);
402481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC1_RGB_SRGB_BLOCK);
403caa2132e470bc79e733fcf49409f7959f4a99a9aWladimir J. van der Laan        STR(BC1_RGBA_UNORM_BLOCK);
404caa2132e470bc79e733fcf49409f7959f4a99a9aWladimir J. van der Laan        STR(BC1_RGBA_SRGB_BLOCK);
405481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC2_UNORM_BLOCK);
406481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC2_SRGB_BLOCK);
407481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC3_UNORM_BLOCK);
408481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC3_SRGB_BLOCK);
409481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC4_UNORM_BLOCK);
410481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC4_SNORM_BLOCK);
411481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC5_UNORM_BLOCK);
412481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC5_SNORM_BLOCK);
413481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC6H_UFLOAT_BLOCK);
414481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC6H_SFLOAT_BLOCK);
415481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC7_UNORM_BLOCK);
416481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(BC7_SRGB_BLOCK);
417481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ETC2_R8G8B8_UNORM_BLOCK);
418caa2132e470bc79e733fcf49409f7959f4a99a9aWladimir J. van der Laan        STR(ETC2_R8G8B8_SRGB_BLOCK);
419481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ETC2_R8G8B8A1_UNORM_BLOCK);
420caa2132e470bc79e733fcf49409f7959f4a99a9aWladimir J. van der Laan        STR(ETC2_R8G8B8A1_SRGB_BLOCK);
421481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ETC2_R8G8B8A8_UNORM_BLOCK);
422caa2132e470bc79e733fcf49409f7959f4a99a9aWladimir J. van der Laan        STR(ETC2_R8G8B8A8_SRGB_BLOCK);
423481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(EAC_R11_UNORM_BLOCK);
424481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(EAC_R11_SNORM_BLOCK);
425481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(EAC_R11G11_UNORM_BLOCK);
426481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(EAC_R11G11_SNORM_BLOCK);
427481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_4x4_UNORM_BLOCK);
428481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_4x4_SRGB_BLOCK);
429481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_5x4_UNORM_BLOCK);
430481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_5x4_SRGB_BLOCK);
431481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_5x5_UNORM_BLOCK);
432481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_5x5_SRGB_BLOCK);
433481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_6x5_UNORM_BLOCK);
434481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_6x5_SRGB_BLOCK);
435481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_6x6_UNORM_BLOCK);
436481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_6x6_SRGB_BLOCK);
437481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_8x5_UNORM_BLOCK);
438481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_8x5_SRGB_BLOCK);
439481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_8x6_UNORM_BLOCK);
440481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_8x6_SRGB_BLOCK);
441481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_8x8_UNORM_BLOCK);
442481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_8x8_SRGB_BLOCK);
443481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x5_UNORM_BLOCK);
444481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x5_SRGB_BLOCK);
445481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x6_UNORM_BLOCK);
446481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x6_SRGB_BLOCK);
447481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x8_UNORM_BLOCK);
448481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x8_SRGB_BLOCK);
449481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x10_UNORM_BLOCK);
450481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_10x10_SRGB_BLOCK);
451481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_12x10_UNORM_BLOCK);
452481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_12x10_SRGB_BLOCK);
453481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_12x12_UNORM_BLOCK);
454481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        STR(ASTC_12x12_SRGB_BLOCK);
455d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu#undef STR
456cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        default:
457cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski            return "UNKNOWN_FORMAT";
458190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    }
459d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
460bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski#if defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_WIN32_KHR)
461f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic const char *VkPresentModeString(VkPresentModeKHR mode) {
4627b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    switch (mode) {
463cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski#define STR(r)                \
464cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    case VK_PRESENT_MODE_##r: \
4657b3aadea3a889f1e04529f50649124277a47db46joey-lunarg        return #r
4667b3aadea3a889f1e04529f50649124277a47db46joey-lunarg        STR(IMMEDIATE_KHR);
4677b3aadea3a889f1e04529f50649124277a47db46joey-lunarg        STR(MAILBOX_KHR);
4687b3aadea3a889f1e04529f50649124277a47db46joey-lunarg        STR(FIFO_KHR);
4697b3aadea3a889f1e04529f50649124277a47db46joey-lunarg        STR(FIFO_RELAXED_KHR);
4707b3aadea3a889f1e04529f50649124277a47db46joey-lunarg#undef STR
471cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        default:
472cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski            return "UNKNOWN_FORMAT";
4737b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    }
4747b3aadea3a889f1e04529f50649124277a47db46joey-lunarg}
475b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#endif
4767b3aadea3a889f1e04529f50649124277a47db46joey-lunarg
4775d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniagerstatic bool CheckExtensionEnabled(const char *extension_to_check, const char **extension_list, uint32_t extension_count) {
4785d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    for (uint32_t i = 0; i < extension_count; i++) {
4795d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        if (!strcmp(extension_to_check, extension_list[i])) return true;
4805d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
4815d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    return false;
4825d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager}
4832b7e88a1fdefc49d78e80765745e87e00034c2a0Jeremy Hayes
4845d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniagerstatic void AppDevInitFormats(struct AppDev *dev) {
485d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt    VkFormat f;
486d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt    for (f = 0; f < VK_FORMAT_RANGE_SIZE; f++) {
487d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt        const VkFormat fmt = f;
488d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt        vkGetPhysicalDeviceFormatProperties(dev->gpu->obj, fmt, &dev->format_props[f]);
4895d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
4905d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, dev->gpu->inst->inst_extensions,
4915d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                  dev->gpu->inst->inst_extensions_count)) {
492d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt            dev->format_props2[f].sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR;
493d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt            dev->format_props2[f].pNext = NULL;
494d4e49b7247597ede0971205cde2553312680f34cMike Schuchardt            dev->gpu->inst->vkGetPhysicalDeviceFormatProperties2KHR(dev->gpu->obj, fmt, &dev->format_props2[f]);
4955d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        }
49646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    }
49746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
49846c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
499bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinskistatic void ExtractVersion(uint32_t version, uint32_t *major, uint32_t *minor, uint32_t *patch) {
50018061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *major = version >> 22;
50118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *minor = (version >> 12) & 0x3ff;
50218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *patch = version & 0xfff;
50318061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter}
50418061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
505bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinskistatic void AppGetPhysicalDeviceLayerExtensions(struct AppGpu *gpu, char *layer_name, uint32_t *extension_count,
506bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski                                                VkExtensionProperties **extension_properties) {
50718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    VkResult err;
50818061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    uint32_t ext_count = 0;
50918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    VkExtensionProperties *ext_ptr = NULL;
51018061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
51118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    /* repeat get until VK_INCOMPLETE goes away */
51218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    do {
513bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        err = vkEnumerateDeviceExtensionProperties(gpu->obj, layer_name, &ext_count, NULL);
51418061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        assert(!err);
51518061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
51618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        if (ext_ptr) {
51718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter            free(ext_ptr);
51818061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        }
51918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        ext_ptr = malloc(ext_count * sizeof(VkExtensionProperties));
520bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        err = vkEnumerateDeviceExtensionProperties(gpu->obj, layer_name, &ext_count, ext_ptr);
52118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    } while (err == VK_INCOMPLETE);
52218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    assert(!err);
52318061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
52418061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *extension_count = ext_count;
52518061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *extension_properties = ext_ptr;
52618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter}
52718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
528f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDevInit(struct AppDev *dev, struct AppGpu *gpu) {
529ddcb6192458d696a106f48eeb12fd0390a3ca63fCourtney Goeltzenleuchter    VkDeviceCreateInfo info = {
5309cc421eb545767e22fd723dc573a7a3225261b1cCourtney Goeltzenleuchter        .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
53146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu        .pNext = NULL,
5328173093c7d5db4415108a25e24fd0c07d7209f20Tony Barbour        .flags = 0,
533045654f003fa47a4a15cba6709222c75b5e72e41Chia-I Wu        .queueCreateInfoCount = 0,
534045654f003fa47a4a15cba6709222c75b5e72e41Chia-I Wu        .pQueueCreateInfos = NULL,
535a4ae48bfd6f2e2a80e1f92e054a007cf90a4e218Jon Ashburn        .enabledLayerCount = 0,
53618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        .ppEnabledLayerNames = NULL,
537a4ae48bfd6f2e2a80e1f92e054a007cf90a4e218Jon Ashburn        .enabledExtensionCount = 0,
53818061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        .ppEnabledExtensionNames = NULL,
53946c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    };
5403c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    VkResult U_ASSERT_ONLY err;
541426b90566abae5716741aade41184dc4dafe4aa4Tony Barbour
5429652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay    // Device extensions
543bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    AppGetPhysicalDeviceLayerExtensions(gpu, NULL, &gpu->device_extension_count, &gpu->device_extensions);
5443c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter
5459e42b8882f26e897f0022f5ce800a04f4d2ad1cfCourtney Goeltzenleuchter    fflush(stdout);
5469e42b8882f26e897f0022f5ce800a04f4d2ad1cfCourtney Goeltzenleuchter
54746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    /* request all queues */
548045654f003fa47a4a15cba6709222c75b5e72e41Chia-I Wu    info.queueCreateInfoCount = gpu->queue_count;
549045654f003fa47a4a15cba6709222c75b5e72e41Chia-I Wu    info.pQueueCreateInfos = gpu->queue_reqs;
55046c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
551a4ae48bfd6f2e2a80e1f92e054a007cf90a4e218Jon Ashburn    info.enabledLayerCount = 0;
55218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    info.ppEnabledLayerNames = NULL;
5534ead55c47dc19d771244bec82679a0f97544c741Jon Ashburn    info.enabledExtensionCount = 0;
5544ead55c47dc19d771244bec82679a0f97544c741Jon Ashburn    info.ppEnabledExtensionNames = NULL;
5553c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    dev->gpu = gpu;
55669f40128cce0970d10aaa30ea8c6b56a7dda3f36Chia-I Wu    err = vkCreateDevice(gpu->obj, &info, NULL, &dev->obj);
557cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (err) ERR_EXIT(err);
55846c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
55946c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
560f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDevDestroy(struct AppDev *dev) {
561c7e3fbda0891c48fb667f645d40d495be48f3fe8Tony Barbour    vkDeviceWaitIdle(dev->obj);
56269f40128cce0970d10aaa30ea8c6b56a7dda3f36Chia-I Wu    vkDestroyDevice(dev->obj, NULL);
56346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
56446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
565bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinskistatic void AppGetGlobalLayerExtensions(char *layer_name, uint32_t *extension_count, VkExtensionProperties **extension_properties) {
56618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    VkResult err;
56718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    uint32_t ext_count = 0;
56818061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    VkExtensionProperties *ext_ptr = NULL;
56918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
57018061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    /* repeat get until VK_INCOMPLETE goes away */
57118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    do {
5727fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        // gets the extension count if the last parameter is NULL
573bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        err = vkEnumerateInstanceExtensionProperties(layer_name, &ext_count, NULL);
57418061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        assert(!err);
57518061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
57618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        if (ext_ptr) {
57718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter            free(ext_ptr);
57818061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        }
57918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        ext_ptr = malloc(ext_count * sizeof(VkExtensionProperties));
5807fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        // gets the extension properties if the last parameter is not NULL
581bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        err = vkEnumerateInstanceExtensionProperties(layer_name, &ext_count, ext_ptr);
58218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    } while (err == VK_INCOMPLETE);
58318061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    assert(!err);
58418061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *extension_count = ext_count;
58518061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    *extension_properties = ext_ptr;
58618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter}
58718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
5887fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay/* Gets a list of layer and instance extensions */
589f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppGetInstanceExtensions(struct AppInstance *inst) {
5907fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    VkResult U_ASSERT_ONLY err;
591a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
5927fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    uint32_t count = 0;
593a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
5947fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    /* Scan layers */
5957fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    VkLayerProperties *global_layer_properties = NULL;
596f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    struct LayerExtensionList *global_layers = NULL;
597a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
5987fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    do {
5997fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        err = vkEnumerateInstanceLayerProperties(&count, NULL);
6007fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        assert(!err);
601a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
6027fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        if (global_layer_properties) {
6037fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay            free(global_layer_properties);
6047fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        }
6057fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        global_layer_properties = malloc(sizeof(VkLayerProperties) * count);
6067fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        assert(global_layer_properties);
607a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
6087fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        if (global_layers) {
6097fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay            free(global_layers);
6107fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        }
611f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        global_layers = malloc(sizeof(struct LayerExtensionList) * count);
6127fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        assert(global_layers);
613a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
614bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        err = vkEnumerateInstanceLayerProperties(&count, global_layer_properties);
6157fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    } while (err == VK_INCOMPLETE);
6167fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    assert(!err);
617a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
6187fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    inst->global_layer_count = count;
6197fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    inst->global_layers = global_layers;
620a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
6217fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    for (uint32_t i = 0; i < inst->global_layer_count; i++) {
6227fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        VkLayerProperties *src_info = &global_layer_properties[i];
623f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        struct LayerExtensionList *dst_info = &inst->global_layers[i];
624bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        memcpy(&dst_info->layer_properties, src_info, sizeof(VkLayerProperties));
625a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
626cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay        // Save away layer extension info for report
627cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay        // Gets layer extensions, if first parameter is not NULL
628bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        AppGetGlobalLayerExtensions(src_info->layerName, &dst_info->extension_count, &dst_info->extension_properties);
6297fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    }
6307fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    free(global_layer_properties);
6317fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay
632cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    // Collect global extensions
6337fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    inst->global_extension_count = 0;
6349652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay    // Gets instance extensions, if no layer was specified in the first
6359652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay    // paramteter
636bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    AppGetGlobalLayerExtensions(NULL, &inst->global_extension_count, &inst->global_extensions);
637a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
638a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
63997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson// Prints opening CSS and HTML code for html output file
64097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson// Defines various div text styles
64197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonvoid PrintHtmlHeader(FILE *out) {
64297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "<!doctype html>\n");
64397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "<html>\n");
64497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t<head>\n");
64597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t<title>Vulkan Info</title>\n");
64697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t<style type='text/css'>\n");
64797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\thtml {\n");
64897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-color: #0b1e48;\n");
64997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-image: url(\"https://vulkan.lunarg.com/img/bg-starfield.jpg\");\n");
65097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-position: center;\n");
65197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\t-webkit-background-size: cover;\n");
65297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\t-moz-background-size: cover;\n");
65397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\t-o-background-size: cover;\n");
65497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-size: cover;\n");
65597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-attachment: fixed;\n");
65697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-repeat: no-repeat;\n");
65797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\theight: 100%%;\n");
65897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
65997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t#header {\n");
66097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tz-index: -1;\n");
66197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
66297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t#header>img {\n");
66397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tposition: absolute;\n");
66497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\twidth: 160px;\n");
66597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tmargin-left: -280px;\n");
66697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\ttop: -10px;\n");
66797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tleft: 50%%;\n");
66897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
66997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t#header>h1 {\n");
67097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tfont-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\n");
67197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tfont-size: 44px;\n");
67297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tfont-weight: 200;\n");
67397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\ttext-shadow: 4px 4px 5px #000;\n");
67497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tcolor: #eee;\n");
67597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tposition: absolute;\n");
67697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\twidth: 400px;\n");
67797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tmargin-left: -80px;\n");
67897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\ttop: 8px;\n");
67997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tleft: 50%%;\n");
68097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
68197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\tbody {\n");
68297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tfont-family: Consolas, monaco, monospace;\n");
68397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tfont-size: 14px;\n");
68497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tline-height: 20px;\n");
68597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tcolor: #eee;\n");
68697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\theight: 100%%;\n");
68797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tmargin: 0;\n");
68897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\toverflow: hidden;\n");
68997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
69097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t#wrapper {\n");
69197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground-color: rgba(0, 0, 0, 0.7);\n");
69297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tborder: 1px solid #446;\n");
69397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbox-shadow: 0px 0px 10px #000;\n");
69497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tpadding: 8px 12px;\n\n");
69597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tdisplay: inline-block;\n");
69697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tposition: absolute;\n");
69797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\ttop: 80px;\n");
69897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbottom: 25px;\n");
69997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tleft: 50px;\n");
70097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tright: 50px;\n");
70197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\toverflow: auto;\n");
70297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
70397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\tdetails>details {\n");
70497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tmargin-left: 22px;\n");
70597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
70697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\tdetails>summary:only-child::-webkit-details-marker {\n");
70797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tdisplay: none;\n");
70897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
70997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t.var, .type, .val {\n");
71097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tdisplay: inline;\n");
71197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
71297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t.var {\n");
71397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
71497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t.type {\n");
71597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tcolor: #acf;\n");
71697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tmargin: 0 12px;\n");
71797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
71897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t.val {\n");
71997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tcolor: #afa;\n");
72097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\tbackground: #222;\n");
72197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\ttext-align: right;\n");
72297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t}\n");
72397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t</style>\n");
72497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t</head>\n");
72597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t<body>\n");
72697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t<div id='header'>\n");
72797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\t<img src='C:/Git/VulkanTools/layersvt/images/lunarg.png' />\n");
72897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t\t<h1>Vulkan Info</h1>\n");
72997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t</div>\n");
73097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t<div id='wrapper'>\n");
73197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson}
73297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
73397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson// Prints closing HTML code for html output file
73497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonvoid PrintHtmlFooter(FILE *out) {
73597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t\t</div>\n");
73697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "\t</body>\n");
73797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "</html>");
73897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson}
73997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
74097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson// static void AppCreateInstance(struct AppInstance *inst, int argc, ...) {
741f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateInstance(struct AppInstance *inst) {
742f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    AppGetInstanceExtensions(inst);
743a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
74497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    //---Build a list of extensions to load---
745a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
7465d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    const char *info_instance_extensions[] = {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME,
7475d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME,
7485d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_SURFACE_EXTENSION_NAME,
7495d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME,
7505d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME,
7517fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay#ifdef VK_USE_PLATFORM_WIN32_KHR
7525d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_WIN32_SURFACE_EXTENSION_NAME
753b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XCB_KHR
7545d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_XCB_SURFACE_EXTENSION_NAME
755b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XLIB_KHR
7565d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_XLIB_SURFACE_EXTENSION_NAME
757b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_WAYLAND_KHR
7585d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME
759b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_ANDROID_KHR
7605d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                              VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
761a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#endif
7625d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    };
7635d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    uint32_t info_instance_extensions_count = ARRAY_SIZE(info_instance_extensions);
7645d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->inst_extensions = malloc(sizeof(char *) * ARRAY_SIZE(info_instance_extensions));
7655d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->inst_extensions_count = 0;
7665d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
7675d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    for (uint32_t k = 0; (k < info_instance_extensions_count); k++) {
7685d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        for (uint32_t j = 0; (j < inst->global_extension_count); j++) {
7695d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            const char *found_name = inst->global_extensions[j].extensionName;
7705d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            if (!strcmp(info_instance_extensions[k], found_name)) {
7715d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                inst->inst_extensions[inst->inst_extensions_count++] = info_instance_extensions[k];
7725d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                break;
7735d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            }
7747fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        }
7755d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
7765d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
777a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    //----------------------------------------
778a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
7793c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    const VkApplicationInfo app_info = {
7803c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
7813c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        .pNext = NULL,
7821f85191a3a8479194ecb7b937aee284cf80cf08fChia-I Wu        .pApplicationName = APP_SHORT_NAME,
7831f85191a3a8479194ecb7b937aee284cf80cf08fChia-I Wu        .applicationVersion = 1,
7843c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        .pEngineName = APP_SHORT_NAME,
7853c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        .engineVersion = 1,
786d3995c987ba7e47700ceb54535880e782c6b04c1Jon Ashburn        .apiVersion = VK_API_VERSION_1_0,
7873c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    };
788a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
7895d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    VkInstanceCreateInfo inst_info = {.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
7905d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                      .pNext = NULL,
7915d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                      .pApplicationInfo = &app_info,
7925d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                      .enabledLayerCount = 0,
7935d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                      .ppEnabledLayerNames = NULL,
7945d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                      .enabledExtensionCount = inst->inst_extensions_count,
7955d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                                      .ppEnabledExtensionNames = inst->inst_extensions};
79646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
797acb1359c8e1528e5d67bb0101c94c48a07785098Courtney Goeltzenleuchter    VkDebugReportCallbackCreateInfoEXT dbg_info;
798f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    memset(&dbg_info, 0, sizeof(dbg_info));
799acb1359c8e1528e5d67bb0101c94c48a07785098Courtney Goeltzenleuchter    dbg_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT;
80038962ad6907bee43493fc48a35b5b654326110ddJeremy Kniager    dbg_info.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
801f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    dbg_info.pfnCallback = DbgCallback;
802f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter    inst_info.pNext = &dbg_info;
803f412d576c9f1d7635786d44e9f40885beaa9867eCourtney Goeltzenleuchter
804a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkResult U_ASSERT_ONLY err;
80569f40128cce0970d10aaa30ea8c6b56a7dda3f36Chia-I Wu    err = vkCreateInstance(&inst_info, NULL, &inst->instance);
8063c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    if (err == VK_ERROR_INCOMPATIBLE_DRIVER) {
8073c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        printf("Cannot create Vulkan instance.\n");
8083c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        ERR_EXIT(err);
8093c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    } else if (err) {
8103c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter        ERR_EXIT(err);
81146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    }
812a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
8135d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceSurfaceSupportKHR =
81497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceSurfaceSupportKHR");
8155d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)vkGetInstanceProcAddr(
81697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
8175d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceSurfaceFormatsKHR =
81897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceSurfaceFormatsKHR");
8195d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)vkGetInstanceProcAddr(
82097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceSurfacePresentModesKHR");
8215d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceProperties2KHR =
82297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            (PFN_vkGetPhysicalDeviceProperties2KHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceProperties2KHR");
8235d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceFormatProperties2KHR = (PFN_vkGetPhysicalDeviceFormatProperties2KHR)vkGetInstanceProcAddr(
82497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceFormatProperties2KHR");
8255d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceQueueFamilyProperties2KHR = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)vkGetInstanceProcAddr(
82697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR");
8275d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceFeatures2KHR =
82897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            (PFN_vkGetPhysicalDeviceFeatures2KHR)vkGetInstanceProcAddr(inst->instance, "vkGetPhysicalDeviceFeatures2KHR");
8295d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2KHR)vkGetInstanceProcAddr(
83097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceMemoryProperties2KHR");
8315d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)vkGetInstanceProcAddr(
83297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR");
8335d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    inst->vkGetPhysicalDeviceSurfaceCapabilities2EXT = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)vkGetInstanceProcAddr(
83497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            inst->instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT");
8353c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter}
8363c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter
837a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//-----------------------------------------------------------
838a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
839f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDestroyInstance(struct AppInstance *inst) {
8403c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    free(inst->global_extensions);
8415d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    for (uint32_t i = 0; i < inst->global_layer_count; i++) {
8425d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        free(inst->global_layers[i].extension_properties);
8435d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
8445d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    free(inst->global_layers);
84597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    free((char **)inst->inst_extensions);
84669f40128cce0970d10aaa30ea8c6b56a7dda3f36Chia-I Wu    vkDestroyInstance(inst->instance, NULL);
84746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
84846c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
8495d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniagerstatic void AppGpuInit(struct AppGpu *gpu, struct AppInstance *inst, uint32_t id, VkPhysicalDevice obj) {
850aae1a570a95ca8074d48698372694bb1ef2b5530Ian Elliott    uint32_t i;
85146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
85246c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    memset(gpu, 0, sizeof(*gpu));
85346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
85446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    gpu->id = id;
85546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    gpu->obj = obj;
8565d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    gpu->inst = inst;
857426b90566abae5716741aade41184dc4dafe4aa4Tony Barbour
85801d2ae18f05184e04eb29a2ab30480f8d4660d25Courtney Goeltzenleuchter    vkGetPhysicalDeviceProperties(gpu->obj, &gpu->props);
85946c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
8605d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions,
8615d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                              gpu->inst->inst_extensions_count)) {
8625d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->props2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
8635d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->props2.pNext = NULL;
8645d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
8655d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        inst->vkGetPhysicalDeviceProperties2KHR(gpu->obj, &gpu->props2);
8665d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
8675d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
86846c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    /* get queue count */
86901d2ae18f05184e04eb29a2ab30480f8d4660d25Courtney Goeltzenleuchter    vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, NULL);
87046c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
871481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    gpu->queue_props = malloc(sizeof(gpu->queue_props[0]) * gpu->queue_count);
872426b90566abae5716741aade41184dc4dafe4aa4Tony Barbour
873cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (!gpu->queue_props) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
874bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski    vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, gpu->queue_props);
87546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
8765d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions,
8775d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                              gpu->inst->inst_extensions_count)) {
8785d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->queue_props2 = malloc(sizeof(gpu->queue_props2[0]) * gpu->queue_count);
8795d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
8805d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        if (!gpu->queue_props2) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
8815d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
8825d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        for (i = 0; i < gpu->queue_count; i++) {
8835d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            gpu->queue_props2[i].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR;
8845d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            gpu->queue_props2[i].pNext = NULL;
8855d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        }
8865d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
8875d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        inst->vkGetPhysicalDeviceQueueFamilyProperties2KHR(gpu->obj, &gpu->queue_count, gpu->queue_props2);
8885d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
8895d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
89046c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    /* set up queue requests */
89146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    gpu->queue_reqs = malloc(sizeof(*gpu->queue_reqs) * gpu->queue_count);
892cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (!gpu->queue_reqs) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
89346c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    for (i = 0; i < gpu->queue_count; i++) {
894bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        float *queue_priorities = malloc(gpu->queue_props[i].queueCount * sizeof(float));
895cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski        if (!queue_priorities) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
896bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        memset(queue_priorities, 0, gpu->queue_props[i].queueCount * sizeof(float));
8975d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
898ea97564708cfcbebb42a842edac456e79643e716Courtney Goeltzenleuchter        gpu->queue_reqs[i].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
899ea97564708cfcbebb42a842edac456e79643e716Courtney Goeltzenleuchter        gpu->queue_reqs[i].pNext = NULL;
9008173093c7d5db4415108a25e24fd0c07d7209f20Tony Barbour        gpu->queue_reqs[i].flags = 0;
901fa6d36ea26354e4d68e81b05d1199a83c9fa3d6aChris Forbes        gpu->queue_reqs[i].queueFamilyIndex = i;
902045654f003fa47a4a15cba6709222c75b5e72e41Chia-I Wu        gpu->queue_reqs[i].queueCount = gpu->queue_props[i].queueCount;
903d3a8d3699ceffb62da8d95d1fb49242fb25b43bfCourtney Goeltzenleuchter        gpu->queue_reqs[i].pQueuePriorities = queue_priorities;
90446c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    }
90546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
90601d2ae18f05184e04eb29a2ab30480f8d4660d25Courtney Goeltzenleuchter    vkGetPhysicalDeviceMemoryProperties(gpu->obj, &gpu->memory_props);
90746c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
90801d2ae18f05184e04eb29a2ab30480f8d4660d25Courtney Goeltzenleuchter    vkGetPhysicalDeviceFeatures(gpu->obj, &gpu->features);
909a048b3146ed9bc094adf4d6ba7355cd8a5ef7008Chris Forbes
9105d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions,
9115d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                              gpu->inst->inst_extensions_count)) {
9125d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->memory_props2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR;
9135d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->memory_props2.pNext = NULL;
9145d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
9155d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        inst->vkGetPhysicalDeviceMemoryProperties2KHR(gpu->obj, &gpu->memory_props2);
9165d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
9175d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
9185d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        gpu->features2.pNext = NULL;
9195d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
9205d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        inst->vkGetPhysicalDeviceFeatures2KHR(gpu->obj, &gpu->features2);
9215d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
9225d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
923f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    AppDevInit(&gpu->dev, gpu);
924f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    AppDevInitFormats(&gpu->dev);
92546c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
92646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
927f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppGpuDestroy(struct AppGpu *gpu) {
928f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    AppDevDestroy(&gpu->dev);
9293c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    free(gpu->device_extensions);
9302c0948342e626904289329dd3f0912b6714eac19Jon Ashburn
931d3a8d3699ceffb62da8d95d1fb49242fb25b43bfCourtney Goeltzenleuchter    for (uint32_t i = 0; i < gpu->queue_count; i++) {
932481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz        free((void *)gpu->queue_reqs[i].pQueuePriorities);
933d3a8d3699ceffb62da8d95d1fb49242fb25b43bfCourtney Goeltzenleuchter    }
9342c0948342e626904289329dd3f0912b6714eac19Jon Ashburn    free(gpu->queue_reqs);
9355d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
93646c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu    free(gpu->queue_props);
9375d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    if (CheckExtensionEnabled(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, gpu->inst->inst_extensions,
9385d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                              gpu->inst->inst_extensions_count)) {
9395d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        free(gpu->queue_props2);
9405d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
94146c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu}
94246c29ddef4360cac80d9dd533486aa1ab34776e1Chia-I Wu
943481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz// clang-format off
944a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
945a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//-----------------------------------------------------------
946a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
947a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//---------------------------Win32---------------------------
948a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#ifdef VK_USE_PLATFORM_WIN32_KHR
949a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
950a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay// MS-Windows event handling function:
951a155d62f73c03dea7315ba34a7582239fdfc85d2Rene LindsayLRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
952a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    return (DefWindowProc(hWnd, uMsg, wParam, lParam));
953a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
954a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
955f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateWin32Window(struct AppInstance *inst) {
956f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    inst->h_instance = GetModuleHandle(NULL);
957a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
958a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    WNDCLASSEX win_class;
959a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
960a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    // Initialize the window class structure:
961a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.cbSize = sizeof(WNDCLASSEX);
962a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.style = CS_HREDRAW | CS_VREDRAW;
963a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.lpfnWndProc = WndProc;
964a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.cbClsExtra = 0;
965a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.cbWndExtra = 0;
966f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    win_class.hInstance = inst->h_instance;
967a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.hIcon = LoadIcon(NULL, IDI_APPLICATION);
968a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.hCursor = LoadCursor(NULL, IDC_ARROW);
969a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
970a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.lpszMenuName = NULL;
971a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.lpszClassName = APP_SHORT_NAME;
972f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    win_class.hInstance = inst->h_instance;
973a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    win_class.hIconSm = LoadIcon(NULL, IDI_WINLOGO);
974a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    // Register window class:
975a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    if (!RegisterClassEx(&win_class)) {
976a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        // It didn't work, so try to give a useful error:
97754cf48a48c9e593f96d20a9abbdda0d48be906deRene Lindsay        printf("Failed to register the window class!\n");
978a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        fflush(stdout);
979a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        exit(1);
980a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    }
981a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    // Create window with the registered class:
982a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    RECT wr = { 0, 0, inst->width, inst->height };
983a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
984f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    inst->h_wnd = CreateWindowEx(0,
985a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        APP_SHORT_NAME,       // class name
986a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        APP_SHORT_NAME,       // app name
987a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        //WS_VISIBLE | WS_SYSMENU |
988a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        WS_OVERLAPPEDWINDOW,  // window style
989a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        100, 100,             // x/y coords
990a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        wr.right - wr.left,   // width
991a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        wr.bottom - wr.top,   // height
992a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        NULL,                 // handle to parent
993a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        NULL,                 // handle to menu
994f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        inst->h_instance,      // hInstance
995a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        NULL);                // no extra parameters
996f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    if (!inst->h_wnd) {
997a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        // It didn't work, so try to give a useful error:
99854cf48a48c9e593f96d20a9abbdda0d48be906deRene Lindsay        printf("Failed to create a window!\n");
999a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        fflush(stdout);
1000a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay        exit(1);
1001a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    }
1002a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1003a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1004f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateWin32Surface(struct AppInstance *inst) {
1005a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkResult U_ASSERT_ONLY err;
1006a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkWin32SurfaceCreateInfoKHR createInfo;
1007a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
1008a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.pNext = NULL;
1009a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.flags = 0;
1010f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    createInfo.hinstance = inst->h_instance;
1011f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    createInfo.hwnd = inst->h_wnd;
10127fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    err = vkCreateWin32SurfaceKHR(inst->instance, &createInfo, NULL, &inst->surface);
10137fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    assert(!err);
1014a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1015a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1016f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDestroyWin32Window(struct AppInstance *inst) {
1017f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    DestroyWindow(inst->h_wnd);
1018a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1019a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#endif //VK_USE_PLATFORM_WIN32_KHR
1020a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//-----------------------------------------------------------
1021a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1022b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#if defined(VK_USE_PLATFORM_XCB_KHR)     || \
1023b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour    defined(VK_USE_PLATFORM_XLIB_KHR)    || \
1024fad114e418ec4300c3a3d86ae30042d1a332c562Karl Schultz    defined(VK_USE_PLATFORM_WIN32_KHR)
1025f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDestroySurface(struct AppInstance *inst) { //same for all platforms
1026a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    vkDestroySurfaceKHR(inst->instance, inst->surface, NULL);
1027a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1028fad114e418ec4300c3a3d86ae30042d1a332c562Karl Schultz#endif
1029a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1030a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//----------------------------XCB----------------------------
103154cf48a48c9e593f96d20a9abbdda0d48be906deRene Lindsay
1032a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#ifdef VK_USE_PLATFORM_XCB_KHR
1033f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateXcbWindow(struct AppInstance *inst) {
1034ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    //--Init Connection--
1035ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    const xcb_setup_t *setup;
1036ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    xcb_screen_iterator_t iter;
1037ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    int scr;
1038ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski
10394be9b3d5fe5ae7cc34a1dbe8cbd4ba4b9b67a882Andreas Bergmeier    // API guarantees non-null xcb_connection
1040ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    inst->xcb_connection = xcb_connect(NULL, &scr);
1041c18eb54c92b625ad2f5d2970eadc53c1d6f55aa5Arda Coskunses    int conn_error = xcb_connection_has_error(inst->xcb_connection);
1042c18eb54c92b625ad2f5d2970eadc53c1d6f55aa5Arda Coskunses    if (conn_error) {
10436b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier        fprintf(stderr, "XCB failed to connect to the X server due to error:%d.\n", conn_error);
10444be9b3d5fe5ae7cc34a1dbe8cbd4ba4b9b67a882Andreas Bergmeier        fflush(stderr);
10456b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier        inst->xcb_connection = NULL;
1046c18eb54c92b625ad2f5d2970eadc53c1d6f55aa5Arda Coskunses    }
1047c18eb54c92b625ad2f5d2970eadc53c1d6f55aa5Arda Coskunses
1048ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    setup = xcb_get_setup(inst->xcb_connection);
1049ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    iter = xcb_setup_roots_iterator(setup);
1050ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    while (scr-- > 0) {
1051ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski        xcb_screen_next(&iter);
1052ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    }
1053ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski
1054ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    inst->xcb_screen = iter.data;
1055ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    //-------------------
1056ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski
1057ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    inst->xcb_window = xcb_generate_id(inst->xcb_connection);
1058ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    xcb_create_window(inst->xcb_connection, XCB_COPY_FROM_PARENT, inst->xcb_window,
1059ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski                      inst->xcb_screen->root, 0, 0, inst->width, inst->height, 0,
1060ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski                      XCB_WINDOW_CLASS_INPUT_OUTPUT, inst->xcb_screen->root_visual,
1061ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski                      0, NULL);
1062ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski
1063ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    xcb_intern_atom_cookie_t cookie = xcb_intern_atom(inst->xcb_connection, 1, 12, "WM_PROTOCOLS");
1064ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    xcb_intern_atom_reply_t *reply =  xcb_intern_atom_reply(inst->xcb_connection, cookie, 0);
1065ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    free(reply);
1066a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1067a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1068f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateXcbSurface(struct AppInstance *inst) {
10696b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier    if (!inst->xcb_connection) {
10706b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier        return;
10716b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier    }
10726b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier
1073a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkResult U_ASSERT_ONLY err;
1074a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkXcbSurfaceCreateInfoKHR xcb_createInfo;
1075a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_createInfo.sType      = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
1076a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_createInfo.pNext      = NULL;
1077a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_createInfo.flags      = 0;
1078a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_createInfo.connection = inst->xcb_connection;
1079a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_createInfo.window     = inst->xcb_window;
10807fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    err = vkCreateXcbSurfaceKHR(inst->instance, &xcb_createInfo, NULL, &inst->surface);
10817fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    assert(!err);
1082a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1083a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1084f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDestroyXcbWindow(struct AppInstance *inst) {
10856b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier    if (!inst->xcb_connection) {
10866b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier        return; // Nothing to destroy
10876b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier    }
10886b2f04341ff7df61779f5840a836b04196a31322Andreas Bergmeier
1089a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_destroy_window(inst->xcb_connection, inst->xcb_window);
1090a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    xcb_disconnect(inst->xcb_connection);
1091a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1092b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour//VK_USE_PLATFORM_XCB_KHR
1093a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//-----------------------------------------------------------
1094a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1095a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//----------------------------XLib---------------------------
1096b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XLIB_KHR
1097f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateXlibWindow(struct AppInstance *inst) {
1098a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    long visualMask = VisualScreenMask;
1099a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    int numberOfVisuals;
110054cf48a48c9e593f96d20a9abbdda0d48be906deRene Lindsay
1101600078730ceb7ffa77f5f57f1ce9a5858d5a0816Karl Schultz    inst->xlib_display = XOpenDisplay(NULL);
1102600078730ceb7ffa77f5f57f1ce9a5858d5a0816Karl Schultz    if (inst->xlib_display == NULL) {
1103600078730ceb7ffa77f5f57f1ce9a5858d5a0816Karl Schultz        printf("XLib failed to connect to the X server.\nExiting ...\n");
1104600078730ceb7ffa77f5f57f1ce9a5858d5a0816Karl Schultz        fflush(stdout);
1105600078730ceb7ffa77f5f57f1ce9a5858d5a0816Karl Schultz        exit(1);
1106600078730ceb7ffa77f5f57f1ce9a5858d5a0816Karl Schultz    }
1107f231a17a49b329c79ef12bc55fde9bdc893372dcAwais Belal
110854cf48a48c9e593f96d20a9abbdda0d48be906deRene Lindsay    XVisualInfo vInfoTemplate={};
1109a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    vInfoTemplate.screen = DefaultScreen(inst->xlib_display);
1110a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    XVisualInfo *visualInfo = XGetVisualInfo(inst->xlib_display, visualMask,
1111a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay                                             &vInfoTemplate, &numberOfVisuals);
1112a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    inst->xlib_window = XCreateWindow(
1113a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay                inst->xlib_display, RootWindow(inst->xlib_display, vInfoTemplate.screen), 0, 0,
1114a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay                inst->width, inst->height, 0, visualInfo->depth, InputOutput,
111554cf48a48c9e593f96d20a9abbdda0d48be906deRene Lindsay                visualInfo->visual, 0, NULL);
1116a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1117aad516ebcb8e220a5770b7802f241c933a920c56Rene Lindsay    XSync(inst->xlib_display,false);
1118a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1119a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1120f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppCreateXlibSurface(struct AppInstance *inst) {
1121a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkResult U_ASSERT_ONLY err;
1122a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    VkXlibSurfaceCreateInfoKHR createInfo;
1123a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.sType  = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;
1124a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.pNext  = NULL;
1125a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.flags  = 0;
1126a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.dpy    = inst->xlib_display;
1127a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    createInfo.window = inst->xlib_window;
11287fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    err = vkCreateXlibSurfaceKHR(inst->instance, &createInfo, NULL, &inst->surface);
11297fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    assert(!err);
1130a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1131a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1132f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunargstatic void AppDestroyXlibWindow(struct AppInstance *inst) {
1133a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    XDestroyWindow(inst->xlib_display, inst->xlib_window);
1134a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    XCloseDisplay(inst->xlib_display);
1135a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
1136a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#endif //VK_USE_PLATFORM_XLIB_KHR
1137a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay//-----------------------------------------------------------
1138a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
1139b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#if defined(VK_USE_PLATFORM_XCB_KHR)     || \
1140b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour    defined(VK_USE_PLATFORM_XLIB_KHR)    || \
1141fad114e418ec4300c3a3d86ae30042d1a332c562Karl Schultz    defined(VK_USE_PLATFORM_WIN32_KHR)
114297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic int AppDumpSurfaceFormats(struct AppInstance *inst, struct AppGpu *gpu, FILE *out){
1143a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    // Get the list of VkFormat's that are supported:
1144ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    VkResult U_ASSERT_ONLY err;
1145f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    uint32_t format_count = 0;
1146f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    err = inst->vkGetPhysicalDeviceSurfaceFormatsKHR(gpu->obj, inst->surface, &format_count, NULL);
1147ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    assert(!err);
1148ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski
1149f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    VkSurfaceFormatKHR *surf_formats = (VkSurfaceFormatKHR *)malloc(format_count * sizeof(VkSurfaceFormatKHR));
1150242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    if (!surf_formats)
1151242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz        ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
1152f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    err = inst->vkGetPhysicalDeviceSurfaceFormatsKHR(gpu->obj, inst->surface, &format_count, surf_formats);
1153ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    assert(!err);
115497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
115597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
115697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t<details><summary>Formats: count = <div class='val'>%d</div></summary>", format_count);
115797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (format_count > 0) {
115897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\n");
115997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
116097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</details>\n");
116197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
116297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
116397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("Formats:\t\tcount = %d\n", format_count);
116497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
1165ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski
1166f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    for (uint32_t i = 0; i < format_count; i++) {
116797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
116897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary><div class='type'>%s</div></summary></details>\n",
116997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    VkFormatString(surf_formats[i].format));
117097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
117197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t%s\n", VkFormatString(surf_formats[i].format));
117297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
1173ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    }
117497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output && format_count > 0) fprintf(out, "\t\t\t\t</details>\n");
11755d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
117697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
11775d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    free(surf_formats);
1178f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    return format_count;
1179a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay}
11807b3aadea3a889f1e04529f50649124277a47db46joey-lunarg
118197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic int AppDumpSurfacePresentModes(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) {
11827b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    // Get the list of VkPresentMode's that are supported:
11837b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    VkResult U_ASSERT_ONLY err;
1184f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    uint32_t present_mode_count = 0;
1185f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    err = inst->vkGetPhysicalDeviceSurfacePresentModesKHR(gpu->obj, inst->surface, &present_mode_count, NULL);
11867b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    assert(!err);
11877b3aadea3a889f1e04529f50649124277a47db46joey-lunarg
1188f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    VkPresentModeKHR *surf_present_modes = (VkPresentModeKHR *)malloc(present_mode_count * sizeof(VkPresentInfoKHR));
1189242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    if (!surf_present_modes)
1190242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz        ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
1191f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    err = inst->vkGetPhysicalDeviceSurfacePresentModesKHR(gpu->obj, inst->surface, &present_mode_count, surf_present_modes);
11927b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    assert(!err);
119397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
119497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
119597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t<details><summary>Present Modes: count = <div class='val'>%d</div></summary>", present_mode_count);
119697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (present_mode_count > 0) {
119797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\n");
119897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
119997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</details>");
120097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
120197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
120297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("Present Modes:\t\tcount = %d\n", present_mode_count);
120397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
12047b3aadea3a889f1e04529f50649124277a47db46joey-lunarg
1205f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    for (uint32_t i = 0; i < present_mode_count; i++) {
120697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
120797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary><div class='type'>%s</div></summary></details>\n",
120897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    VkPresentModeString(surf_present_modes[i]));
120997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
121097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t%s\n", VkPresentModeString(surf_present_modes[i]));
121197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
12127b3aadea3a889f1e04529f50649124277a47db46joey-lunarg    }
121397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output && present_mode_count > 0) fprintf(out, "\t\t\t\t</details>\n");
12145d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
121597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
12165d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    free(surf_present_modes);
1217f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    return present_mode_count;
12187b3aadea3a889f1e04529f50649124277a47db46joey-lunarg}
12195d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
122097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppDumpSurfaceCapabilities(struct AppInstance *inst, struct AppGpu *gpu, FILE *out) {
12215d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    if (CheckExtensionEnabled(VK_KHR_SURFACE_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) {
12225d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        inst->vkGetPhysicalDeviceSurfaceCapabilitiesKHR(gpu->obj, inst->surface, &inst->surface_capabilities);
12235d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
122497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
122597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t<details><summary>VkSurfaceCapabilitiesKHR</summary>\n");
122697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>minImageCount = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.minImageCount);
122797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>maxImageCount = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.maxImageCount);
122897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>currentExtent</summary>\n");
122997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t<details><summary>width = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.currentExtent.width);
123097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t<details><summary>height = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.currentExtent.height);
123197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
123297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>minImageExtent</summary>\n");
123397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t<details><summary>width = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.minImageExtent.width);
123497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t<details><summary>height = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.minImageExtent.height);
123597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
123697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>maxImageExtent</summary>\n");
123797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t<details><summary>width = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.maxImageExtent.width);
123897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t<details><summary>height = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.maxImageExtent.height);
123997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
124097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>maxImageArrayLayers = <div class='val'>%u</div></summary></details>\n", inst->surface_capabilities.maxImageArrayLayers);
124197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>supportedTransform</summary>\n");
124297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms == 0) { fprintf(out, "\t\t\t\t\t\t<details><summary>None</summary></details>\n"); }
124397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) {
124497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR</div></summary></details>\n");
124597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
124697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) {
124797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR</div></summary></details>\n");
124897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
124997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) {
125097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR</div></summary></details>\n");
125197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
125297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) {
125397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR</div></summary></details>\n");
125497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
125597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) {
125697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR</div></summary></details>\n");
125797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
125897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) {
125997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR</div></summary></details>\n");
126097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
126197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) {
126297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR</div></summary></details>\n");
126397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
126497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) {
126597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR</div></summary></details>\n");
126697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
126797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) {
126897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR</div></summary></details>\n");
126997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
127097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
127197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>currentTransform</summary>\n");
127297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.currentTransform == 0) { fprintf(out, "\t\t\t\t\t\t<details><summary>None</summary></details>\n"); }
127397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) {
127497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR</div></summary></details>\n");
127597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
127697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) {
127797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR</div></summary></details>\n");
127897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
127997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) {
128097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR</div></summary></details>\n");
128197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
128297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) {
128397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR</div></summary></details>\n");
128497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
128597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) {
128697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR</div></summary></details>\n");
128797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
128897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) {
128997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR</div></summary></details>\n");
129097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
129197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) {
129297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR</div></summary></details>\n");
129397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
129497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) {
129597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR</div></summary></details>\n");
129697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
129797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) {
129897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR</div></summary></details>\n");
129997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
130097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
130197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>supportedCompositeAlpha</summary>\n");
130297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha == 0) { fprintf(out, "\t\t\t\t\t\t<details><summary>None</summary></details>\n"); }
130397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) {
130497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR</div></summary></details>\n");
130597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
130697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) {
130797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR</div></summary></details>\n");
130897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
130997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) {
131097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR</div></summary></details>\n");
131197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
131297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) {
131397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR</div></summary></details>\n");
131497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
131597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
131697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>supportedUsageFlags</summary>\n");
131797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags == 0) { fprintf(out, "\t\t\t\t\t\t<details><summary>None</summary></details>\n"); }
131897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
131997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_TRANSFER_SRC_BIT</div></summary></details>\n");
132097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
132197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
132297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_TRANSFER_DST_BIT</div></summary></details>\n");
132397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
132497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) {
132597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_SAMPLED_BIT</div></summary></details>\n");
132697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
132797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) {
132897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_STORAGE_BIT</div></summary></details>\n");
132997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
133097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
133197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT</div></summary></details>\n");
133297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
133397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) {
133497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT</div></summary></details>\n");
133597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
133697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) {
133797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT</div></summary></details>\n");
133897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
133997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
134097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT</div></summary></details>\n");
134197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
134297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t</details>\n");
134397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
134497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\nVkSurfaceCapabilitiesKHR:\n");
134597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("=========================\n");
134697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tminImageCount       = %u\n", inst->surface_capabilities.minImageCount);
134797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tmaxImageCount       = %u\n", inst->surface_capabilities.maxImageCount);
134897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tcurrentExtent:\n");
134997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\twidth       = %u\n", inst->surface_capabilities.currentExtent.width);
135097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\theight      = %u\n", inst->surface_capabilities.currentExtent.height);
135197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tminImageExtent:\n");
135297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\twidth       = %u\n", inst->surface_capabilities.minImageExtent.width);
135397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\theight      = %u\n", inst->surface_capabilities.minImageExtent.height);
135497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tmaxImageExtent:\n");
135597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\twidth       = %u\n", inst->surface_capabilities.maxImageExtent.width);
135697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\theight      = %u\n", inst->surface_capabilities.maxImageExtent.height);
135797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tmaxImageArrayLayers = %u\n", inst->surface_capabilities.maxImageArrayLayers);
135897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tsupportedTransform:\n");
135997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms == 0) { printf("\t\tNone\n"); }
136097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); }
136197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); }
136297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); }
136397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); }
136497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); }
136597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); }
136697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); }
136797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); }
136897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); }
136997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tcurrentTransform:\n");
137097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.currentTransform == 0) { printf("\t\tNone\n"); }
137197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR\n"); }
137297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR\n"); }
137397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR\n"); }
137497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR\n"); }
137597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR\n"); }
137697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR\n"); }
137797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR\n"); }
137897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR\n"); }
137997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            else if (inst->surface_capabilities.currentTransform & VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR) { printf("\t\tVK_SURFACE_TRANSFORM_INHERIT_BIT_KHR\n"); }
138097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tsupportedCompositeAlpha:\n");
138197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha == 0) { printf("\t\tNone\n"); }
138297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR\n"); }
138397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR\n"); }
138497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR\n"); }
138597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR) { printf("\t\tVK_COMPOSITE_ALPHA_INHERIT_BIT_KHR\n"); }
138697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tsupportedUsageFlags:\n");
138797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags == 0) { printf("\t\tNone\n"); }
138897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); }
138997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); }
139097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); }
139197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); }
139297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); }
139397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); }
139497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); }
139597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (inst->surface_capabilities.supportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); }
139697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
13975d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
13985d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        // Get additional surface capability information from vkGetPhysicalDeviceSurfaceCapabilities2EXT
13995d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        if (CheckExtensionEnabled(VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) {
14005d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            memset(&inst->surface_capabilities2_ext, 0, sizeof(VkSurfaceCapabilities2EXT));
1401ffadaf34580ea434addcaf710016382b34a4e71fMark Lobodzinski            inst->surface_capabilities2_ext.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT;
14025d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            inst->surface_capabilities2_ext.pNext = NULL;
14035d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
14045d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            inst->vkGetPhysicalDeviceSurfaceCapabilities2EXT(gpu->obj, inst->surface, &inst->surface_capabilities2_ext);
14055d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
140697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) {
140797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t<details><summary>VkSurfaceCapabilities2EXT</summary>\n");
140897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary>supportedSurfaceCounters</summary>\n");
140997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { fprintf(out, "\t\t\t\t\t\t\t<details><summary>None</summary></details>\n"); }
141097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) {
141197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_SURFACE_COUNTER_VBLANK_EXT</div></summary></details>\n");
141297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                }
141397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t</details>\n");
141497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t</details>\n");
141597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
141697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("\nVkSurfaceCapabilities2EXT:\n");
141797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("==========================\n\n");
141897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("\tsupportedSurfaceCounters:\n");
141997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                if (inst->surface_capabilities2_ext.supportedSurfaceCounters == 0) { printf("\t\tNone\n"); }
142097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                if (inst->surface_capabilities2_ext.supportedSurfaceCounters & VK_SURFACE_COUNTER_VBLANK_EXT) { printf("\t\tVK_SURFACE_COUNTER_VBLANK_EXT\n"); }
142197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
14225d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        }
14235d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
14245d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        // Get additional surface capability information from vkGetPhysicalDeviceSurfaceCapabilities2KHR
14255d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        if (CheckExtensionEnabled(VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) {
14265d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            if (CheckExtensionEnabled(VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME, gpu->inst->inst_extensions, gpu->inst->inst_extensions_count)) {
14275d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                inst->shared_surface_capabilities.sType = VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR;
14285d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                inst->shared_surface_capabilities.pNext = NULL;
14295d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                inst->surface_capabilities2.pNext = &inst->shared_surface_capabilities;
14305d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            } else {
14315d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                inst->surface_capabilities2.pNext = NULL;
14325d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            }
14335d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
14345d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            inst->surface_capabilities2.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR;
14355d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
14365d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            VkPhysicalDeviceSurfaceInfo2KHR surface_info;
14375d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            surface_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR;
14385d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            surface_info.pNext = NULL;
14395d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            surface_info.surface = inst->surface;
14405d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
14415d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            inst->vkGetPhysicalDeviceSurfaceCapabilities2KHR(gpu->obj, &surface_info, &inst->surface_capabilities2);
14425d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
14435d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            void *place = inst->surface_capabilities2.pNext;
14445d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            while (place) {
14455d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                struct VkStructureHeader* work = (struct VkStructureHeader*) place;
14465d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                if (work->sType == VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR) {
144797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    if (html_output) {
144897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        fprintf(out, "\t\t\t\t\t<details><summary>VkSharedPresentSurfaceCapabilitiesKHR</summary>\n");
144997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        VkSharedPresentSurfaceCapabilitiesKHR* shared_surface_capabilities = (VkSharedPresentSurfaceCapabilitiesKHR*)place;
145097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        fprintf(out, "\t\t\t\t\t\t<details><summary>sharedPresentSupportedUsageFlags</summary>\n");
145197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { fprintf(out, "\t\t\t\t\t\t\t<details><summary>None</summary></details>\n"); }
145297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
145397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_TRANSFER_SRC_BIT</div></summary></details>\n");
145497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
145597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
145697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_TRANSFER_DST_BIT</div></summary></details>\n");
145797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
145897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) {
145997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_SAMPLED_BIT</div></summary></details>\n");
146097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
146197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) {
146297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_STORAGE_BIT</div></summary></details>\n");
146397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
146497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
146597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT</div></summary></details>\n");
146697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
146797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) {
146897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT</div></summary></details>\n");
146997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
147097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) {
147197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT</div></summary></details>\n");
147297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
147397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
147497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                            fprintf(out, "\t\t\t\t\t\t\t<details><summary><div class='type'>VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT</div></summary></details>\n");
147597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        }
147697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        fprintf(out, "\t\t\t\t\t\t</details>\n");
147797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        fprintf(out, "\t\t\t\t\t</details>\n");
147897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    } else {
147997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        printf("\nVkSharedPresentSurfaceCapabilitiesKHR:\n");
148097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        printf("========================================\n");
148197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        VkSharedPresentSurfaceCapabilitiesKHR* shared_surface_capabilities = (VkSharedPresentSurfaceCapabilitiesKHR*)place;
148297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        printf("\tsharedPresentSupportedUsageFlags:\n");
148397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags == 0) { printf("\t\tNone\n"); }
148497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_SRC_BIT\n"); }
148597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_DST_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSFER_DST_BIT\n"); }
148697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_SAMPLED_BIT) { printf("\t\tVK_IMAGE_USAGE_SAMPLED_BIT\n"); }
148797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_STORAGE_BIT) { printf("\t\tVK_IMAGE_USAGE_STORAGE_BIT\n"); }
148897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT\n"); }
148997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT\n"); }
149097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT\n"); }
149197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        if (shared_surface_capabilities->sharedPresentSupportedUsageFlags & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) { printf("\t\tVK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT\n"); }
149297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    }
14935d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                }
14945d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager                place = work->pNext;
14955d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager            }
14965d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        }
149797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) { fprintf(out, "\t\t\t\t</details>\n"); }
14985d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    }
14995d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager}
15005d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager
1501fad114e418ec4300c3a3d86ae30042d1a332c562Karl Schultz#endif
1502a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
150397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppDevDumpFormatProps(const struct AppDev *dev, VkFormat fmt, FILE *out) {
1504382489d723fd0d3935da0dc7e1021c56c7b721d3Courtney Goeltzenleuchter    const VkFormatProperties *props = &dev->format_props[fmt];
1505190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    struct {
1506190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu        const char *name;
1507382489d723fd0d3935da0dc7e1021c56c7b721d3Courtney Goeltzenleuchter        VkFlags flags;
15084b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    } features[3];
1509190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
15104b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    features[0].name  = "linearTiling   FormatFeatureFlags";
15114b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    features[0].flags = props->linearTilingFeatures;
15124b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    features[1].name  = "optimalTiling  FormatFeatureFlags";
15134b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    features[1].flags = props->optimalTilingFeatures;
15144b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    features[2].name  = "bufferFeatures FormatFeatureFlags";
15154b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski    features[2].flags = props->bufferFeatures;
15164b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski
151797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
151897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary><div class='type'>FORMAT_%s</div></summary>\n", VkFormatString(fmt));
151997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
152097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\nFORMAT_%s:", VkFormatString(fmt));
152197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
152297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
1523ce165d8fd729f7ff9d2e12eac2865a6327073d1dMark Lobodzinski    for (uint32_t i = 0; i < ARRAY_SIZE(features); i++) {
152497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
152597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t<details open><summary>%s</summary>\n", features[i].name);
152697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (features[i].flags == 0) {
152797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t\t\t<details><summary>None</summary></details>\n");
152897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
152997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
153097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)                  ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT</div></summary></details>\n"                  : ""),  //0x0001
153197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)                  ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT</div></summary></details>\n"                  : ""),  //0x0002
153297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT)           ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT</div></summary></details>\n"           : ""),  //0x0004
153397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT)           ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT</div></summary></details>\n"           : ""),  //0x0008
153497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT)           ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT</div></summary></details>\n"           : ""),  //0x0010
153597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT)    ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT</div></summary></details>\n"    : ""),  //0x0020
153697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT)                  ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT</div></summary></details>\n"                  : ""),  //0x0040
153797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)               ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT</div></summary></details>\n"               : ""),  //0x0080
153897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT)         ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT</div></summary></details>\n"         : ""),  //0x0100
153997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)       ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT</div></summary></details>\n"       : ""),  //0x0200
154097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT)                       ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_BLIT_SRC_BIT</div></summary></details>\n"                       : ""),  //0x0400
154197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT)                       ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_BLIT_DST_BIT</div></summary></details>\n"                       : ""),  //0x0800
154297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT)    ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT</div></summary></details>\n"    : ""),  //0x1000
154397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG</div></summary></details>\n" : ""),  //0x2000
154497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR)               ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR</div></summary></details>\n"               : ""),  //0x4000
154597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR)               ? "\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR</div></summary></details>\n"               : "")); //0x8000
154697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
154797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t</details>\n");
15484b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski        } else {
154997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\n\t%s:", features[i].name);
155097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (features[i].flags == 0) {
155197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("\n\t\tNone");
155297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
155397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
155497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)                  ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT"                  : ""),  //0x0001
155597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)                  ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_BIT"                  : ""),  //0x0002
155697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT)           ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT"           : ""),  //0x0004
155797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT)           ? "\n\t\tVK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT"           : ""),  //0x0008
155897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT)           ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT"           : ""),  //0x0010
155997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT)    ? "\n\t\tVK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT"    : ""),  //0x0020
156097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT)                  ? "\n\t\tVK_FORMAT_FEATURE_VERTEX_BUFFER_BIT"                  : ""),  //0x0040
156197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)               ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT"               : ""),  //0x0080
156297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT)         ? "\n\t\tVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT"         : ""),  //0x0100
156397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)       ? "\n\t\tVK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT"       : ""),  //0x0200
156497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_BLIT_SRC_BIT)                       ? "\n\t\tVK_FORMAT_FEATURE_BLIT_SRC_BIT"                       : ""),  //0x0400
156597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_BLIT_DST_BIT)                       ? "\n\t\tVK_FORMAT_FEATURE_BLIT_DST_BIT"                       : ""),  //0x0800
156697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT)    ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT"    : ""),  //0x1000
156797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG) ? "\n\t\tVK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG" : ""),  //0x2000
156897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR)               ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR"               : ""),  //0x4000
156997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                       ((features[i].flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR)               ? "\n\t\tVK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR"               : "")); //0x8000
157097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
15714b36dd453ecb809731dbc68ccdb50e83f5417dd6Mark Lobodzinski        }
1572190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    }
157397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
157497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
157597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t</details>\n");
157697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
157797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\n");
157897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
1579d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
1580d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
158197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppDevDump(const struct AppDev *dev, FILE *out) {
158297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
158397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>Format Properties</summary>\n");
158497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
158597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("Format Properties:\n");
158697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("==================");
158797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
1588382489d723fd0d3935da0dc7e1021c56c7b721d3Courtney Goeltzenleuchter    VkFormat fmt;
15891f85191a3a8479194ecb7b937aee284cf80cf08fChia-I Wu    for (fmt = 0; fmt < VK_FORMAT_RANGE_SIZE; fmt++) {
159097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        AppDevDumpFormatProps(dev, fmt, out);
1591190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    }
159297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) fprintf(out, "\t\t\t\t\t</details>\n");
1593d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
1594d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
1595009d8ca0c07c81adff475c48273207e170b4b5fbMike Stroyan#ifdef _WIN32
1596009d8ca0c07c81adff475c48273207e170b4b5fbMike Stroyan#define PRINTF_SIZE_T_SPECIFIER    "%Iu"
1597009d8ca0c07c81adff475c48273207e170b4b5fbMike Stroyan#else
1598009d8ca0c07c81adff475c48273207e170b4b5fbMike Stroyan#define PRINTF_SIZE_T_SPECIFIER    "%zu"
1599009d8ca0c07c81adff475c48273207e170b4b5fbMike Stroyan#endif
1600009d8ca0c07c81adff475c48273207e170b4b5fbMike Stroyan
160197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppGpuDumpFeatures(const struct AppGpu *gpu, FILE *out) {
1602a048b3146ed9bc094adf4d6ba7355cd8a5ef7008Chris Forbes    const VkPhysicalDeviceFeatures *features = &gpu->features;
1603a048b3146ed9bc094adf4d6ba7355cd8a5ef7008Chris Forbes
160497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
160597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>VkPhysicalDeviceFeatures</summary>\n");
160697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>robustBufferAccess                      = <div class='val'>%u</div></summary></details>\n", features->robustBufferAccess                     );
160797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>fullDrawIndexUint32                     = <div class='val'>%u</div></summary></details>\n", features->fullDrawIndexUint32                    );
160897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>imageCubeArray                          = <div class='val'>%u</div></summary></details>\n", features->imageCubeArray                         );
160997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>independentBlend                        = <div class='val'>%u</div></summary></details>\n", features->independentBlend                       );
161097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>geometryShader                          = <div class='val'>%u</div></summary></details>\n", features->geometryShader                         );
161197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>tessellationShader                      = <div class='val'>%u</div></summary></details>\n", features->tessellationShader                     );
161297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sampleRateShading                       = <div class='val'>%u</div></summary></details>\n", features->sampleRateShading                      );
161397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>dualSrcBlend                            = <div class='val'>%u</div></summary></details>\n", features->dualSrcBlend                           );
161497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>logicOp                                 = <div class='val'>%u</div></summary></details>\n", features->logicOp                                );
161597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>multiDrawIndirect                       = <div class='val'>%u</div></summary></details>\n", features->multiDrawIndirect                      );
161697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>drawIndirectFirstInstance               = <div class='val'>%u</div></summary></details>\n", features->drawIndirectFirstInstance              );
161797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>depthClamp                              = <div class='val'>%u</div></summary></details>\n", features->depthClamp                             );
161897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>depthBiasClamp                          = <div class='val'>%u</div></summary></details>\n", features->depthBiasClamp                         );
161997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>fillModeNonSolid                        = <div class='val'>%u</div></summary></details>\n", features->fillModeNonSolid                       );
162097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>depthBounds                             = <div class='val'>%u</div></summary></details>\n", features->depthBounds                            );
162197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>wideLines                               = <div class='val'>%u</div></summary></details>\n", features->wideLines                              );
162297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>largePoints                             = <div class='val'>%u</div></summary></details>\n", features->largePoints                            );
162397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>alphaToOne                              = <div class='val'>%u</div></summary></details>\n", features->alphaToOne                             );
162497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>multiViewport                           = <div class='val'>%u</div></summary></details>\n", features->multiViewport                          );
162597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>samplerAnisotropy                       = <div class='val'>%u</div></summary></details>\n", features->samplerAnisotropy                      );
162697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>textureCompressionETC2                  = <div class='val'>%u</div></summary></details>\n", features->textureCompressionETC2                 );
162797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>textureCompressionASTC_LDR              = <div class='val'>%u</div></summary></details>\n", features->textureCompressionASTC_LDR             );
162897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>textureCompressionBC                    = <div class='val'>%u</div></summary></details>\n", features->textureCompressionBC                   );
162997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>occlusionQueryPrecise                   = <div class='val'>%u</div></summary></details>\n", features->occlusionQueryPrecise                  );
163097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>pipelineStatisticsQuery                 = <div class='val'>%u</div></summary></details>\n", features->pipelineStatisticsQuery                );
163197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>vertexPipelineStoresAndAtomics          = <div class='val'>%u</div></summary></details>\n", features->vertexPipelineStoresAndAtomics         );
163297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>fragmentStoresAndAtomics                = <div class='val'>%u</div></summary></details>\n", features->fragmentStoresAndAtomics               );
163397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderTessellationAndGeometryPointSize  = <div class='val'>%u</div></summary></details>\n", features->shaderTessellationAndGeometryPointSize );
163497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderImageGatherExtended               = <div class='val'>%u</div></summary></details>\n", features->shaderImageGatherExtended              );
163597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderStorageImageExtendedFormats       = <div class='val'>%u</div></summary></details>\n", features->shaderStorageImageExtendedFormats      );
163697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderStorageImageMultisample           = <div class='val'>%u</div></summary></details>\n", features->shaderStorageImageMultisample          );
163797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderStorageImageReadWithoutFormat     = <div class='val'>%u</div></summary></details>\n", features->shaderStorageImageReadWithoutFormat    );
163897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderStorageImageWriteWithoutFormat    = <div class='val'>%u</div></summary></details>\n", features->shaderStorageImageWriteWithoutFormat   );
163997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderUniformBufferArrayDynamicIndexing = <div class='val'>%u</div></summary></details>\n", features->shaderUniformBufferArrayDynamicIndexing);
164097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderSampledImageArrayDynamicIndexing  = <div class='val'>%u</div></summary></details>\n", features->shaderSampledImageArrayDynamicIndexing );
164197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderStorageBufferArrayDynamicIndexing = <div class='val'>%u</div></summary></details>\n", features->shaderStorageBufferArrayDynamicIndexing);
164297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderStorageImageArrayDynamicIndexing  = <div class='val'>%u</div></summary></details>\n", features->shaderStorageImageArrayDynamicIndexing );
164397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderClipDistance                      = <div class='val'>%u</div></summary></details>\n", features->shaderClipDistance                     );
164497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderCullDistance                      = <div class='val'>%u</div></summary></details>\n", features->shaderCullDistance                     );
164597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderFloat64                           = <div class='val'>%u</div></summary></details>\n", features->shaderFloat64                          );
164697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderInt64                             = <div class='val'>%u</div></summary></details>\n", features->shaderInt64                            );
164797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderInt16                             = <div class='val'>%u</div></summary></details>\n", features->shaderInt16                            );
164897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderResourceResidency                 = <div class='val'>%u</div></summary></details>\n", features->shaderResourceResidency                );
164997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>shaderResourceMinLod                    = <div class='val'>%u</div></summary></details>\n", features->shaderResourceMinLod                   );
165097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseBinding                           = <div class='val'>%u</div></summary></details>\n", features->sparseBinding                          );
165197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidencyBuffer                   = <div class='val'>%u</div></summary></details>\n", features->sparseResidencyBuffer                  );
165297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidencyImage2D                  = <div class='val'>%u</div></summary></details>\n", features->sparseResidencyImage2D                 );
165397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidencyImage3D                  = <div class='val'>%u</div></summary></details>\n", features->sparseResidencyImage3D                 );
165497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidency2Samples                 = <div class='val'>%u</div></summary></details>\n", features->sparseResidency2Samples                );
165597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidency4Samples                 = <div class='val'>%u</div></summary></details>\n", features->sparseResidency4Samples                );
165697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidency8Samples                 = <div class='val'>%u</div></summary></details>\n", features->sparseResidency8Samples                );
165797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidency16Samples                = <div class='val'>%u</div></summary></details>\n", features->sparseResidency16Samples               );
165897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseResidencyAliased                  = <div class='val'>%u</div></summary></details>\n", features->sparseResidencyAliased                 );
165997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>variableMultisampleRate                 = <div class='val'>%u</div></summary></details>\n", features->variableMultisampleRate                );
166097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>inheritedQueries                        = <div class='val'>%u</div></summary></details>\n", features->inheritedQueries                       );
166197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t</details>\n");
166297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
166397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("VkPhysicalDeviceFeatures:\n");
166497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("=========================\n");
166597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\trobustBufferAccess                      = %u\n", features->robustBufferAccess                     );
166697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tfullDrawIndexUint32                     = %u\n", features->fullDrawIndexUint32                    );
166797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\timageCubeArray                          = %u\n", features->imageCubeArray                         );
166897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tindependentBlend                        = %u\n", features->independentBlend                       );
166997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tgeometryShader                          = %u\n", features->geometryShader                         );
167097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\ttessellationShader                      = %u\n", features->tessellationShader                     );
167197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsampleRateShading                       = %u\n", features->sampleRateShading                      );
167297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdualSrcBlend                            = %u\n", features->dualSrcBlend                           );
167397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tlogicOp                                 = %u\n", features->logicOp                                );
167497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tmultiDrawIndirect                       = %u\n", features->multiDrawIndirect                      );
167597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdrawIndirectFirstInstance               = %u\n", features->drawIndirectFirstInstance              );
167697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdepthClamp                              = %u\n", features->depthClamp                             );
167797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdepthBiasClamp                          = %u\n", features->depthBiasClamp                         );
167897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tfillModeNonSolid                        = %u\n", features->fillModeNonSolid                       );
167997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdepthBounds                             = %u\n", features->depthBounds                            );
168097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\twideLines                               = %u\n", features->wideLines                              );
168197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tlargePoints                             = %u\n", features->largePoints                            );
168297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\talphaToOne                              = %u\n", features->alphaToOne                             );
168397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tmultiViewport                           = %u\n", features->multiViewport                          );
168497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsamplerAnisotropy                       = %u\n", features->samplerAnisotropy                      );
168597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\ttextureCompressionETC2                  = %u\n", features->textureCompressionETC2                 );
168697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\ttextureCompressionASTC_LDR              = %u\n", features->textureCompressionASTC_LDR             );
168797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\ttextureCompressionBC                    = %u\n", features->textureCompressionBC                   );
168897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tocclusionQueryPrecise                   = %u\n", features->occlusionQueryPrecise                  );
168997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tpipelineStatisticsQuery                 = %u\n", features->pipelineStatisticsQuery                );
169097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tvertexPipelineStoresAndAtomics          = %u\n", features->vertexPipelineStoresAndAtomics         );
169197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tfragmentStoresAndAtomics                = %u\n", features->fragmentStoresAndAtomics               );
169297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderTessellationAndGeometryPointSize  = %u\n", features->shaderTessellationAndGeometryPointSize );
169397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderImageGatherExtended               = %u\n", features->shaderImageGatherExtended              );
169497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderStorageImageExtendedFormats       = %u\n", features->shaderStorageImageExtendedFormats      );
169597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderStorageImageMultisample           = %u\n", features->shaderStorageImageMultisample          );
169697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderStorageImageReadWithoutFormat     = %u\n", features->shaderStorageImageReadWithoutFormat    );
169797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderStorageImageWriteWithoutFormat    = %u\n", features->shaderStorageImageWriteWithoutFormat   );
169897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderUniformBufferArrayDynamicIndexing = %u\n", features->shaderUniformBufferArrayDynamicIndexing);
169997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderSampledImageArrayDynamicIndexing  = %u\n", features->shaderSampledImageArrayDynamicIndexing );
170097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderStorageBufferArrayDynamicIndexing = %u\n", features->shaderStorageBufferArrayDynamicIndexing);
170197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderStorageImageArrayDynamicIndexing  = %u\n", features->shaderStorageImageArrayDynamicIndexing );
170297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderClipDistance                      = %u\n", features->shaderClipDistance                     );
170397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderCullDistance                      = %u\n", features->shaderCullDistance                     );
170497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderFloat64                           = %u\n", features->shaderFloat64                          );
170597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderInt64                             = %u\n", features->shaderInt64                            );
170697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderInt16                             = %u\n", features->shaderInt16                            );
170797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderResourceResidency                 = %u\n", features->shaderResourceResidency                );
170897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tshaderResourceMinLod                    = %u\n", features->shaderResourceMinLod                   );
170997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseBinding                           = %u\n", features->sparseBinding                          );
171097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidencyBuffer                   = %u\n", features->sparseResidencyBuffer                  );
171197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidencyImage2D                  = %u\n", features->sparseResidencyImage2D                 );
171297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidencyImage3D                  = %u\n", features->sparseResidencyImage3D                 );
171397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidency2Samples                 = %u\n", features->sparseResidency2Samples                );
171497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidency4Samples                 = %u\n", features->sparseResidency4Samples                );
171597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidency8Samples                 = %u\n", features->sparseResidency8Samples                );
171697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidency16Samples                = %u\n", features->sparseResidency16Samples               );
171797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tsparseResidencyAliased                  = %u\n", features->sparseResidencyAliased                 );
171897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tvariableMultisampleRate                 = %u\n", features->variableMultisampleRate                );
171997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tinheritedQueries                        = %u\n", features->inheritedQueries                       );
172097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
1721a048b3146ed9bc094adf4d6ba7355cd8a5ef7008Chris Forbes}
1722a048b3146ed9bc094adf4d6ba7355cd8a5ef7008Chris Forbes
172397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppDumpSparseProps(const VkPhysicalDeviceSparseProperties *sparse_props, FILE *out) {
172497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
172597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>VkPhysicalDeviceSparseProperties</summary>\n");
172697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>residencyStandard2DBlockShape            = <div class='val'>%u</div></summary></details>\n", sparse_props->residencyStandard2DBlockShape           );
172797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>residencyStandard2DMultisampleBlockShape = <div class='val'>%u</div></summary></details>\n", sparse_props->residencyStandard2DMultisampleBlockShape);
172897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>residencyStandard3DBlockShape            = <div class='val'>%u</div></summary></details>\n", sparse_props->residencyStandard3DBlockShape           );
172997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>residencyAlignedMipSize                  = <div class='val'>%u</div></summary></details>\n", sparse_props->residencyAlignedMipSize                 );
173097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>residencyNonResidentStrict               = <div class='val'>%u</div></summary></details>\n", sparse_props->residencyNonResidentStrict              );
173197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t</details>\n");
173297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
173397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tVkPhysicalDeviceSparseProperties:\n");
173497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t---------------------------------\n");
173597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tresidencyStandard2DBlockShape            = %u\n", sparse_props->residencyStandard2DBlockShape           );
173697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tresidencyStandard2DMultisampleBlockShape = %u\n", sparse_props->residencyStandard2DMultisampleBlockShape);
173797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tresidencyStandard3DBlockShape            = %u\n", sparse_props->residencyStandard3DBlockShape           );
173897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tresidencyAlignedMipSize                  = %u\n", sparse_props->residencyAlignedMipSize                 );
173997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tresidencyNonResidentStrict               = %u\n", sparse_props->residencyNonResidentStrict              );
174097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
17417dae6868682383bb8370d45784cbc94f357e745bMark Lobodzinski}
17427dae6868682383bb8370d45784cbc94f357e745bMark Lobodzinski
174397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppDumpLimits(const VkPhysicalDeviceLimits *limits, FILE *out) {
174497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
174597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>VkPhysicalDeviceLimits</summary>\n");
174697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxImageDimension1D                     = <div class='val'>%u</div></summary></details>\n",                 limits->maxImageDimension1D                    );
174797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxImageDimension2D                     = <div class='val'>%u</div></summary></details>\n",                 limits->maxImageDimension2D                    );
174897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxImageDimension3D                     = <div class='val'>%u</div></summary></details>\n",                 limits->maxImageDimension3D                    );
174997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxImageDimensionCube                   = <div class='val'>%u</div></summary></details>\n",                 limits->maxImageDimensionCube                  );
175097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxImageArrayLayers                     = <div class='val'>%u</div></summary></details>\n",                 limits->maxImageArrayLayers                    );
175197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTexelBufferElements                  = <div class='val'>0x%" PRIxLEAST32 "</div></summary></details>\n", limits->maxTexelBufferElements                 );
175297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxUniformBufferRange                   = <div class='val'>0x%" PRIxLEAST32 "</div></summary></details>\n", limits->maxUniformBufferRange                  );
175397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxStorageBufferRange                   = <div class='val'>0x%" PRIxLEAST32 "</div></summary></details>\n", limits->maxStorageBufferRange                  );
175497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPushConstantsSize                    = <div class='val'>%u</div></summary></details>\n",                 limits->maxPushConstantsSize                   );
175597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxMemoryAllocationCount                = <div class='val'>%u</div></summary></details>\n",                 limits->maxMemoryAllocationCount               );
175697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxSamplerAllocationCount               = <div class='val'>%u</div></summary></details>\n",                 limits->maxSamplerAllocationCount              );
175797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>bufferImageGranularity                  = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->bufferImageGranularity                 );
175897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sparseAddressSpaceSize                  = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->sparseAddressSpaceSize                 );
175997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxBoundDescriptorSets                  = <div class='val'>%u</div></summary></details>\n",                 limits->maxBoundDescriptorSets                 );
176097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageDescriptorSamplers           = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageDescriptorSamplers          );
176197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageDescriptorUniformBuffers     = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageDescriptorUniformBuffers    );
176297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageDescriptorStorageBuffers     = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageDescriptorStorageBuffers    );
176397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageDescriptorSampledImages      = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageDescriptorSampledImages     );
176497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageDescriptorStorageImages      = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageDescriptorStorageImages     );
176597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageDescriptorInputAttachments   = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageDescriptorInputAttachments  );
176697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxPerStageResources                    = <div class='val'>%u</div></summary></details>\n",                 limits->maxPerStageResources                   );
176797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetSamplers                = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetSamplers               );
176897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetUniformBuffers          = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetUniformBuffers         );
176997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetUniformBuffersDynamic   = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetUniformBuffersDynamic  );
177097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetStorageBuffers          = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetStorageBuffers         );
177197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetStorageBuffersDynamic   = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetStorageBuffersDynamic  );
177297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetSampledImages           = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetSampledImages          );
177397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetStorageImages           = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetStorageImages          );
177497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDescriptorSetInputAttachments        = <div class='val'>%u</div></summary></details>\n",                 limits->maxDescriptorSetInputAttachments       );
177597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxVertexInputAttributes                = <div class='val'>%u</div></summary></details>\n",                 limits->maxVertexInputAttributes               );
177697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxVertexInputBindings                  = <div class='val'>%u</div></summary></details>\n",                 limits->maxVertexInputBindings                 );
177797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxVertexInputAttributeOffset           = <div class='val'>0x%" PRIxLEAST32 "</div></summary></details>\n", limits->maxVertexInputAttributeOffset          );
177897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxVertexInputBindingStride             = <div class='val'>0x%" PRIxLEAST32 "</div></summary></details>\n", limits->maxVertexInputBindingStride            );
177997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxVertexOutputComponents               = <div class='val'>%u</div></summary></details>\n",                 limits->maxVertexOutputComponents              );
178097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationGenerationLevel          = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationGenerationLevel         );
178197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationPatchSize                        = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationPatchSize                       );
178297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationControlPerVertexInputComponents  = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationControlPerVertexInputComponents );
178397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationControlPerVertexOutputComponents = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationControlPerVertexOutputComponents);
178497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationControlPerPatchOutputComponents  = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationControlPerPatchOutputComponents );
178597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationControlTotalOutputComponents     = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationControlTotalOutputComponents    );
178697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationEvaluationInputComponents        = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationEvaluationInputComponents       );
178797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTessellationEvaluationOutputComponents       = <div class='val'>%u</div></summary></details>\n",                 limits->maxTessellationEvaluationOutputComponents      );
178897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxGeometryShaderInvocations            = <div class='val'>%u</div></summary></details>\n",                 limits->maxGeometryShaderInvocations           );
178997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxGeometryInputComponents              = <div class='val'>%u</div></summary></details>\n",                 limits->maxGeometryInputComponents             );
179097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxGeometryOutputComponents             = <div class='val'>%u</div></summary></details>\n",                 limits->maxGeometryOutputComponents            );
179197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxGeometryOutputVertices               = <div class='val'>%u</div></summary></details>\n",                 limits->maxGeometryOutputVertices              );
179297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxGeometryTotalOutputComponents        = <div class='val'>%u</div></summary></details>\n",                 limits->maxGeometryTotalOutputComponents       );
179397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFragmentInputComponents              = <div class='val'>%u</div></summary></details>\n",                 limits->maxFragmentInputComponents             );
179497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFragmentOutputAttachments            = <div class='val'>%u</div></summary></details>\n",                 limits->maxFragmentOutputAttachments           );
179597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFragmentDualSrcAttachments           = <div class='val'>%u</div></summary></details>\n",                 limits->maxFragmentDualSrcAttachments          );
179697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFragmentCombinedOutputResources      = <div class='val'>%u</div></summary></details>\n",                 limits->maxFragmentCombinedOutputResources     );
179797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeSharedMemorySize              = <div class='val'>0x%" PRIxLEAST32 "</div></summary></details>\n", limits->maxComputeSharedMemorySize             );
179897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupCount[0]             = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupCount[0]            );
179997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupCount[1]             = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupCount[1]            );
180097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupCount[2]             = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupCount[2]            );
180197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupInvocations          = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupInvocations         );
180297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupSize[0]              = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupSize[0]             );
180397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupSize[1]              = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupSize[1]             );
180497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxComputeWorkGroupSize[2]              = <div class='val'>%u</div></summary></details>\n",                 limits->maxComputeWorkGroupSize[2]             );
180597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>subPixelPrecisionBits                   = <div class='val'>%u</div></summary></details>\n",                 limits->subPixelPrecisionBits                  );
180697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>subTexelPrecisionBits                   = <div class='val'>%u</div></summary></details>\n",                 limits->subTexelPrecisionBits                  );
180797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>mipmapPrecisionBits                     = <div class='val'>%u</div></summary></details>\n",                 limits->mipmapPrecisionBits                    );
180897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDrawIndexedIndexValue                = <div class='val'>%u</div></summary></details>\n",                 limits->maxDrawIndexedIndexValue               );
180997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxDrawIndirectCount                    = <div class='val'>%u</div></summary></details>\n",                 limits->maxDrawIndirectCount                   );
181097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxSamplerLodBias                       = <div class='val'>%f</div></summary></details>\n",                 limits->maxSamplerLodBias                      );
181197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxSamplerAnisotropy                    = <div class='val'>%f</div></summary></details>\n",                 limits->maxSamplerAnisotropy                   );
181297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxViewports                            = <div class='val'>%u</div></summary></details>\n",                 limits->maxViewports                           );
181397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxViewportDimensions[0]                = <div class='val'>%u</div></summary></details>\n",                 limits->maxViewportDimensions[0]               );
181497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxViewportDimensions[1]                = <div class='val'>%u</div></summary></details>\n",                 limits->maxViewportDimensions[1]               );
181597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>viewportBoundsRange[0]                  =<div class='val'>%13f</div></summary></details>\n",                 limits->viewportBoundsRange[0]                 );
181697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>viewportBoundsRange[1]                  =<div class='val'>%13f</div></summary></details>\n",                 limits->viewportBoundsRange[1]                 );
181797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>viewportSubPixelBits                    = <div class='val'>%u</div></summary></details>\n",                 limits->viewportSubPixelBits                   );
181897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minMemoryMapAlignment                   = <div class='val'>" PRINTF_SIZE_T_SPECIFIER "</div></summary></details>\n", limits->minMemoryMapAlignment         );
181997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minTexelBufferOffsetAlignment           = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->minTexelBufferOffsetAlignment          );
182097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minUniformBufferOffsetAlignment         = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->minUniformBufferOffsetAlignment        );
182197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minStorageBufferOffsetAlignment         = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->minStorageBufferOffsetAlignment        );
182297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minTexelOffset                          =<div class='val'>%3d</div></summary></details>\n",                 limits->minTexelOffset                         );
182397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTexelOffset                          =<div class='val'>%3d</div></summary></details>\n",                 limits->maxTexelOffset                         );
182497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minTexelGatherOffset                    =<div class='val'>%3d</div></summary></details>\n",                 limits->minTexelGatherOffset                   );
182597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxTexelGatherOffset                    =<div class='val'>%3d</div></summary></details>\n",                 limits->maxTexelGatherOffset                   );
182697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minInterpolationOffset                  =<div class='val'>%9f</div></summary></details>\n",                 limits->minInterpolationOffset                 );
182797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxInterpolationOffset                  =<div class='val'>%9f</div></summary></details>\n",                 limits->maxInterpolationOffset                 );
182897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>subPixelInterpolationOffsetBits         = <div class='val'>%u</div></summary></details>\n",                 limits->subPixelInterpolationOffsetBits        );
182997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFramebufferWidth                     = <div class='val'>%u</div></summary></details>\n",                 limits->maxFramebufferWidth                    );
183097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFramebufferHeight                    = <div class='val'>%u</div></summary></details>\n",                 limits->maxFramebufferHeight                   );
183197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxFramebufferLayers                    = <div class='val'>%u</div></summary></details>\n",                 limits->maxFramebufferLayers                   );
183297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>framebufferColorSampleCounts            = <div class='val'>%u</div></summary></details>\n",                 limits->framebufferColorSampleCounts           );
183397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>framebufferDepthSampleCounts            = <div class='val'>%u</div></summary></details>\n",                 limits->framebufferDepthSampleCounts           );
183497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>framebufferStencilSampleCounts          = <div class='val'>%u</div></summary></details>\n",                 limits->framebufferStencilSampleCounts         );
183597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>framebufferNoAttachmentsSampleCounts    = <div class='val'>%u</div></summary></details>\n",                 limits->framebufferNoAttachmentsSampleCounts   );
183697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxColorAttachments                     = <div class='val'>%u</div></summary></details>\n",                 limits->maxColorAttachments                    );
183797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sampledImageColorSampleCounts           = <div class='val'>%u</div></summary></details>\n",                 limits->sampledImageColorSampleCounts          );
183897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sampledImageDepthSampleCounts           = <div class='val'>%u</div></summary></details>\n",                 limits->sampledImageDepthSampleCounts          );
183997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sampledImageStencilSampleCounts         = <div class='val'>%u</div></summary></details>\n",                 limits->sampledImageStencilSampleCounts        );
184097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>sampledImageIntegerSampleCounts         = <div class='val'>%u</div></summary></details>\n",                 limits->sampledImageIntegerSampleCounts        );
184197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>storageImageSampleCounts                = <div class='val'>%u</div></summary></details>\n",                 limits->storageImageSampleCounts               );
184297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxSampleMaskWords                      = <div class='val'>%u</div></summary></details>\n",                 limits->maxSampleMaskWords                     );
184397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>timestampComputeAndGraphics             = <div class='val'>%u</div></summary></details>\n",                 limits->timestampComputeAndGraphics            );
184497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>timestampPeriod                         = <div class='val'>%f</div></summary></details>\n",                 limits->timestampPeriod                        );
184597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxClipDistances                        = <div class='val'>%u</div></summary></details>\n",                 limits->maxClipDistances                       );
184697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxCullDistances                        = <div class='val'>%u</div></summary></details>\n",                 limits->maxCullDistances                       );
184797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>maxCombinedClipAndCullDistances         = <div class='val'>%u</div></summary></details>\n",                 limits->maxCombinedClipAndCullDistances        );
184897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>discreteQueuePriorities                 = <div class='val'>%u</div></summary></details>\n",                 limits->discreteQueuePriorities                );
184997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>pointSizeRange[0]                       = <div class='val'>%f</div></summary></details>\n",                 limits->pointSizeRange[0]                      );
185097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>pointSizeRange[1]                       = <div class='val'>%f</div></summary></details>\n",                 limits->pointSizeRange[1]                      );
185197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>lineWidthRange[0]                       = <div class='val'>%f</div></summary></details>\n",                 limits->lineWidthRange[0]                      );
185297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>lineWidthRange[1]                       = <div class='val'>%f</div></summary></details>\n",                 limits->lineWidthRange[1]                      );
185397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>pointSizeGranularity                    = <div class='val'>%f</div></summary></details>\n",                 limits->pointSizeGranularity                   );
185497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>lineWidthGranularity                    = <div class='val'>%f</div></summary></details>\n",                 limits->lineWidthGranularity                   );
185597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>strictLines                             = <div class='val'>%u</div></summary></details>\n",                 limits->strictLines                            );
185697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>standardSampleLocations                 = <div class='val'>%u</div></summary></details>\n",                 limits->standardSampleLocations                );
185797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>optimalBufferCopyOffsetAlignment        = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->optimalBufferCopyOffsetAlignment       );
185897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>optimalBufferCopyRowPitchAlignment      = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->optimalBufferCopyRowPitchAlignment     );
185997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>nonCoherentAtomSize                     = <div class='val'>0x%" PRIxLEAST64 "</div></summary></details>\n", limits->nonCoherentAtomSize                    );
186097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t</details>\n");
186197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
186297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tVkPhysicalDeviceLimits:\n");
186397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t-----------------------\n");
186497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxImageDimension1D                     = %u\n",                 limits->maxImageDimension1D                    );
186597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxImageDimension2D                     = %u\n",                 limits->maxImageDimension2D                    );
186697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxImageDimension3D                     = %u\n",                 limits->maxImageDimension3D                    );
186797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxImageDimensionCube                   = %u\n",                 limits->maxImageDimensionCube                  );
186897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxImageArrayLayers                     = %u\n",                 limits->maxImageArrayLayers                    );
186997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTexelBufferElements                  = 0x%" PRIxLEAST32 "\n", limits->maxTexelBufferElements                 );
187097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxUniformBufferRange                   = 0x%" PRIxLEAST32 "\n", limits->maxUniformBufferRange                  );
187197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxStorageBufferRange                   = 0x%" PRIxLEAST32 "\n", limits->maxStorageBufferRange                  );
187297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPushConstantsSize                    = %u\n",                 limits->maxPushConstantsSize                   );
187397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxMemoryAllocationCount                = %u\n",                 limits->maxMemoryAllocationCount               );
187497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxSamplerAllocationCount               = %u\n",                 limits->maxSamplerAllocationCount              );
187597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tbufferImageGranularity                  = 0x%" PRIxLEAST64 "\n", limits->bufferImageGranularity                 );
187697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsparseAddressSpaceSize                  = 0x%" PRIxLEAST64 "\n", limits->sparseAddressSpaceSize                 );
187797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxBoundDescriptorSets                  = %u\n",                 limits->maxBoundDescriptorSets                 );
187897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageDescriptorSamplers           = %u\n",                 limits->maxPerStageDescriptorSamplers          );
187997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageDescriptorUniformBuffers     = %u\n",                 limits->maxPerStageDescriptorUniformBuffers    );
188097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageDescriptorStorageBuffers     = %u\n",                 limits->maxPerStageDescriptorStorageBuffers    );
188197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageDescriptorSampledImages      = %u\n",                 limits->maxPerStageDescriptorSampledImages     );
188297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageDescriptorStorageImages      = %u\n",                 limits->maxPerStageDescriptorStorageImages     );
188397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageDescriptorInputAttachments   = %u\n",                 limits->maxPerStageDescriptorInputAttachments  );
188497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxPerStageResources                    = %u\n",                 limits->maxPerStageResources                   );
188597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetSamplers                = %u\n",                 limits->maxDescriptorSetSamplers               );
188697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetUniformBuffers          = %u\n",                 limits->maxDescriptorSetUniformBuffers         );
188797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetUniformBuffersDynamic   = %u\n",                 limits->maxDescriptorSetUniformBuffersDynamic  );
188897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetStorageBuffers          = %u\n",                 limits->maxDescriptorSetStorageBuffers         );
188997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetStorageBuffersDynamic   = %u\n",                 limits->maxDescriptorSetStorageBuffersDynamic  );
189097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetSampledImages           = %u\n",                 limits->maxDescriptorSetSampledImages          );
189197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetStorageImages           = %u\n",                 limits->maxDescriptorSetStorageImages          );
189297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDescriptorSetInputAttachments        = %u\n",                 limits->maxDescriptorSetInputAttachments       );
189397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxVertexInputAttributes                = %u\n",                 limits->maxVertexInputAttributes               );
189497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxVertexInputBindings                  = %u\n",                 limits->maxVertexInputBindings                 );
189597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxVertexInputAttributeOffset           = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputAttributeOffset          );
189697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxVertexInputBindingStride             = 0x%" PRIxLEAST32 "\n", limits->maxVertexInputBindingStride            );
189797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxVertexOutputComponents               = %u\n",                 limits->maxVertexOutputComponents              );
189897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationGenerationLevel          = %u\n",                 limits->maxTessellationGenerationLevel         );
189997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationPatchSize                        = %u\n",                 limits->maxTessellationPatchSize                       );
190097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationControlPerVertexInputComponents  = %u\n",                 limits->maxTessellationControlPerVertexInputComponents );
190197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationControlPerVertexOutputComponents = %u\n",                 limits->maxTessellationControlPerVertexOutputComponents);
190297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationControlPerPatchOutputComponents  = %u\n",                 limits->maxTessellationControlPerPatchOutputComponents );
190397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationControlTotalOutputComponents     = %u\n",                 limits->maxTessellationControlTotalOutputComponents    );
190497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationEvaluationInputComponents        = %u\n",                 limits->maxTessellationEvaluationInputComponents       );
190597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTessellationEvaluationOutputComponents       = %u\n",                 limits->maxTessellationEvaluationOutputComponents      );
190697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxGeometryShaderInvocations            = %u\n",                 limits->maxGeometryShaderInvocations           );
190797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxGeometryInputComponents              = %u\n",                 limits->maxGeometryInputComponents             );
190897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxGeometryOutputComponents             = %u\n",                 limits->maxGeometryOutputComponents            );
190997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxGeometryOutputVertices               = %u\n",                 limits->maxGeometryOutputVertices              );
191097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxGeometryTotalOutputComponents        = %u\n",                 limits->maxGeometryTotalOutputComponents       );
191197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFragmentInputComponents              = %u\n",                 limits->maxFragmentInputComponents             );
191297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFragmentOutputAttachments            = %u\n",                 limits->maxFragmentOutputAttachments           );
191397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFragmentDualSrcAttachments           = %u\n",                 limits->maxFragmentDualSrcAttachments          );
191497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFragmentCombinedOutputResources      = %u\n",                 limits->maxFragmentCombinedOutputResources     );
191597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeSharedMemorySize              = 0x%" PRIxLEAST32 "\n", limits->maxComputeSharedMemorySize             );
191697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupCount[0]             = %u\n",                 limits->maxComputeWorkGroupCount[0]            );
191797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupCount[1]             = %u\n",                 limits->maxComputeWorkGroupCount[1]            );
191897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupCount[2]             = %u\n",                 limits->maxComputeWorkGroupCount[2]            );
191997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupInvocations          = %u\n",                 limits->maxComputeWorkGroupInvocations         );
192097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupSize[0]              = %u\n",                 limits->maxComputeWorkGroupSize[0]             );
192197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupSize[1]              = %u\n",                 limits->maxComputeWorkGroupSize[1]             );
192297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxComputeWorkGroupSize[2]              = %u\n",                 limits->maxComputeWorkGroupSize[2]             );
192397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsubPixelPrecisionBits                   = %u\n",                 limits->subPixelPrecisionBits                  );
192497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsubTexelPrecisionBits                   = %u\n",                 limits->subTexelPrecisionBits                  );
192597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmipmapPrecisionBits                     = %u\n",                 limits->mipmapPrecisionBits                    );
192697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDrawIndexedIndexValue                = %u\n",                 limits->maxDrawIndexedIndexValue               );
192797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxDrawIndirectCount                    = %u\n",                 limits->maxDrawIndirectCount                   );
192897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxSamplerLodBias                       = %f\n",                 limits->maxSamplerLodBias                      );
192997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxSamplerAnisotropy                    = %f\n",                 limits->maxSamplerAnisotropy                   );
193097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxViewports                            = %u\n",                 limits->maxViewports                           );
193197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxViewportDimensions[0]                = %u\n",                 limits->maxViewportDimensions[0]               );
193297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxViewportDimensions[1]                = %u\n",                 limits->maxViewportDimensions[1]               );
193397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tviewportBoundsRange[0]                  =%13f\n",                limits->viewportBoundsRange[0]                 );
193497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tviewportBoundsRange[1]                  =%13f\n",                limits->viewportBoundsRange[1]                 );
193597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tviewportSubPixelBits                    = %u\n",                 limits->viewportSubPixelBits                   );
193697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminMemoryMapAlignment                   = " PRINTF_SIZE_T_SPECIFIER "\n", limits->minMemoryMapAlignment         );
193797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminTexelBufferOffsetAlignment           = 0x%" PRIxLEAST64 "\n", limits->minTexelBufferOffsetAlignment          );
193897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminUniformBufferOffsetAlignment         = 0x%" PRIxLEAST64 "\n", limits->minUniformBufferOffsetAlignment        );
193997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminStorageBufferOffsetAlignment         = 0x%" PRIxLEAST64 "\n", limits->minStorageBufferOffsetAlignment        );
194097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminTexelOffset                          =%3d\n",                 limits->minTexelOffset                         );
194197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTexelOffset                          =%3d\n",                 limits->maxTexelOffset                         );
194297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminTexelGatherOffset                    =%3d\n",                 limits->minTexelGatherOffset                   );
194397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxTexelGatherOffset                    =%3d\n",                 limits->maxTexelGatherOffset                   );
194497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tminInterpolationOffset                  =%9f\n",                 limits->minInterpolationOffset                 );
194597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxInterpolationOffset                  =%9f\n",                 limits->maxInterpolationOffset                 );
194697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsubPixelInterpolationOffsetBits         = %u\n",                 limits->subPixelInterpolationOffsetBits        );
194797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFramebufferWidth                     = %u\n",                 limits->maxFramebufferWidth                    );
194897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFramebufferHeight                    = %u\n",                 limits->maxFramebufferHeight                   );
194997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxFramebufferLayers                    = %u\n",                 limits->maxFramebufferLayers                   );
195097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tframebufferColorSampleCounts            = %u\n",                 limits->framebufferColorSampleCounts           );
195197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tframebufferDepthSampleCounts            = %u\n",                 limits->framebufferDepthSampleCounts           );
195297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tframebufferStencilSampleCounts          = %u\n",                 limits->framebufferStencilSampleCounts         );
195397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tframebufferNoAttachmentsSampleCounts    = %u\n",                 limits->framebufferNoAttachmentsSampleCounts   );
195497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxColorAttachments                     = %u\n",                 limits->maxColorAttachments                    );
195597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsampledImageColorSampleCounts           = %u\n",                 limits->sampledImageColorSampleCounts          );
195697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsampledImageDepthSampleCounts           = %u\n",                 limits->sampledImageDepthSampleCounts          );
195797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsampledImageStencilSampleCounts         = %u\n",                 limits->sampledImageStencilSampleCounts        );
195897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tsampledImageIntegerSampleCounts         = %u\n",                 limits->sampledImageIntegerSampleCounts        );
195997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tstorageImageSampleCounts                = %u\n",                 limits->storageImageSampleCounts               );
196097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxSampleMaskWords                      = %u\n",                 limits->maxSampleMaskWords                     );
196197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\ttimestampComputeAndGraphics             = %u\n",                 limits->timestampComputeAndGraphics            );
196297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\ttimestampPeriod                         = %f\n",                 limits->timestampPeriod                        );
196397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxClipDistances                        = %u\n",                 limits->maxClipDistances                       );
196497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxCullDistances                        = %u\n",                 limits->maxCullDistances                       );
196597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tmaxCombinedClipAndCullDistances         = %u\n",                 limits->maxCombinedClipAndCullDistances        );
196697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tdiscreteQueuePriorities                 = %u\n",                 limits->discreteQueuePriorities                );
196797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tpointSizeRange[0]                       = %f\n",                 limits->pointSizeRange[0]                      );
196897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tpointSizeRange[1]                       = %f\n",                 limits->pointSizeRange[1]                      );
196997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tlineWidthRange[0]                       = %f\n",                 limits->lineWidthRange[0]                      );
197097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tlineWidthRange[1]                       = %f\n",                 limits->lineWidthRange[1]                      );
197197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tpointSizeGranularity                    = %f\n",                 limits->pointSizeGranularity                   );
197297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tlineWidthGranularity                    = %f\n",                 limits->lineWidthGranularity                   );
197397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tstrictLines                             = %u\n",                 limits->strictLines                            );
197497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tstandardSampleLocations                 = %u\n",                 limits->standardSampleLocations                );
197597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\toptimalBufferCopyOffsetAlignment        = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyOffsetAlignment       );
197697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\toptimalBufferCopyRowPitchAlignment      = 0x%" PRIxLEAST64 "\n", limits->optimalBufferCopyRowPitchAlignment     );
197797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\t\tnonCoherentAtomSize                     = 0x%" PRIxLEAST64 "\n", limits->nonCoherentAtomSize                    );
197897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
1979d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
1980d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
198197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppGpuDumpProps(const struct AppGpu *gpu, FILE *out) {
198218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    const VkPhysicalDeviceProperties *props = &gpu->props;
19833c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay    const uint32_t apiVersion=props->apiVersion;
19843c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay    const uint32_t major = VK_VERSION_MAJOR(apiVersion);
19853c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay    const uint32_t minor = VK_VERSION_MINOR(apiVersion);
19863c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay    const uint32_t patch = VK_VERSION_PATCH(apiVersion);
198718061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
198897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
198997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>VkPhysicalDeviceProperties</summary>\n");
199097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>apiVersion = <div class='val'>0x%" PRIxLEAST32 "</div>  (<div class='val'>%d.%d.%d</div>)</summary></details>\n", apiVersion, major, minor, patch);
199197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>driverVersion = <div class='val'>%u</div> (<div class='val'>0x%" PRIxLEAST32 "</div>)</summary></details>\n", props->driverVersion, props->driverVersion);
199297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>vendorID = <div class='val'>0x%04x</div></summary></details>\n", props->vendorID);
199397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>deviceID = <div class='val'>0x%04x</div></summary></details>\n", props->deviceID);
199497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>deviceType = %s</summary></details>\n", VkPhysicalDeviceTypeString(props->deviceType));
199597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>deviceName = %s</summary></details>\n", props->deviceName);
199697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
199797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("VkPhysicalDeviceProperties:\n");
199897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("===========================\n");
199997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tapiVersion     = 0x%" PRIxLEAST32 "  (%d.%d.%d)\n", apiVersion, major, minor, patch);
200097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdriverVersion  = %u (0x%" PRIxLEAST32 ")\n", props->driverVersion, props->driverVersion);
200197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tvendorID       = 0x%04x\n", props->vendorID);
200297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdeviceID       = 0x%04x\n", props->deviceID);
200397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdeviceType     = %s\n", VkPhysicalDeviceTypeString(props->deviceType));
200497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tdeviceName     = %s\n", props->deviceName);
200597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
200697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) fprintf(out, "\t\t\t\t\t</details>\n");
20077dae6868682383bb8370d45784cbc94f357e745bMark Lobodzinski
200897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppDumpLimits(&gpu->props.limits, out);
200997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppDumpSparseProps(&gpu->props.sparseProperties, out);
20107dae6868682383bb8370d45784cbc94f357e745bMark Lobodzinski
201197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
201218061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter}
201318061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
2014bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinskistatic void AppDumpExtensions(const char *indent, const char *layer_name, const uint32_t extension_count,
201597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                              const VkExtensionProperties *extension_properties, FILE *out) {
20163c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    uint32_t i;
201797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
201897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) fprintf(out, "\t\t\t%s<details><summary>", indent);
201918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    if (layer_name && (strlen(layer_name) > 0)) {
202097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
202197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "%s Extensions", layer_name);
202297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
202397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("%s%s Extensions", indent, layer_name);
202497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
202597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
202697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "%sExtensions", indent);
202797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
202897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
202997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\tcount = <div class='val'>%d</div></summary>", extension_count);
203097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (extension_count > 0) fprintf(out, "\n");
203118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    } else {
203297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tcount = %d\n", extension_count);
20333c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter    }
203497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
2035481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultz    for (i = 0; i < extension_count; i++) {
203618061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        VkExtensionProperties const *ext_prop = &extension_properties[i];
20373c1ccf58f9f38b00cf0409e72fc65349aa11e742Courtney Goeltzenleuchter
203897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
203997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t%s<details><summary>", indent);
204097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "<div class='type'>%s</div>: extension revision <div class='val'>%d</div>", ext_prop->extensionName,
204197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    ext_prop->specVersion);
204297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</summary></details>\n");
204397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
204497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("%s\t", indent);
204597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("%-36s: extension revision %2d\n", ext_prop->extensionName, ext_prop->specVersion);
204697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
2047ff87c822214d31c677026f8dcf53d8f953b395fdCourtney Goeltzenleuchter    }
204897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
204997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (extension_count > 0) {
205097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t%s</details>\n", indent);
205197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
205297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</details>\n");
205397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
205497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
205597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
205697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
2057ff87c822214d31c677026f8dcf53d8f953b395fdCourtney Goeltzenleuchter}
2058ff87c822214d31c677026f8dcf53d8f953b395fdCourtney Goeltzenleuchter
205997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id, FILE *out) {
2060ef72e2a7cf4fa5708fdbfbc1c972a24ad0dbf809Cody Northrop    const VkQueueFamilyProperties *props = &gpu->queue_props[id];
2061190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
206297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
206397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>VkQueueFamilyProperties[<div class='val'>%d</div>]</summary>\n", id);
206497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>queueFlags = ");
206597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
206697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("VkQueueFamilyProperties[%d]:\n", id);
206797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("===========================\n");
206897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tqueueFlags         = ");
206997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
207097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
2071cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    char *sep = "";  // separator character
20727fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    if (props->queueFlags & VK_QUEUE_GRAPHICS_BIT) {
207397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "GRAPHICS");
20747fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        sep = " | ";
20757fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    }
20767fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    if (props->queueFlags & VK_QUEUE_COMPUTE_BIT) {
207797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "%sCOMPUTE", sep);
20787fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        sep = " | ";
20797fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    }
20807fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    if (props->queueFlags & VK_QUEUE_TRANSFER_BIT) {
208197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "%sTRANSFER", sep);
20827fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        sep = " | ";
20837fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    }
20847fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    if (props->queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) {
208597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "%sSPARSE", sep);
208697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
208797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
208897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "</summary></details>\n");
208997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>queueCount         = <div class='val'>%u</div></summary></details>\n", props->queueCount);
209097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>timestampValidBits = <div class='val'>%u</div></summary></details>\n", props->timestampValidBits);
209197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>minImageTransferGranularity = (<div class='val'>%d</div>, <div class='val'>%d</div>, <div class='val'>%d</div>)</summary></details>\n", props->minImageTransferGranularity.width,
209297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                props->minImageTransferGranularity.height, props->minImageTransferGranularity.depth);
209397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t</details>\n");
209497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
209597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\n");
209697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tqueueCount         = %u\n", props->queueCount);
209797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\ttimestampValidBits = %u\n", props->timestampValidBits);
209897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tminImageTransferGranularity = (%d, %d, %d)\n", props->minImageTransferGranularity.width,
209997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson               props->minImageTransferGranularity.height, props->minImageTransferGranularity.depth);
21007fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    }
2101a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
210297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
2103d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
2104d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
2105bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus// This prints a number of bytes in a human-readable format according to prefixes of the International System of Quantities (ISQ),
2106bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus// defined in ISO/IEC 80000. The prefixes used here are not SI prefixes, but rather the binary prefixes based on powers of 1024
2107bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus// (kibi-, mebi-, gibi- etc.).
2108bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus#define kBufferSize 32
2109bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus
2110bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markusstatic char *HumanReadable(const size_t sz) {
2111bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    const char prefixes[] = "KMGTPEZY";
2112bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    char buf[kBufferSize];
2113bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    int which = -1;
2114bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    double result = (double)sz;
2115bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    while (result > 1024 && which < 7) {
2116bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus        result /= 1024;
2117bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus        ++which;
2118bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    }
2119bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus
2120bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    char unit[] = "\0i";
2121bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    if (which >= 0) {
2122bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus        unit[0] = prefixes[which];
2123bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    }
2124bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    snprintf(buf, kBufferSize, "%.2f %sB", result, unit);
2125bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus    return strndup(buf, kBufferSize);
2126bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus}
2127bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus
212897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppGpuDumpMemoryProps(const struct AppGpu *gpu, FILE *out) {
21298205d901f17b1c76d89c956be235cf4e7a20a546Tony Barbour    const VkPhysicalDeviceMemoryProperties *props = &gpu->memory_props;
2130d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
213197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
213297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t<details><summary>VkPhysicalDeviceMemoryProperties</summary>\n");
213397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>memoryTypeCount = <div class='val'>%u</div></summary>", props->memoryTypeCount);
213497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (props->memoryTypeCount > 0) {
213597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\n");
213697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
213797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</details>\n");
213897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
213997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
214097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("VkPhysicalDeviceMemoryProperties:\n");
214197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("=================================\n");
214297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tmemoryTypeCount       = %u\n", props->memoryTypeCount);
214397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
2144723462910ef2f9ed0255b74399c835020a75a0b1Mark Lobodzinski    for (uint32_t i = 0; i < props->memoryTypeCount; i++) {
214597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
214697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t<details><summary>memoryTypes[<div class='val'>%u</div>]</summary>\n", i);
214797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t\t<details><summary>heapIndex = <div class='val'>%u</div></summary></summary></details>\n", props->memoryTypes[i].heapIndex);
214897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t\t<details open><summary>propertyFlags = <div class='val'>0x%" PRIxLEAST32 "</div></summary>", props->memoryTypes[i].propertyFlags);
214997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (props->memoryTypes[i].propertyFlags == 0) {
215097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "</details>\n");
215197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
215297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\n");
215397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
215497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
215597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tmemoryTypes[%u] :\n", i);
215697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\theapIndex     = %u\n", props->memoryTypes[i].heapIndex);
215797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\tpropertyFlags = 0x%" PRIxLEAST32 ":\n", props->memoryTypes[i].propertyFlags);
215897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
21597fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay
216097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        // Print each named flag, if it is set
21617fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay        VkFlags flags = props->memoryTypes[i].propertyFlags;
216297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
216397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT</div></summary></details>\n");  }
216497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT</div></summary></details>\n");  }
216597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_MEMORY_PROPERTY_HOST_COHERENT_BIT</div></summary></details>\n"); }
216697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_MEMORY_PROPERTY_HOST_CACHED_BIT</div></summary></details>\n"); }
216797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { fprintf(out, "\t\t\t\t\t\t\t\t\t<details><summary><div class='type'>VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT</div></summary></details>\n"); }
216897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (props->memoryTypes[i].propertyFlags > 0) fprintf(out, "\t\t\t\t\t\t\t\t</details>\n");
216997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t</details>\n");
217097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
217197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT\n"); }
217297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_HOST_VISIBLE_BIT\n"); }
217397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_HOST_COHERENT_BIT\n"); }
217497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_HOST_CACHED_BIT\n"); }
217597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) { printf("\t\t\tVK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT\n"); }
217697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
217797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
217897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
21790e8b5ae25202ce7c869b1734b970bff5513f27d1Gabríel Arthúr Pétursson    if (html_output && props->memoryTypeCount > 0) {
21800e8b5ae25202ce7c869b1734b970bff5513f27d1Gabríel Arthúr Pétursson        fprintf(out, "\t\t\t\t\t\t</details>\n");
21810e8b5ae25202ce7c869b1734b970bff5513f27d1Gabríel Arthúr Pétursson    }
218297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
218397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
218497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t<details><summary>memoryHeapCount = <div class='val'>%u</div></summary>", props->memoryHeapCount);
218597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (props->memoryTypeCount > 0) fprintf(out, "\n");
218697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
218797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\tmemoryHeapCount       = %u\n", props->memoryHeapCount);
218897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
2189723462910ef2f9ed0255b74399c835020a75a0b1Mark Lobodzinski    for (uint32_t i = 0; i < props->memoryHeapCount; i++) {
21903c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay        const VkDeviceSize memSize = props->memoryHeaps[i].size;
2191bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus        char *mem_size_human_readable = HumanReadable((const size_t)memSize);
219297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
219397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
219497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t<details><summary>memoryHeaps[<div class='val'>%u</div>]</summary>\n", i);
219597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t\t<details><summary>size = <div class='val'>" PRINTF_SIZE_T_SPECIFIER "</div> (<div class='val'>0x%" PRIxLEAST64 "</div>) (<div class='val'>%s</div>)</summary></details>\n",
219697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    (size_t)memSize, memSize, mem_size_human_readable);
219797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
219897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tmemoryHeaps[%u] :\n", i);
219997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\tsize          = " PRINTF_SIZE_T_SPECIFIER " (0x%" PRIxLEAST64 ") (%s)\n", (size_t)memSize, memSize,
220097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                   mem_size_human_readable);
220197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
2202bcc5c8ef92b67f36ba151270cce72f595ab27beaTobias Markus        free(mem_size_human_readable);
22033c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay
2204f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        VkMemoryHeapFlags heap_flags = props->memoryHeaps[i].flags;
220597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
220697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t\t<details open><summary>flags</summary>\n");
220797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t\t\t<details><summary>");
220897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, (heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "<div class='type'>VK_MEMORY_HEAP_DEVICE_LOCAL_BIT</div>" : "None");
220997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</summary></details>\n");
221097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t\t</details>\n");
221197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t\t\t</details>\n");
221297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
221397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\t\tflags:\n\t\t\t");
221497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf((heap_flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) ? "VK_MEMORY_HEAP_DEVICE_LOCAL_BIT\n" : "None\n");
221597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
2216723462910ef2f9ed0255b74399c835020a75a0b1Mark Lobodzinski    }
221797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
221897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
221997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t\t</details>\n");
222097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t\t</details>\n");
222197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
222297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
222397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
2224d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
222597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson// clang-format on
2226d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
222797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPhersonstatic void AppGpuDump(const struct AppGpu *gpu, FILE *out) {
2228e2d07a5a3810d83d0ea7ecb396d61477893b74a4Mark Lobodzinski    uint32_t i;
2229190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
223097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
223197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t<details><summary>Device Properties and Extensions</summary>\n");
223297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t<details><summary>GPU%u</summary>\n", gpu->id);
223397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
223497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\nDevice Properties and Extensions :\n");
223597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("==================================\n");
223697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("GPU%u\n", gpu->id);
223797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
223897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
223997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppGpuDumpProps(gpu, out);
224097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
224197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        AppDumpExtensions("\t\t", "Device", gpu->device_extension_count, gpu->device_extensions, out);
224297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
224397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\n");
224497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        AppDumpExtensions("", "Device", gpu->device_extension_count, gpu->device_extensions, out);
2245190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu        printf("\n");
2246190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    }
224797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
224897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    for (i = 0; i < gpu->queue_count; i++) {
224997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        AppGpuDumpQueueProps(gpu, i, out);
225097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (!html_output) printf("\n");
225197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
225297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppGpuDumpMemoryProps(gpu, out);
225397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (!html_output) printf("\n");
225497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppGpuDumpFeatures(gpu, out);
225597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (!html_output) printf("\n");
225697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppDevDump(&gpu->dev, out);
225797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
225897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t\t</details>\n");
225997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t</details>\n");
226097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
2261d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu}
2262d4bae362585dff8c456fb3b906512b4d2ef17fe8Chia-I Wu
2263a3b7170656404199592bb65040621772f299a7f3Hugo Landau#ifdef _WIN32
2264a3b7170656404199592bb65040621772f299a7f3Hugo Landau// Enlarges the console window to have a large scrollback size.
2265a3b7170656404199592bb65040621772f299a7f3Hugo Landaustatic void ConsoleEnlarge() {
2266f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    HANDLE console_handle = GetStdHandle(STD_OUTPUT_HANDLE);
2267a3b7170656404199592bb65040621772f299a7f3Hugo Landau
2268a3b7170656404199592bb65040621772f299a7f3Hugo Landau    // make the console window bigger
2269a3b7170656404199592bb65040621772f299a7f3Hugo Landau    CONSOLE_SCREEN_BUFFER_INFO csbi;
2270f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    COORD buffer_size;
2271f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    if (GetConsoleScreenBufferInfo(console_handle, &csbi)) {
2272f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        buffer_size.X = csbi.dwSize.X + 30;
2273f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        buffer_size.Y = 20000;
2274f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        SetConsoleScreenBufferSize(console_handle, buffer_size);
2275a3b7170656404199592bb65040621772f299a7f3Hugo Landau    }
2276a3b7170656404199592bb65040621772f299a7f3Hugo Landau
2277a3b7170656404199592bb65040621772f299a7f3Hugo Landau    SMALL_RECT r;
2278a3b7170656404199592bb65040621772f299a7f3Hugo Landau    r.Left = r.Top = 0;
2279a3b7170656404199592bb65040621772f299a7f3Hugo Landau    r.Right = csbi.dwSize.X - 1 + 30;
2280a3b7170656404199592bb65040621772f299a7f3Hugo Landau    r.Bottom = 50;
2281f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    SetConsoleWindowInfo(console_handle, true, &r);
2282a3b7170656404199592bb65040621772f299a7f3Hugo Landau
2283a3b7170656404199592bb65040621772f299a7f3Hugo Landau    // change the console window title
2284a3b7170656404199592bb65040621772f299a7f3Hugo Landau    SetConsoleTitle(TEXT(APP_SHORT_NAME));
2285a3b7170656404199592bb65040621772f299a7f3Hugo Landau}
2286a3b7170656404199592bb65040621772f299a7f3Hugo Landau#endif
2287a3b7170656404199592bb65040621772f299a7f3Hugo Landau
2288481756e168555e1bf150d3b8f1b81edca1d98c43Karl Schultzint main(int argc, char **argv) {
22899784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    uint32_t vulkan_major, vulkan_minor, vulkan_patch;
2290242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    struct AppGpu *gpus;
2291242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    VkPhysicalDevice *objs;
22929784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    uint32_t gpu_count;
2293382489d723fd0d3935da0dc7e1021c56c7b721d3Courtney Goeltzenleuchter    VkResult err;
2294f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    struct AppInstance inst;
229597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    FILE *out = stdout;
2296190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
2297a3b7170656404199592bb65040621772f299a7f3Hugo Landau#ifdef _WIN32
2298cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (ConsoleIsExclusive()) ConsoleEnlarge();
2299a3b7170656404199592bb65040621772f299a7f3Hugo Landau#endif
2300a3b7170656404199592bb65040621772f299a7f3Hugo Landau
23019784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    vulkan_major = VK_VERSION_MAJOR(VK_API_VERSION_1_0);
23029784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    vulkan_minor = VK_VERSION_MINOR(VK_API_VERSION_1_0);
23039784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    vulkan_patch = VK_VERSION_PATCH(VK_HEADER_VERSION);
230497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    for (int i = 1; i < argc; i++) {
230597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (strcmp(argv[i], "--html") == 0) {
230697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            out = fopen("vulkaninfo.html", "w");
230797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            html_output = true;
230897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            continue;
230997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
231097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
23113c877cdec3dc56f422fcc2e6ffa11dd7cd666eb0Rene Lindsay
231297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
231397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        PrintHtmlHeader(out);
231497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t<details><summary>");
231597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
231697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("===========\n");
231797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("VULKAN INFO\n");
231897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("===========\n\n");
231997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
232097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fprintf(out, "Vulkan API Version: ");
232197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
232297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "<div class='val'>%d.%d.%d</div></summary></details>\n", vulkan_major, vulkan_minor, vulkan_patch);
232397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t<br />\n");
232497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
232597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("%d.%d.%d\n\n", vulkan_major, vulkan_minor, vulkan_patch);
232697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
2327b5ec4c29f35458d9a072956e983563a35d9c2416David Pinedo
2328f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    AppCreateInstance(&inst);
232918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
233097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (!html_output) {
233197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("Instance Extensions:\n");
233297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("====================\n");
233397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
233497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    AppDumpExtensions("", "Instance", inst.global_extension_count, inst.global_extensions, out);
2335825cc51df04b93f130e48788ced8e63937272b4dMark Lobodzinski
2336cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    err = vkEnumeratePhysicalDevices(inst.instance, &gpu_count, NULL);
2337cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (err) ERR_EXIT(err);
2338242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    objs = malloc(sizeof(objs[0]) * gpu_count);
2339cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (!objs) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
2340cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    err = vkEnumeratePhysicalDevices(inst.instance, &gpu_count, objs);
2341cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (err) ERR_EXIT(err);
2342cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay
2343242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    gpus = malloc(sizeof(gpus[0]) * gpu_count);
2344cc7c305c82f6443c324165edb7af59f60fc87eebMark Lobodzinski    if (!gpus) ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
23459784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    for (uint32_t i = 0; i < gpu_count; i++) {
23465d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager        AppGpuInit(&gpus[i], &inst, i, objs[i]);
234797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (!html_output) printf("\n\n");
2348cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    }
2349cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay
2350cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    //---Layer-Device-Extensions---
235197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
235297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t<details><summary>Layers: count = <div class='val'>%d</div></summary>", inst.global_layer_count);
235397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (inst.global_layer_count > 0) {
235497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\n");
235597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
235697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
235797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("Layers: count = %d\n", inst.global_layer_count);
235897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("=======\n");
235997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
236097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
236118061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter    for (uint32_t i = 0; i < inst.global_layer_count; i++) {
23629784e78683f658f304062235ceb2dd2c2652c357Karl Schultz        uint32_t layer_major, layer_minor, layer_patch;
236318061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter        char spec_version[64], layer_version[64];
2364bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        VkLayerProperties const *layer_prop = &inst.global_layers[i].layer_properties;
236518061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
23669784e78683f658f304062235ceb2dd2c2652c357Karl Schultz        ExtractVersion(layer_prop->specVersion, &layer_major, &layer_minor, &layer_patch);
23679784e78683f658f304062235ceb2dd2c2652c357Karl Schultz        snprintf(spec_version, sizeof(spec_version), "%d.%d.%d", layer_major, layer_minor, layer_patch);
2368bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski        snprintf(layer_version, sizeof(layer_version), "%d", layer_prop->implementationVersion);
236918061cdee54b19cd628178d2924a7a914c62a10bCourtney Goeltzenleuchter
237097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
237197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t<details><summary>");
237297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "<div class='type'>%s</div> (%s) Vulkan version <div class='val'>%s</div>, ", layer_prop->layerName,
237397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                    (char *)layer_prop->description, spec_version);
237497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "layer version <div class='val'>%s</div></summary>\n", layer_version);
237597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            AppDumpExtensions("\t\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties,
237697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                              out);
237797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
237897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("%s (%s) Vulkan version %s, layer version %s\n", layer_prop->layerName, (char *) layer_prop->description,
237997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                   spec_version, layer_version);
238097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            AppDumpExtensions("\t", "Layer", inst.global_layers[i].extension_count, inst.global_layers[i].extension_properties,
238197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                              out);
238297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
2383190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
2384f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        char *layer_name = inst.global_layers[i].layer_properties.layerName;
238597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
238697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
238797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t\t<details><summary>Devices count = <div class='val'>%d</div></summary>\n", gpu_count);
238897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
238997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\tDevices \tcount = %d\n", gpu_count);
239097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
2391cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay        for (uint32_t j = 0; j < gpu_count; j++) {
239297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) {
239397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t\t\t<details><summary>");
239497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "GPU id: <div class='val'>%u</div> (%s)</summary></details>\n", j, gpus[j].props.deviceName);
239597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
239697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("\t\tGPU id       : %u (%s)\n", j, gpus[j].props.deviceName);
239797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
23989652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay            uint32_t count = 0;
23999652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay            VkExtensionProperties *props;
2400bc9caa57c5583dfdf05198e78b78a7cb361da16cMark Lobodzinski            AppGetPhysicalDeviceLayerExtensions(&gpus[j], layer_name, &count, &props);
240197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) {
240297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                AppDumpExtensions("\t\t\t", "Layer-Device", count, props, out);
240397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
240497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                AppDumpExtensions("\t\t", "Layer-Device", count, props, out);
240597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
240697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) { fprintf(out, "\t\t\t\t\t</details>\n"); }
2407cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay            free(props);
2408cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay        }
240997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
241097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t</details>\n");
241197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
241297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf("\n");
241397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
2414190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu    }
241597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
241697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) { fprintf(out, "\t\t\t</details>\n"); }
241797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
241897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
2419cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    //-----------------------------
2420190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
242197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
242297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t<details><summary>Presentable Surfaces</summary>");
242397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (gpu_count > 0) {
242497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\n");
242597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
242697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "</details>\n");
242797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
242897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
242997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("Presentable Surfaces:\n");
243097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("=====================\n");
243197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
24327fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    inst.width = 256;
24337fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    inst.height = 256;
2434f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    int format_count = 0;
2435f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    int present_mode_count = 0;
2436a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
2437b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#if defined(VK_USE_PLATFORM_XCB_KHR) || defined(VK_USE_PLATFORM_XLIB_KHR)
2438fbc62776dac366f8905757855d736fc946857400Petr Kraus    bool has_display = true;
2439d4b1fccc28c91b3bc31993720af4b7e171bfd30ePetr Kraus    const char *display_var = getenv("DISPLAY");
2440d4b1fccc28c91b3bc31993720af4b7e171bfd30ePetr Kraus    if (display_var == NULL || strlen(display_var) == 0) {
2441fbc62776dac366f8905757855d736fc946857400Petr Kraus        printf("'DISPLAY' environment variable not set... skipping surface info\n");
2442fbc62776dac366f8905757855d736fc946857400Petr Kraus        has_display = false;
2443b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour    }
2444b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#endif
244597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
24467fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay//--WIN32--
2447a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#ifdef VK_USE_PLATFORM_WIN32_KHR
24485d8d6b4f93daceacca1de36be6de935a8264caf6Jeremy Kniager    if (CheckExtensionEnabled(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) {
2449f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        AppCreateWin32Window(&inst);
24509784e78683f658f304062235ceb2dd2c2652c357Karl Schultz        for (uint32_t i = 0; i < gpu_count; i++) {
2451f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg            AppCreateWin32Surface(&inst);
245297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) {
245397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t<details><summary>GPU id : <div class='val'>%u</div> (%s)</summary></details>\n", i,
245497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        gpus[i].props.deviceName);
245597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t<details><summary>Surface type : <div class='type'>%s</div></summary></details>\n",
245697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
245797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
245897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("GPU id       : %u (%s)\n", i, gpus[i].props.deviceName);
245997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("Surface type : %s\n", VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
246097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
246197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out);
246297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out);
246397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            AppDumpSurfaceCapabilities(&inst, &gpus[i], out);
2464f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg            AppDestroySurface(&inst);
24659652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay        }
2466f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        AppDestroyWin32Window(&inst);
2467a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    }
24687fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay//--XCB--
2469b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XCB_KHR
2470fbc62776dac366f8905757855d736fc946857400Petr Kraus    if (has_display && CheckExtensionEnabled(VK_KHR_XCB_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) {
2471f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        AppCreateXcbWindow(&inst);
24729784e78683f658f304062235ceb2dd2c2652c357Karl Schultz        for (uint32_t i = 0; i < gpu_count; i++) {
2473f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg            AppCreateXcbSurface(&inst);
247497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) {
247597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t<details><summary>GPU id : <div class='val'>%u</div> (%s)</summary></details>\n", i,
247697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        gpus[i].props.deviceName);
247797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t<details><summary>Surface type : <div class='type'>%s</div></summary></details>\n",
247897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        VK_KHR_XCB_SURFACE_EXTENSION_NAME);
247997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
248097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("GPU id       : %u (%s)\n", i, gpus[i].props.deviceName);
248197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("Surface type : %s\n", VK_KHR_XCB_SURFACE_EXTENSION_NAME);
248297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
248397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out);
248497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out);
248597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            AppDumpSurfaceCapabilities(&inst, &gpus[i], out);
2486f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg            AppDestroySurface(&inst);
24879652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay        }
2488f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        AppDestroyXcbWindow(&inst);
2489a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    }
24907fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay//--XLIB--
2491b6bbc99f21cbe1698a6de16d2e24d667cc1da116Tony Barbour#elif VK_USE_PLATFORM_XLIB_KHR
2492fbc62776dac366f8905757855d736fc946857400Petr Kraus    if (has_display && CheckExtensionEnabled(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, inst.inst_extensions, inst.inst_extensions_count)) {
2493f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        AppCreateXlibWindow(&inst);
24949784e78683f658f304062235ceb2dd2c2652c357Karl Schultz        for (uint32_t i = 0; i < gpu_count; i++) {
2495f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg            AppCreateXlibSurface(&inst);
249697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            if (html_output) {
249797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t<details><summary>GPU id : <div class='val'>%u</div> (%s)</summary></details>\n", i,
249897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        gpus[i].props.deviceName);
249997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                fprintf(out, "\t\t\t\t<details><summary>Surface type : <div class='type'>%s</div></summary></details>\n",
250097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                        VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
250197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            } else {
250297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("GPU id       : %u (%s)\n", i, gpus[i].props.deviceName);
250397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson                printf("Surface type : %s\n", VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
250497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            }
250597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            format_count += AppDumpSurfaceFormats(&inst, &gpus[i], out);
250697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            present_mode_count += AppDumpSurfacePresentModes(&inst, &gpus[i], out);
250797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            AppDumpSurfaceCapabilities(&inst, &gpus[i], out);
2508f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg            AppDestroySurface(&inst);
25099652e55fbd98d82c0013eb812892528ea367f035Rene Lindsay        }
2510f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg        AppDestroyXlibWindow(&inst);
2511a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    }
2512a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay#endif
251397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
25147fb1e0197fa66f1e61671d212fd1de2b21e718cdRene Lindsay    // TODO: Android / Wayland / MIR
251597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (!format_count && !present_mode_count) {
251697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        if (html_output) {
251797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            fprintf(out, "\t\t\t\t<details><summary>None found</summary></details>\n");
251897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        } else {
251997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson            printf( "None found\n");
252097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        }
252197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
252297a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
252397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
252497a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fprintf(out, "\t\t\t</details>\n");
252597a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    } else {
252697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        printf("\n");
252797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
2528a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay    //---------
2529a155d62f73c03dea7315ba34a7582239fdfc85d2Rene Lindsay
25309784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    for (uint32_t i = 0; i < gpu_count; i++) {
253197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        AppGpuDump(&gpus[i], out);
2532cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay        printf("\n\n");
2533cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay    }
2534cb6b5ca5918ef51a9c435f80aaaedc69b7978e41Rene Lindsay
25359784e78683f658f304062235ceb2dd2c2652c357Karl Schultz    for (uint32_t i = 0; i < gpu_count; i++) AppGpuDestroy(&gpus[i]);
2536242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    free(gpus);
2537242a9c9379564b08b9b8ae197c4088e53ea49015Karl Schultz    free(objs);
2538190ebdcce84b767d8db7a42383c834dc067b3e77Chia-I Wu
2539f0743b0e79005e46a5f9eea2f1443daa3fcfe828joey-lunarg    AppDestroyInstance(&inst);
25400b9a73720abbc3e1229507a4a97e0209976b7610Chia-I Wu
254197a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    fflush(out);
2542a3b7170656404199592bb65040621772f299a7f3Hugo Landau#ifdef _WIN32
254397a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (ConsoleIsExclusive() && !html_output) Sleep(INFINITE);
2544ea95f5c3967480a57ceb03a98e8370225094ce42Ian Elliott#endif
2545a3b7170656404199592bb65040621772f299a7f3Hugo Landau
254697a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    if (html_output) {
254797a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        PrintHtmlFooter(out);
254897a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson        fclose(out);
254997a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson    }
255097a5bc7c33a9fd81616789f729918a13d7587af5Shannon McPherson
2551a3b7170656404199592bb65040621772f299a7f3Hugo Landau    return 0;
2552a3b7170656404199592bb65040621772f299a7f3Hugo Landau}
2553