diff options
| author | Charles Giessen <charles@lunarg.com> | 2021-06-10 16:19:21 -0600 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2021-06-11 13:35:39 -0700 |
| commit | 53231a96c0a69f03fd8a4d8770662df570ef9504 (patch) | |
| tree | f7d26e3e512f6fd115358049fe21046fa4e86cb5 /scripts/vulkaninfo_generator.py | |
| parent | 9023ea7504c67be7f90294ab5f3ec247292f0f22 (diff) | |
| download | usermoji-53231a96c0a69f03fd8a4d8770662df570ef9504.tar.xz | |
vulkaninfo: Improve formatting of surface caps
VkSurfaceCapabilities has the width & height way out to the right
while the rest of the structure doesn't. This makes it look inconsistent.
This PR also changes the layout of the flag and flagbit printers to return
earlier if possible.
Change-Id: I1b478838b3c95e33354d3daf13040e891454324e
Diffstat (limited to 'scripts/vulkaninfo_generator.py')
| -rw-r--r-- | scripts/vulkaninfo_generator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index 7f1e1361..dfa2e0e7 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -441,7 +441,7 @@ def PrintGetFlagStrings(name, bitmask): "GetStrings(" + name + " value) {\n" out += " std::vector<const char *> strings;\n" - out += " if (value == 0) strings.push_back(\"None\");\n" + out += " if (value == 0) { strings.push_back(\"None\"); return strings; }\n" for v in bitmask.options: val = v.value if isinstance(v.value, str) else str(hex(v.value)) out += " if (" + val + " & value) strings.push_back(\"" + \ @@ -454,13 +454,13 @@ def PrintFlags(bitmask, name): out = "void Dump" + name + \ "(Printer &p, std::string name, " + name + " value, int width = 0) {\n" out += " if (p.Type() == OutputType::json) { p.PrintKeyValue(name, value); return; }\n" - out += " auto strings = " + bitmask.name + \ - "GetStrings(static_cast<" + bitmask.name + ">(value));\n" out += " if (static_cast<" + bitmask.name + ">(value) == 0) {\n" out += " ArrayWrapper arr(p, name, 0);\n" out += " p.SetAsType().PrintString(\"None\");\n" out += " return;\n" out += " }\n" + out += " auto strings = " + bitmask.name + \ + "GetStrings(static_cast<" + bitmask.name + ">(value));\n" out += " ArrayWrapper arr(p, name, strings.size());\n" out += " for(auto& str : strings){\n" out += " p.SetAsType().PrintString(str);\n" |
