48#define ACTIVE_NURB (1 << 2)
49#define BEZIER_HANDLE (1 << 3)
50#define EVEN_U_BIT (1 << 4)
81 vert_len += nu->pntsu * 3;
83 edge_len += 2 * nu->pntsu;
86 vert_len += nu->pntsu * nu->pntsv;
88 edge_len += (nu->pntsu - 1) * nu->pntsv;
89 edge_len += (nu->pntsv - 1) * nu->pntsu;
93 *r_vert_len = vert_len;
96 *r_edge_len = edge_len;
105 const OffsetIndices points_by_curve = curves.evaluated_points_by_curve();
108 *r_curve_len = curves.curves_num();
111 for (
const int i : curves.curves_range()) {
125 int skip = nu->
resolu / 16;
133 normal_len += (nr / (skip + 1)) + ((nr % (skip + 1)) != 0);
224 nurbs = &editnurb->
nurbs;
241 rdata->
nurbs = nurbs;
251 if (rdata->loose_verts) {
337 if (cache ==
nullptr) {
367 memset(cache, 0,
sizeof(*cache));
374 nurbs = &editnurb->
nurbs;
402 if (cache ==
nullptr) {
427 for (
int i = 0; i <
sizeof(cache->
ordered) /
sizeof(
void *); i++) {
431 for (
int i = 0; i <
sizeof(cache->
edit) /
sizeof(
void *); i++) {
435 for (
int i = 0; i <
sizeof(cache->
ibo) /
sizeof(
void *); i++) {
439 for (
int i = 0; i <
sizeof(cache->
batch) /
sizeof(
void *); i++) {
440 gpu::Batch **
batch = (gpu::Batch **)&cache->
batch;
466 if (
format.attr_len == 0) {
475 const Span<float3> positions = curves.evaluated_positions();
486 if (
format.attr_len == 0) {
495 curves.ensure_can_interpolate_to_evaluated();
511 const int index_len = edge_len + curve_len * 2;
517 const OffsetIndices points_by_curve = curves.evaluated_points_by_curve();
520 for (
const int i : curves.curves_range()) {
522 if (cyclic[i] && points.size() > 1) {
525 for (
const int i_point : points) {
545 uint pos_hq, nor_hq, tan_hq, rad_hq;
547 if (
format.attr_len == 0) {
567 int vbo_len_used = 0;
587 int skip = nu->
resolu / 16;
590 float nor[3] = {1.0f, 0.0f, 0.0f};
612 BLI_assert(vbo_len_used == verts_len_capacity);
621 const bool handle_selected)
668 int vbo_len_used = 0;
670#define DRW_TEST_ASSIGN_VBO(v) (v = (DRW_vbo_requested(v) ? (v) : nullptr))
671#define DRW_TEST_ASSIGN_IBO(v) (v = (DRW_ibo_requested(v) ? (v) : nullptr))
685 elbp_verts = &elb_verts;
689 elbp_lines = &elb_lines;
693#undef DRW_TEST_ASSIGN_VBO
694#undef DRW_TEST_ASSIGN_IBO
699 const BPoint *bp = nu->bp;
702 for (
int a = 0; a < nu->pntsu; a++, bezt++) {
703 if (bezt->
hide != 0) {
723 for (
int j = 0; j < 3; j++) {
728 for (
int j = 0; j < 3; j++) {
736 int pt_len = nu->pntsu * nu->pntsv;
737 for (
int a = 0; a < pt_len; a++, bp++, vbo_len_used += 1) {
741 int u = (a % nu->pntsu);
742 int v = (a / nu->pntsu);
749 const BPoint *bp_next_u = (u < (nu->pntsu - 1)) ? &nu->bp[a + 1] :
nullptr;
750 const BPoint *bp_next_v = (
v < (nu->pntsv - 1)) ? &nu->bp[a + nu->pntsu] :
nullptr;
751 if (bp_next_u && (bp_next_u->
hide ==
false)) {
754 if (bp_next_v && (bp_next_v->
hide ==
false)) {
770 if (elbp_verts !=
nullptr) {
773 if (elbp_lines !=
nullptr) {
776 if (vbo_len_used != verts_len_capacity) {
777 if (vbo_pos !=
nullptr) {
780 if (vbo_data !=
nullptr) {
866#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
883#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
884 printf(
" mr_flag %d\n\n", mr_flag);
913 for (
int i = 0; i <
sizeof(cache->
batch) /
sizeof(
void *); i++) {
@ BKE_CURVE_BATCH_DIRTY_SELECT
@ BKE_CURVE_BATCH_DIRTY_ALL
Low-level operations for curves.
display list (or rather multi purpose list) stuff.
#define LISTBASE_FOREACH(type, var, list)
MINLINE int max_ii(int a, int b)
void mul_qt_v3(const float q[4], float r[3])
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BEZT_ISSEL_ANY(bezt)
#define GPU_BATCH_DISCARD_SAFE(batch)
bool GPU_use_hq_normals_workaround()
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
void GPU_indexbuf_add_primitive_restart(GPUIndexBufBuilder *)
void GPU_indexbuf_add_point_vert(GPUIndexBufBuilder *, uint v)
void GPU_indexbuf_add_line_verts(GPUIndexBufBuilder *, uint v1, uint v2)
void GPU_indexbuf_add_generic_vert(GPUIndexBufBuilder *, uint v)
void GPU_indexbuf_build_in_place(GPUIndexBufBuilder *, blender::gpu::IndexBuf *)
void GPU_indexbuf_init_ex(GPUIndexBufBuilder *, GPUPrimType, uint index_len, uint vertex_len)
void GPU_vertbuf_data_resize(blender::gpu::VertBuf &verts, uint v_len)
void GPU_vertbuf_attr_fill(blender::gpu::VertBuf *, uint a_idx, const void *data)
void GPU_vertbuf_attr_set(blender::gpu::VertBuf *, uint a_idx, uint v_idx, const void *data)
#define GPU_vertbuf_init_with_format(verts, format)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
#define DRW_TEST_ASSIGN_VBO(v)
#define DRW_TEST_ASSIGN_IBO(v)
bool DRW_batch_requested(blender::gpu::Batch *batch, GPUPrimType prim_type)
#define DRW_ADD_FLAG_FROM_IBO_REQUEST(flag, ibo, value)
#define DRW_ADD_FLAG_FROM_VBO_REQUEST(flag, vbo, value)
blender::gpu::Batch * DRW_batch_request(blender::gpu::Batch **batch)
void DRW_vbo_request(blender::gpu::Batch *batch, blender::gpu::VertBuf **vbo)
bool DRW_vbo_requested(blender::gpu::VertBuf *vbo)
void DRW_ibo_request(blender::gpu::Batch *batch, blender::gpu::IndexBuf **ibo)
bool DRW_ibo_requested(blender::gpu::IndexBuf *ibo)
struct @620::@623 attr_id
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
int segments_num(const int points_num, const bool cyclic)
static void curve_batch_cache_init(Curve *cu)
@ CU_DATATYPE_TEXT_SELECT
static void curve_create_curves_lines(CurveRenderData *rdata, gpu::IndexBuf *ibo_curve_lines)
static uint8_t beztriple_vflag_get(CurveRenderData *rdata, uint8_t flag, uint8_t col_id, int v_idx, int nu_id, bool handle_point, const bool handle_selected)
blender::gpu::Batch * DRW_curve_batch_cache_get_wire_edge(Curve *cu)
blender::gpu::Batch * DRW_curve_batch_cache_get_edit_verts(Curve *cu)
static int curve_render_data_wire_verts_len_get(const CurveRenderData *rdata)
static int curve_render_data_normal_len_get(const CurveRenderData *rdata)
blender::gpu::Batch * DRW_curve_batch_cache_get_edit_edges(Curve *cu)
void DRW_curve_batch_cache_validate(Curve *cu)
static void curve_create_curves_pos(CurveRenderData *rdata, gpu::VertBuf *vbo_curves_pos)
void DRW_curve_batch_cache_create_requested(Object *ob, const Scene *scene)
@ VFLAG_VERT_SELECTED_BEZT_HANDLE
static int curve_render_data_overlay_edges_len_get(const CurveRenderData *rdata)
blender::gpu::Batch * DRW_curve_batch_cache_get_normal_edge(Curve *cu)
static void curve_render_overlay_verts_edges_len_get(ListBase *lb, int *r_vert_len, int *r_edge_len)
static int curve_render_data_overlay_verts_len_get(const CurveRenderData *rdata)
static void curve_batch_cache_clear(Curve *cu)
void DRW_curve_batch_cache_free(Curve *cu)
int DRW_curve_material_count_get(const Curve *cu)
static CurveRenderData * curve_render_data_create(Curve *cu, CurveCache *ob_curve_cache, const int types)
static void curve_create_edit_data_and_handles(CurveRenderData *rdata, gpu::VertBuf *vbo_pos, gpu::VertBuf *vbo_data, gpu::IndexBuf *ibo_edit_verts_points, gpu::IndexBuf *ibo_edit_lines)
static void curve_render_data_free(CurveRenderData *rdata)
static void curve_create_edit_curves_nor(CurveRenderData *rdata, gpu::VertBuf &vbo_curves_nor, const Scene *scene)
static void curve_eval_render_wire_verts_edges_len_get(const bke::CurvesGeometry &curves, int *r_curve_len, int *r_vert_len, int *r_edge_len)
static CurveBatchCache * curve_batch_cache_get(Curve *cu)
static int curve_render_data_wire_edges_len_get(const CurveRenderData *rdata)
static void curve_create_attribute(CurveRenderData *rdata, gpu::VertBuf &vbo_attr)
static bool curve_batch_cache_valid(Curve *cu)
static uint8_t bpoint_vflag_get(CurveRenderData *rdata, uint8_t flag, int v_idx, int nu_id, int u)
static int curve_render_data_wire_curve_len_get(const CurveRenderData *rdata)
blender::gpu::Batch * DRW_curve_batch_cache_get_wire_edge_viewer_attribute(Curve *cu)
static int curve_render_normal_len_get(const ListBase *lb, const CurveCache *ob_curve_cache)
void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode)
T tan(const AngleRadianBase< T > &a)
Frequency::GEOMETRY nor[]
const struct Curves * curve_eval
struct EditFont * editfont
ObjectRuntimeHandle * runtime
gpu::IndexBuf * curves_lines
gpu::VertBuf * curves_pos
gpu::Batch * edit_normals
gpu::IndexBuf * edit_lines
struct blender::draw::CurveBatchCache::@258 edit
gpu::VertBuf * attr_viewer
gpu::VertBuf * curves_nor
struct blender::draw::CurveBatchCache::@260 batch
struct blender::draw::CurveBatchCache::@259 ibo
struct blender::draw::CurveBatchCache::@257 ordered
gpu::IndexBuf * edit_verts
gpu::Batch * curves_viewer_attribute
struct blender::draw::CurveRenderData::@254 wire
CurveCache * ob_curve_cache
struct blender::draw::CurveRenderData::@253 overlay
struct blender::draw::CurveRenderData::@256 text
const Curves * curve_eval
struct blender::draw::CurveRenderData::@255 normal