Update Dependencies (#150)

* Update Dependencies

* Fix non-WGPU builds

---------

Co-authored-by: NWPlayer123 <NWPlayer123@users.noreply.github.com>
This commit is contained in:
NWPlayer123 2025-01-01 20:45:48 -07:00 committed by GitHub
parent c65e87c382
commit dcafe51eda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 320 additions and 288 deletions

561
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -96,12 +96,12 @@ winapi = { version = "0.3", optional = true }
# For Linux static binaries, use rustls # For Linux static binaries, use rustls
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "multipart", "rustls-tls"], optional = true } reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "multipart", "rustls-tls"], optional = true }
self_update = { version = "0.41", default-features = false, features = ["rustls"], optional = true } self_update = { version = "0.42", default-features = false, features = ["rustls"], optional = true }
# For all other platforms, use native TLS # For all other platforms, use native TLS
[target.'cfg(not(target_os = "linux"))'.dependencies] [target.'cfg(not(target_os = "linux"))'.dependencies]
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "multipart", "default-tls"], optional = true } reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "multipart", "default-tls"], optional = true }
self_update = { version = "0.41", optional = true } self_update = { version = "0.42", optional = true }
[build-dependencies] [build-dependencies]
prost-build = { version = "0.13", optional = true } prost-build = { version = "0.13", optional = true }

View File

@ -31,8 +31,8 @@ const_format = "0.2"
cwdemangle = "1.0" cwdemangle = "1.0"
cwextab = "1.0" cwextab = "1.0"
dirs = "5.0" dirs = "5.0"
egui = "0.29" egui = "0.30"
egui_extras = "0.29" egui_extras = "0.30"
filetime = "0.2" filetime = "0.2"
float-ord = "0.3" float-ord = "0.3"
font-kit = "0.14" font-kit = "0.14"
@ -54,7 +54,7 @@ time = { version = "0.3", features = ["formatting", "local-offset"] }
# Keep version in sync with egui # Keep version in sync with egui
[dependencies.eframe] [dependencies.eframe]
version = "0.29" version = "0.30"
features = [ features = [
"default_fonts", "default_fonts",
"persistence", "persistence",
@ -65,7 +65,7 @@ default-features = false
# Keep version in sync with eframe # Keep version in sync with eframe
[dependencies.wgpu] [dependencies.wgpu]
version = "22.1" version = "23.0"
features = [ features = [
"dx12", "dx12",
"metal", "metal",

View File

@ -96,7 +96,7 @@ pub fn load_font_if_needed(
let default_font = family.handles.get(family.default_index).unwrap(); let default_font = family.handles.get(family.default_index).unwrap();
let default_font_data = load_font(default_font).unwrap(); let default_font_data = load_font(default_font).unwrap();
log::info!("Loaded font family '{}'", family.family_name); log::info!("Loaded font family '{}'", family.family_name);
fonts.font_data.insert(default_font_ref.full_name(), default_font_data.font_data); fonts.font_data.insert(default_font_ref.full_name(), Arc::new(default_font_data.font_data));
fonts fonts
.families .families
.entry(egui::FontFamily::Name(Arc::from(family.family_name))) .entry(egui::FontFamily::Name(Arc::from(family.family_name)))

View File

@ -88,14 +88,29 @@ fn main() -> ExitCode {
} }
#[cfg(feature = "wgpu")] #[cfg(feature = "wgpu")]
{ {
use eframe::egui_wgpu::wgpu::Backends; use eframe::egui_wgpu::{wgpu::Backends, WgpuSetup};
if graphics_config.desired_backend.is_supported() { if graphics_config.desired_backend.is_supported() {
native_options.wgpu_options.supported_backends = match graphics_config.desired_backend { native_options.wgpu_options.wgpu_setup = match native_options.wgpu_options.wgpu_setup {
GraphicsBackend::Auto => native_options.wgpu_options.supported_backends, WgpuSetup::CreateNew {
GraphicsBackend::Dx12 => Backends::DX12, supported_backends: backends,
GraphicsBackend::Metal => Backends::METAL, power_preference,
GraphicsBackend::Vulkan => Backends::VULKAN, device_descriptor,
GraphicsBackend::OpenGL => Backends::GL, } => {
let backend = match graphics_config.desired_backend {
GraphicsBackend::Auto => backends,
GraphicsBackend::Dx12 => Backends::DX12,
GraphicsBackend::Metal => Backends::METAL,
GraphicsBackend::Vulkan => Backends::VULKAN,
GraphicsBackend::OpenGL => Backends::GL,
};
WgpuSetup::CreateNew {
supported_backends: backend,
power_preference,
device_descriptor,
}
}
// WgpuConfiguration::Default is CreateNew until we call run_eframe()
_ => unreachable!(),
}; };
} }
} }
@ -112,6 +127,8 @@ fn main() -> ExitCode {
} }
#[cfg(feature = "wgpu")] #[cfg(feature = "wgpu")]
if let Some(e) = eframe_error { if let Some(e) = eframe_error {
use eframe::egui_wgpu::WgpuConfiguration;
// Attempt to relaunch using wgpu auto backend if the desired backend failed // Attempt to relaunch using wgpu auto backend if the desired backend failed
#[allow(unused_mut)] #[allow(unused_mut)]
let mut should_relaunch = graphics_config.desired_backend != GraphicsBackend::Auto; let mut should_relaunch = graphics_config.desired_backend != GraphicsBackend::Auto;
@ -123,7 +140,7 @@ fn main() -> ExitCode {
if should_relaunch { if should_relaunch {
log::warn!("Failed to launch application: {e:?}"); log::warn!("Failed to launch application: {e:?}");
log::warn!("Attempting to relaunch using auto-detected backend"); log::warn!("Attempting to relaunch using auto-detected backend");
native_options.wgpu_options.supported_backends = Default::default(); native_options.wgpu_options.wgpu_setup = WgpuConfiguration::default().wgpu_setup;
if let Err(e) = run_eframe( if let Err(e) = run_eframe(
native_options.clone(), native_options.clone(),
utc_offset, utc_offset,