diff --git a/Cargo.lock b/Cargo.lock index 4d52975..63d95bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3465,7 +3465,7 @@ dependencies = [ [[package]] name = "throttle" -version = "0.2.0" +version = "0.2.1" dependencies = [ "anyhow", "crossbeam-channel", diff --git a/Cargo.toml b/Cargo.toml index 2d9c3f0..41949bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "throttle" -version = "0.2.0" +version = "0.2.1" edition = "2024" description = "A free, open-source per-process bandwidth monitor and limiter for Windows" repository = "https://github.com/FrancescoCoding/Throttle" diff --git a/src/main.rs b/src/main.rs index d595b94..3bfa6c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -151,6 +151,7 @@ fn main() -> eframe::Result { .with_min_inner_size([720.0, 480.0]) .with_icon(app_icon) .with_title("Throttle"), + wgpu_options: wgpu_options(), // With the `persistence` feature eframe keeps the window size and // position (clamped to the monitors present) in `%APPDATA%\Throttle\data`. // The app opts out of saving egui's other state (see @@ -201,6 +202,22 @@ fn main() -> eframe::Result { } } +/// Renderer backends for wgpu. egui-wgpu enables every backend by default, so +/// wgpu creates a Vulkan instance on Windows even when it renders elsewhere. +/// Some old Intel drivers (Skylake's igvk64.dll) crash inside that call, so +/// Vulkan is left out: DX12 first, GL as a fallback. `WGPU_BACKEND` still +/// overrides this. +fn wgpu_options() -> eframe::egui_wgpu::WgpuConfiguration { + use eframe::{egui_wgpu, wgpu}; + + let mut options = egui_wgpu::WgpuConfiguration::default(); + if let egui_wgpu::WgpuSetup::CreateNew(setup) = &mut options.wgpu_setup { + setup.instance_descriptor.backends = + wgpu::Backends::from_env().unwrap_or(wgpu::Backends::DX12 | wgpu::Backends::GL); + } + options +} + fn setup_logging() { if cfg!(debug_assertions) { // Use the terminal in debug builds