{"record":{"id":"1f292538aea4ad77","repo":"gfx-rs/wgpu","slug":"not-supported-by-a-render-bundle","errorCode":null,"errorMessage":"not supported by a render bundle","messagePattern":"not supported by a render bundle","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-core/src/command/bundle.rs","lineNumber":525,"sourceCode":"                    let scope = PassErrorScope::Draw {\n                        kind: DrawKind::DrawIndirect,\n                        family,\n                    };\n                    multi_draw_indirect(&mut state, buffer, offset, family).map_pass_err(scope)?;\n                }\n                RenderCommand::DrawIndirect {\n                    count,\n                    vertex_or_index_limit,\n                    instance_limit,\n                    ..\n                } => {\n                    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\");\n                }\n                RenderCommand::MultiDrawIndirectCount { .. }\n                | RenderCommand::PushDebugGroup { color: _, len: _ }\n                | RenderCommand::InsertDebugMarker { color: _, len: _ }\n                | RenderCommand::PopDebugGroup => {\n                    unimplemented!(\"not supported by a render bundle\")\n                }\n                // Must check the TIMESTAMP_QUERY_INSIDE_PASSES feature\n                RenderCommand::WriteTimestamp { .. }\n                | RenderCommand::BeginOcclusionQuery { .. }\n                | RenderCommand::EndOcclusionQuery\n                | RenderCommand::BeginPipelineStatisticsQuery { .. }\n                | RenderCommand::EndPipelineStatisticsQuery => {\n                    unimplemented!(\"not supported by a render bundle\")\n                }\n                RenderCommand::ExecuteBundle(_)\n                | RenderCommand::SetBlendConstant(_)\n                | RenderCommand::SetStencilReference(_)\n                | RenderCommand::SetViewport { .. }\n                | RenderCommand::SetScissor(_) => unreachable!(\"not supported by a render bundle\"),\n            }\n        }\n\n        let State {","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-core/src/command/bundle.rs#L507-L543","documentation":"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').","triggerScenarios":"Calling multi_draw_indirect_count, push_debug_group, insert_debug_marker, or pop_debug_group on a RenderBundleEncoder and then calling finish().","commonSituations":"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.","solutions":["Remove or branch around debug group/marker calls when recording into a RenderBundleEncoder","Replace multi_draw_indirect_count with multi_draw_indirect (or single draw_indirect) when building bundles","Centralize recording logic behind a flag (is_bundle) that skips unsupported calls","Check the WebGPU spec list of allowed render bundle commands before encoding"],"exampleFix":"// before\nif let Some(bc) = buffer_count { encoder.multi_draw_indirect_count(...); }\nencoder.push_debug_group(\"mesh\");\n// after\nif !is_bundle { if let Some(bc) = buffer_count { encoder.multi_draw_indirect_count(...); } encoder.push_debug_group(\"mesh\"); }","handlingStrategy":"try-catch","validationCode":"// Only these commands are bundle-safe: draw/draw indirect (non-count), set pipeline/bind group/index buffer/vertex buffers, set bind group dynamic offsets.\nconst BUNDLE_ALLOWED: [&str; 1] = [\"multi_draw_indirect_count, push/insert/pop debug-group are NOT allowed\"];","typeGuard":null,"tryCatchPattern":"// finish() panics (not Result); guard at recording time instead:\nif is_bundle_encoder { skip_unsupported_commands(); }\nlet bundle = bundle_encoder.finish(&desc); // only reached when no unsupported commands recorded","preventionTips":["Never call push_debug_group/insert_debug_marker/pop_debug_group on RenderBundleEncoder","Never call multi_draw_indirect_count in bundles","Share recording code via a parameter that filters bundle-unsupported calls"],"tags":["wgpu","render-bundle","debug-groups","indirect-draw"],"backgroundTag":"unsupported-render-bundle-command","analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}