Add needs_shader_reload to PipelineCache#23461
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom Mar 22, 2026
Merged
Add needs_shader_reload to PipelineCache#23461alice-i-cecile merged 1 commit intobevyengine:mainfrom
alice-i-cecile merged 1 commit intobevyengine:mainfrom
Conversation
This was referenced Mar 22, 2026
Merged
tychedelia
approved these changes
Mar 22, 2026
Member
tychedelia
left a comment
There was a problem hiding this comment.
A little ugly but not the end of the world in terms of scope.
IceSentry
reviewed
Mar 22, 2026
| pipelines: default(), | ||
| global_shader_defs, | ||
| synchronous_pipeline_compilation, | ||
| needs_shader_reload: true, |
Contributor
There was a problem hiding this comment.
Is this the only place where it's set to true because the PipelineCache gets recreated entirely on recovery? I'm trying to understand when that shader reload will actually run.
alice-i-cecile
approved these changes
Mar 22, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 22, 2026
# Objective - Continue Render Recovery efforts #23350 #22761 #23433 #23458 #23459 #23461 - Part of goal #23029 - Make render assets exist again after reload ## Solution - We re-extract everything from the main world. This assumes things *exist* on the main world, which is not actually always true. This is enough for most examples and simple usage to be recoverable, but it's really butting up against bevy_asset deficiencies. The next step to making this truly production grade is asset streaming, which will probably be my next goal. ## Testing - examples run - in combination with the rest of the fixes, render_recovery example works.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 23, 2026
# Objective - Completes goal and closes #23029 - Culmination of #22761, #23350, #23349, #23433, #23458, #23444, #23459, #23461, #23463, #22714, #22759, #16481 ## Solution - Add a release note. - Re-export a wgpu type that you need to match on to handle errors. ## Testing - cargo run --example render_recovery with all the other PRs merged in. Press 5 and then V, the app will not crash. Note that D for "destroy device" will still crash: this is a WGPU problem resolved by gfx-rs/wgpu#9281. # Note I opted not to change the default recovery behavior yet. I believe we need testing in user projects and just general trodding of this code path before committing to a new default. It works in a simple example, it might not work in a complex project. We need to field test this and likely iterate to really call this ready IMO.
splo
pushed a commit
to splo/bevy
that referenced
this pull request
Mar 31, 2026
# Objective - Continue Render Recovery efforts bevyengine#23350 bevyengine#22761 bevyengine#23433 bevyengine#23458 bevyengine#23459 - Part of goal bevyengine#23029 - Make shaders work after reload ## Solution - This is a kinda ugly hack. I explored like 5 different ways of doing this, none of them are satisfying and they are all much larger diffs than this. The crux of the problem is that the composer's capabilities may differ on the new device, due to switching from dedicated to integrated GPU. This means that we cannot even retain the composed modules. The ShaderCache and PipelineCache are quite annoyingly tangled, and I have some glimpses of how to fix it in the future but I dont want to block render recovery on it. - For now, we just do the kinda brute force thing and reinsert all the shaders, recompose etc ## Testing - examples run - in combination with the rest of the fixes and a couple other local changes i havent PRd yet, render_recovery example works.
splo
pushed a commit
to splo/bevy
that referenced
this pull request
Mar 31, 2026
# Objective - Continue Render Recovery efforts bevyengine#23350 bevyengine#22761 bevyengine#23433 bevyengine#23458 bevyengine#23459 bevyengine#23461 - Part of goal bevyengine#23029 - Make render assets exist again after reload ## Solution - We re-extract everything from the main world. This assumes things *exist* on the main world, which is not actually always true. This is enough for most examples and simple usage to be recoverable, but it's really butting up against bevy_asset deficiencies. The next step to making this truly production grade is asset streaming, which will probably be my next goal. ## Testing - examples run - in combination with the rest of the fixes, render_recovery example works.
splo
pushed a commit
to splo/bevy
that referenced
this pull request
Mar 31, 2026
# Objective - Completes goal and closes bevyengine#23029 - Culmination of bevyengine#22761, bevyengine#23350, bevyengine#23349, bevyengine#23433, bevyengine#23458, bevyengine#23444, bevyengine#23459, bevyengine#23461, bevyengine#23463, bevyengine#22714, bevyengine#22759, bevyengine#16481 ## Solution - Add a release note. - Re-export a wgpu type that you need to match on to handle errors. ## Testing - cargo run --example render_recovery with all the other PRs merged in. Press 5 and then V, the app will not crash. Note that D for "destroy device" will still crash: this is a WGPU problem resolved by gfx-rs/wgpu#9281. # Note I opted not to change the default recovery behavior yet. I believe we need testing in user projects and just general trodding of this code path before committing to a new default. It works in a simple example, it might not work in a complex project. We need to field test this and likely iterate to really call this ready IMO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Solution
Testing