bevyengine / bevyengine/bevy

`ShaderModule` creation error isn't handled on web

Open
#25,342 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug O-Web S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

0.19

## What you did

Load an invalid Shader on web

## What went wrong

Application quits due to validation error

## Additional information

See https://github.com/bevyengine/bevy/blob/e8b3598ff5e5ec40e8ba84edd5750a1c0e4d4e59/crates/bevy_render/src/render_resource/pipeline_cache.rs#L162-L170

We should get shader compilation info and validation error and return Err when failing.

However this may be non-trivial because `ShaderModule::get_compilation_info` and `ErrorScopeGuard::pop` are async function which can't be blocking on web.

Contributor guide

Open the contributing guide

Research direction

Start in crates/bevy_render/src/render_resource/pipeline_cache.rs at lines 162-170, where ShaderModule creation errors are currently handled. Investigate the web behavior of ShaderModule::get_compilation_info and ErrorScopeGuard::pop, then verify that an invalid shader reports an error instead of quitting the application.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.