Skip to content

Commit

Permalink
Use dGPU if both dGPU and iGPU are available (Windows)
Browse files Browse the repository at this point in the history
Normally, to use the dGPU on Windows 10/11, you need to manually set it for the executable in Windows setting. This will set some registry values to tell the NVidia/AMD drivers to use the dGPU here.
  • Loading branch information
VReaperV committed Jan 29, 2025
1 parent f3acf80 commit 98b3dbb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/engine/renderer/tr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "DetectGLVendors.h"
#include "Material.h"

#ifdef _WIN32
extern "C" {
// Use dGPU if both dGPU and iGPU are available
// https://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec( dllexport ) uint32_t NvOptimusEnablement = 0x00000001;
// https://gpuopen.com/learn/amdpowerxpressrequesthighperformance/
__declspec( dllexport ) uint32_t AmdPowerXpressRequestHighPerformance = 0x00000001;
}
#endif

glconfig_t glConfig;
glconfig2_t glConfig2;

Expand Down

0 comments on commit 98b3dbb

Please sign in to comment.