Skip to content

Commit 318fae7

Browse files
committed
Update Deps
1 parent 0b32af6 commit 318fae7

File tree

19 files changed

+2190
-775
lines changed

19 files changed

+2190
-775
lines changed

Cargo.lock

Lines changed: 1234 additions & 466 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
[package]
22
name = "wgpu-bootstrap"
3-
version = "0.2.2"
3+
version = "0.3.0"
44
edition = "2021"
55

66
[dependencies]
7-
winit = "0.28"
8-
env_logger = "0.10"
7+
winit = "0.30"
8+
env_logger = "0.11"
99
log = "0.4"
10-
wgpu = "0.17"
10+
wgpu = "22.0"
1111
pollster = "0.3"
12-
bytemuck = { version = "1.12", features = ["derive"] }
12+
bytemuck = { version = "1.18", features = ["derive"] }
1313
cgmath = "0.18"
14-
egui = "0.23"
15-
egui_wgpu_backend = "0.26"
16-
egui_winit_platform = "0.20"
14+
egui = "0.29"
15+
egui-winit = "0.29"
16+
egui-wgpu = "0.29"
17+
egui_wgpu_backend = "0.31"
18+
egui_winit_platform = "0.24"
1719

1820
[dependencies.image]
19-
version = "0.24"
21+
version = "0.25"
2022
default-features = false
2123
features = ["png", "jpeg"]

examples/cube/cube_app.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use wgpu_bootstrap::{
44
runner::App,
55
util::orbit_camera::{CameraUniform, OrbitCamera},
66
wgpu::{self, util::DeviceExt, TextureView},
7-
winit::event::Event,
87
};
8+
use winit::event::{DeviceEvent, WindowEvent};
99

1010
#[repr(C)]
1111
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
@@ -210,6 +210,7 @@ impl CubeApp {
210210
module: &shader,
211211
entry_point: "vs_main",
212212
buffers: &[Vertex::desc()],
213+
compilation_options: wgpu::PipelineCompilationOptions::default(),
213214
},
214215
fragment: Some(wgpu::FragmentState {
215216
module: &shader,
@@ -219,6 +220,7 @@ impl CubeApp {
219220
blend: Some(wgpu::BlendState::REPLACE),
220221
write_mask: wgpu::ColorWrites::ALL,
221222
})],
223+
compilation_options: wgpu::PipelineCompilationOptions::default(),
222224
}),
223225
primitive: wgpu::PrimitiveState {
224226
topology: wgpu::PrimitiveTopology::TriangleList,
@@ -245,6 +247,7 @@ impl CubeApp {
245247
alpha_to_coverage_enabled: false,
246248
},
247249
multiview: None,
250+
cache: None,
248251
});
249252

250253
let mut camera = OrbitCamera::new(
@@ -270,8 +273,12 @@ impl CubeApp {
270273
}
271274

272275
impl App for CubeApp {
273-
fn input(&mut self, context: &mut Context, event: &Event<()>) {
274-
self.camera.process_events(context, event)
276+
fn window_event(&mut self, context: &mut Context, event: &WindowEvent) -> bool {
277+
return self.camera.window_event(context, event);
278+
}
279+
280+
fn device_event(&mut self, context: &mut Context, event: &DeviceEvent) -> bool {
281+
return self.camera.device_event(context, event);
275282
}
276283

277284
fn render(&mut self, context: &mut Context, view: &TextureView) {
@@ -295,17 +302,19 @@ impl App for CubeApp {
295302
b: 1.0,
296303
a: 1.0,
297304
}),
298-
store: true,
305+
store: wgpu::StoreOp::Store,
299306
},
300307
})],
301308
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
302309
view: context.depth_texture_view(),
303310
depth_ops: Some(wgpu::Operations {
304311
load: wgpu::LoadOp::Clear(1.0),
305-
store: true,
312+
store: wgpu::StoreOp::Store,
306313
}),
307314
stencil_ops: None,
308315
}),
316+
occlusion_query_set: None,
317+
timestamp_writes: None,
309318
});
310319

311320
render_pass.set_pipeline(&self.render_pipeline);

examples/cube/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use crate::cube_app::CubeApp;
44
use wgpu_bootstrap::runner::Runner;
55

66
fn main() {
7-
let mut runner = pollster::block_on(Runner::new());
8-
9-
let app = CubeApp::new(&mut runner.context);
10-
11-
runner.start(app);
7+
let mut runner = Runner::new(Box::new(|context| Box::new(CubeApp::new(context))));
8+
pollster::block_on(runner.run());
129
}

