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;
553 &
format,
"nor", blender::gpu::VertAttrType::SNORM_10_10_10_2);
555 &
format,
"tangent", blender::gpu::VertAttrType::SNORM_10_10_10_2);
565 &
format,
"tangent", gpu::VertAttrType::SNORM_16_16_16_16);
572 int vbo_len_used = 0;
592 int skip = nu->
resolu / 16;
595 float nor[3] = {1.0f, 0.0f, 0.0f};
623 BLI_assert(vbo_len_used == verts_len_capacity);
632 const bool handle_selected)
684 int vbo_len_used = 0;
686#define DRW_TEST_ASSIGN_VBO(v) (v = (DRW_vbo_requested(v) ? (v) : nullptr))
687#define DRW_TEST_ASSIGN_IBO(v) (v = (DRW_ibo_requested(v) ? (v) : nullptr))
701 elbp_verts = &elb_verts;
705 elbp_lines = &elb_lines;
709#undef DRW_TEST_ASSIGN_VBO
710#undef DRW_TEST_ASSIGN_IBO
715 const BPoint *bp = nu->bp;
718 for (
int a = 0; a < nu->pntsu; a++, bezt++) {
719 if (bezt->
hide != 0) {
734 const uint32_t vflag[3] = {
739 for (
int j = 0; j < 3; j++) {
744 for (
int j = 0; j < 3; j++) {
752 int pt_len = nu->pntsu * nu->pntsv;
753 for (
int a = 0; a < pt_len; a++, bp++, vbo_len_used += 1) {
757 int u = (a % nu->pntsu);
758 int v = (a / nu->pntsu);
765 const BPoint *bp_next_u = (u < (nu->pntsu - 1)) ? &nu->bp[a + 1] :
nullptr;
766 const BPoint *bp_next_v = (
v < (nu->pntsv - 1)) ? &nu->bp[a + nu->pntsu] :
nullptr;
767 if (bp_next_u && (bp_next_u->
hide ==
false)) {
770 if (bp_next_v && (bp_next_v->
hide ==
false)) {
786 if (elbp_verts !=
nullptr) {
789 if (elbp_lines !=
nullptr) {
792 if (vbo_len_used != verts_len_capacity) {
793 if (vbo_pos !=
nullptr) {
796 if (vbo_data !=
nullptr) {
877#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
894#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
895 printf(
" mr_flag %d\n\n", mr_flag);
924 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 @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
struct @021025263243242147216143265077100330027142264337::@240232116316110053135047106323056371161236243121 attr_id
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)
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)
@ CU_DATATYPE_TEXT_SELECT
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)
@ VFLAG_VERT_SELECTED_BEZT_HANDLE
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)
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
struct blender::draw::CurveBatchCache::@312205073163315253307202052205133100013110033055 edit
gpu::IndexBuf * curves_lines
gpu::VertBuf * curves_pos
gpu::Batch * edit_normals
gpu::IndexBuf * edit_lines
gpu::VertBuf * attr_viewer
struct blender::draw::CurveBatchCache::@315126015106367235231311237374341020143156112115 batch
gpu::VertBuf * curves_nor
struct blender::draw::CurveBatchCache::@073053223252371303042153262013226335324253043315 ibo
struct blender::draw::CurveBatchCache::@071026276370372045157133366165211214356344347354 ordered
gpu::IndexBuf * edit_verts
gpu::Batch * curves_viewer_attribute
struct blender::draw::CurveRenderData::@145251267312362064345170074174210160167064064227 wire
struct blender::draw::CurveRenderData::@037067172015002275154223215154037373112276015040 text
CurveCache * ob_curve_cache
struct blender::draw::CurveRenderData::@141010375164230177146153004237102010277074022342 overlay
struct blender::draw::CurveRenderData::@110121043272336260250327375123345371232202304200 normal
const Curves * curve_eval