diff options
| author | Charles Giessen <charles@lunarg.com> | 2023-08-20 11:36:31 -0600 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2023-08-21 11:41:52 -0600 |
| commit | a7da7027ca9fd0901639f02619c226da9c6036f1 (patch) | |
| tree | 8e25f616eea80765569febbe5b30c0e113d4bbcd | |
| parent | 300d9bf6b3cf7b237ee5e2c1d0ae10b9236f82d3 (diff) | |
| download | usermoji-a7da7027ca9fd0901639f02619c226da9c6036f1.tar.xz | |
vulkaninfo: Make -j=<GPU> work
The help text indicates that -j=<GPU> should work, but was never implemented
when the code was refactored.
| -rw-r--r-- | vulkaninfo/vulkaninfo.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp index 37c9a684..0696cff8 100644 --- a/vulkaninfo/vulkaninfo.cpp +++ b/vulkaninfo/vulkaninfo.cpp @@ -913,11 +913,15 @@ util::vulkaninfo_optional<ParsedResults> parse_arguments(int argc, char **argv, #endif ++i; } - } else if (strncmp("--json", argv[i], 6) == 0 || strcmp(argv[i], "-j") == 0) { + } else if (strncmp("--json", argv[i], 6) == 0 || strncmp(argv[i], "-j", 2) == 0) { if (strlen(argv[i]) > 7 && strncmp("--json=", argv[i], 7) == 0) { results.selected_gpu = static_cast<uint32_t>(strtol(argv[i] + 7, nullptr, 10)); results.has_selected_gpu = true; } + if (strlen(argv[i]) > 3 && strncmp("-j=", argv[i], 3) == 0) { + results.selected_gpu = static_cast<uint32_t>(strtol(argv[i] + 3, nullptr, 10)); + results.has_selected_gpu = true; + } results.output_category = OutputCategory::profile_json; results.default_filename = "vulkaninfo.json"; results.print_to_file = true; |
