summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/program.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/program.hpp')
-rw-r--r--src/mbgl/gl/program.hpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mbgl/gl/program.hpp b/src/mbgl/gl/program.hpp
index 3b54ec194a..1a429c6630 100644
--- a/src/mbgl/gl/program.hpp
+++ b/src/mbgl/gl/program.hpp
@@ -34,17 +34,15 @@ public:
: program(
context.createProgram(context.createShader(ShaderType::Vertex, vertexSource),
context.createShader(ShaderType::Fragment, fragmentSource))),
- uniformsState((context.linkProgram(program), Uniforms::bindLocations(program))),
- attributeLocations(Attributes::bindLocations(program)) {
- // Re-link program after manually binding only active attributes in Attributes::bindLocations
- context.linkProgram(program);
+ attributeLocations(Attributes::bindLocations(program)),
+ uniformsState((context.linkProgram(program), Uniforms::bindLocations(program))) {
}
template <class BinaryProgram>
Program(Context& context, const BinaryProgram& binaryProgram)
: program(context.createProgram(binaryProgram.format(), binaryProgram.code())),
- uniformsState(Uniforms::loadNamedLocations(binaryProgram)),
- attributeLocations(Attributes::loadNamedLocations(binaryProgram)) {
+ attributeLocations(Attributes::loadNamedLocations(binaryProgram)),
+ uniformsState(Uniforms::loadNamedLocations(binaryProgram)) {
}
static Program createProgram(gl::Context& context,
@@ -142,8 +140,8 @@ public:
private:
UniqueProgram program;
- typename Uniforms::State uniformsState;
typename Attributes::Locations attributeLocations;
+ typename Uniforms::State uniformsState;
};
} // namespace gl