Do some optimize

This commit is contained in:
lvlong 2015-01-27 15:50:05 +08:00
parent bb419719aa
commit 57970da398
1 changed files with 2 additions and 3 deletions

View File

@ -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