-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Make specialization cache cleanup respect material swaps #20993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Yeah, my concern was that this is kinda a race in the typed extract systems. I think (?) this wouldn't trigger if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about this part of bevy at all, but going after the comments and the small change, I will still approve it, because it looks very well informed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice fix, cant wait to yeet those generics lol
# Objective Swapping material types can break specialization caches. Fixes #20992. ## Solution Make sure that type erased bookkeeping (i.e. `RenderMaterialInstances`) runs first so that we can know whether the material was actually removed or just swapped. ## Testing Example in #20992. Tested also with 2d and didn't seem to be an issue there.
Objective
Swapping material types can break specialization caches.
Fixes #20992.
Solution
Make sure that type erased bookkeeping (i.e.
RenderMaterialInstances
) runs first so that we can know whether the material was actually removed or just swapped.Testing
Example in #20992. Tested also with 2d and didn't seem to be an issue there.