Skip to content

Commit 7258bbc

Browse files
authored
Merge pull request Yatekii#75 from Yatekii/wgpu-0.11
2 parents e04038f + 685c876 commit 7258bbc

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Per Keep a Changelog there are 6 main categories of changes:
2929

3030
## Unreleased
3131

32+
#### Updated
33+
- updated wgpu dependency to `>=0.10,<0.12`
34+
3235
## v0.17.1
3336

3437
Released 2021-09-22

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ bytemuck = "1"
5151
imgui = ">=0.1, <0.9"
5252
log = "0.4"
5353
smallvec = "1"
54-
wgpu = "0.10"
54+
wgpu = ">=0.10, <0.12"
5555

5656
[dev-dependencies]
5757
bytemuck = { version = "1.4", features = ["derive"] }

examples/hello-world.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn main() {
4141
let adapter = block_on(instance.request_adapter(&wgpu::RequestAdapterOptions {
4242
power_preference: wgpu::PowerPreference::HighPerformance,
4343
compatible_surface: Some(&surface),
44+
force_fallback_adapter: false,
4445
}))
4546
.unwrap();
4647

@@ -152,7 +153,7 @@ fn main() {
152153
imgui.io_mut().update_delta_time(now - last_frame);
153154
last_frame = now;
154155

155-
let frame = match surface.get_current_frame() {
156+
let frame = match surface.get_current_texture() {
156157
Ok(frame) => frame,
157158
Err(e) => {
158159
eprintln!("dropped frame: {:?}", e);
@@ -222,6 +223,8 @@ fn main() {
222223
drop(rpass);
223224

224225
queue.submit(Some(encoder.finish()));
226+
227+
frame.submit();
225228
}
226229
_ => (),
227230
}

simple-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ imgui-wgpu = { path = ".." }
2121
imgui-winit-support = "0.8"
2222
pollster = "0.2" # for block_on executor
2323
winit = "0.25"
24-
wgpu = "0.10"
24+
wgpu = "0.11"
2525

simple-api/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ pub fn run<YourState: 'static, UiFunction: 'static + Fn(&imgui::Ui, &mut YourSta
103103
let adapter = block_on(instance.request_adapter(&wgpu::RequestAdapterOptions {
104104
power_preference: wgpu::PowerPreference::HighPerformance,
105105
compatible_surface: Some(&surface),
106+
force_fallback_adapter: false,
106107
}))
107108
.unwrap();
108109

@@ -205,7 +206,7 @@ pub fn run<YourState: 'static, UiFunction: 'static + Fn(&imgui::Ui, &mut YourSta
205206
imgui.io_mut().update_delta_time(now - last_frame);
206207
last_frame = now;
207208

208-
let frame = match surface.get_current_frame() {
209+
let frame = match surface.get_current_texture() {
209210
Ok(frame) => frame,
210211
Err(e) => {
211212
eprintln!("dropped frame: {:?}", e);
@@ -228,7 +229,6 @@ pub fn run<YourState: 'static, UiFunction: 'static + Fn(&imgui::Ui, &mut YourSta
228229
}
229230

230231
let view = frame
231-
.output
232232
.texture
233233
.create_view(&wgpu::TextureViewDescriptor::default());
234234
let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
@@ -251,6 +251,7 @@ pub fn run<YourState: 'static, UiFunction: 'static + Fn(&imgui::Ui, &mut YourSta
251251
drop(rpass);
252252

253253
queue.submit(Some(encoder.finish()));
254+
frame.present();
254255
}
255256
Event::WindowEvent { ref event, .. } => {
256257
(config.on_event)(event, &mut state);

0 commit comments

Comments
 (0)