From 8a47e7e49361180498094ae5e41aa1f75958c025 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Thu, 19 Apr 2018 20:22:26 +0200 Subject: Implement Pull #3528 from citra: use nvidia graphics automatically on laptops with optimus (with AMD support) (#271) * Port 3528: use nvidia graphics automatically on laptops with optimus * Force dedicated AMD Card for switchable Graphics * Ran clang-format --- src/yuzu_cmd/yuzu.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/yuzu_cmd/yuzu.cpp') diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 261312f62..a91140447 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -37,6 +37,15 @@ #include "yuzu_cmd/config.h" #include "yuzu_cmd/emu_window/emu_window_sdl2.h" +#ifdef _WIN32 +extern "C" { +// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable +// graphics +__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; +} +#endif + static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] \n" -- cgit v1.2.3