47#define ACTIVE_NURB (1 << 2)
48#define BEZIER_HANDLE (1 << 3)
49#define EVEN_U_BIT (1 << 4)
80 vert_len += nu->pntsu * 3;
82 edge_len += 2 * nu->pntsu;
85 vert_len += nu->pntsu * nu->pntsv;
87 edge_len += (nu->pntsu - 1) * nu->pntsv;
88 edge_len += (nu->pntsv - 1) * nu->pntsu;
92 *r_vert_len = vert_len;
95 *r_edge_len = edge_len;
124 int skip = nu->
resolu / 16;
132 normal_len += (nr / (skip + 1)) + ((nr % (skip + 1)) != 0);
223 nurbs = &editnurb->
nurbs;
240 rdata->
nurbs = nurbs;
250 if (rdata->loose_verts) {
336 if (cache ==
nullptr) {
366 memset(cache, 0,
sizeof(*cache));
373 nurbs = &editnurb->
nurbs;
401 if (cache ==
nullptr) {
426 for (
int i = 0;
i <
sizeof(cache->
ordered) /
sizeof(
void *);
i++) {
430 for (
int i = 0;
i <
sizeof(cache->
edit) /
sizeof(
void *);
i++) {
434 for (
int i = 0;
i <
sizeof(cache->
ibo) /
sizeof(
void *);
i++) {
438 for (
int i = 0;
i <
sizeof(cache->
batch) /
sizeof(
void *);
i++) {
439 gpu::Batch **
batch = (gpu::Batch **)&cache->
batch;
513 const int index_len = edge_len + curve_len * 2;
524 if (cyclic[
i] && points.
size() > 1) {
527 for (
const int i_point : points) {
545 uint pos_hq, nor_hq, tan_hq, rad_hq;
573 int vbo_len_used = 0;
593 int skip = nu->
resolu / 16;
596 float nor[3] = {1.0f, 0.0f, 0.0f};
624 BLI_assert(vbo_len_used == verts_len_capacity);
633 const bool handle_selected)
685 int vbo_len_used = 0;
687#define DRW_TEST_ASSIGN_VBO(v) (v = (DRW_vbo_requested(v) ? (v) : nullptr))
688#define DRW_TEST_ASSIGN_IBO(v) (v = (DRW_ibo_requested(v) ? (v) : nullptr))
702 elbp_verts = &elb_verts;
706 elbp_lines = &elb_lines;
710#undef DRW_TEST_ASSIGN_VBO
711#undef DRW_TEST_ASSIGN_IBO
716 const BPoint *bp = nu->bp;
719 for (
int a = 0; a < nu->pntsu; a++, bezt++) {
720 if (bezt->
hide != 0) {
735 const uint32_t vflag[3] = {
740 for (
int j = 0; j < 3; j++) {
745 for (
int j = 0; j < 3; j++) {
753 int pt_len = nu->pntsu * nu->pntsv;
754 for (
int a = 0; a < pt_len; a++, bp++, vbo_len_used += 1) {
758 int u = (a % nu->pntsu);
759 int v = (a / nu->pntsu);
766 const BPoint *bp_next_u = (u < (nu->pntsu - 1)) ? &nu->bp[a + 1] :
nullptr;
767 const BPoint *bp_next_v = (
v < (nu->pntsv - 1)) ? &nu->bp[a + nu->pntsu] :
nullptr;
768 if (bp_next_u && (bp_next_u->
hide ==
false)) {
771 if (bp_next_v && (bp_next_v->
hide ==
false)) {
787 if (elbp_verts !=
nullptr) {
790 if (elbp_lines !=
nullptr) {
793 if (vbo_len_used != verts_len_capacity) {
794 if (vbo_pos !=
nullptr) {
797 if (vbo_data !=
nullptr) {
878#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
895#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
896 printf(
" mr_flag %d\n\n", mr_flag);
925 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.
#define LISTBASE_FOREACH(type, var, list)
void mul_qt_v3(const float q[4], float r[3])
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BEZT_ISSEL_ANY(bezt)
Object is a sort of wrapper for general info.
#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.
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr int64_t last(const int64_t n=0) const
constexpr int64_t size() const
constexpr const T * data() const
GAttributeReader lookup(const StringRef attribute_id) const
void ensure_can_interpolate_to_evaluated() const
IndexRange curves_range() const
void interpolate_to_evaluated(int curve_index, GSpan src, GMutableSpan dst) const
OffsetIndices< int > evaluated_points_by_curve() const
AttributeAccessor attributes() const
Span< float3 > evaluated_positions() const
VArray< bool > cyclic() const
#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 @064345207361167251075330302113175271221317160336::@201157344026354305110036153026103256267276205234 attr_id
struct @064345207361167251075330302113175271221317160336::@113254110077376341056327177062323111323010325277 batch
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
int segments_num(const int points_num, const bool cyclic)
static void curve_batch_cache_init(Curve *cu)
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)
@ VFLAG_VERT_SELECTED_BEZT_HANDLE
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)
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)
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)
@ CU_DATATYPE_TEXT_SELECT
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)
GPUType convert_normal(const float3 &src)
T tan(const AngleRadianBase< T > &a)
blender::VecBase< int16_t, 4 > short4
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
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::@116074100157005142364077032020057271063127306145 ordered
gpu::VertBuf * attr_viewer
gpu::VertBuf * curves_nor
struct blender::draw::CurveBatchCache::@136140164071233110054174064301264213314323011323 batch
gpu::IndexBuf * edit_verts
struct blender::draw::CurveBatchCache::@317253274161271075246205275310235216250327177024 ibo
gpu::Batch * curves_viewer_attribute
struct blender::draw::CurveBatchCache::@137343061214163102106143020200062326230202012336 edit
struct blender::draw::CurveRenderData::@103024302264201317260173147137056252315230202247 normal
struct blender::draw::CurveRenderData::@052204210304327130055226223234247341360334364073 text
struct blender::draw::CurveRenderData::@032075353246216163276233222204255140015346324332 wire
struct blender::draw::CurveRenderData::@011255275001326006313062202127127160055052072055 overlay
CurveCache * ob_curve_cache
const Curves * curve_eval