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
|
else
|
||||||
{
|
{
|
||||||
if (element->second.second != bytes){
|
if (element->second.second < bytes){
|
||||||
free(element->second.first);
|
GLvoid* value = realloc(element->second.first, bytes);
|
||||||
GLvoid* value = malloc(bytes);
|
|
||||||
memcpy(value, data, bytes );
|
memcpy(value, data, bytes );
|
||||||
_hashForUniforms[location] = std::make_pair(value, bytes);
|
_hashForUniforms[location] = std::make_pair(value, bytes);
|
||||||
}else
|
}else
|
||||||
|
|
Loading…
Reference in New Issue