optional software render to fix flutter render problem on some nvidia

card

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-01-05 14:27:28 +08:00
parent 9117d6956c
commit 5f6a264278
36 changed files with 175 additions and 2 deletions

View File

@@ -38,6 +38,17 @@ pub fn core_main() -> Option<Vec<String>> {
}
i += 1;
}
#[cfg(target_os = "linux")]
#[cfg(feature = "flutter")]
{
crate::platform::linux::register_breakdown_handler();
let (k, v) = ("LIBGL_ALWAYS_SOFTWARE", "true");
if !hbb_common::config::Config::get_option("allow-always-software-render").is_empty() {
std::env::set_var(k, v);
} else {
std::env::remove_var(k);
}
}
#[cfg(feature = "flutter")]
if _is_flutter_connect {
return core_main_invoke_new_connection(std::env::args());