gfx-rs/wgpu · error

Feature `MESH_SHADING` not enabled

Error message

Feature `MESH_SHADING` not enabled

What it means

Panic from the Vulkan command encoder when draw_mesh_tasks is called but the VK_EXT_mesh_shader extension functions were not loaded at device creation. The guard checks device.extension_fns.mesh_shading; it is None because Features::MESH_SHADING was not requested/enabled when the device was created.

Source

Thrown at wgpu-hal/src/vulkan/command.rs:1165

                instance_count,
                first_index,
                base_vertex,
                first_instance,
            )
        };
    }
    unsafe fn draw_mesh_tasks(
        &mut self,
        group_count_x: u32,
        group_count_y: u32,
        group_count_z: u32,
    ) {
        if let Some(ref t) = self.device.extension_fns.mesh_shading {
            unsafe {
                t.cmd_draw_mesh_tasks(self.active, group_count_x, group_count_y, group_count_z);
            };
        } else {
            panic!("Feature `MESH_SHADING` not enabled");
        }
    }
    unsafe fn draw_indirect(
        &mut self,
        buffer: &super::Buffer,
        offset: wgt::BufferAddress,
        draw_count: u32,
    ) {
        if draw_count >= 1
            && self.device.private_caps.multi_draw_indirect
            && draw_count <= self.device.private_caps.max_draw_indirect_count
        {
            unsafe {
                self.device.raw.cmd_draw_indirect(
                    self.active,
                    buffer.raw,
                    offset,
                    draw_count,

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Create the device with Features::MESH_SHADING enabled (requires a Vulkan device exposing VK_EXT_mesh_shader)
  2. Only call draw_mesh_tasks from code paths gated behind a mesh-shading feature check
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at wgpu-hal/src/vulkan/command.rs:1165 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/98193675f7600ef0. Report an issue: GitHub.