diff options
Diffstat (limited to 'src/mbgl/renderer/paint_property_binder.hpp')
-rw-r--r-- | src/mbgl/renderer/paint_property_binder.hpp | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp index aade672ae7..7773e79314 100644 --- a/src/mbgl/renderer/paint_property_binder.hpp +++ b/src/mbgl/renderer/paint_property_binder.hpp @@ -273,100 +273,4 @@ struct InterpolationUniform : gl::UniformScalar<InterpolationUniform<Attr>, floa } }; -template <class Ps> -class PaintPropertyBinders; - -template <class... Ps> -class PaintPropertyBinders<TypeList<Ps...>> { -public: - template <class P> - using Binder = PaintPropertyBinder<typename P::Type, typename P::Attribute::Type>; - - using Binders = IndexedTuple< - TypeList<Ps...>, - TypeList<std::unique_ptr<Binder<Ps>>...>>; - - template <class EvaluatedProperties> - PaintPropertyBinders(const EvaluatedProperties& properties, float z) - : binders(Binder<Ps>::create(properties.template get<Ps>(), z, Ps::defaultValue())...) { - (void)z; // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56958 - } - - PaintPropertyBinders(PaintPropertyBinders&&) = default; - PaintPropertyBinders(const PaintPropertyBinders&) = delete; - - void populateVertexVectors(const GeometryTileFeature& feature, std::size_t length) { - util::ignore({ - (binders.template get<Ps>()->populateVertexVector(feature, length), 0)... - }); - } - - void upload(gl::Context& context) { - util::ignore({ - (binders.template get<Ps>()->upload(context), 0)... - }); - } - - template <class P> - using Attribute = ZoomInterpolatedAttribute<typename P::Attribute>; - - using Attributes = gl::Attributes<Attribute<Ps>...>; - using AttributeBindings = typename Attributes::Bindings; - - template <class EvaluatedProperties> - AttributeBindings attributeBindings(const EvaluatedProperties& currentProperties) const { - return AttributeBindings { - binders.template get<Ps>()->attributeBinding(currentProperties.template get<Ps>())... - }; - } - - using Uniforms = gl::Uniforms<InterpolationUniform<typename Ps::Attribute>..., typename Ps::Uniform...>; - using UniformValues = typename Uniforms::Values; - - template <class EvaluatedProperties> - UniformValues uniformValues(float currentZoom, const EvaluatedProperties& currentProperties) const { - (void)currentZoom; // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56958 - return UniformValues { - typename InterpolationUniform<typename Ps::Attribute>::Value { - binders.template get<Ps>()->interpolationFactor(currentZoom) - }..., - typename Ps::Uniform::Value { - binders.template get<Ps>()->uniformValue(currentProperties.template get<Ps>()) - }... - }; - } - - template <class P> - const auto& statistics() const { - return binders.template get<P>()->statistics; - } - - - using Bitset = std::bitset<sizeof...(Ps)>; - - template <class EvaluatedProperties> - static Bitset constants(const EvaluatedProperties& currentProperties) { - Bitset result; - util::ignore({ - result.set(TypeIndex<Ps, Ps...>::value, - currentProperties.template get<Ps>().isConstant())... - }); - return result; - } - - template <class EvaluatedProperties> - static std::vector<std::string> defines(const EvaluatedProperties& currentProperties) { - std::vector<std::string> result; - util::ignore({ - (result.push_back(currentProperties.template get<Ps>().isConstant() - ? std::string("#define HAS_UNIFORM_") + Ps::Uniform::name() - : std::string()), 0)... - }); - return result; - } - -private: - Binders binders; -}; - } // namespace mbgl |