gfx-rs/wgpu · error

MESH_SHADER feature must be enabled to call multi_draw_mesh_

Error message

MESH_SHADER feature must be enabled to call multi_draw_mesh_tasks_indirect_count

What it means

Panic in the WebGPU (WASM) backend's multi_draw_mesh_tasks_indirect_count stub. The browser WebGPU API has no mesh-shader indirect-count entry point, so any call reaching this trait method aborts; the faulty input is the call itself on a backend that cannot support it.

Source

Thrown at wgpu/src/backend/webgpu.rs:3945

        &mut self,
        _indirect_buffer: &dispatch::DispatchBuffer,
        _indirect_offset: crate::BufferAddress,
        _count_buffer: &dispatch::DispatchBuffer,
        _count_buffer_offset: crate::BufferAddress,
        _max_count: u32,
    ) {
        panic!("MULTI_DRAW_INDIRECT_COUNT feature must be enabled to call multi_draw_indexed_indirect_count")
    }

    fn multi_draw_mesh_tasks_indirect_count(
        &mut self,
        _indirect_buffer: &dispatch::DispatchBuffer,
        _indirect_offset: crate::BufferAddress,
        _count_buffer: &dispatch::DispatchBuffer,
        _count_buffer_offset: crate::BufferAddress,
        _max_count: u32,
    ) {
        panic!("MESH_SHADER feature must be enabled to call multi_draw_mesh_tasks_indirect_count")
    }

    fn insert_debug_marker(&mut self, label: &str) {
        self.inner.insert_debug_marker(label);
    }

    fn push_debug_group(&mut self, group_label: &str) {
        self.inner.push_debug_group(group_label);
    }

    fn pop_debug_group(&mut self) {
        self.inner.pop_debug_group();
    }

    fn write_timestamp(&mut self, _query_set: &dispatch::DispatchQuerySet, _query_index: u32) {
        panic!("TIMESTAMP_QUERY_INSIDE_PASSES feature must be enabled to call write_timestamp in a render pass.")
    }

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Do not call multi_draw_mesh_tasks_indirect_count when targeting WASM/WebGPU
  2. Gate mesh-shading indirect paths behind a native-only backend check or feature flag
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at wgpu/src/backend/webgpu.rs:3945 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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