examples/gui/gui_app.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use wgpu_bootstrap::{
55
runner::App,
66
util::orbit_camera::{CameraUniform, OrbitCamera},
77
wgpu::{self, util::DeviceExt, TextureView},
8-
winit::event::Event,
98
};
9+
use winit::event::{DeviceEvent, WindowEvent};
1010

1111
#[repr(C)]
1212
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
@@ -212,6 +212,7 @@ impl GuiApp {
212212
module: &shader,
213213
entry_point: "vs_main",
214214
buffers: &[Vertex::desc()],
215+
compilation_options: wgpu::PipelineCompilationOptions::default(),
215216
},
216217
fragment: Some(wgpu::FragmentState {
217218
module: &shader,
@@ -221,6 +222,7 @@ impl GuiApp {
221222
blend: Some(wgpu::BlendState::REPLACE),
222223
write_mask: wgpu::ColorWrites::ALL,
223224
})],
225+
compilation_options: wgpu::PipelineCompilationOptions::default(),
224226
}),
225227
primitive: wgpu::PrimitiveState {
226228
topology: wgpu::PrimitiveTopology::TriangleList,
@@ -247,6 +249,7 @@ impl GuiApp {
247249
alpha_to_coverage_enabled: false,
248250
},
249251
multiview: None,
252+
cache: None,
250253
});
251254

252255
let mut camera = OrbitCamera::new(
@@ -273,8 +276,12 @@ impl GuiApp {
273276
}
274277

275278
impl App for GuiApp {
276-
fn input(&mut self, context: &mut Context, event: &Event<()>) {
277-
self.camera.process_events(context, event)
279+
fn window_event(&mut self, context: &mut Context, event: &WindowEvent) -> bool {
280+
return self.camera.window_event(context, event);
281+
}
282+
283+
fn device_event(&mut self, context: &mut Context, event: &DeviceEvent) -> bool {
284+
return self.camera.device_event(context, event);
278285
}
279286

280287
fn render(&mut self, context: &mut Context, view: &TextureView) {
@@ -298,17 +305,19 @@ impl App for GuiApp {
298305
b: 1.0,
299306
a: 1.0,
300307
}),
301-
store: true,
308+
store: wgpu::StoreOp::Store,
302309
},
303310
})],
304311
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
305312
view: context.depth_texture_view(),
306313
depth_ops: Some(wgpu::Operations {
307314
load: wgpu::LoadOp::Clear(1.0),
308-
store: true,
315+
store: wgpu::StoreOp::Store,
309316
}),
310317
stencil_ops: None,
311318
}),
319+
occlusion_query_set: None,
320+
timestamp_writes: None,
312321
});
313322

314323
render_pass.set_pipeline(&self.render_pipeline);

examples/gui/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use crate::gui_app::GuiApp;
44
use wgpu_bootstrap::runner::Runner;
55

66
fn main() {
7-
let mut runner = pollster::block_on(Runner::new());
8-
9-
let app = GuiApp::new(&mut runner.context);
10-
11-
runner.start(app);
7+
let mut runner = Runner::new(Box::new(|context| Box::new(GuiApp::new(context))));
8+
pollster::block_on(runner.run());
129
}

examples/instances/instances_app.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use wgpu_bootstrap::{
99
wgpu::{self, util::DeviceExt, TextureView},
1010
winit,
1111
};
12+
use winit::event::{DeviceEvent, WindowEvent};
1213

1314
#[repr(C)]
1415
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
@@ -148,6 +149,7 @@ impl InstanceApp {
148149
module: &shader,
149150
entry_point: "vs_main",
150151
buffers: &[Vertex::desc(), Instance::desc()],
152+
compilation_options: wgpu::PipelineCompilationOptions::default(),
151153
},
152154
fragment: Some(wgpu::FragmentState {
153155
module: &shader,
@@ -157,6 +159,7 @@ impl InstanceApp {
157159
blend: Some(wgpu::BlendState::REPLACE),
158160
write_mask: wgpu::ColorWrites::ALL,
159161
})],
162+
compilation_options: wgpu::PipelineCompilationOptions::default(),
160163
}),
161164
primitive: wgpu::PrimitiveState {
162165
topology: wgpu::PrimitiveTopology::TriangleList,
@@ -183,6 +186,7 @@ impl InstanceApp {
183186
alpha_to_coverage_enabled: false,
184187
},
185188
multiview: None,
189+
cache: None,
186190
});
187191

188192
let aspect = (context.config().width as f32) / (context.config().height as f32);
@@ -204,9 +208,14 @@ impl InstanceApp {
204208
}
205209

