File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -2094,15 +2094,11 @@ GLint GLShader::GetUniformLocation( const GLchar *uniformName ) const {
20942094
20952095static int FindUniformForAlignment ( std::vector<GLUniform*>& uniforms, const GLuint alignment ) {
20962096 for ( uint32_t i = 0 ; i < uniforms.size (); i++ ) {
2097- if ( uniforms[i]->GetSTD430Size () = = alignment ) {
2097+ if ( uniforms[i]->GetSTD430Size () < = alignment ) {
20982098 return i;
20992099 }
21002100 }
21012101
2102- if ( uniforms[uniforms.size () - 1 ]->GetSTD430Size () < alignment ) {
2103- return uniforms.size () - 1 ;
2104- }
2105-
21062102 return -1 ;
21072103}
21082104
@@ -2131,7 +2127,7 @@ void GLShader::PostProcessUniforms() {
21312127 // Higher-alignment uniforms first to avoid wasting memory
21322128 GLuint size = _materialSystemUniforms[0 ]->GetSTD430Size ();
21332129 GLuint components = _materialSystemUniforms[0 ]->GetComponentSize ();
2134- size = components ? 4 * components : size;
2130+ size = components ? PAD ( size, 4 ) * components : size;
21352131 GLuint alignmentConsume = 4 - size % 4 ;
21362132
21372133 tmp.emplace_back ( _materialSystemUniforms[0 ] );
You can’t perform that action at this time.
0 commit comments