[Bf-blender-cvs] [b95d647fb12] curve-nodes-modifier: Merge branch 'master' into curve-nodes-modifier
Hans Goudey
noreply at git.blender.org
Tue Jul 20 23:43:36 CEST 2021
Commit: b95d647fb125c2b54b96debb9800f8c62a8bf065
Author: Hans Goudey
Date: Tue Jul 20 16:47:51 2021 -0400
Branches: curve-nodes-modifier
https://developer.blender.org/rBb95d647fb125c2b54b96debb9800f8c62a8bf065
Merge branch 'master' into curve-nodes-modifier
===================================================================
===================================================================
diff --cc source/blender/draw/intern/draw_cache_impl_curve.cc
index 3501a9d191f,1efe0c080be..73db5e604da
--- a/source/blender/draw/intern/draw_cache_impl_curve.cc
+++ b/source/blender/draw/intern/draw_cache_impl_curve.cc
@@@ -595,20 -655,54 +595,20 @@@ static void curve_create_curves_lines(C
GPUIndexBufBuilder elb;
GPU_indexbuf_init_ex(&elb, GPU_PRIM_LINE_STRIP, index_len, vert_len);
- if (rdata->curve_eval != nullptr) {
- const CurveEval &curve_eval = *rdata->curve_eval;
- Span<SplinePtr> splines = curve_eval.splines();
- Array<int> offsets = curve_eval.evaluated_point_offsets();
- BLI_assert(offsets.last() == vert_len);
-
- for (const int i_spline : splines.index_range()) {
- const int eval_size = splines[i_spline]->evaluated_points_size();
- 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);
- }
- for (const int i_point : IndexRange(eval_size)) {
- GPU_indexbuf_add_generic_vert(&elb, offsets[i_spline] + i_point);
- }
- GPU_indexbuf_add_primitive_restart(&elb);
- }
- }
- else {
- BLI_assert(rdata->ob_curve_cache != nullptr);
+ const CurveEval &curve_eval = *rdata->curve_eval;
+ Span<SplinePtr> splines = curve_eval.splines();
+ Array<int> offsets = curve_eval.evaluated_point_offsets();
+ BLI_assert(offsets.last() == vert_len);
- int v_idx = 0;
- LISTBASE_FOREACH (const BevList *, bl, &rdata->ob_curve_cache->bev) {
- if (bl->nr <= 0) {
- continue;
- }
- const bool is_cyclic = bl->poly != -1;
- if (is_cyclic) {
- GPU_indexbuf_add_generic_vert(&elb, v_idx + (bl->nr - 1));
- }
- for (int i = 0; i < bl->nr; i++) {
- GPU_indexbuf_add_generic_vert(&elb, v_idx + i);
- }
- GPU_indexbuf_add_primitive_restart(&elb);
- v_idx += bl->nr;
+ for (const int i_spline : splines.index_range()) {
+ 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);
}
- LISTBASE_FOREACH (const DispList *, dl, &rdata->ob_curve_cache->disp) {
- if (ELEM(dl->type, DL_SEGM, DL_POLY)) {
- const bool is_cyclic = dl->type == DL_POLY;
- if (is_cyclic) {
- GPU_indexbuf_add_generic_vert(&elb, v_idx + (dl->nr - 1));
- }
- for (int i = 0; i < dl->nr; i++) {
- GPU_indexbuf_add_generic_vert(&elb, v_idx + i);
- }
- GPU_indexbuf_add_primitive_restart(&elb);
- v_idx += dl->nr;
- }
+ for (const int i_point : IndexRange(eval_size)) {
+ GPU_indexbuf_add_generic_vert(&elb, offsets[i_spline] + i_point);
}
+ GPU_indexbuf_add_primitive_restart(&elb);
}
GPU_indexbuf_build_in_place(&elb, ibo_curve_lines);
More information about the Bf-blender-cvs
mailing list