206210
impl App for InstanceApp {
207-
fn input(&mut self, context: &mut Context, event: &winit::event::Event<()>) {
208-
self.camera.process_events(context, event);
211+
fn window_event(&mut self, context: &mut Context, event: &WindowEvent) -> bool {
212+
return self.camera.window_event(context, event);
209213
}
214+
215+
fn device_event(&mut self, context: &mut Context, event: &DeviceEvent) -> bool {
216+
return self.camera.device_event(context, event);
217+
}
218+
210219
fn render(&mut self, context: &mut Context, view: &TextureView) {
211220
let mut encoder =
212221
context
@@ -228,17 +237,19 @@ impl App for InstanceApp {
228237
b: 1.0,
229238
a: 1.0,
230239
}),
231-
store: true,
240+
store: wgpu::StoreOp::Store,
232241
},
233242
})],
234243
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
235244
view: context.depth_texture_view(),
236245
depth_ops: Some(wgpu::Operations {
237246
load: wgpu::LoadOp::Clear(1.0),
238-
store: true,
247+
store: wgpu::StoreOp::Store,
239248
}),
240249
stencil_ops: None,
241250
}),
251+
occlusion_query_set: None,
252+
timestamp_writes: None,
242253
});
243254

244255
render_pass.set_pipeline(&self.render_pipeline);

examples/instances/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use crate::instances_app::InstanceApp;
44
use wgpu_bootstrap::runner::Runner;
55

66
fn main() {
7-
let mut runner = pollster::block_on(Runner::new());
8-
9-
let app = InstanceApp::new(&mut runner.context);
10-
11-
runner.start(app);
7+
let mut runner = Runner::new(Box::new(|context| Box::new(InstanceApp::new(context))));
8+
pollster::block_on(runner.run());
129
}

examples/shading/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use crate::shading_app::ShadingApp;
44
use wgpu_bootstrap::runner::Runner;
55

66
fn main() {
7-
let mut runner = pollster::block_on(Runner::new());
8-
9-
let app = ShadingApp::new(&mut runner.context);
10-
11-
runner.start(app);
7+
let mut runner = Runner::new(Box::new(|context| Box::new(ShadingApp::new(context))));
8+
pollster::block_on(runner.run());
129
}

examples/shading/shading_app.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use wgpu_bootstrap::{
88
},
99
wgpu::{self, util::DeviceExt, TextureView},
1010
};
11+
use winit::event::{DeviceEvent, WindowEvent};
1112

1213
#[repr(C)]
1314
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
@@ -115,6 +116,7 @@ impl ShadingApp {
115116
module: &shader,
116117
entry_point: "vs_main",
117118
buffers: &[Vertex::desc()],
119+
compilation_options: wgpu::PipelineCompilationOptions::default(),
118120
},
119121
fragment: Some(wgpu::FragmentState {
120122
module: &shader,
@@ -124,6 +126,7 @@ impl ShadingApp {
124126
blend: Some(wgpu::BlendState::REPLACE),
125127
write_mask: wgpu::ColorWrites::ALL,
126128
})],
129+
compilation_options: wgpu::PipelineCompilationOptions::default(),
127130
}),
128131
primitive: wgpu::PrimitiveState {
129132
topology: wgpu::PrimitiveTopology::TriangleList,
@@ -150,6 +153,7 @@ impl ShadingApp {
150153
alpha_to_coverage_enabled: false,
151154
},
152155
multiview: None,
156+
cache: None,
153157
});
154158

155159
let aspect = (context.config().width as f32) / (context.config().height as f32);
@@ -169,9 +173,14 @@ impl ShadingApp {
169173
}
170174

171175
impl App for ShadingApp {
172-
fn input(&mut self, context: &mut Context, event: &winit::event::Event<()>) {
173-
self.camera.process_events(context, event);
176+
fn window_event(&mut self, context: &mut Context, event: &WindowEvent) -> bool {
177+
return self.camera.window_event(context, event);
174178
}
179+
180+
fn device_event(&mut self, context: &mut Context, event: &DeviceEvent) -> bool {
181+
return self.camera.device_event(context, event);
182+
}
183+
175184
fn render(&mut self, context: &mut Context, view: &TextureView) {
176185
let mut encoder =
177186
context
@@ -193,17 +202,19 @@ impl App for ShadingApp {
193202
b: 1.0,
194203
a: 1.0,
195204
}),
196-
store: true,
205+
store: wgpu::StoreOp::Store,
197206
},
198207
})],
199208
depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment {
200209
view: context.depth_texture_view(),
201210
depth_ops: Some(wgpu::Operations {
202211
load: wgpu::LoadOp::Clear(1.0),
203-
store: true,
212+
store: wgpu::StoreOp::Store,
204213
}),
205214
stencil_ops: None,
206215
}),
216+
occlusion_query_set: None,
217+
timestamp_writes: None,
207218
});
208219

209220
render_pass.set_pipeline(&self.render_pipeline);

0 commit comments

Comments
 (0)