From f47038f5c8de4d4bb083c2a81b7b40c9049ea2da Mon Sep 17 00:00:00 2001 From: atlv Date: Sat, 17 May 2025 15:03:47 -0400 Subject: [PATCH] fix(render): transitive shader imports now work consistently on web (#19266) # Objective - transitive shader imports sometimes fail to load silently and return Ok - Fixes #19226 ## Solution - Don't return Ok, return the appropriate error code which will retry the load later when the dependencies load ## Testing - `bevy run --example=3d_scene web --open` Note: this is was theoretically a problem before the hot reloading PR, but probably extremely unlikely to occur. --- crates/bevy_render/src/render_resource/pipeline_cache.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_render/src/render_resource/pipeline_cache.rs b/crates/bevy_render/src/render_resource/pipeline_cache.rs index 653ae70b1c..706ebd23f2 100644 --- a/crates/bevy_render/src/render_resource/pipeline_cache.rs +++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs @@ -208,7 +208,11 @@ impl ShaderCache { } composer.add_composable_module(shader.into())?; + } else { + Err(PipelineCacheError::ShaderImportNotYetAvailable)?; } + } else { + Err(PipelineCacheError::ShaderImportNotYetAvailable)?; } // if we fail to add a module the composer will tell us what is missing }