Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 17 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading