diff --git a/libraries/gpu-gl/src/gpu/gl/GLShader.h b/libraries/gpu-gl/src/gpu/gl/GLShader.h index 40dd0b7be9..07a17f458d 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLShader.h +++ b/libraries/gpu-gl/src/gpu/gl/GLShader.h @@ -40,10 +40,14 @@ public: 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 - return _uniformMappings[version][srcLoc]; - // return srcLoc; + const auto& mapping = _uniformMappings[version]; + auto found = mapping.find(srcLoc); + if (found == mapping.end()) { + return -1; + } + return found->second; } const std::weak_ptr _backend;