-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest_dedicated_gpu.inc
More file actions
39 lines (32 loc) · 963 Bytes
/
request_dedicated_gpu.inc
File metadata and controls
39 lines (32 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ Include this in your program file to force using a dedicated GPU
for OpenGL with Delphi and FreePascal/Lazarus
on Multi-GPU systems such as Notebooks on Windows.
See Castle Game Engine src/common_includes/request_dedicated_gpu.inc }
// uncomment and recomment this line, for compile-time-switching between integrated GPU and dedicated GPU
{$define ForceDedicatedGPUUsage}
{$if defined(ForceDedicatedGPUUsage) and (defined(cpu386) or defined(cpux64) or defined(cpuamd64)) and (defined(MSWINDOWS) or defined(Linux))}
{$ifdef fpc}
{$asmmode intel}
{$endif}
procedure NvOptimusEnablement; {$ifdef fpc}assembler; nostackframe;{$endif}
asm
{$ifdef cpu64}
{$ifndef fpc}
.NOFRAME
{$endif}
{$endif}
dd 1
end;
procedure AmdPowerXpressRequestHighPerformance; {$ifdef fpc}assembler; nostackframe;{$endif}
asm
{$ifdef cpu64}
{$ifndef fpc}
.NOFRAME
{$endif}
{$endif}
dd 1
end;
exports
NvOptimusEnablement,
AmdPowerXpressRequestHighPerformance;
{$ifend}