summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-11-14 12:11:53 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-15 13:55:08 -0800
commit58877d1b3ddf0e4521d680b85e31b7a4c6287302 (patch)
treef844c8a12f82e40b1777ae79fe416c1eaa714470 /src/mbgl/gl/context.hpp
parent0fe8d8d7b4bbf136e8fb0f972cc31a94ddc4b67e (diff)
downloadqtlocation-mapboxgl-58877d1b3ddf0e4521d680b85e31b7a4c6287302.tar.gz
[core] Assign attribute locations sequentially
Two reasons to prefer explicit sequential location assignment, rather than relying on the GLSL linker to assign locations: * For data-driven properties, we want to have the option to use glDisableVertexAttribArray plus glVertexAttrib*. In order to use glDisableVertexAttribArray, we must avoid using attribute location 0, which cannot be disabled. * We want to use the same VAO in cases where, say, a fill layer might be rendered with FillProgram at first, and then FillPatternProgram later. VAOs do not store the program binding, only the attribute bindings, so as long as the two programs have the same attributes and attribute locations, only a single VAO (per segment) is needed.
Diffstat (limited to 'src/mbgl/gl/context.hpp')
-rw-r--r--src/mbgl/gl/context.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp
index 154921a1b9..33b7a555a8 100644
--- a/src/mbgl/gl/context.hpp
+++ b/src/mbgl/gl/context.hpp
@@ -38,6 +38,7 @@ public:
UniqueShader createShader(ShaderType type, const std::string& source);
UniqueProgram createProgram(ShaderID vertexShader, ShaderID fragmentShader);
+ void linkProgram(ProgramID);
UniqueTexture createTexture();
template <class Vertex, class DrawMode>