aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorkrypton <bot@hydroroll.team>2026-04-01 14:06:32 +0800
committerkrypton <bot@hydroroll.team>2026-04-01 14:06:32 +0800
commit64228251e7523e9cdc98d0c13db948b679722ff4 (patch)
tree1762a01e914229dacba1677aa8afda0f5d767de7 /src-tauri/src/main.rs
parent1016a53a97622c94f70d78d7a3876ff010a9dfc9 (diff)
downloadDropOut-64228251e7523e9cdc98d0c13db948b679722ff4.tar.gz
DropOut-64228251e7523e9cdc98d0c13db948b679722ff4.zip
feat: add GPU acceleration JVM parameters support
- Add Prism rendering pipeline parameters when enable_gpu_acceleration is enabled - Windows: -Dprism.order=d3d,es2,sw (Direct3D priority) - Linux/macOS: -Dprism.order=es2,sw (OpenGL ES priority) - Add -Dprism.forcegpu=true to force hardware acceleration
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 63287cd..f15a2c6 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -660,6 +660,21 @@ async fn start_game(
args.push(format!("-Djava.library.path={}", natives_path));
}
+ // Add GPU acceleration parameters if enabled
+ // JavaFX Prism rendering pipeline settings for hardware acceleration
+ if config.enable_gpu_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());
+ }
+ // 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") {
args.push("-cp".to_string());