bevyengine / bevyengine/bevy

WebGPU WASM: Shader and texture errors on Chrome/Edge (Dawn) while Firefox works

Open
#23,109 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug O-WebGPU S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.18.0

## Relevant system information

- **OS**: macOS 26.2 (Tahoe)
- **wgpu**: 27.0.1
- **Browsers tested**:
- Chrome (fails)
- Firefox (works)

## What you did

Built a Bevy WASM application with `webgpu` feature and ran it in the browser.

```toml
bevy = { version = "0.18", features = ["webgpu"] }
```

## What went wrong

On Chrome/Edge (Dawn-based WebGPU), the application fails with multiple shader and texture errors. The same build works perfectly on Firefox (wgpu-based WebGPU).

### Error 1: Destroyed texture
```
Destroyed texture [Texture "IOSurface(RasterRead|DisplayRead|Scanout|WebgpuRead|WebgpuSwapChainTexture|WebgpuWrite)"] used in a submit.
- While calling [Queue].Submit([[CommandBuffer], [CommandBuffer "main_opaque_pass_3d_command_encoder" ...]])
```

### Error 2: Invalid ShaderModule
```
[Invalid ShaderModule (unlabeled)] is invalid.
- While validating fragment stage ([Invalid ShaderModule (unlabeled)], entryPoint: [undefined]).
- While validating fragment state.
- While calling [Device].CreateRenderPipeline([RenderPipelineDescriptor ""opaque_mesh_pipeline""]).
```

Similar errors occur for:
- `mtoon_outline_pipeline`
- `alpha_blend_mesh_pipeline`

## Additional information

- **Firefox works**: The exact same WASM build runs without any errors on Firefox
- This suggests a Dawn (Chrome/Edge) vs wgpu (Firefox) compatibility issue in shader validation or texture lifecycle management

## Related issues

- #21224 - Webgpu breaking browser differences (closed as not planned, but same root cause)
- #22044 - WebGPU degrades Chrome browser performance (similar "Destroyed texture" error)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Bevy 0.18 WASM build with the webgpu feature in Chrome and Edge, then compare the shader and destroyed-texture errors with Firefox. Read related issues #21224 and #22044 for prior context; done means isolating whether Dawn compatibility or texture lifecycle causes the failures and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
computer-graphics, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.