mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
FIx a potential bug when using _glUniform calls with an invalid location
This commit is contained in:
parent
030f0d7103
commit
6342762fde
1 changed files with 7 additions and 3 deletions
|
@ -40,10 +40,14 @@ public:
|
||||||
return _shaderObjects[version].glprogram;
|
return _shaderObjects[version].glprogram;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLint getUniformLocation(GLint srcLoc, Version version = Mono) {
|
GLint getUniformLocation(GLint srcLoc, Version version = Mono) const {
|
||||||
// THIS will be used in the future PR as we grow the number of versions
|
// THIS will be used in the future PR as we grow the number of versions
|
||||||
return _uniformMappings[version][srcLoc];
|
const auto& mapping = _uniformMappings[version];
|
||||||
// return srcLoc;
|
auto found = mapping.find(srcLoc);
|
||||||
|
if (found == mapping.end()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return found->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::weak_ptr<GLBackend> _backend;
|
const std::weak_ptr<GLBackend> _backend;
|
||||||
|
|
Loading…
Reference in a new issue