summaryrefslogtreecommitdiffstats
path: root/examples/integration_wgpu/src/main.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-07-03 17:35:31 +0200
committerLibravatar GitHub <noreply@github.com>2022-07-03 17:35:31 +0200
commit66eb6263003c1bbedd1fd14d6b12f172d20a6211 (patch)
tree46253081865e677d7199fd036f0fed309f531ea7 /examples/integration_wgpu/src/main.rs
parente6e3eff8762e9e8350f00b340348dc2261dd0053 (diff)
parent9adc20922d16b990eede1f6c5f059e68efe15d0e (diff)
downloadiced-66eb6263003c1bbedd1fd14d6b12f172d20a6211.tar.gz
iced-66eb6263003c1bbedd1fd14d6b12f172d20a6211.tar.bz2
iced-66eb6263003c1bbedd1fd14d6b12f172d20a6211.zip
Merge pull request #1378 from Cupnfish/wgpu-0.13
update `wgpu` to `0.13`
Diffstat (limited to 'examples/integration_wgpu/src/main.rs')
-rw-r--r--examples/integration_wgpu/src/main.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs
index 045ee0d3..89ae03c6 100644
--- a/examples/integration_wgpu/src/main.rs
+++ b/examples/integration_wgpu/src/main.rs
@@ -7,7 +7,6 @@ use scene::Scene;
use iced_wgpu::{wgpu, Backend, Renderer, Settings, Viewport};
use iced_winit::{conversion, futures, program, winit, Clipboard, Debug, Size};
-use futures::task::SpawnExt;
use winit::{
dpi::PhysicalPosition,
event::{Event, ModifiersState, WindowEvent},
@@ -91,7 +90,9 @@ pub fn main() {
(
surface
- .get_preferred_format(&adapter)
+ .get_supported_formats(&adapter)
+ .first()
+ .copied()
.expect("Get preferred format"),
adapter
.request_device(
@@ -114,15 +115,14 @@ pub fn main() {
format,
width: physical_size.width,
height: physical_size.height,
- present_mode: wgpu::PresentMode::Mailbox,
+ present_mode: wgpu::PresentMode::AutoVsync,
},
);
let mut resized = false;
- // Initialize staging belt and local pool
+ // Initialize staging belt
let mut staging_belt = wgpu::util::StagingBelt::new(5 * 1024);
- let mut local_pool = futures::executor::LocalPool::new();
// Initialize scene and GUI controls
let scene = Scene::new(&mut device, format);
@@ -207,7 +207,7 @@ pub fn main() {
format: format,
width: size.width,
height: size.height,
- present_mode: wgpu::PresentMode::Mailbox,
+ present_mode: wgpu::PresentMode::AutoVsync,
},
);
@@ -262,12 +262,8 @@ pub fn main() {
);
// And recall staging buffers
- local_pool
- .spawner()
- .spawn(staging_belt.recall())
- .expect("Recall staging buffers");
+ staging_belt.recall();
- local_pool.run_until_stalled();
}
Err(error) => match error {
wgpu::SurfaceError::OutOfMemory => {