only use wgpu backend for Windows

This commit is contained in:
hinto-janaiyo 2023-02-06 17:59:51 -05:00
parent 95953ffda9
commit c592f0c9af
No known key found for this signature in database
GPG key ID: B1C5A64B80691E45
6 changed files with 36 additions and 14 deletions

View file

@ -1,8 +1,10 @@
# v1.1.2 # v1.1.2
## Fixes ## Fixes
* **Windows:** Fixed Gupax crashing on certain CPU-based graphics (integrated + basic drivers) * **Windows:** Fixed Gupax crashing on certain CPU-based graphics (integrated + basic drivers)
* **Windows:** Fixed P2Pool Advanced command inputs being ignored
* **P2Pool/XMRig:** Fixed parsing of `localhost` into `127.0.0.1` * **P2Pool/XMRig:** Fixed parsing of `localhost` into `127.0.0.1`
* **P2Pool/XMRig:** Current (non-saved) text-box values are now used instead of "old" selected values for custom nodes/pools * **P2Pool/XMRig:** Current (non-saved) text-box values are now used instead of "old" selected values for custom nodes/pools
* **Log:** Only Gupax console logs will be printed (libraries filtered out)
## Bundled Versions ## Bundled Versions
* [`P2Pool v3.0`](https://github.com/SChernykh/p2pool/releases/tag/v3.0) * [`P2Pool v3.0`](https://github.com/SChernykh/p2pool/releases/tag/v3.0)

20
Cargo.lock generated
View file

@ -915,12 +915,12 @@ dependencies = [
[[package]] [[package]]
name = "darling" name = "darling"
version = "0.14.2" version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8"
dependencies = [ dependencies = [
"darling_core 0.14.2", "darling_core 0.14.3",
"darling_macro 0.14.2", "darling_macro 0.14.3",
] ]
[[package]] [[package]]
@ -939,9 +939,9 @@ dependencies = [
[[package]] [[package]]
name = "darling_core" name = "darling_core"
version = "0.14.2" version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb"
dependencies = [ dependencies = [
"fnv", "fnv",
"ident_case", "ident_case",
@ -964,11 +964,11 @@ dependencies = [
[[package]] [[package]]
name = "darling_macro" name = "darling_macro"
version = "0.14.2" version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685"
dependencies = [ dependencies = [
"darling_core 0.14.2", "darling_core 0.14.3",
"quote", "quote",
"syn", "syn",
] ]
@ -990,7 +990,7 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24c1b715c79be6328caa9a5e1a387a196ea503740f0722ec3dd8f67a9e72314d" checksum = "24c1b715c79be6328caa9a5e1a387a196ea503740f0722ec3dd8f67a9e72314d"
dependencies = [ dependencies = [
"darling 0.14.2", "darling 0.14.3",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",

View file

@ -23,12 +23,12 @@ arti-hyper = "0.7.0"
bytes = "1.2.1" bytes = "1.2.1"
dirs = "4.0.0" dirs = "4.0.0"
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
eframe = { version = "0.19.0", default-features = false, features = ["wgpu"] }
egui = "0.19.0" egui = "0.19.0"
egui_extras = { version = "0.19.0", features = ["image"] } egui_extras = { version = "0.19.0", features = ["image"] }
## Update 2023-Feb-06: The below gets fixed by using the [wgpu] backend instead of [glow] ## Update 2023-Feb-06: The below gets fixed by using the [wgpu] backend instead of [glow]
## It also fixes crashes on CPU-based graphics. ## It also fixes crashes on CPU-based graphics. Only used for Windows.
## Using [wgpu] actually crashes macOS (fixed in 0.20.x though).
## [external/egui/crates/eframe/src/native/run.rs] line 41: [.with_srgb(true)] ## [external/egui/crates/eframe/src/native/run.rs] line 41: [.with_srgb(true)]
## This line causes a [panic!] inside a Windows VM, from a Linux host. ## This line causes a [panic!] inside a Windows VM, from a Linux host.
@ -66,14 +66,17 @@ serde-xml-rs = "0.6.0"
# Unix dependencies # Unix dependencies
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
ef
tar = "0.4.38" tar = "0.4.38"
flate2 = "1.0" flate2 = "1.0"
sudo = "0.6.0" sudo = "0.6.0"
eframe = { version = "0.19.0", default-features = false, features = ["glow"] }
# Windows dependencies # Windows dependencies
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
zip = "0.6.3" zip = "0.6.3"
is_elevated = "0.1.2" is_elevated = "0.1.2"
eframe = { version = "0.19.0", default-features = false, features = ["wgpu"] }
# For Windows build (icon) # For Windows build (icon)
[target.'cfg(windows)'.build-dependencies] [target.'cfg(windows)'.build-dependencies]

View file

@ -358,7 +358,7 @@ In general:
- `WARN` means something has gone wrong, but things will be fine - `WARN` means something has gone wrong, but things will be fine
- `INFO` logs are general info about what Gupax (the GUI thread) is currently doing - `INFO` logs are general info about what Gupax (the GUI thread) is currently doing
- `DEBUG` logs are much more verbose and include what EVERY thread is doing (not just the main GUI thread) - `DEBUG` logs are much more verbose and include what EVERY thread is doing (not just the main GUI thread)
- `TRACE` logs are insanely verbose and shows very low-level logs of the libraries Gupax uses (HTTP connections, GUI polling, etc) - `TRACE` logs are insanely verbose and shows very low-level logs
--- ---

View file

@ -713,6 +713,16 @@ fn init_text_styles(ctx: &egui::Context, width: f32) {
fn init_logger(now: Instant) { fn init_logger(now: Instant) {
use env_logger::fmt::Color; use env_logger::fmt::Color;
let filter_env = std::env::var("RUST_LOG").unwrap_or_else(|_| "INFO".to_string());
let filter = match filter_env.as_str() {
"error"|"Error"|"ERROR" => LevelFilter::Error,
"warn"|"Warn"|"WARN" => LevelFilter::Warn,
"debug"|"Debug"|"DEBUG" => LevelFilter::Debug,
"trace"|"Trace"|"TRACE" => LevelFilter::Trace,
_ => LevelFilter::Info,
};
std::env::set_var("RUST_LOG", format!("off,gupax={}", filter_env));
Builder::new().format(move |buf, record| { Builder::new().format(move |buf, record| {
let mut style = buf.style(); let mut style = buf.style();
let level = match record.level() { let level = match record.level() {
@ -731,8 +741,9 @@ fn init_logger(now: Instant) {
buf.style().set_dimmed(true).value(record.line().unwrap_or(0)), buf.style().set_dimmed(true).value(record.line().unwrap_or(0)),
record.args(), record.args(),
) )
}).filter_level(LevelFilter::Info).write_style(WriteStyle::Always).parse_default_env().format_timestamp_millis().init(); }).filter_level(filter).write_style(WriteStyle::Always).parse_default_env().format_timestamp_millis().init();
info!("init_logger() ... OK"); info!("init_logger() ... OK");
info!("Log level ... {}", filter);
} }
fn init_options(initial_window_size: Option<Vec2>) -> NativeOptions { fn init_options(initial_window_size: Option<Vec2>) -> NativeOptions {
@ -742,7 +753,12 @@ fn init_options(initial_window_size: Option<Vec2>) -> NativeOptions {
options.initial_window_size = initial_window_size; options.initial_window_size = initial_window_size;
options.follow_system_theme = false; options.follow_system_theme = false;
options.default_theme = eframe::Theme::Dark; options.default_theme = eframe::Theme::Dark;
#[cfg(target_os = "windows")]
options.renderer = eframe::Renderer::Wgpu; options.renderer = eframe::Renderer::Wgpu;
#[cfg(target_family = "unix")]
options.renderer = eframe::Renderer::Glow;
let icon = image::load_from_memory(BYTES_ICON).expect("Failed to read icon bytes").to_rgba8(); let icon = image::load_from_memory(BYTES_ICON).expect("Failed to read icon bytes").to_rgba8();
let (icon_width, icon_height) = icon.dimensions(); let (icon_width, icon_height) = icon.dimensions();
options.icon_data = Some(eframe::IconData { options.icon_data = Some(eframe::IconData {

View file

@ -36,6 +36,7 @@ cat << EOM > CHANGELOG.md.new
* [\`P2Pool ${P2POOL_VERSION//\"/}\`](https://github.com/SChernykh/p2pool/releases/tag/${P2POOL_VERSION//\"/}) * [\`P2Pool ${P2POOL_VERSION//\"/}\`](https://github.com/SChernykh/p2pool/releases/tag/${P2POOL_VERSION//\"/})
* [\`XMRig ${XMRIG_VERSION//\"/}\`](https://github.com/xmrig/xmrig/releases/tag/${XMRIG_VERSION//\"/}) * [\`XMRig ${XMRIG_VERSION//\"/}\`](https://github.com/xmrig/xmrig/releases/tag/${XMRIG_VERSION//\"/})
--- ---