Skip to content

Commit

Permalink
set pipeline to queued when shader is not yet available (#12051)
Browse files Browse the repository at this point in the history
# Objective

- Fixes #11977 - user defined shaders don't work in wasm
- After investigation, it won't work if the shader is not yet available
when compiling the pipeline on all platforms, for example if you load
many assets

## Solution

- Set the pipeline state to queued when it errs waiting for the shader
so that it's retried
  • Loading branch information
mockersf committed Feb 27, 2024
1 parent d62319b commit 5bf5d48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/bevy_render/src/render_resource/pipeline_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,9 @@ impl PipelineCache {
CachedPipelineState::Err(err) => match err {
// Retry
PipelineCacheError::ShaderNotLoaded(_)
| PipelineCacheError::ShaderImportNotYetAvailable => {}
| PipelineCacheError::ShaderImportNotYetAvailable => {
cached_pipeline.state = CachedPipelineState::Queued;
}

// Shader could not be processed ... retrying won't help
PipelineCacheError::ProcessShaderError(err) => {
Expand Down

0 comments on commit 5bf5d48

Please sign in to comment.