Fix bugs in the new non-bindless mesh material allocator.#17980
Merged
superdump merged 1 commit intobevyengine:mainfrom Feb 22, 2025
Merged
Fix bugs in the new non-bindless mesh material allocator.#17980superdump merged 1 commit intobevyengine:mainfrom
superdump merged 1 commit intobevyengine:mainfrom
Conversation
This patch fixes two bugs in the new non-bindless material allocator that landed in PR bevyengine#17898: 1. A debug assertion to prevent double frees had been flipped: we checked to see whether the slot was empty before freeing, while we should have checked to see whether the slot was full. 2. The non-bindless allocator returned `None` when querying a slab that hadn't been prepared yet instead of returning a handle to that slab. This resulted in a 1-frame delay when modifying materials. In the `animated_material` example, this resulted in the meshes never showing up at all, because that example changes every material every frame. Together with bevyengine#17979, this patch locally fixes the problems with `animated_material` on macOS that were reported in bevyengine#17970.
rparrett
approved these changes
Feb 22, 2025
Contributor
There was a problem hiding this comment.
Mostly over my head, but seems to make sense and look good. Applying this and 17979 seems to fix most of #17970.
Of the stuff that didn't get documented there immediately, it seems that the texture example is still broken, so there may yet be one more lingering issue.
atlv24
approved these changes
Feb 22, 2025
superdump
approved these changes
Feb 22, 2025
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.
This patch fixes two bugs in the new non-bindless material allocator that landed in PR #17898:
A debug assertion to prevent double frees had been flipped: we checked to see whether the slot was empty before freeing, while we should have checked to see whether the slot was full.
The non-bindless allocator returned
Nonewhen querying a slab that hadn't been prepared yet instead of returning a handle to that slab. This resulted in a 1-frame delay when modifying materials. In theanimated_materialexample, this resulted in the meshes never showing up at all, because that example changes every material every frame.Together with #17979, this patch locally fixes the problems with
animated_materialon macOS that were reported in #17970.