From 8991e967fe7961889519d58fc8436878445f123b Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Thu, 16 Jul 2020 07:42:49 +0300 Subject: [PATCH] [rs] Update to latest `wgpu-core` --- wgpu/Cargo.toml | 4 ++-- wgpu/src/backend/direct.rs | 33 ++++++++++++++++++--------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index c2664909df..125fe29322 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -27,14 +27,14 @@ vulkan = ["wgc/gfx-backend-vulkan"] package = "wgpu-core" version = "0.5" git = "https://github.com/gfx-rs/wgpu" -rev = "f67771fb87ce17a7f7e09f9a01149b4132196928" +rev = "a0ed09a6a83dc0d16c6ad711cf139a5fcfbb9c35" features = ["raw-window-handle"] [dependencies.wgt] package = "wgpu-types" version = "0.5" git = "https://github.com/gfx-rs/wgpu" -rev = "f67771fb87ce17a7f7e09f9a01149b4132196928" +rev = "a0ed09a6a83dc0d16c6ad711cf139a5fcfbb9c35" [dependencies] arrayvec = "0.5" diff --git a/wgpu/src/backend/direct.rs b/wgpu/src/backend/direct.rs index 224a8b88eb..2bf23e81e1 100644 --- a/wgpu/src/backend/direct.rs +++ b/wgpu/src/backend/direct.rs @@ -415,17 +415,19 @@ fn map_texture_copy_view(view: crate::TextureCopyView) -> wgc::command::TextureC } } -fn map_pass_channel(ops: Option<&Operations>) -> wgt::PassChannel { +fn map_pass_channel( + ops: Option<&Operations>, +) -> wgc::command::PassChannel { match ops { Some(&Operations { load: LoadOp::Clear(clear_value), store, - }) => wgt::PassChannel { - load_op: wgt::LoadOp::Clear, + }) => wgc::command::PassChannel { + load_op: wgc::command::LoadOp::Clear, store_op: if store { - wgt::StoreOp::Store + wgc::command::StoreOp::Store } else { - wgt::StoreOp::Clear + wgc::command::StoreOp::Clear }, clear_value, read_only: false, @@ -433,19 +435,19 @@ fn map_pass_channel(ops: Option<&Operations>) -> wgt::Pass Some(&Operations { load: LoadOp::Load, store, - }) => wgt::PassChannel { - load_op: wgt::LoadOp::Load, + }) => wgc::command::PassChannel { + load_op: wgc::command::LoadOp::Load, store_op: if store { - wgt::StoreOp::Store + wgc::command::StoreOp::Store } else { - wgt::StoreOp::Clear + wgc::command::StoreOp::Clear }, clear_value: V::default(), read_only: false, }, - None => wgt::PassChannel { - load_op: wgt::LoadOp::Load, - store_op: wgt::StoreOp::Store, + None => wgc::command::PassChannel { + load_op: wgc::command::LoadOp::Load, + store_op: wgc::command::StoreOp::Store, clear_value: V::default(), read_only: true, }, @@ -770,7 +772,7 @@ impl crate::Context for Context { device: &Self::DeviceId, desc: &wgt::RenderBundleEncoderDescriptor, ) -> Self::RenderBundleEncoderId { - wgc::command::RenderBundleEncoder::new(desc, *device, None) + wgc::command::RenderBundleEncoder::new(desc, *device, None).unwrap() } fn device_drop(&self, device: &Self::DeviceId) { @@ -1010,7 +1012,7 @@ impl crate::Context for Context { encoder: &Self::CommandEncoderId, pass: &mut Self::ComputePassId, ) { - gfx_select!(*encoder => self.command_encoder_run_compute_pass(*encoder, pass)); + gfx_select!(*encoder => self.command_encoder_run_compute_pass(*encoder, pass)).unwrap() } fn command_encoder_begin_render_pass<'a>( @@ -1051,7 +1053,7 @@ impl crate::Context for Context { encoder: &Self::CommandEncoderId, pass: &mut Self::RenderPassId, ) { - gfx_select!(*encoder => self.command_encoder_run_render_pass(*encoder, pass)); + gfx_select!(*encoder => self.command_encoder_run_render_pass(*encoder, pass)).unwrap() } fn command_encoder_finish(&self, encoder: &Self::CommandEncoderId) -> Self::CommandBufferId { @@ -1070,6 +1072,7 @@ impl crate::Context for Context { &desc.map_label(|_| owned_label.as_ptr()), PhantomData )) + .unwrap() } fn queue_write_buffer(