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

Fix surface-shader #17837

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Fix surface-shader #17837

merged 1 commit into from
Nov 11, 2024

Conversation

GengineJS
Copy link
Contributor

No description provided.

const instanceBuffers = this.instanceBuffers;
instanceBuffers.forEach((instance) => {
instance.clear();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Should also clear instanceBuffers?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think gfx instance buffers are reused. They are not recreated every frame.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The instanceBuffers here will be reused, so there's no need to clear them

Copy link
Contributor

Choose a reason for hiding this comment

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

And the size of it is not changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reuse logic is here: image

Copy link

⚠️ Package size ⤴ 303 bytes, old: 5377715, new: 5378018

Interface Check Report

This pull request does not change any public interfaces !

@minggo minggo merged commit 77ee36a into cocos:v3.8.5 Nov 11, 2024
13 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.

3 participants