summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-11 14:11:59 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-12 14:55:02 -0700
commitc0d6a07a8e44c69267c2df98278d54c055c06ca4 (patch)
tree99303c0100de4d066a51995185fea741878e4bfa
parent86ee821c6e8e6e68a984c65492523fdf94425ea7 (diff)
downloadqtlocation-mapboxgl-c0d6a07a8e44c69267c2df98278d54c055c06ca4.tar.gz
[core] Pass correct sources to programIdentifier
-rw-r--r--src/mbgl/gl/program.hpp16
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>