Only update PushBuffer if any uniform has actually changed#1685
Only update PushBuffer if any uniform has actually changed#1685VReaperV merged 4 commits intoDaemonEngine:masterfrom
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.
Because the bone count is multiplied by 2 in SetUniform_Bones().
There was a problem hiding this comment.
I guess it must have only worked with 128 before.
| 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.
I think this could give an incorrect result if called with differing transpose parameters.
There was a problem hiding this comment.
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
slipher
left a comment
There was a problem hiding this comment.
LGTM. Looks good in my screenshot tests
| 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.
I guess it must have only worked with 128 before.
Requires #1684
Further improvement for PushBuffer, only update it if it's actually required.