-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
WebGPURenderer: Update attribute only when needed #28701
WebGPURenderer: Update attribute only when needed #28701
Conversation
Consequently the example I will also need to fix the fact adding |
Added a fix in |
@@ -85,6 +93,22 @@ class InstanceNode extends Node { | |||
|
|||
} | |||
|
|||
update( /*frame*/ ) { | |||
|
|||
if ( this.buffer !== null && this.instanceMesh.instanceMatrix.version !== this.buffer.version ) { |
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.
This check necessary? this.buffer !== null
update()
should be called after setup.
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.
Indeed! Updated the PR accordingly 👍
Related issue: #28697
Description
This PR addresses an issue where WebGPURenderer was updating all attributes in every render frame, regardless of their state. With this fix, attributes are now updated only if
attribute.needsUpdate
has been called, enhancing performance. /cc @sunagThis PR fixes the handling of interleavedBuffer management.
InstanceNode
was missing a way to notify the associated buffers if theinstanceMatrix
andinstanceColor
were flagged to be updated, I also added a way to transfer the correct version to the corresponding buffers.This contribution is funded by Utsubo