add ForceDiscreteGPU.c
This commit is contained in:
parent
148372a601
commit
5d496298bc
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -19,3 +19,6 @@
|
|||||||
[submodule "CMPlatform"]
|
[submodule "CMPlatform"]
|
||||||
path = CMPlatform
|
path = CMPlatform
|
||||||
url = https://github.com/hyzboy/CMPlatform
|
url = https://github.com/hyzboy/CMPlatform
|
||||||
|
[submodule "CMAssetsManage"]
|
||||||
|
path = CMAssetsManage
|
||||||
|
url = https://github.com/hyzboy/CMAssetsManage.git
|
||||||
|
1
CMAssetsManage
Submodule
1
CMAssetsManage
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit a03628acf307e07d383d8ab41c2a9ca73a052fb3
|
@ -23,6 +23,7 @@ BEGIN_SHADER_NAMESPACE
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}//namespace
|
}//namespace
|
||||||
|
|
||||||
bool ShaderMaker::Check()
|
bool ShaderMaker::Check()
|
||||||
|
@ -56,7 +56,14 @@ SOURCE_GROUP("Header Files" FILES ${RENDER_DEVICE_VULKAN_HEADER})
|
|||||||
SOURCE_GROUP("Source Files" FILES ${RENDER_DEVICE_VULKAN_SOURCE})
|
SOURCE_GROUP("Source Files" FILES ${RENDER_DEVICE_VULKAN_SOURCE})
|
||||||
SOURCE_GROUP("POD Source Files" FILES ${RENDER_DEVICE_VULKAN_POD_SOURCE})
|
SOURCE_GROUP("POD Source Files" FILES ${RENDER_DEVICE_VULKAN_POD_SOURCE})
|
||||||
|
|
||||||
add_cm_library(ULRE.RenderDevice.Vulkan "ULRE" ${RENDER_DEVICE_VULKAN_HEADER}
|
OPTION(FORCE_DISCETE_GPU "Force Discrete GPU" OFF)
|
||||||
|
|
||||||
|
IF(FORCE_DISCETE_GPU)
|
||||||
|
SET(RENDER_DEVICE_SOURCE ForceDiscreteGPU.c)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
add_cm_library(ULRE.RenderDevice.Vulkan "ULRE" ${RENDER_DEVICE_SOURCE}
|
||||||
|
${RENDER_DEVICE_VULKAN_HEADER}
|
||||||
${RENDER_DEVICE_VULKAN_SOURCE}
|
${RENDER_DEVICE_VULKAN_SOURCE}
|
||||||
${RENDER_DEVICE_VULKAN_POD_SOURCE}
|
${RENDER_DEVICE_VULKAN_POD_SOURCE}
|
||||||
|
|
||||||
|
10
src/RenderDevice/Vulkan/ForceDiscreteGPU.c
Normal file
10
src/RenderDevice/Vulkan/ForceDiscreteGPU.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include<windows.h>
|
||||||
|
|
||||||
|
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
|
||||||
|
// The following line is to favor the high performance NVIDIA GPU if there are multiple GPUs
|
||||||
|
// Has to be .exe module to be correctly detected.
|
||||||
|
extern __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
|
||||||
|
|
||||||
|
// And the AMD equivalent
|
||||||
|
// Also has to be .exe module to be correctly detected.
|
||||||
|
extern __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 0x00000001;
|
Loading…
x
Reference in New Issue
Block a user