Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Fix CI errors (hidden within #if block)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Apr 6, 2017
1 parent 926a9da commit 10e1fc1
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/mbgl/gl/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <mbgl/gl/attribute.hpp>
#include <mbgl/gl/uniform.hpp>

#include <mbgl/util/io.hpp>
#include <mbgl/programs/binary_program.hpp>
#include <mbgl/programs/program_parameters.hpp>
#include <mbgl/shaders/shaders.hpp>

Expand Down Expand Up @@ -45,28 +47,28 @@ class Program {
static Program createProgram(gl::Context& context,
const ProgramParameters& programParameters,
const char* name,
const char* vertexSource,
const char* fragmentSource) {
const char* vertexSource_,
const char* fragmentSource_) {
#if MBGL_HAS_BINARY_PROGRAMS
if (!programParameters.cacheDir.empty() && context.supportsProgramBinaries()) {
const std::string vertexSource =
shaders::vertexSource(programParameters, vertexSource);
shaders::vertexSource(programParameters, vertexSource_);
const std::string fragmentSource =
shaders::fragmentSource(programParameters, fragmentSource);
shaders::fragmentSource(programParameters, fragmentSource_);
const std::string cachePath =
shaders::programCachePath(programParameters, name);
const std::string identifier =
shaders::programIdentifier(vertexSource, fragmentSource);
shaders::programIdentifier(vertexSource, fragmentSource_);

try {
if (auto cachedBinaryProgram = util::readFile(cachePath)) {
const BinaryProgram binaryProgram(std::move(*cachedBinaryProgram));
if (binaryProgram.identifier() == identifier) {
return ProgramType{ context, binaryProgram };
return Program { context, binaryProgram };
} else {
Log::Warning(Event::OpenGL,
"Cached program %s changed. Recompilation required.",
Shaders::name);
name);
}
}
} catch (std::runtime_error& error) {
Expand All @@ -75,7 +77,7 @@ class Program {
}

// Compile the shader
ProgramType result{ context, vertexSource, fragmentSource };
Program result{ context, vertexSource, fragmentSource };

try {
if (const auto binaryProgram =
Expand All @@ -92,8 +94,8 @@ class Program {
#endif
(void)name;
return Program {
context, shaders::vertexSource(programParameters, vertexSource),
shaders::fragmentSource(programParameters, fragmentSource)
context, shaders::vertexSource(programParameters, vertexSource_),
shaders::fragmentSource(programParameters, fragmentSource_)
};
}

Expand Down

0 comments on commit 10e1fc1

Please sign in to comment.