mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +02:00
Merge pull request #9134 from samcake/blue
Fix a bug when using the gpu::Batch::_glUniform*() calls with a bad location
This commit is contained in:
commit
e0bcbb08ff
1 changed files with 8 additions and 4 deletions
|
@ -40,10 +40,14 @@ public:
|
|||
return _shaderObjects[version].glprogram;
|
||||
}
|
||||
|
||||
GLint getUniformLocation(GLint srcLoc, Version version = Mono) {
|
||||
// THIS will be used in the future PR as we grow the number of versions
|
||||
return _uniformMappings[version][srcLoc];
|
||||
// return srcLoc;
|
||||
GLint getUniformLocation(GLint srcLoc, Version version = Mono) const {
|
||||
// This check protect against potential invalid src location for this shader, if unknown then return -1.
|
||||
const auto& mapping = _uniformMappings[version];
|
||||
auto found = mapping.find(srcLoc);
|
||||
if (found == mapping.end()) {
|
||||
return -1;
|
||||
}
|
||||
return found->second;
|
||||
}
|
||||
|
||||
const std::weak_ptr<GLBackend> _backend;
|
||||
|
|
Loading…
Reference in a new issue