{"record":{"id":"112e35e68c1f2094","repo":"gfx-rs/wgpu","slug":"mesh-shader-feature-must-be-enabled-to-call-draw-m-112e35","errorCode":null,"errorMessage":"MESH_SHADER feature must be enabled to call draw_mesh_tasks_indirect","messagePattern":"MESH_SHADER feature must be enabled to call draw_mesh_tasks_indirect","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu/src/backend/webgpu.rs","lineNumber":3871,"sourceCode":"            .draw_indirect_with_f64(&buffer.inner, indirect_offset as f64);\n    }\n\n    fn draw_indexed_indirect(\n        &mut self,\n        indirect_buffer: &dispatch::DispatchBuffer,\n        indirect_offset: crate::BufferAddress,\n    ) {\n        let buffer = indirect_buffer.as_webgpu();\n        self.inner\n            .draw_indexed_indirect_with_f64(&buffer.inner, indirect_offset as f64);\n    }\n\n    fn draw_mesh_tasks_indirect(\n        &mut self,\n        _indirect_buffer: &dispatch::DispatchBuffer,\n        _indirect_offset: crate::BufferAddress,\n    ) {\n        panic!(\"MESH_SHADER feature must be enabled to call draw_mesh_tasks_indirect\")\n    }\n\n    fn multi_draw_indirect(\n        &mut self,\n        indirect_buffer: &dispatch::DispatchBuffer,\n        indirect_offset: crate::BufferAddress,\n        count: u32,\n    ) {\n        let buffer = indirect_buffer.as_webgpu();\n\n        for i in 0..count {\n            let offset = indirect_offset + i as crate::BufferAddress * 16;\n            self.inner\n                .draw_indirect_with_f64(&buffer.inner, offset as f64);\n        }\n    }\n\n    fn multi_draw_indexed_indirect(","sourceCodeStart":3853,"sourceCodeEnd":3889,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu/src/backend/webgpu.rs#L3853-L3889","documentation":"Mesh shader indirect draws are unsupported by the WebGPU backend, so RenderPassEncoder::draw_mesh_tasks_indirect panics unconditionally. This path requires MESH_SHADER (plus indirect support) on native backends.","triggerScenarios":"Calling draw_mesh_tasks_indirect(indirect_buffer, indirect_offset) on a render pass while running on the webgpu backend, or on a native backend without Features::MESH_SHADER.","commonSituations":"GPU-driven rendering issuing mesh task draws from buffers, compiled for web; shared indirect-draw helpers that don't distinguish mesh-task indirect draws; Vulkan prototypes moved to the browser backend.","solutions":["Gate the call on Features::MESH_SHADER and a non-WebGPU backend.","Fall back to CPU-computed draw counts with regular draw calls.","Use standard draw_indirect with a conventional pipeline as a fallback.","Detect capabilities at device creation and pick a rendering strategy accordingly."],"exampleFix":"// before\nrender_pass.draw_mesh_tasks_indirect(&count_buffer, 0);\n// after\nif mesh_shader_supported {\n    render_pass.draw_mesh_tasks_indirect(&count_buffer, 0);\n} else {\n    render_pass.draw_indirect(&args_buffer, 0);\n}","handlingStrategy":"validation","validationCode":"if supports_mesh_shader(device.features(), backend) {\n    render_pass.draw_mesh_tasks_indirect(&buf, 0);\n} else { /* fallback draw path */ }","typeGuard":"fn supports_mesh_shader(f: Features, b: Backend) -> bool {\n    f.contains(Features::MESH_SHADER) && b != Backend::Browser\n}","tryCatchPattern":null,"preventionTips":["Dispatch indirect mesh draws through a capability-checked code path.","Keep a conventional indirect draw fallback for unsupported backends.","Detect capabilities once at device creation, not per frame.","Cover web targets in automated render tests."],"tags":["panic","webgpu","mesh-shader","indirect-draw","unsupported-feature"],"backgroundTag":"unsupported-feature-panic","analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}