From 0909a654593f644e66383a6dcc92afef4324ced5 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 16 May 2022 13:47:49 -0700 Subject: [PATCH] Report invalid pipelines in render bundles as errors, not panics. Fixes #2665. --- wgpu-core/src/command/bundle.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index 4a37e358ec..fc51927858 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -271,7 +271,8 @@ impl RenderBundleEncoder { .trackers .render_pipes .use_extend(&*pipeline_guard, pipeline_id, (), ()) - .unwrap(); + .map_err(|_| RenderCommandError::InvalidPipeline(pipeline_id)) + .map_pass_err(scope)?; self.context .check_compatible(&pipeline.pass_context)