From 2325d84c22b5242dc10d43a5917d7c67ee500620 Mon Sep 17 00:00:00 2001 From: Yousef Khadadeh Date: Sun, 7 Sep 2025 09:50:56 +0300 Subject: [PATCH] Force use of dedicated graphics card on Windows --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 41cc6bf..409c41f 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,6 +90,15 @@ #include #include "SwitchCWD.hpp" +// Use dedicated graphics card on Windows +#ifdef _WIN32 +extern "C" +{ + __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; + __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; +} +#endif + struct MainStruct { #ifdef USE_BACKEND_VULKAN #ifdef USE_SKIA_BACKEND_GANESH