Skip to content

Commit

Permalink
Update wgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Oct 17, 2021
1 parent dae17b6 commit c9909ea
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 46 deletions.
86 changes: 49 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ futures = "0.3.12"
# winit = "0.24.0"
winit = { git = "https://github.com/PolyMeilex/winit.git" }

wgpu = "0.10"
wgpu_glyph = "0.14"
wgpu = "0.11.0"
wgpu_glyph = "0.15.1"


log = "0.4.14"
Expand All @@ -37,9 +37,9 @@ nfd2 = { version="0.3.0", optional = true }
lib_midi = {path="./lib_midi"}
midir = "0.7.0"

iced_native = { git="https://github.com/hecrj/iced.git", rev="73f288156899ddd51ae686e95bdf09f9bd129df4", optional = true }
iced_wgpu = { git="https://github.com/hecrj/iced.git", rev="73f288156899ddd51ae686e95bdf09f9bd129df4", features = ["png"], optional = true}
iced_graphics = { git="https://github.com/hecrj/iced.git", rev="73f288156899ddd51ae686e95bdf09f9bd129df4", optional = true}
iced_native = { git="https://github.com/hecrj/iced.git", rev="20177e423cd2bdc08f8060b31c379a6f764e3df6", optional = true }
iced_wgpu = { git="https://github.com/hecrj/iced.git", rev="20177e423cd2bdc08f8060b31c379a6f764e3df6", features = ["png"], optional = true}
iced_graphics = { git="https://github.com/hecrj/iced.git", rev="20177e423cd2bdc08f8060b31c379a6f764e3df6", optional = true}

cpal = { version = "0.13.1", optional = true }
fluidlite = {git= "https://github.com/PolyMeilex/fluidlite-rs.git", optional = true}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,14 @@ impl Neothesia {

pub fn render(&mut self) {
let frame = loop {
let swap_chain_output = self.target.window.get_current_frame();
let swap_chain_output = self.target.window.get_current_texture();
match swap_chain_output {
Ok(s) => break s,
Err(err) => log::warn!("{:?}", err),
}
};

let view = &frame
.output
.texture
.create_view(&wgpu::TextureViewDescriptor::default());

Expand All @@ -157,6 +156,7 @@ impl Neothesia {
.render(&self.target.window, &mut self.target.gpu, &view);

self.target.gpu.submit().unwrap();
frame.present();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/wgpu_jumpstart/gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl Gpu {
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::HighPerformance,
compatible_surface: Some(&surface),
force_fallback_adapter: false,
})
.await
.ok_or(GpuInitError::AdapterRequest)?;
Expand Down
4 changes: 2 additions & 2 deletions src/wgpu_jumpstart/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ impl Window {
}

#[inline]
pub fn get_current_frame(&mut self) -> Result<wgpu::SurfaceFrame, wgpu::SurfaceError> {
self.surface.get_current_frame()
pub fn get_current_texture(&mut self) -> Result<wgpu::SurfaceTexture, wgpu::SurfaceError> {
self.surface.get_current_texture()
}

#[inline]
Expand Down

0 comments on commit c9909ea

Please sign in to comment.