diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-13 16:45:12 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-14 11:14:05 -0700 |
commit | f3bb99f9195c28cff5bb9029c752871a21e96f12 (patch) | |
tree | e758995b092be40c67fc387e10f8a73da8df8257 /src/mbgl/programs | |
parent | 7a3f7980b056754b336ac22c43fb6289fa64d4e1 (diff) | |
download | qtlocation-mapboxgl-f3bb99f9195c28cff5bb9029c752871a21e96f12.tar.gz |
[core] Eliminate constant attribute bindings
Rather than binding constant attributes that will never be used, just disable the attribute.
Diffstat (limited to 'src/mbgl/programs')
-rw-r--r-- | src/mbgl/programs/program.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/programs/symbol_program.hpp | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index 36bbdf349e..3a38f30a86 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -66,7 +66,7 @@ public: std::move(colorMode), uniformValues .concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties)), - LayoutAttributes::allVariableBindings(layoutVertexBuffer) + LayoutAttributes::bindings(layoutVertexBuffer) .concat(paintPropertyBinders.attributeBindings(currentProperties)), indexBuffer, segments diff --git a/src/mbgl/programs/symbol_program.hpp b/src/mbgl/programs/symbol_program.hpp index 4cde5695e6..e7c428034b 100644 --- a/src/mbgl/programs/symbol_program.hpp +++ b/src/mbgl/programs/symbol_program.hpp @@ -156,8 +156,9 @@ public: } SymbolSizeAttributes::Bindings attributeBindings() const override { - return SymbolSizeAttributes::Bindings { SymbolSizeAttributes::Attribute::ConstantBinding {{{0, 0, 0}}} }; + return SymbolSizeAttributes::Bindings { gl::DisabledAttribute() }; } + void upload(gl::Context&) override {} void populateVertexVector(const GeometryTileFeature&) override {}; @@ -210,9 +211,9 @@ public: } SymbolSizeAttributes::Bindings attributeBindings() const override { - return SymbolSizeAttributes::Bindings { SymbolSizeAttributes::Attribute::variableBinding(*buffer, 0, 1) }; + return SymbolSizeAttributes::Bindings { SymbolSizeAttributes::Attribute::binding(*buffer, 0, 1) }; } - + void populateVertexVector(const GeometryTileFeature& feature) override { const auto sizeVertex = Vertex { {{ @@ -263,7 +264,7 @@ public: {} SymbolSizeAttributes::Bindings attributeBindings() const override { - return SymbolSizeAttributes::Bindings { SymbolSizeAttributes::Attribute::variableBinding(*buffer, 0) }; + return SymbolSizeAttributes::Bindings { SymbolSizeAttributes::Attribute::binding(*buffer, 0) }; } void populateVertexVector(const GeometryTileFeature& feature) override { @@ -368,7 +369,7 @@ public: uniformValues .concat(symbolSizeBinder.uniformValues(currentZoom)) .concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties)), - LayoutAttributes::allVariableBindings(layoutVertexBuffer) + LayoutAttributes::bindings(layoutVertexBuffer) .concat(symbolSizeBinder.attributeBindings()) .concat(paintPropertyBinders.attributeBindings(currentProperties)), indexBuffer, |