aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorN00byKing <N00byKing@users.noreply.github.com>2018-04-19 20:22:26 +0200
committerJames Rowe <jroweboy@gmail.com>2018-04-19 12:22:26 -0600
commit8a47e7e49361180498094ae5e41aa1f75958c025 (patch)
treee0640edd0182ba57322b98985ee9a6fcb1747b0b /src/yuzu/main.cpp
parente90a12f80c72244c74b39eaff38f0122370b7bdb (diff)
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
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 534145f7e5..20796e92c3 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -44,6 +44,15 @@
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
#endif
+#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
+
/**
* "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