-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Fix unbatchable meshes. #18761
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
Fix unbatchable meshes. #18761
Conversation
I'm not confident enough to review the code, but can confirm this fixes the stress in #18536 breaking when meshes are frustum culled (Win10/Vulkan/Nvidia). |
I've pushed this fix to a branch on top of the 0.16.0-rc.3 if anyone want to test it before merging: https://github.com/mockersf/bevy/tree/16.0-rc.3-with-18761 |
Tested against my issue in #18736 and happy to report this is fixing it even with the gltf using shape-keys! Thank you so much! |
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.
Not really familiar with the code, but it looks fine and was shown to fix the problem.
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.
Thanks for the fix. The sparse/dense stuff is some of my least favorite parts of the renderer and can be removed once we drop WebGL 2.
// but let's go ahead and do the sensible thing anyhow: demote | ||
// the compressed `NoDynamicOffsets` field to the full | ||
// `DynamicOffsets` array. | ||
warn!( |
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'd just make this an error!
# Objective Fixes #18550. Because bin state for unbatchable meshes wasn't being cleared each frame, the buffer indices for unbatchable meshes would demote from sparse to dense storage and aggressively leak memory, with all kinds of weird consequences downstream, namely supplying invalid instance ranges for render. ## Solution Clear out the unbatchable mesh bin state when we start a new frame.
# Objective Fixes bevyengine#18550. Because bin state for unbatchable meshes wasn't being cleared each frame, the buffer indices for unbatchable meshes would demote from sparse to dense storage and aggressively leak memory, with all kinds of weird consequences downstream, namely supplying invalid instance ranges for render. ## Solution Clear out the unbatchable mesh bin state when we start a new frame.
Objective
Fixes #18550.
Because bin state for unbatchable meshes wasn't being cleared each frame, the buffer indices for unbatchable meshes would demote from sparse to dense storage and aggressively leak memory, with all kinds of weird consequences downstream, namely supplying invalid instance ranges for render.
Solution
Clear out the unbatchable mesh bin state when we start a new frame.