3#include "GeometryToBufferStrategies.hpp"
5#include <ossia/dataflow/geometry_port.hpp>
7#include <Threedim/Debug.hpp>
74[[nodiscard]]
constexpr int32_t attributeFormatSize(AttributeFormat fmt)
noexcept
76 return Threedim::attributeFormatSize((halp::attribute_format)fmt);
79[[nodiscard]]
constexpr halp::attribute_format toHalpFormat(AttributeFormat fmt)
noexcept
81 return static_cast<halp::attribute_format
>(fmt);
84[[nodiscard]]
constexpr halp::primitive_topology
85toHalpTopology(PrimitiveTopology t)
noexcept
89 case PrimitiveTopology::Triangles:
90 return halp::primitive_topology::triangles;
91 case PrimitiveTopology::TriangleStrip:
92 return halp::primitive_topology::triangle_strip;
93 case PrimitiveTopology::TriangleFan:
94 return halp::primitive_topology::triangle_fan;
95 case PrimitiveTopology::Lines:
96 return halp::primitive_topology::lines;
97 case PrimitiveTopology::LineStrip:
98 return halp::primitive_topology::line_strip;
99 case PrimitiveTopology::Points:
100 return halp::primitive_topology::points;
102 return halp::primitive_topology::triangles;
105[[nodiscard]]
constexpr halp::cull_mode toHalpCullMode(CullMode c)
noexcept
110 return halp::cull_mode::none;
111 case CullMode::Front:
112 return halp::cull_mode::front;
114 return halp::cull_mode::back;
116 return halp::cull_mode::none;
119[[nodiscard]]
constexpr halp::front_face toHalpFrontFace(FrontFace f)
noexcept
123 case FrontFace::CounterClockwise:
124 return halp::front_face::counter_clockwise;
125 case FrontFace::Clockwise:
126 return halp::front_face::clockwise;
128 return halp::front_face::counter_clockwise;
131[[nodiscard]]
constexpr halp::index_format toHalpIndexFormat(IndexFormat f)
noexcept
135 case IndexFormat::UInt16:
136 return halp::index_format::uint16;
137 case IndexFormat::UInt32:
138 return halp::index_format::uint32;
140 return halp::index_format::uint32;
143[[nodiscard]]
constexpr halp::binding_classification
144toHalpClassification(
bool instanced)
noexcept
146 return instanced ? halp::binding_classification::per_instance
147 : halp::binding_classification::per_vertex;
152[[nodiscard]]
inline int resolveSemanticFromName(
const std::string& name)
noexcept
155 return static_cast<int>(ossia::attribute_semantic::custom);
157 auto sem = ossia::name_to_semantic(name);
158 return static_cast<int>(sem);