Initial commit
This commit is contained in:
10
internal/render/gpu_preference/gpu_preference.c
Normal file
10
internal/render/gpu_preference/gpu_preference.c
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
// define the two symbols on Windows so that application
|
||||
// could benefit from using the more powerful discrete GPU
|
||||
|
||||
#if defined (_WIN32)
|
||||
|
||||
__declspec(dllexport) unsigned long NvOptimusEnablement = 1;
|
||||
__declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
|
||||
|
||||
#endif
|
3
internal/render/gpu_preference/gpu_preference.go
Normal file
3
internal/render/gpu_preference/gpu_preference.go
Normal file
@ -0,0 +1,3 @@
|
||||
package gpu_preference
|
||||
|
||||
import "C"
|
15
internal/render/gpu_preference/linux_nvidia.go
Normal file
15
internal/render/gpu_preference/linux_nvidia.go
Normal file
@ -0,0 +1,15 @@
|
||||
//+build nvidia
|
||||
|
||||
package gpu_preference
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if runtime.GOOS == "linux" {
|
||||
os.Setenv("__NV_PRIME_RENDER_OFFLOAD", "1")
|
||||
os.Setenv("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user