Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_curve.cc
| Show First 20 Lines • Show All 657 Lines • ▼ Show 20 Lines | static void curve_create_curves_lines(CurveRenderData *rdata, GPUIndexBuf *ibo_curve_lines) | ||||
| if (rdata->curve_eval != nullptr) { | if (rdata->curve_eval != nullptr) { | ||||
| const CurveEval &curve_eval = *rdata->curve_eval; | const CurveEval &curve_eval = *rdata->curve_eval; | ||||
| Span<SplinePtr> splines = curve_eval.splines(); | Span<SplinePtr> splines = curve_eval.splines(); | ||||
| Array<int> offsets = curve_eval.evaluated_point_offsets(); | Array<int> offsets = curve_eval.evaluated_point_offsets(); | ||||
| BLI_assert(offsets.last() == vert_len); | BLI_assert(offsets.last() == vert_len); | ||||
| for (const int i_spline : splines.index_range()) { | for (const int i_spline : splines.index_range()) { | ||||
| const int eval_size = splines[i_spline]->evaluated_points_size(); | const int eval_size = splines[i_spline]->evaluated_points_size(); | ||||
| if (splines[i_spline]->is_cyclic()) { | if (splines[i_spline]->is_cyclic() && splines[i_spline]->evaluated_edges_size() > 1) { | ||||
| GPU_indexbuf_add_generic_vert(&elb, offsets[i_spline] + eval_size - 1); | GPU_indexbuf_add_generic_vert(&elb, offsets[i_spline] + eval_size - 1); | ||||
| } | } | ||||
| for (const int i_point : IndexRange(eval_size)) { | for (const int i_point : IndexRange(eval_size)) { | ||||
| GPU_indexbuf_add_generic_vert(&elb, offsets[i_spline] + i_point); | GPU_indexbuf_add_generic_vert(&elb, offsets[i_spline] + i_point); | ||||
| } | } | ||||
| GPU_indexbuf_add_primitive_restart(&elb); | GPU_indexbuf_add_primitive_restart(&elb); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 540 Lines • Show Last 20 Lines | |||||