diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-07-11 14:11:59 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-07-12 14:55:02 -0700 |
commit | c0d6a07a8e44c69267c2df98278d54c055c06ca4 (patch) | |
tree | 99303c0100de4d066a51995185fea741878e4bfa | |
parent | 86ee821c6e8e6e68a984c65492523fdf94425ea7 (diff) | |
download | qtlocation-mapboxgl-c0d6a07a8e44c69267c2df98278d54c055c06ca4.tar.gz |
[core] Pass correct sources to programIdentifier
-rw-r--r-- | src/mbgl/gl/program.hpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/mbgl/gl/program.hpp b/src/mbgl/gl/program.hpp index 9d8b0a5b04..3b54ec194a 100644 --- a/src/mbgl/gl/program.hpp +++ b/src/mbgl/gl/program.hpp @@ -52,15 +52,13 @@ public: const char* name, const char* vertexSource_, const char* fragmentSource_) { + const std::string vertexSource = shaders::vertexSource(programParameters, vertexSource_); + const std::string fragmentSource = shaders::fragmentSource(programParameters, fragmentSource_); + #if MBGL_HAS_BINARY_PROGRAMS optional<std::string> cachePath = programParameters.cachePath(name); if (cachePath && context.supportsProgramBinaries()) { - const std::string vertexSource = - shaders::vertexSource(programParameters, vertexSource_); - const std::string fragmentSource = - shaders::fragmentSource(programParameters, fragmentSource_); - const std::string identifier = - shaders::programIdentifier(vertexSource, fragmentSource_); + const std::string identifier = shaders::programIdentifier(vertexSource, fragmentSource); try { if (auto cachedBinaryProgram = util::readFile(*cachePath)) { @@ -94,11 +92,9 @@ public: return std::move(result); } #endif + (void)name; - return Program { - context, shaders::vertexSource(programParameters, vertexSource_), - shaders::fragmentSource(programParameters, fragmentSource_) - }; + return Program { context, vertexSource, fragmentSource }; } template <class BinaryProgram> |