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

(cherry picked from commit c641882)
  • Loading branch information
mockersf authored and Waridley committed Feb 23, 2024
1 parent 16c76b7 commit 0636595
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 @@ -881,7 +881,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 0636595

Please sign in to comment.