summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/program.hpp
diff options
context:
space:
mode:
authorRandall Lee <randall.lee@mapbox.com>2018-05-22 14:09:36 -0400
committerGitHub <noreply@github.com>2018-05-22 14:09:36 -0400
commitd858cb783b499a1cc77b48a0faee137ca5e6a423 (patch)
tree5c36c353730e3050d44e472545519c0429723266 /src/mbgl/programs/program.hpp
parentf93d722458be62d567aa152711a014ef51a90193 (diff)
parent60505b03174b5ec02ae723beafa7683f6ed54a62 (diff)
downloadqtlocation-mapboxgl-upstream/rclee-async-setup.tar.gz
Merge branch 'master' into rclee-async-setupupstream/rclee-async-setup
Diffstat (limited to 'src/mbgl/programs/program.hpp')
-rw-r--r--src/mbgl/programs/program.hpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp
index bcdb270b9c..4d5de05337 100644
--- a/src/mbgl/programs/program.hpp
+++ b/src/mbgl/programs/program.hpp
@@ -46,26 +46,38 @@ public:
Shaders::fragmentSource)) {
}
+ static typename AllUniforms::Values computeAllUniformValues(
+ const UniformValues& uniformValues,
+ const PaintPropertyBinders& paintPropertyBinders,
+ const typename PaintProperties::PossiblyEvaluated& currentProperties,
+ float currentZoom) {
+ return uniformValues
+ .concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties));
+ }
+
+ static typename Attributes::Bindings computeAllAttributeBindings(
+ const gl::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
+ const PaintPropertyBinders& paintPropertyBinders,
+ const typename PaintProperties::PossiblyEvaluated& currentProperties) {
+ return LayoutAttributes::bindings(layoutVertexBuffer)
+ .concat(paintPropertyBinders.attributeBindings(currentProperties));
+ }
+
+ static uint32_t activeBindingCount(const typename Attributes::Bindings& allAttributeBindings) {
+ return Attributes::activeBindingCount(allAttributeBindings);
+ }
+
template <class DrawMode>
void draw(gl::Context& context,
DrawMode drawMode,
gl::DepthMode depthMode,
gl::StencilMode stencilMode,
gl::ColorMode colorMode,
- const UniformValues& uniformValues,
- const gl::VertexBuffer<LayoutVertex>& layoutVertexBuffer,
const gl::IndexBuffer<DrawMode>& indexBuffer,
const SegmentVector<Attributes>& segments,
- const PaintPropertyBinders& paintPropertyBinders,
- const typename PaintProperties::PossiblyEvaluated& currentProperties,
- float currentZoom,
+ const typename AllUniforms::Values& allUniformValues,
+ const typename Attributes::Bindings& allAttributeBindings,
const std::string& layerID) {
- typename AllUniforms::Values allUniformValues = uniformValues
- .concat(paintPropertyBinders.uniformValues(currentZoom, currentProperties));
-
- typename Attributes::Bindings allAttributeBindings = LayoutAttributes::bindings(layoutVertexBuffer)
- .concat(paintPropertyBinders.attributeBindings(currentProperties));
-
for (auto& segment : segments) {
auto vertexArrayIt = segment.vertexArrays.find(layerID);