gfx-rs/wgpu · error

not supported by a render bundle

Error message

not supported by a render bundle

What it means

Render bundles do not support multi-draw-indirect-count calls or debug-group commands (pushDebugGroup/insertDebugMarker/popDebugGroup). When a render bundle encoder created from such commands is finished, bundle::finish panics with unimplemented!('not supported by a render bundle').

Source

Thrown at wgpu-core/src/command/bundle.rs:525

                    let scope = PassErrorScope::Draw {
                        kind: DrawKind::DrawIndirect,
                        family,
                    };
                    multi_draw_indirect(&mut state, buffer, offset, family).map_pass_err(scope)?;
                }
                RenderCommand::DrawIndirect {
                    count,
                    vertex_or_index_limit,
                    instance_limit,
                    ..
                } => {
                    unreachable!("unexpected (multi-)draw indirect with count {count}, vertex_or_index_limits {vertex_or_index_limit:?}, instance_limit {instance_limit:?} found in a render bundle");
                }
                RenderCommand::MultiDrawIndirectCount { .. }
                | RenderCommand::PushDebugGroup { color: _, len: _ }
                | RenderCommand::InsertDebugMarker { color: _, len: _ }
                | RenderCommand::PopDebugGroup => {
                    unimplemented!("not supported by a render bundle")
                }
                // Must check the TIMESTAMP_QUERY_INSIDE_PASSES feature
                RenderCommand::WriteTimestamp { .. }
                | RenderCommand::BeginOcclusionQuery { .. }
                | RenderCommand::EndOcclusionQuery
                | RenderCommand::BeginPipelineStatisticsQuery { .. }
                | RenderCommand::EndPipelineStatisticsQuery => {
                    unimplemented!("not supported by a render bundle")
                }
                RenderCommand::ExecuteBundle(_)
                | RenderCommand::SetBlendConstant(_)
                | RenderCommand::SetStencilReference(_)
                | RenderCommand::SetViewport { .. }
                | RenderCommand::SetScissor(_) => unreachable!("not supported by a render bundle"),
            }
        }

        let State {

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Remove or branch around debug group/marker calls when recording into a RenderBundleEncoder
  2. Replace multi_draw_indirect_count with multi_draw_indirect (or single draw_indirect) when building bundles
  3. Centralize recording logic behind a flag (is_bundle) that skips unsupported calls
  4. Check the WebGPU spec list of allowed render bundle commands before encoding

Example fix

// before
if let Some(bc) = buffer_count { encoder.multi_draw_indirect_count(...); }
encoder.push_debug_group("mesh");
// after
if !is_bundle { if let Some(bc) = buffer_count { encoder.multi_draw_indirect_count(...); } encoder.push_debug_group("mesh"); }
Defensive patterns

Strategy: try-catch

Validate before calling

// Only these commands are bundle-safe: draw/draw indirect (non-count), set pipeline/bind group/index buffer/vertex buffers, set bind group dynamic offsets.
const BUNDLE_ALLOWED: [&str; 1] = ["multi_draw_indirect_count, push/insert/pop debug-group are NOT allowed"];

Try / catch

// finish() panics (not Result); guard at recording time instead:
if is_bundle_encoder { skip_unsupported_commands(); }
let bundle = bundle_encoder.finish(&desc); // only reached when no unsupported commands recorded

Prevention

When it happens

Trigger: Calling multi_draw_indirect_count, push_debug_group, insert_debug_marker, or pop_debug_group on a RenderBundleEncoder and then calling finish().

Common situations: Reusing a shared command-recording helper for both render passes and render bundles; instrumentation/profiling code that wraps draws with debug groups being applied to bundle encoders.

Related errors


AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03). Data as JSON: /api/errors/1f292538aea4ad77. Report an issue: GitHub.