diff --git a/crates/bootstrap/Cargo.toml b/crates/bootstrap/Cargo.toml index 314a9657..3745b5cd 100644 --- a/crates/bootstrap/Cargo.toml +++ b/crates/bootstrap/Cargo.toml @@ -20,5 +20,5 @@ log = "0.4.17" pollster = "0.3.0" profiling = "1.0.6" tracy-client = { version = "0.15.1", optional = true } -wgpu = "0.18.0" +wgpu = "0.19.0" winit = "0.29.2" diff --git a/crates/demo/Cargo.toml b/crates/demo/Cargo.toml index b43eb659..eb819e60 100644 --- a/crates/demo/Cargo.toml +++ b/crates/demo/Cargo.toml @@ -14,7 +14,7 @@ yakui-app = { path = "../yakui-app" } env_logger = "0.10.0" log = "0.4.17" pollster = "0.3.0" -wgpu = { version = "0.18.0", features = ["webgl"] } +wgpu = { version = "0.19.0", features = ["webgl"] } winit = "0.29.2" [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/crates/yakui-app/Cargo.toml b/crates/yakui-app/Cargo.toml index b6f2a18f..9ff1696d 100644 --- a/crates/yakui-app/Cargo.toml +++ b/crates/yakui-app/Cargo.toml @@ -17,5 +17,5 @@ yakui-winit = { path = "../yakui-winit" } yakui-wgpu = { path = "../yakui-wgpu" } profiling = { version = "1.0.6", optional = true } -wgpu = "0.18.0" +wgpu = "0.19.0" winit = { version = "0.29.2", features = ["rwh_05"] } diff --git a/crates/yakui-app/src/lib.rs b/crates/yakui-app/src/lib.rs index 8e963243..24a68664 100644 --- a/crates/yakui-app/src/lib.rs +++ b/crates/yakui-app/src/lib.rs @@ -15,7 +15,7 @@ pub struct Graphics { pub queue: wgpu::Queue, format: wgpu::TextureFormat, - surface: wgpu::Surface, + surface: wgpu::Surface<'static>, surface_config: wgpu::SurfaceConfiguration, size: PhysicalSize, sample_count: u32, @@ -40,8 +40,13 @@ impl Graphics { } let instance = wgpu::Instance::default(); - let surface = - unsafe { instance.create_surface(&window) }.expect("Could not create wgpu surface"); + let surface = unsafe { + instance.create_surface_unsafe( + wgpu::SurfaceTargetUnsafe::from_window(&window) + .expect("Could not create wgpu surface from window"), + ) + } + .expect("Could not create wgpu surface"); let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { @@ -55,10 +60,10 @@ impl Graphics { let (device, queue) = adapter .request_device( &wgpu::DeviceDescriptor { - features: wgpu::Features::empty(), + required_features: wgpu::Features::empty(), // WebGL doesn't support all of wgpu's features, so if // we're building for the web we'll have to disable some. - limits: if cfg!(target_arch = "wasm32") { + required_limits: if cfg!(target_arch = "wasm32") { wgpu::Limits::downlevel_webgl2_defaults() } else { wgpu::Limits::default() @@ -80,6 +85,7 @@ impl Graphics { width: size.width, height: size.height, present_mode: wgpu::PresentMode::Fifo, + desired_maximum_frame_latency: 2, }; surface.configure(&device, &surface_config); diff --git a/crates/yakui-to-image/Cargo.toml b/crates/yakui-to-image/Cargo.toml index 249b9f9b..a2c51c21 100644 --- a/crates/yakui-to-image/Cargo.toml +++ b/crates/yakui-to-image/Cargo.toml @@ -11,6 +11,6 @@ edition = "2021" yakui-core = { path = "../yakui-core" } yakui-wgpu = { path = "../yakui-wgpu" } -wgpu = "0.18.0" +wgpu = "0.19.0" image = { version = "0.24.4", default-features = false, features = ["png"] } pollster = "0.3.0" diff --git a/crates/yakui-to-image/src/graphics.rs b/crates/yakui-to-image/src/graphics.rs index f16acac3..940d68dd 100644 --- a/crates/yakui-to-image/src/graphics.rs +++ b/crates/yakui-to-image/src/graphics.rs @@ -25,8 +25,8 @@ impl Graphics { let (device, queue) = adapter .request_device( &wgpu::DeviceDescriptor { - features: wgpu::Features::empty(), - limits: wgpu::Limits::default(), + required_features: wgpu::Features::empty(), + required_limits: wgpu::Limits::default(), label: None, }, None, diff --git a/crates/yakui-wgpu/Cargo.toml b/crates/yakui-wgpu/Cargo.toml index e3b62688..bbe75eda 100644 --- a/crates/yakui-wgpu/Cargo.toml +++ b/crates/yakui-wgpu/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" [dependencies] yakui-core = { path = "../yakui-core", version = "0.2.0" } -wgpu = "0.18.0" +wgpu = "0.19.0" glam = { version = "0.24.2", features = ["bytemuck"] } bytemuck = { version = "1.12.1", features = ["derive"] } thunderdome = "0.6.0"