From 5592643c57522a9a1877b1ec6d51d1dd7c48ddcd Mon Sep 17 00:00:00 2001 From: Bestest-Coder Date: Tue, 21 Mar 2023 17:04:57 -0400 Subject: [PATCH] Added --gpu-index to forwardable_cli_arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- main/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index f6c4df583ba1..6e09ad1a8f73 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -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) {