diff options
| author | Charles Giessen <charles@lunarg.com> | 2025-04-23 18:31:19 -0500 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2025-04-25 13:11:28 -0600 |
| commit | 3e9d7a008869360dccbd8c812f4795afa7f8b416 (patch) | |
| tree | 6cc13517c28bd4fb3dfd2244ce3063e3190fbbf9 | |
| parent | 0b8196724e4ad28cc7459b82a9b75f252c08cb3e (diff) | |
| download | usermoji-3e9d7a008869360dccbd8c812f4795afa7f8b416.tar.xz | |
vulkaninfo: Make Presentable Surfaces array unique
Makes each JSON field unique in the Presentatble Surfaces array by
appending the list of surfaces to the object name.
| -rw-r--r-- | vulkaninfo/vulkaninfo.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp index cec2e6c6..425172e9 100644 --- a/vulkaninfo/vulkaninfo.cpp +++ b/vulkaninfo/vulkaninfo.cpp @@ -220,7 +220,22 @@ void DumpSurfaceCapabilities(Printer &p, AppInstance &inst, AppGpu &gpu, AppSurf } void DumpSurface(Printer &p, AppInstance &inst, AppGpu &gpu, AppSurface &surface, std::set<std::string> surface_types) { - ObjectWrapper obj(p, std::string("GPU id : ") + p.DecorateAsValue(std::to_string(gpu.id)) + " (" + gpu.props.deviceName + ")"); + std::string surface_type_list_str = ""; + if (surface_types.size() > 0) { + surface_type_list_str = " ["; + bool is_first = true; + for (auto &name : surface_types) { + if (!is_first) { + surface_type_list_str += ", "; + } else { + is_first = false; + } + surface_type_list_str += name; + } + surface_type_list_str += "]"; + } + ObjectWrapper obj(p, std::string("GPU id : ") + p.DecorateAsValue(std::to_string(gpu.id)) + " (" + gpu.props.deviceName + ")" + + surface_type_list_str); if (surface_types.size() == 0) { p.SetAsType().PrintKeyString("Surface type", "No type found"); |
