-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Optimized] upload buffer #17595
[Optimized] upload buffer #17595
Conversation
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.
LGTM
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
cocos/rendering/custom/define.ts
Outdated
if (this.buffers.length === 1) { | ||
return this.buffers[0]; | ||
} |
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.
Why is this check needed? I think this.buffers
is correctly resized in constructor
.
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 is a determination of the array length, not the internal length of the buffer.
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.
I mean we can remove this guard, the rest of the code still works. I think this is an optimization, because when this.buffers.length === 1
, we don't need to do the modulo?
Interface Check ReportThis pull request does not change any public interfaces ! |
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.
LGTM
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Greptile Summary
This pull request optimizes buffer management in the custom rendering pipeline, focusing on improving performance and reducing unnecessary updates. Key changes include:
currUniform
property inDescBuffManager
class for more efficient uniform handlingDescBuffManager
, simplifying buffer managementidxRD
parameter in several functions for improved indexing in buffer-related operationsThese changes should lead to improved rendering performance by reducing buffer operations and optimizing memory usage.