From eed1dc428be77dbcae8b88737b214811a5bc30f8 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 c234b1ed4e..f2ab16a23e 100644 --- a/crates/bevy_render/src/render_resource/pipeline_cache.rs +++ b/crates/bevy_render/src/render_resource/pipeline_cache.rs @@ -216,7 +216,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 }