1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-25 23:43:58 +00:00

Fix bug in shader uniform assignment

This commit is contained in:
fgenesis 2013-05-15 01:56:50 +02:00
parent 6666787f6d
commit cfd9b0ca5b

View file

@ -405,6 +405,9 @@ int Shader::_getUniformIndex(const char *name)
{
// binary search
UniformVec::iterator it = stdx_fg::lower_bound(uniforms.begin(), uniforms.end(), name, _sortUniform);
// because lower_bound returns the first element that compares less, it might not be the correct one
if(it != uniforms.end() && strcmp(it->name, name))
return -1;
return int(it - uniforms.begin());
}