add gpu hints on windows (#1158)
This commit is contained in:
parent
81cc78ce90
commit
282ec6c6c7
@ -10,6 +10,13 @@
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
|
||||
#ifdef _WIN32
|
||||
extern "C" {
|
||||
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
|
||||
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
using namespace Vulkan;
|
||||
|
||||
#define DP_STATUS_XBUS_DMA 0x01
|
||||
|
||||
@ -106,6 +106,12 @@ pub struct Ui {
|
||||
}
|
||||
|
||||
pub fn sdl_hints() {
|
||||
#[cfg(target_os = "linux")]
|
||||
unsafe {
|
||||
std::env::set_var("DRI_PRIME", "1");
|
||||
std::env::set_var("__NV_PRIME_RENDER_OFFLOAD", "1");
|
||||
}
|
||||
|
||||
unsafe {
|
||||
let hint = std::ffi::CString::new("1").unwrap();
|
||||
sdl3_sys::everything::SDL_SetHint(
|
||||
|
||||
Reference in New Issue
Block a user