Skip to content

Commit

Permalink
Added --gpu-index to forwardable_cli_arguments
Browse files Browse the repository at this point in the history
when the gpu index is specified through the CLI, that setting will
be inherited by both the editor (if started through project manager)
and instances of the game started through the editor

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
  • Loading branch information
Bestest-Coder and akien-mga committed Aug 2, 2023
1 parent 16508ea commit 5592643
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,15 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
forwardable_cli_arguments[CLI_SCOPE_TOOL].push_back(I->next()->get());
}
}
// If gpu is specified, both editor and debug instances started from editor will inherit.
if (I->get() == "--gpu-index") {
if (I->next()) {
forwardable_cli_arguments[CLI_SCOPE_TOOL].push_back(I->get());
forwardable_cli_arguments[CLI_SCOPE_TOOL].push_back(I->next()->get());
forwardable_cli_arguments[CLI_SCOPE_PROJECT].push_back(I->get());
forwardable_cli_arguments[CLI_SCOPE_PROJECT].push_back(I->next()->get());
}
}
#endif

if (adding_user_args) {
Expand Down

0 comments on commit 5592643

Please sign in to comment.