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

WebGPURenderer: optimize interleaved buffer update #28704

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

z4122
Copy link
Contributor

@z4122 z4122 commented Jun 19, 2024

Related issue: #28697 #28701

Description

Optimize interlavedBuffer update

Before
image

After
image

@RenaudRohlinger
Copy link
Collaborator

I didn't noticed the pattern with DynamicDraw usage in Attributes.js. This is actually the correct PR. /cc @sunag

Thanks for that.

Also my attempt did unveil an issue which is the forwarding of version update for non-DynamicUsage draw pattern in InstancedMesh.
Consequently we should update InstanceNode with:

update( /*frame*/ ) {

	if ( this.instanceMesh.instanceMatrix.usage !== DynamicDrawUsage && this.instanceMesh.instanceMatrix.version !== this.buffer.version ) {

		this.buffer.version = this.instanceMesh.instanceMatrix.version;

	}

	if ( this.instanceMesh.instanceColor && this.instanceMesh.instanceColor.usage !== DynamicDrawUsage && this.instanceMesh.instanceColor.version !== this.bufferColor.version ) {

		this.bufferColor.version = this.instanceMesh.instanceColor.version;

	}

}

@RenaudRohlinger RenaudRohlinger added this to the r166 milestone Jun 20, 2024
@sunag sunag merged commit 7a50693 into mrdoob:dev Jun 20, 2024
11 checks passed
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.

None yet

3 participants