Remove Shader weak_handles from bevy_pbr meshlets (with one exception). #19368
+60
−102
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
load_shader_library
macro for the shader libraries andembedded_asset
/load_embedded_asset
for the "shader binaries" inbevy_pbr
meshlets.The last piece that I haven't handled here is
MESHLET_VISIBILITY_BUFFER_RESOLVE_SHADER_HANDLE
. This is in an awkward situation that prevents us from using the standard solutions I've been using thus far. Essentially, a shader with this import path needs to be present, but we also need to be able to replace it if meshlets really are loaded. Embedded assets don't really play nicely with that, so we will need to figure out a solution there (or maybe wait for WESL to hopefully resolve this situation).Testing
meshlet
example still works.P.S. I don't think this needs a migration guide. Technically users could be using the
pub
weak handles, but there's no actual good use for them, so omitting it seems fine. Alternatively, we could mix this in with the migration guide notes for #19137.