{"record":{"id":"dbb5b253d3068d86","repo":"gfx-rs/wgpu","slug":"mesh-shader-feature-must-be-enabled-to-call-create","errorCode":null,"errorMessage":"MESH_SHADER feature must be enabled to call create_mesh_pipeline","messagePattern":"MESH_SHADER feature must be enabled to call create_mesh_pipeline","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu/src/backend/webgpu.rs","lineNumber":2504,"sourceCode":"        mapped_desc.set_multisample(&mapped_multisample);\n\n        let mapped_primitive = map_primitive_state(&desc.primitive);\n        mapped_desc.set_primitive(&mapped_primitive);\n\n        let render_pipeline = self.inner.create_render_pipeline(&mapped_desc).unwrap();\n\n        WebRenderPipeline {\n            inner: render_pipeline,\n            ident: crate::cmp::Identifier::create(),\n        }\n        .into()\n    }\n\n    fn create_mesh_pipeline(\n        &self,\n        _desc: &crate::MeshPipelineDescriptor<'_>,\n    ) -> dispatch::DispatchRenderPipeline {\n        panic!(\"MESH_SHADER feature must be enabled to call create_mesh_pipeline\")\n    }\n\n    fn create_compute_pipeline(\n        &self,\n        desc: &crate::ComputePipelineDescriptor<'_>,\n    ) -> dispatch::DispatchComputePipeline {\n        let shader_module = desc.module.inner.as_webgpu();\n        let mapped_compute_stage = webgpu_sys::GpuProgrammableStage::new(&shader_module.module);\n        insert_constants_map(&mapped_compute_stage, desc.compilation_options.constants);\n        if let Some(ep) = desc.entry_point {\n            mapped_compute_stage.set_entry_point(ep);\n        }\n        let mapped_desc = match desc.layout {\n            Some(layout) => webgpu_sys::GpuComputePipelineDescriptor::new(\n                &layout.inner.as_webgpu().inner,\n                &mapped_compute_stage,\n            ),\n            None => webgpu_sys::GpuComputePipelineDescriptor::new_with_gpu_auto_layout_mode(","sourceCodeStart":2486,"sourceCodeEnd":2522,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu/src/backend/webgpu.rs#L2486-L2522","documentation":"create_mesh_pipeline is unconditionally unimplemented in the web backend: any call panics stating the MESH_SHADER feature must be enabled. Browser WebGPU has no mesh-shader pipeline support, so the entry point exists only to satisfy the trait and can never succeed on this backend.","triggerScenarios":"Calling device.create_mesh_pipeline with any descriptor on the web (wasm32/browser) backend, regardless of requested features.","commonSituations":"Shared render-path code that builds mesh shader pipelines (task/mesh stages) on native (e.g. Vulkan/DX12) also running on web; feature detection missing before choosing a mesh-based render path.","solutions":["Check whether the backend supports mesh shaders (e.g. adapter features / cfg!(target_arch = \"wasm32\")) before creating a mesh pipeline, and fall back to a vertex/fragment pipeline on web.","Keep mesh-shader paths behind a feature flag disabled for wasm builds.","Implement a traditional vertex-buffer-based equivalent pipeline for web targets."],"exampleFix":"// before\nlet pipeline = device.create_mesh_pipeline(&mesh_desc); // panics on web\n// after\nlet pipeline = if cfg!(target_arch = \"wasm32\") { device.create_render_pipeline(&vert_frag_desc) } else { device.create_mesh_pipeline(&mesh_desc) };","handlingStrategy":"fallback","validationCode":"if cfg!(target_arch = \"wasm32\") {\n    return create_standard_render_pipeline(...); // mesh pipelines never available on web\n}","typeGuard":"fn supports_mesh_pipelines(backend_is_web: bool) -> bool {\n    !backend_is_web\n}","tryCatchPattern":null,"preventionTips":["Never call create_mesh_pipeline from code compiled for wasm32.","Maintain a vertex/fragment fallback pipeline for mesh-shader-based paths.","Detect backend capabilities once at startup and select the render path accordingly."],"tags":["webgpu","wasm","mesh-shader","pipeline","unsupported-feature"],"backgroundTag":"mesh-shader-unsupported-on-web","analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}