diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-02-28 14:28:58 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-01 09:33:37 +0100 |
commit | 95deab32ceadd2bca3912d866e76c6b0f1b931f4 (patch) | |
tree | 09a2178cd034d67370cd9b9bc62312fd45f5af0d /src/mbgl/programs/program.hpp | |
parent | 3f1d754369fe0a12f924c3dd47ad028c98b8e3b7 (diff) | |
download | qtlocation-mapboxgl-95deab32ceadd2bca3912d866e76c6b0f1b931f4.tar.gz |
[core] extract attribute structs and gl::Vertex to separate namespace
Diffstat (limited to 'src/mbgl/programs/program.hpp')
-rw-r--r-- | src/mbgl/programs/program.hpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index 30d226854f..429937dd7d 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -7,6 +7,7 @@ #include <mbgl/programs/attributes.hpp> #include <mbgl/programs/program_parameters.hpp> #include <mbgl/style/paint_property.hpp> +#include <mbgl/renderer/paint_property_binder.hpp> #include <mbgl/shaders/shaders.hpp> #include <mbgl/util/io.hpp> @@ -16,22 +17,22 @@ namespace mbgl { template <class Shaders, class Primitive, - class LayoutAttrs, - class UniformTypeList, + class LayoutAttributeList, + class UniformList, class PaintProps> class Program { public: - using LayoutAttributes = LayoutAttrs; - using LayoutVertex = typename LayoutAttributes::Vertex; + using LayoutAttributes = gl::Attributes<LayoutAttributeList>; + using LayoutVertex = gfx::Vertex<LayoutAttributeList>; using PaintProperties = PaintProps; - using PaintPropertyBinders = typename PaintProperties::Binders; - using PaintAttributes = typename PaintPropertyBinders::Attributes; - using Attributes = gl::ConcatenateAttributes<LayoutAttributes, PaintAttributes>; + using Binders = PaintPropertyBinders<typename PaintProperties::DataDrivenProperties>; + using PaintAttributeList = typename Binders::AttributeList; + using Attributes = gl::Attributes<TypeListConcat<LayoutAttributeList, PaintAttributeList>>; - using UniformValues = gfx::UniformValues<UniformTypeList>; - using PaintUniformTypeList = typename PaintPropertyBinders::UniformTypeList; - using AllUniforms = typename TypeListConcat<UniformTypeList, PaintUniformTypeList>::template ExpandInto<gl::Uniforms>; + using UniformValues = gfx::UniformValues<UniformList>; + using PaintUniformList = typename Binders::UniformList; + using AllUniforms = gl::Uniforms<TypeListConcat<UniformList, PaintUniformList>>; using ProgramType = gl::Program<Primitive, Attributes, AllUniforms>; @@ -48,7 +49,7 @@ public: static typename AllUniforms::Values computeAllUniformValues( const UniformValues& uniformValues, - const PaintPropertyBinders& paintPropertyBinders, + const Binders& paintPropertyBinders, const typename PaintProperties::PossiblyEvaluated& currentProperties, float currentZoom) { return uniformValues @@ -57,7 +58,7 @@ public: static typename Attributes::Bindings computeAllAttributeBindings( const gl::VertexBuffer<LayoutVertex>& layoutVertexBuffer, - const PaintPropertyBinders& paintPropertyBinders, + const Binders& paintPropertyBinders, const typename PaintProperties::PossiblyEvaluated& currentProperties) { return LayoutAttributes::bindings(layoutVertexBuffer) .concat(paintPropertyBinders.attributeBindings(currentProperties)); @@ -107,8 +108,8 @@ template <class Program> class ProgramMap { public: using PaintProperties = typename Program::PaintProperties; - using PaintPropertyBinders = typename Program::PaintPropertyBinders; - using Bitset = typename PaintPropertyBinders::Bitset; + using Binders = typename Program::Binders; + using Bitset = typename Binders::Bitset; ProgramMap(gl::Context& context_, ProgramParameters parameters_) : context(context_), @@ -116,7 +117,7 @@ public: } Program& get(const typename PaintProperties::PossiblyEvaluated& currentProperties) { - Bitset bits = PaintPropertyBinders::constants(currentProperties); + Bitset bits = Binders::constants(currentProperties); auto it = programs.find(bits); if (it != programs.end()) { return it->second; @@ -124,7 +125,7 @@ public: return programs.emplace(std::piecewise_construct, std::forward_as_tuple(bits), std::forward_as_tuple(context, - parameters.withAdditionalDefines(PaintPropertyBinders::defines(currentProperties)))).first->second; + parameters.withAdditionalDefines(Binders::defines(currentProperties)))).first->second; } private: |