diff --git a/deno_webgpu/device.rs b/deno_webgpu/device.rs index 8dfca8b44..51ab0fb5a 100644 --- a/deno_webgpu/device.rs +++ b/deno_webgpu/device.rs @@ -903,7 +903,6 @@ impl GPUDevice { ( GPURenderPipeline { - error_handler: self.error_handler.clone(), wgpu_render_pipeline, label: descriptor.label, }, diff --git a/deno_webgpu/render_pipeline.rs b/deno_webgpu/render_pipeline.rs index e81f163fa..bfbe9d89e 100644 --- a/deno_webgpu/render_pipeline.rs +++ b/deno_webgpu/render_pipeline.rs @@ -19,8 +19,6 @@ use crate::webidl::GPUColorWriteFlags; use crate::webidl::GPUPipelineLayoutOrGPUAutoLayoutMode; pub struct GPURenderPipeline { - pub error_handler: super::error::ErrorHandler, - pub wgpu_render_pipeline: Arc, pub label: String, } @@ -56,11 +54,9 @@ impl GPURenderPipeline { #[cppgc] fn get_bind_group_layout(&self, #[webidl] index: u32) -> GPUBindGroupLayout { - let (wgpu_bind_group_layout, err) = + let wgpu_bind_group_layout = self.wgpu_render_pipeline.get_bind_group_layout(index); - self.error_handler.push_error(err); - // TODO(wgpu): needs to add a way to retrieve the label GPUBindGroupLayout { wgpu_bind_group_layout, diff --git a/player/src/lib.rs b/player/src/lib.rs index cafea75c0..86967af15 100644 --- a/player/src/lib.rs +++ b/player/src/lib.rs @@ -188,7 +188,7 @@ impl Player { index, } => { let pipeline = self.resolve_render_pipeline_id(pipeline); - let (bgl, _error) = pipeline.get_bind_group_layout(index); + let bgl = pipeline.get_bind_group_layout(index); self.bind_group_layouts.insert(id, bgl); } Action::GetComputePipelineBindGroupLayout { diff --git a/wgpu-core-remote/src/global/device.rs b/wgpu-core-remote/src/global/device.rs index 5317485de..48e2e33f4 100644 --- a/wgpu-core-remote/src/global/device.rs +++ b/wgpu-core-remote/src/global/device.rs @@ -857,9 +857,6 @@ impl Global { pipeline_id: id::RenderPipelineId, index: u32, id_in: id::BindGroupLayoutId, - ) -> ( - id::BindGroupLayoutId, - Option, ) { let mut hub = self.hub.borrow_mut(); let Hub { @@ -870,11 +867,9 @@ impl Global { let pipeline = render_pipelines.get(pipeline_id); - let (bgl, error) = pipeline.get_bind_group_layout(index); + let bgl = pipeline.get_bind_group_layout(index); - let id = bind_group_layouts.assign(id_in, bgl); - - (id, error) + bind_group_layouts.assign(id_in, bgl); } pub fn render_pipeline_drop(&self, render_pipeline_id: id::RenderPipelineId) { diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 0fbcabbf7..d11069f45 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -1131,17 +1131,14 @@ impl RenderPipeline { self.layout()?.get_bind_group_layout(index, self.into()) } - pub fn get_bind_group_layout( - self: &Arc, - index: u32, - ) -> (Arc, Option) { - let (bgl, error) = match self.get_bind_group_layout_inner(index) { - Ok(bgl) => (bgl, None), - Err(e) => ( - BindGroupLayout::invalid(&self.device, String::new()), - Some(e), - ), - }; + pub fn get_bind_group_layout(self: &Arc, index: u32) -> Arc { + let bgl = self + .get_bind_group_layout_inner(index) + .unwrap_or_else(|err| { + self.device + .handle_error_nolabel(err, "RenderPipeline::get_bind_group_layout"); + BindGroupLayout::invalid(&self.device, String::new()) + }); #[cfg(feature = "trace")] if let Some(ref mut trace) = *self.device.trace.lock() { use crate::device::trace; @@ -1152,7 +1149,7 @@ impl RenderPipeline { index, }); }; - (bgl, error) + bgl } } diff --git a/wgpu/src/backend/wgpu_core.rs b/wgpu/src/backend/wgpu_core.rs index 4d5a15712..5c36b75b7 100644 --- a/wgpu/src/backend/wgpu_core.rs +++ b/wgpu/src/backend/wgpu_core.rs @@ -1963,13 +1963,7 @@ impl dispatch::PipelineLayoutInterface for CorePipelineLayout {} impl dispatch::RenderPipelineInterface for CoreRenderPipeline { fn get_bind_group_layout(&self, index: u32) -> dispatch::DispatchBindGroupLayout { - let (wgpu_bind_group_layout, error) = - self.wgpu_render_pipeline.get_bind_group_layout(index); - if let Some(err) = error { - self.wgpu_render_pipeline - .device() - .handle_error_nolabel(err, "RenderPipeline::get_bind_group_layout") - } + let wgpu_bind_group_layout = self.wgpu_render_pipeline.get_bind_group_layout(index); CoreBindGroupLayout { wgpu_bind_group_layout, }