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-17 09:19:02 -0700
commit550da70cf78e700deea4d298e90afe134fda27e2 (patch)
treed4001477fe3f52a1cb2e1562f7513abf27f11342
parent902d9442da0f2f2c74530a4b770c9ff05f5d4d1e (diff)
downloadqtlocation-mapboxgl-550da70cf78e700deea4d298e90afe134fda27e2.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>