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:
parent
6666787f6d
commit
cfd9b0ca5b
1 changed files with 3 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue