From 6b92c1a01ea86759ab06838c2d862a1a5606db39 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 27 Dec 2015 10:21:11 -0800 Subject: [PATCH] Moving GPU flags to graphics_system.cc so all graphical exes get them. --- src/xenia/app/xenia_main.cc | 10 ---------- src/xenia/gpu/graphics_system.cc | 12 ++++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index 710edfd1b..865d28cf3 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -26,16 +26,6 @@ // Available graphics systems: #include "xenia/gpu/gl4/gl4_graphics_system.h" -// Nvidia Optimus/AMD PowerXpress support -// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf -// http://stackoverflow.com/questions/17458803/amd-equivalent-to-nvoptimusenablement -#if XE_PLATFORM_WIN32 -extern "C" { - __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; - __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; -} -#endif // XE_PLATFORM_WIN32 - // Available input drivers: #include "xenia/hid/nop/nop_hid.h" #if XE_PLATFORM_WIN32 diff --git a/src/xenia/gpu/graphics_system.cc b/src/xenia/gpu/graphics_system.cc index 25b38dced..617c74a65 100644 --- a/src/xenia/gpu/graphics_system.cc +++ b/src/xenia/gpu/graphics_system.cc @@ -22,6 +22,18 @@ namespace xe { namespace gpu { +// Nvidia Optimus/AMD PowerXpress support. +// These exports force the process to trigger the discrete GPU in multi-GPU +// systems. +// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf +// http://stackoverflow.com/questions/17458803/amd-equivalent-to-nvoptimusenablement +#if XE_PLATFORM_WIN32 +extern "C" { +__declspec(dllexport) uint32_t NvOptimusEnablement = 0x00000001; +__declspec(dllexport) uint32_t AmdPowerXpressRequestHighPerformance = 1; +} // extern "C" +#endif // XE_PLATFORM_WIN32 + GraphicsSystem::GraphicsSystem() : vsync_worker_running_(false) {} GraphicsSystem::~GraphicsSystem() = default;