Skip to content

Commit

Permalink
Update to wgpu 0.19 (#139)
Browse files Browse the repository at this point in the history
update to wgpu 0.19
  • Loading branch information
Uriopass authored Jan 18, 2024
1 parent 2dffdfe commit 7750ad6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion crates/demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion crates/yakui-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
16 changes: 11 additions & 5 deletions crates/yakui-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>,
sample_count: u32,
Expand All @@ -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 {
Expand All @@ -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()
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion crates/yakui-to-image/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions crates/yakui-to-image/src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/yakui-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7750ad6

Please sign in to comment.