Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_curves.cc
| Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | |||||
| static void curves_batch_cache_ensure_data_edit_points(const Curves &curves_id, | static void curves_batch_cache_ensure_data_edit_points(const Curves &curves_id, | ||||
| CurvesEvalCache &cache) | CurvesEvalCache &cache) | ||||
| { | { | ||||
| using namespace blender; | using namespace blender; | ||||
| const bke::CurvesGeometry &curves = bke::CurvesGeometry::wrap(curves_id.geometry); | const bke::CurvesGeometry &curves = bke::CurvesGeometry::wrap(curves_id.geometry); | ||||
| static GPUVertFormat format_data = {0}; | static GPUVertFormat format_data = {0}; | ||||
| uint data = GPU_vertformat_attr_add(&format_data, "data", GPU_COMP_U8, 1, GPU_FETCH_INT); | static uint data; | ||||
| if (format_data.attr_len == 0) { | |||||
| data = GPU_vertformat_attr_add(&format_data, "data", GPU_COMP_U8, 1, GPU_FETCH_INT); | |||||
| } | |||||
| GPU_vertbuf_init_with_format(cache.data_edit_points, &format_data); | GPU_vertbuf_init_with_format(cache.data_edit_points, &format_data); | ||||
| GPU_vertbuf_data_alloc(cache.data_edit_points, curves.points_num()); | GPU_vertbuf_data_alloc(cache.data_edit_points, curves.points_num()); | ||||
| VArray<float> selection; | VArray<float> selection; | ||||
| switch (curves_id.selection_domain) { | switch (curves_id.selection_domain) { | ||||
| case ATTR_DOMAIN_POINT: | case ATTR_DOMAIN_POINT: | ||||
| selection = curves.selection_point_float(); | selection = curves.selection_point_float(); | ||||
| for (const int point_i : selection.index_range()) { | for (const int point_i : selection.index_range()) { | ||||
| ▲ Show 20 Lines • Show All 397 Lines • Show Last 20 Lines | |||||