aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorkrypton <bot@hydroroll.team>2026-04-01 14:23:15 +0800
committerkrypton <bot@hydroroll.team>2026-04-01 14:23:15 +0800
commit551aab67f54093d3c72b81a7d04f8776dbb4159a (patch)
treeb927190edf8aa22adda3786f98acf3b80e8ff6bb /src-tauri/src/main.rs
parent0e2f2ed0b71d58a1e04f95ab19ae1893f99bd884 (diff)
downloadDropOut-551aab67f54093d3c72b81a7d04f8776dbb4159a.tar.gz
DropOut-551aab67f54093d3c72b81a7d04f8776dbb4159a.zip
refactor: improve GPU params - remove forcegpu, respect user prism.orderfeat/gpu-jvm-params
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 5ae1c8d..7f7c4c0 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -660,18 +660,19 @@ async fn start_game(
args.push(format!("-Djava.library.path={}", natives_path));
}
- // Add GPU acceleration parameters by default
+ // Add GPU acceleration parameters if not already set by user
// JavaFX Prism rendering pipeline settings for hardware acceleration
- // Platform-specific rendering order:
- // - Windows: d3d (Direct3D) > es2 (OpenGL ES 2) > sw (software)
- // - Linux/macOS: es2 > sw (no Direct3D available)
- if cfg!(target_os = "windows") {
- args.push("-Dprism.order=d3d,es2,sw".to_string());
- } else {
- args.push("-Dprism.order=es2,sw".to_string());
+ // Only set prism.order if user hasn't already specified it
+ if !args.iter().any(|a| a.contains("-Dprism.order=")) {
+ // Platform-specific rendering order:
+ // - Windows: d3d (Direct3D) > es2 (OpenGL ES 2) > sw (software)
+ // - Linux/macOS: es2 > sw (no Direct3D available)
+ if cfg!(target_os = "windows") {
+ args.push("-Dprism.order=d3d,es2,sw".to_string());
+ } else {
+ args.push("-Dprism.order=es2,sw".to_string());
+ }
}
- // Force GPU usage instead of software fallback
- args.push("-Dprism.forcegpu=true".to_string());
// Ensure classpath is set if not already
if !args.iter().any(|a| a == "-cp" || a == "-classpath") {