From ce6a1491d6317d5311a939be50d854865018eee7 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Mon, 29 Nov 2021 15:06:59 -0700 Subject: vulkaninfo: Refactor printer to use stack for data The output printer kept track of variables that should of been per object or array in a single variable for the entire output. This commit refactors the code to store data in a new StackNode struct such that pushing and poping the stack is how to save and restore the top node's properties, such as the indent, min_width, and if it is an array or object. It allows behavior such as a parent object ignoring the width output but its children respecting it. --- vulkaninfo/vulkaninfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'vulkaninfo/vulkaninfo.cpp') diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp index a2e8e77d..6007687f 100644 --- a/vulkaninfo/vulkaninfo.cpp +++ b/vulkaninfo/vulkaninfo.cpp @@ -142,9 +142,8 @@ void DumpPresentModes(Printer &p, AppSurface &surface) { void DumpSurfaceCapabilities(Printer &p, AppInstance &inst, AppGpu &gpu, AppSurface &surface) { auto &surf_cap = surface.surface_capabilities; - p.SetSubHeader().SetIgnoreMinWidth(); + p.SetSubHeader().SetIgnoreMinWidthInChild(); DumpVkSurfaceCapabilitiesKHR(p, "VkSurfaceCapabilitiesKHR", surf_cap); - p.UnsetIgnoreMinWidth(); if (inst.CheckExtensionEnabled(VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME)) { p.SetSubHeader(); -- cgit v1.2.3