Repository navigation
Destroy the material of each debris crate in the entity inspector example - #9692
Merged
Merged
Conversation
…y inspector The entity inspector example creates a StandardMaterial for every debris crate it spawns, and destroying the crate's entity leaves that material alive. Each one holds a uniform buffer registered with the device, so on WebGPU the device's uniform buffer count grew by one per crate, about 2.5 a second, without bound. The material is now destroyed with its crate.
Build size reportThis PR does not change the size of the minified bundles.
|
This branch was successfully deployed
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.
Fixes a material leak in the entity inspector example: on WebGPU the device's uniform buffer count grew by about 2.5 a second without bound.
Changes:
StandardMaterial, and destroying a crate's entity left its material alive, along with the uniform buffer the material registers with the device. The material is now destroyed together with its crate, so the count stays flat once the debris pool is full. Crates still keep appearing and disappearing, each with its own shade.Examples:
debug/entity-inspector