diff options
| author | Andrew Poole <a.poole@samsung.com> | 2023-04-04 11:41:15 +0100 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2023-04-06 10:18:43 -0600 |
| commit | 37a259a5b2c94cfd6abd4a6bc33a463102830cc2 (patch) | |
| tree | ade7d65cfa468748791ae0f7160897f1d7cd0836 /scripts/vulkaninfo_generator.py | |
| parent | 01e0a0a5bebd27fcfb836f133cfe1562d7de45cb (diff) | |
| download | usermoji-37a259a5b2c94cfd6abd4a6bc33a463102830cc2.tar.xz | |
vulkaninfo: Add "VK_" prefix for PrintFlagBits
For types like VkSampleCountFlagBits a "VK_" prefix will be added for
JSON outputs. This makes the behaviour consistent for all JSON output.
Diffstat (limited to 'scripts/vulkaninfo_generator.py')
| -rw-r--r-- | scripts/vulkaninfo_generator.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index cea74909..a66d1d6a 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -475,8 +475,12 @@ def PrintFlags(bitmask, name): def PrintFlagBits(bitmask): return f"""void Dump{bitmask.name}(Printer &p, std::string name, {bitmask.name} value) {{ auto strings = {bitmask.name}GetStrings(value); - if (strings.size() > 0) - p.PrintKeyString(name, strings.at(0)); + if (strings.size() > 0) {{ + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + strings.at(0)); + else + p.PrintKeyString(name, strings.at(0)); + }} }} """ |
