From ab1fa7d96e54fdcd564bea004ccfe61f718cd058 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:07:52 +0200 Subject: [PATCH] remove compute pipeline id from set compute pipeline scope and make sure that we use `ResourceErrorIdent` in all relevant inner errors --- wgpu-core/src/command/compute.rs | 4 ++-- wgpu-core/src/command/compute_command.rs | 2 +- wgpu-core/src/command/mod.rs | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 3cbea05b1..91aed2421 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -615,7 +615,7 @@ impl Global { .map_pass_err(scope)?; } ArcComputeCommand::SetPipeline(pipeline) => { - let scope = PassErrorScope::SetPipelineCompute(pipeline.as_info().id()); + let scope = PassErrorScope::SetPipelineCompute; set_pipeline(&mut state, cmd_buf, pipeline).map_pass_err(scope)?; } ArcComputeCommand::SetPushConstant { @@ -1083,7 +1083,7 @@ impl Global { ) -> Result<(), ComputePassError> { let redundant = pass.current_pipeline.set_and_check_redundant(pipeline_id); - let scope = PassErrorScope::SetPipelineCompute(pipeline_id); + let scope = PassErrorScope::SetPipelineCompute; let base = pass.base_mut(scope)?; if redundant { diff --git a/wgpu-core/src/command/compute_command.rs b/wgpu-core/src/command/compute_command.rs index e4662910f..0a37f3d78 100644 --- a/wgpu-core/src/command/compute_command.rs +++ b/wgpu-core/src/command/compute_command.rs @@ -107,7 +107,7 @@ impl ComputeCommand { pipelines_guard .get_owned(pipeline_id) .map_err(|_| ComputePassError { - scope: PassErrorScope::SetPipelineCompute(pipeline_id), + scope: PassErrorScope::SetPipelineCompute, inner: ComputePassErrorInner::InvalidPipeline(pipeline_id), })?, ), diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 58ce0a162..952de9a55 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -871,7 +871,7 @@ pub enum PassErrorScope { #[error("In a set_pipeline command")] SetPipelineRender(id::RenderPipelineId), #[error("In a set_pipeline command")] - SetPipelineCompute(id::ComputePipelineId), + SetPipelineCompute, #[error("In a set_push_constant command")] SetPushConstant, #[error("In a set_vertex_buffer command")] @@ -928,9 +928,6 @@ impl PrettyError for PassErrorScope { Self::SetPipelineRender(id) => { fmt.render_pipeline_label(&id); } - Self::SetPipelineCompute(id) => { - fmt.compute_pipeline_label(&id); - } _ => {} } }