vulkaninfo: Make json output print extensions
authorCharles Giessen <charles@lunarg.com>
Thu, 12 Nov 2020 21:28:32 +0000 (14:28 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Thu, 12 Nov 2020 22:16:33 +0000 (15:16 -0700)
The json schema includes an array of extensions, yet vulkaninfo was not
printing them. This commit remedies that.

Change-Id: I4ae8627660f16d7c831704ba4b082870b5e62bb5

vulkaninfo/outputprinter.h
vulkaninfo/vulkaninfo.cpp

index 42e15e4..862e965 100644 (file)
@@ -603,6 +603,10 @@ class Printer {
                     << DecorateAsValue(std::to_string(revision)) << "</summary></details>\n";
                 break;
             case (OutputType::json):
+                ObjectStart("");
+                PrintKeyString("extensionName", ext_name);
+                PrintKeyValue("specVersion", revision);
+                ObjectEnd();
                 break;
             case (OutputType::vkconfig_output):
                 ObjectStart(ext_name);
index d771bf8..ef8a869 100644 (file)
@@ -698,6 +698,13 @@ void DumpGpuJson(Printer &p, AppGpu &gpu) {
             GpuDumpQueuePropsJson(p, gpu.inst.surface_extensions, queue_props);
         }
     }
+    {
+        ArrayWrapper arr(p, "ArrayOfVkExtensionProperties");
+        for (auto &ext : gpu.device_extensions) {
+            p.PrintExtension(ext.extensionName, ext.specVersion);
+        }
+    }
+
     GpuDumpMemoryPropsJson(p, gpu);
     DumpVkPhysicalDeviceFeatures(p, "VkPhysicalDeviceFeatures", gpu.features);
     GpuDevDumpJson(p, gpu);