Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Foundation/bsfCore/CMakeSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ set(BS_CORE_INC_RENDERAPI
"bsfCore/RenderAPI/BsGpuPipelineState.h"
"bsfCore/RenderAPI/BsGpuPipelineParamInfo.h"
"bsfCore/RenderAPI/BsVertexDataDesc.h"
"bsfCore/RenderAPI/BsWin32DiscreteGpuForce.h"
)

set(BS_CORE_INC_RENDERAPI_MANAGERS
Expand Down
26 changes: 26 additions & 0 deletions Source/Foundation/bsfCore/RenderAPI/BsWin32DiscreteGpuForce.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//

/**
* This Header file is used on Windows-based systems to force the operating system
* to use discrete graphics chips on laptops instead of the integrated graphics chips.
* @note This header shouldn't be used on non-Windows based operating systems and
* and it should only be included by final executables.
* Incorrect usage will cause error during compilation.
*/

#if BS_PLATFORM == BS_PLATFORM_WIN32
#if defined(BS_FORCE_DISCRETE_GPUS_INCLUDE_CHECK)
#error GPU force header file already included. Please, only include it once and preferably in the program's executable. Aborting compilation.
#else
#define BS_FORCE_DISCRETE_GPUS_INCLUDE_CHECK

extern "C"
{
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}

#endif

#endif