summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/segment.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-06 08:06:12 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-12 14:48:22 -0700
commit358b0305ae1f52b477ae145bcca4b7af242dd5c3 (patch)
treef5b1315e650079fce12130611896836e1c8cfa98 /src/mbgl/programs/segment.hpp
parentc61041b44cd9181641db2351f4657cc356300226 (diff)
downloadqtlocation-mapboxgl-358b0305ae1f52b477ae145bcca4b7af242dd5c3.tar.gz
[core] Per-segment-per-layer vertex arrays
Reduces rebinding, matches gl-js, and works around the buggy VAO implementation on PowerVR SGX544 GPUs.
Diffstat (limited to 'src/mbgl/programs/segment.hpp')
-rw-r--r--src/mbgl/programs/segment.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mbgl/programs/segment.hpp b/src/mbgl/programs/segment.hpp
index d8cc9679d7..74bf4a75c5 100644
--- a/src/mbgl/programs/segment.hpp
+++ b/src/mbgl/programs/segment.hpp
@@ -28,7 +28,14 @@ public:
std::size_t vertexLength;
std::size_t indexLength;
- mutable optional<gl::VertexArray> vertexArray;
+ // One VertexArray per layer ID. This minimizes rebinding in cases where
+ // several layers share buckets but have different sets of active attributes.
+ // This can happen:
+ // * when two layers have the same layout properties, but differing
+ // data-driven paint properties
+ // * when two fill layers have the same layout properties, but one
+ // uses fill-color and the other uses fill-pattern
+ mutable std::map<std::string, optional<gl::VertexArray>> vertexArrays;
};
template <class Attributes>