summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-01-22 20:38:52 +0100
committersfan5 <sfan5@live.de>2022-01-27 22:30:02 +0100
commit22f0c66abbd02c8d7a66a81cf853f7c7fb84fe17 (patch)
treec707437e6ef97767d1a112c171128112233a6275 /src
parent7aea5cb88f9a8cc9f9ca52ecd4d13cfd7ab16e69 (diff)
downloadminetest-22f0c66abbd02c8d7a66a81cf853f7c7fb84fe17.tar.gz
minetest-22f0c66abbd02c8d7a66a81cf853f7c7fb84fe17.tar.bz2
minetest-22f0c66abbd02c8d7a66a81cf853f7c7fb84fe17.zip
Request execution on dedicated GPU on Windows
Diffstat (limited to 'src')
-rw-r--r--src/porting.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index f78de39ad..caf9e9be3 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -70,6 +70,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <cstdarg>
#include <cstdio>
+#if !defined(SERVER) && defined(_WIN32)
+// On Windows export some driver-specific variables to encourage Minetest to be
+// executed on the discrete GPU in case of systems with two. Portability is fun.
+extern "C" {
+ __declspec(dllexport) DWORD NvOptimusEnablement = 1;
+ __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 1;
+}
+#endif
+
namespace porting
{