NvPatch & EditBinPE & IL ASSEMBLY & C#
To enable AmdPowerXpressRequestHighPerformance
you must use one of two applications, nvpatch and EditBinPE. Since so far it is not possible to export symbols in pure C# itself, it is only possible to do so directly in the IL assembly ...
EditBinPE
EditBinPE command: editbinpe --enable-gpu filename.exe
or editbinpe --enable filename.exe AmdPowerXpressRequestHighPerformance
NvPatch
nvpatch command: nvpatch --enable filename.exe
IL Assembly
.class public WindowsApplication1.ForceDedicatedGraphicCard
{
.method public static uint32 AmdPowerXpressRequestHighPerformance() cil managed
{
.export [2]
ldc.i4.1
ret
}
}
END
To check if it has been qualified use dumpbin:
dumpbin.exe /exports your_project.exe
Edit: this question looks like a duplicate of this one: Forcing hardware accelerated rendering