Skip to content

Commit

Permalink
set pipeline to queued when shader is not yet available (bevyengine#1…
Browse files Browse the repository at this point in the history
…2051)

# Objective

- Fixes bevyengine#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 authored and msvbg committed Feb 26, 2024
1 parent b34ca1e commit 7e967fd
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 7e967fd

Please sign in to comment.