-
Notifications
You must be signed in to change notification settings - Fork 69
Only update PushBuffer if any uniform has actually changed #1685
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
base: master
Are you sure you want to change the base?
Conversation
bec3aa0 to
ad58d5c
Compare
|
Also added a fix for |
f67e29b to
e84d583
Compare
|
Changed the initial commit and added a new one, now it mutualises |
80717b6 to
8832f45
Compare
fedb60c to
fc2fff3
Compare
fc2fff3 to
bf51f59
Compare
bf51f59 to
2b38e3f
Compare
9a82e42 to
553f6d9
Compare
| public: | ||
| u_Bones( GLShader *shader ) : | ||
| GLUniform4fv( shader, "u_Bones", MAX_BONES, PUSH ) | ||
| GLUniform4fv( shader, "u_Bones", MAX_BONES * 2, PUSH ) |
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 times two?
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.
Because the bone count is multiplied by 2 in SetUniform_Bones().
| if ( ( _shader->UseMaterialSystem() && _updateType == MATERIAL_OR_PUSH ) | ||
| || ( glConfig.pushBufferAvailable && _updateType <= FRAME ) ) { | ||
| memcpy( currentValue, m, 6 * sizeof( float ) ); | ||
| if ( !CacheValue( value ) ) { |
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 think this could give an incorrect result if called with differing transpose parameters.
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.
Yeah, but why would you do that? Besides, using this transpose arg wouldn't work correctly with material or push buffers.
54c1107 to
36eefa5
Compare
Also mutualises `uniformFirewall` and `currentValue` and removes a bunch of unneeded code.
14d2f84 to
2d87602
Compare
Requires #1684
Further improvement for PushBuffer, only update it if it's actually required.