diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index eb22a8ccfb..dc57e2e966 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -41,6 +41,13 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); #endif +#ifdef _WIN32 +extern "C" { +// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics +__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +} +#endif + /** * "Callouts" are one-time instructional messages shown to the user. In the config settings, there * is a bitfield "callout_flags" options, used to track if a message has already been shown to the diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 8f7c75796d..d8361d2c35 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -37,6 +37,14 @@ #include "yuzu_cmd/config.h" #include "yuzu_cmd/emu_window/emu_window_sdl2.h" +#ifdef _WIN32 +extern "C" { +// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics +__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +} +#endif + + static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] \n"