mirror of https://github.com/axmolengine/axmol.git
Do some optimize
This commit is contained in:
parent
bb419719aa
commit
57970da398
|
@ -672,9 +672,8 @@ bool GLProgram::updateUniformLocation(GLint location, const GLvoid* data, unsign
|
|||
}
|
||||
else
|
||||
{
|
||||
if (element->second.second != bytes){
|
||||
free(element->second.first);
|
||||
GLvoid* value = malloc(bytes);
|
||||
if (element->second.second < bytes){
|
||||
GLvoid* value = realloc(element->second.first, bytes);
|
||||
memcpy(value, data, bytes );
|
||||
_hashForUniforms[location] = std::make_pair(value, bytes);
|
||||
}else
|
||||
|
|
Loading…
Reference in New Issue