diff --git a/deno_webgpu/device.rs b/deno_webgpu/device.rs index 0ce6fc9ab..151a53495 100644 --- a/deno_webgpu/device.rs +++ b/deno_webgpu/device.rs @@ -429,10 +429,7 @@ impl GPUDevice { entries: Cow::Owned(entries), }; - let (wgpu_bind_group, err) = - self.wgpu_device.create_bind_group(&wgpu_descriptor); - - self.error_handler.push_error(err); + let wgpu_bind_group = self.wgpu_device.create_bind_group(&wgpu_descriptor); GPUBindGroup { wgpu_bind_group, diff --git a/player/src/lib.rs b/player/src/lib.rs index 5bb980160..f0ddbd61d 100644 --- a/player/src/lib.rs +++ b/player/src/lib.rs @@ -229,7 +229,7 @@ impl Player { } Action::CreateBindGroup(id, desc) => { let resolved_desc = self.resolve_bind_group_descriptor(desc); - let (bind_group, _error) = device.create_bind_group(&resolved_desc); + let bind_group = device.create_bind_group(&resolved_desc); self.bind_groups.insert(id, bind_group); } Action::DropBindGroup(id) => { diff --git a/wgpu-core-remote/src/global/device.rs b/wgpu-core-remote/src/global/device.rs index 2c94ad2d4..6d10f851f 100644 --- a/wgpu-core-remote/src/global/device.rs +++ b/wgpu-core-remote/src/global/device.rs @@ -496,7 +496,7 @@ impl Global { device_id: DeviceId, desc: &BindGroupDescriptor, id_in: id::BindGroupId, - ) -> (id::BindGroupId, Option) { + ) { let mut hub = self.hub.borrow_mut(); let Hub { bind_groups, @@ -564,10 +564,9 @@ impl Global { entries, }; - let (bind_group, error) = device.create_bind_group(&desc); + let bind_group = device.create_bind_group(&desc); - let id = bind_groups.assign(id_in, bind_group); - (id, error) + bind_groups.assign(id_in, bind_group); } pub fn bind_group_drop(&self, bind_group_id: id::BindGroupId) { diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 029850623..67245dcf8 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -3640,18 +3640,15 @@ impl Device { pub fn create_bind_group( self: &Arc, desc: &binding_model::BindGroupDescriptor, - ) -> (Arc, Option) { + ) -> Arc { profiling::scope!("Device::create_bind_group"); #[cfg(feature = "trace")] let trace_desc = (&desc).to_trace(); - let (bind_group, error) = match self.create_bind_group_inner(desc) { - Ok(bind_group) => (bind_group, None), - Err(e) => ( - BindGroup::invalid(self.clone(), desc.label.to_string(), desc.layout.clone()), - Some(e), - ), - }; + let bind_group = self.create_bind_group_inner(desc).unwrap_or_else(|err| { + self.handle_error(err, desc.label.as_deref(), "Device::create_bind_group"); + BindGroup::invalid(self.clone(), desc.label.to_string(), desc.layout.clone()) + }); #[cfg(feature = "trace")] if let Some(ref mut trace) = *self.trace.lock() { @@ -3666,7 +3663,7 @@ impl Device { Arc::as_ptr(&bind_group) ); - (bind_group, error) + bind_group } // This function expects the provided bind group layout to be resolved diff --git a/wgpu/src/backend/wgpu_core.rs b/wgpu/src/backend/wgpu_core.rs index 3f2495a82..e9a9e39b8 100644 --- a/wgpu/src/backend/wgpu_core.rs +++ b/wgpu/src/backend/wgpu_core.rs @@ -1067,11 +1067,7 @@ impl dispatch::DeviceInterface for CoreDevice { entries: Borrowed(&entries), }; - let (wgpu_bind_group, error) = self.wgpu_device.create_bind_group(&descriptor); - if let Some(cause) = error { - self.wgpu_device - .handle_error(cause, desc.label, "Device::create_bind_group"); - } + let wgpu_bind_group = self.wgpu_device.create_bind_group(&descriptor); CoreBindGroup { wgpu_bind_group }.into() }