From 22f0c66abbd02c8d7a66a81cf853f7c7fb84fe17 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 22 Jan 2022 20:38:52 +0100 Subject: Request execution on dedicated GPU on Windows --- src/porting.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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 #include +#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 { -- cgit v1.2.3