Skip to content

Commit

Permalink
Bump winit & wgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoqsh committed May 2, 2024
1 parent 84c7a3f commit 7f8ef62
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
10 changes: 5 additions & 5 deletions dunge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ bytemuck.workspace = true
glam.workspace = true
instant = { version = "0.1", optional = true }
log.workspace = true
wgpu = { version = "0.19", default-features = false, features = ["naga-ir"] }
wgpu = { version = "0.20", default-features = false, features = ["naga-ir"] }

[dependencies.winit]
version = "0.29"
version = "0.30"
default-features = false
features = ["rwh_06", "x11"]
optional = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
instant = { version = "0.1", features = ["wasm-bindgen"], optional = true }
wgpu = { version = "0.19", default-features = false, features = ["webgpu"] }
web-sys = { version = "<0.3.68", features = ["Document", "Window", "Element"] }
wgpu = { version = "0.20", default-features = false, features = ["webgpu"] }
web-sys = { version = "0.3", features = ["Document", "Window", "Element"] }

[target.'cfg(target_os = "android")'.dependencies.winit]
version = "0.29"
version = "0.30"
default-features = false
features = ["android-native-activity"]
optional = true
Expand Down
12 changes: 3 additions & 9 deletions dunge/src/el.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ where

impl<V> Loop<V> {
pub fn new() -> Result<Self, EventLoopError> {
use winit::event_loop::EventLoopBuilder;

let inner = EventLoopBuilder::with_user_event().build()?;
let inner = EventLoop::with_user_event().build()?;
Ok(Self(inner))
}

Expand Down Expand Up @@ -97,14 +95,10 @@ impl error::Error for LoopError {
}

type Event<V> = event::Event<V>;
type Target<V> = event_loop::EventLoopWindowTarget<V>;
type Target = event_loop::ActiveEventLoop;
type Failure = Option<Box<dyn error::Error>>;

fn handle<U>(
cx: Context,
view: View,
mut upd: U,
) -> impl FnMut(Event<U::Event>, &Target<U::Event>) -> Failure
fn handle<U>(cx: Context, view: View, mut upd: U) -> impl FnMut(Event<U::Event>, &Target) -> Failure
where
U: Update,
{
Expand Down
2 changes: 2 additions & 0 deletions dunge/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ impl<V, I> Layer<V, I> {
vertex: VertexState {
module,
entry_point: "vs",
compilation_options: PipelineCompilationOptions::default(),
buffers: &buffers,
},
primitive: PrimitiveState {
Expand All @@ -254,6 +255,7 @@ impl<V, I> Layer<V, I> {
fragment: Some(FragmentState {
module,
entry_point: "fs",
compilation_options: PipelineCompilationOptions::default(),
targets: &targets,
}),
multiview: None,
Expand Down
10 changes: 5 additions & 5 deletions dunge/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ impl<V> WindowBuilder<V> {
let lu = Loop::new()?;
let inner = {
let title = mem::take(&mut self.title);
let builder = window::WindowBuilder::new().with_title(title);
let builder = match self.size {
Some((width, height)) => builder.with_inner_size(PhysicalSize::new(width, height)),
None => builder.with_fullscreen(Some(Fullscreen::Borderless(None))),
let attrs = window::Window::default_attributes().with_title(title);
let attrs = match self.size {
Some((width, height)) => attrs.with_inner_size(PhysicalSize::new(width, height)),
None => attrs.with_fullscreen(Some(Fullscreen::Borderless(None))),
};

Arc::new(builder.build(lu.inner())?)
Arc::new(lu.inner().create_window(attrs)?)
};

let view = {
Expand Down
2 changes: 1 addition & 1 deletion dunge_shader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version.workspace = true
[dependencies]
glam.workspace = true
log.workspace = true
naga = "0.19"
naga = "0.20"

[features]
wgsl = ["naga/wgsl-out"]
Expand Down

0 comments on commit 7f8ef62

Please sign in to comment.