-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validate MaterialInstance references when destroyed (#8366)
* validate MaterialInstance references when destroyed With this change we now enforce two things: - All MaterialInstance of a Material must be destroyed when destroying said Material. This has always been a documented requirement of the public API, but wasn't enforced (only a warning was printed). This new assertion is unconditional. - A MaterialInstance, when destroyed is no longer in use by any Renderable. So before destroying a MaterialInstance, the user of API needs to ensure that either all Renderable using that MaterialInstance in one of their Render Primitives are destroyed, or, that these Renderable using that MaterialInstance are reset to another one or to null. There is a new RenderableManager::clearMaterialInstanceAt() that can be used to clear a MaterialInstance on a Render Primitive. Additionally, a Render Primitive with a null MaterialInstance is now silently skipped during rendering, instead of a null-dereference. Finally, that second assert is protected by a new feature flag: "features.engine.debug.assert_material_instance_in_use". This flag is enabled on DEBUG builds and disabled on RELEASE builds by default. The flag can be changed at any time using `Engine::setFeatureFlag()`. BUGS=[333907416] * Update filament/src/components/RenderableManager.cpp Co-authored-by: Powei Feng <[email protected]> --------- Co-authored-by: Powei Feng <[email protected]>
- Loading branch information
1 parent
4c3a324
commit 1747ae8
Showing
15 changed files
with
153 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.