{"record":{"id":"566e0effe5121e1a","repo":"bevyengine/bevy","slug":"please-use-a-more-specific-shader-stage-https-g","errorCode":null,"errorMessage":"Please use a more specific shader stage: https://github.com/gfx-rs/wgpu/issues/7708","messagePattern":"Please use a more specific shader stage: https://github\\.com/gfx-rs/wgpu/issues/7708","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_render/macros/src/as_bind_group.rs","lineNumber":1387,"sourceCode":"            fragment: true,\n            ..Default::default()\n        }\n    }\n\n    fn compute() -> Self {\n        Self {\n            compute: true,\n            ..Default::default()\n        }\n    }\n}\n\nimpl ShaderStageVisibility {\n    fn hygienic_quote(&self, path: &proc_macro2::TokenStream) -> proc_macro2::TokenStream {\n        match self {\n            ShaderStageVisibility::All => quote! {\n                if cfg!(feature = \"webgpu\") {\n                    todo!(\"Please use a more specific shader stage: https://github.com/gfx-rs/wgpu/issues/7708\")\n                } else {\n                    #path::ShaderStages::all()\n                }\n            },\n            ShaderStageVisibility::None => quote! { #path::ShaderStages::NONE },\n            ShaderStageVisibility::Flags(flags) => {\n                let mut quoted = Vec::new();\n\n                if flags.vertex {\n                    quoted.push(quote! { #path::ShaderStages::VERTEX });\n                }\n                if flags.fragment {\n                    quoted.push(quote! { #path::ShaderStages::FRAGMENT });\n                }\n                if flags.compute {\n                    quoted.push(quote! { #path::ShaderStages::COMPUTE });\n                }\n","sourceCodeStart":1369,"sourceCodeEnd":1405,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_render/macros/src/as_bind_group.rs#L1369-L1405","documentation":"In an `AsBindGroup` derive, each binding can declare which shader stages may access it via `visibility(...)`. `visibility(all)` is special: on regular builds it expands to `ShaderStages::all()`, but when the expanded code is compiled with the `webgpu` feature it expands to `todo!()` referencing gfx-rs/wgpu#7708, because WebGPU rejects that stage set for bind group layouts. The panic fires at runtime when the bind group layout is first constructed.","triggerScenarios":"Any `#[texture]`, `#[sampler]`, `#[uniform]`, `#[storage]` or `#[storage_texture]` attribute with `visibility(all)` on an AsBindGroup type that is built in a WebGPU configuration; the todo!() triggers when the material's bind group layout is created.","commonSituations":"Enabling bevy's `webgpu` feature for browser builds on materials that worked on native; using `visibility(all)` copied from other code under the assumption that all-stages is the safe default.","solutions":["Replace `visibility(all)` with an explicit combination such as `visibility(vertex, fragment)` or `visibility(vertex, fragment, compute)`","Prefer the narrowest stage set that matches the shader (the derive's default is already `visibility(vertex, fragment)`)","Until wgpu#7708 is resolved, keep `visibility(all)` out of any code path built for WebGPU"],"exampleFix":"// before\n#[texture(0, visibility(all))]\n#[sampler(1)]\nalbedo: Option<Handle<Image>>,\n\n// after\n#[texture(0, visibility(vertex, fragment))]\n#[sampler(1)]\nalbedo: Option<Handle<Image>>,","handlingStrategy":"validation","validationCode":"// compile-time audit: find every occurrence in your AsBindGroup types\n//   grep -rn \"visibility(all)\" src/\n// replace each with an explicit stage list, e.g. visibility(vertex, fragment)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never use visibility(all) in code that may be built for WebGPU","Rely on the derive's default (vertex, fragment) unless a compute stage is required","Add a CI build with the webgpu feature to catch the todo!() before release"],"tags":["bevy","as-bind-group","webgpu","wgpu","shader-stages","panic"],"backgroundTag":"shader-stages-all-webgpu","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}