Skip to content
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

Reuse NodeBuilder #26729

Merged
merged 7 commits into from
Sep 12, 2023
Merged

Reuse NodeBuilder #26729

merged 7 commits into from
Sep 12, 2023

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Sep 11, 2023

Related issue: #26673

Description

  • Check Material Cache Key only after the version difference -- material.needsUpdate=true
  • Reuse NodeBuilder based from Cache Key, currently the cache uses Material/Geometry as reference. For example, this means that two Materials of the same type with only a different color will be compiled twice instead of reuse the NodeBuilder, this sharing already happens for the GPU Program, but as the code is dynamically generated this optimization process should be API oriented for the Nodes.
  • Create a NodeBuilderState to reduce memory usage when reuse NodeBuilder

@sunag sunag marked this pull request as ready for review September 12, 2023 05:52

if ( material.version !== this._materialVersion ) {
for ( const property in material ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work for properties available via getters/setters, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will access private properties instead.

@sunag sunag merged commit 366e25e into mrdoob:dev Sep 12, 2023
@Methuselah96 Methuselah96 mentioned this pull request Jan 18, 2024
45 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants