Blender V5.0
draw_cache_impl_curves.cc File Reference

Curves API for render engines. More...

#include <cstring>
#include "MEM_guardedalloc.h"
#include "BLI_array_utils.hh"
#include "BLI_listbase.h"
#include "BLI_math_base.h"
#include "BLI_math_vector.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_span.hh"
#include "BLI_string_utf8.h"
#include "BLI_task.hh"
#include "DNA_curves_types.h"
#include "DNA_object_types.h"
#include "DNA_userdef_types.h"
#include "DEG_depsgraph_query.hh"
#include "BKE_crazyspace.hh"
#include "BKE_curves.hh"
#include "BKE_curves_utils.hh"
#include "BKE_customdata.hh"
#include "BKE_geometry_set.hh"
#include "GPU_batch.hh"
#include "GPU_capabilities.hh"
#include "GPU_context.hh"
#include "GPU_material.hh"
#include "GPU_texture.hh"
#include "DRW_render.hh"
#include "draw_attributes.hh"
#include "draw_cache_impl.hh"
#include "draw_cache_inline.hh"
#include "draw_context_private.hh"
#include "draw_curves_private.hh"
#include "draw_hair_private.hh"

Go to the source code of this file.

Classes

struct  blender::draw::CurvesBatchCache

Namespaces

namespace  blender
namespace  blender::draw

Macros

#define EDIT_CURVES_NURBS_CONTROL_POINT   (1u)
#define EDIT_CURVES_BEZIER_HANDLE   (1u << 1)
#define EDIT_CURVES_ACTIVE_HANDLE   (1u << 2)
#define EDIT_CURVES_BEZIER_KNOT   (1u << 3)
#define EDIT_CURVES_HANDLE_TYPES_SHIFT   (4u)

Functions

static bool blender::draw::batch_cache_is_dirty (const Curves &curves)
static void blender::draw::init_batch_cache (Curves &curves)
static void blender::draw::clear_edit_data (CurvesBatchCache *cache)
static void blender::draw::clear_batch_cache (Curves &curves)
static CurvesBatchCacheblender::draw::get_batch_cache (Curves &curves)
static uint32_t blender::draw::bezier_data_value (int8_t handle_type, bool is_active)
static int blender::draw::handles_and_points_num (const int points_num, const OffsetIndices< int > bezier_offsets)
static IndexRange blender::draw::handle_range_left (const int points_num, const OffsetIndices< int > bezier_offsets)
static IndexRange blender::draw::handle_range_right (const int points_num, const OffsetIndices< int > bezier_offsets)
static void blender::draw::extract_edit_data (const OffsetIndices< int > points_by_curve, const IndexMask &curve_selection, const VArray< bool > &selection_attr, const bool mark_active, const uint32_t fill_value, MutableSpan< uint32_t > data)
static void blender::draw::create_edit_points_data (const OffsetIndices< int > points_by_curve, const IndexMask &catmull_rom_curves, const IndexMask &poly_curves, const IndexMask &bezier_curves, const IndexMask &nurbs_curves, const OffsetIndices< int > bezier_offsets, const bke::CurvesGeometry &curves, gpu::VertBuf &vbo)
static void blender::draw::create_edit_points_position (const bke::CurvesGeometry &curves, const OffsetIndices< int > points_by_curve, const IndexMask &bezier_curves, const OffsetIndices< int > bezier_offsets, const bke::crazyspace::GeometryDeformation deformation, gpu::VertBuf &vbo)
static void blender::draw::create_edit_points_selection (const OffsetIndices< int > points_by_curve, const IndexMask &bezier_curves, const OffsetIndices< int > bezier_offsets, const bke::AttributeAccessor attributes, gpu::VertBuf &vbo)
static void blender::draw::create_lines_ibo_no_cyclic (const OffsetIndices< int > points_by_curve, gpu::IndexBuf &ibo)
static void blender::draw::create_lines_ibo_with_cyclic (const OffsetIndices< int > points_by_curve, const Span< bool > cyclic, gpu::IndexBuf &ibo)
static void blender::draw::create_lines_ibo_with_cyclic (const OffsetIndices< int > points_by_curve, const VArray< bool > &cyclic, gpu::IndexBuf &ibo)
static void blender::draw::create_segments_with_cyclic (const OffsetIndices< int > points_by_curve, const VArray< bool > &cyclic, const IndexMask &selection, MutableSpan< uint2 > lines)
static void blender::draw::calc_edit_handles_ibo (const OffsetIndices< int > points_by_curve, const IndexMask &catmull_rom_curves, const IndexMask &poly_curves, const IndexMask &bezier_curves, const IndexMask &nurbs_curves, const OffsetIndices< int > bezier_offsets, const VArray< bool > &cyclic, gpu::IndexBuf &ibo)
static gpu::VertBufPtr blender::draw::alloc_evaluated_point_attribute_vbo (const GPUVertFormat &format, const StringRef, int64_t size)
static gpu::VertBufPtr blender::draw::ensure_control_point_attribute (const bke::CurvesGeometry &curves, const StringRef name, const GPUVertFormat &format, bool &r_is_point_domain)
static std::optional< StringRefblender::draw::get_first_uv_name (const bke::AttributeAccessor &attributes)
static void blender::draw::request_attribute (Curves &curves, const StringRef name)
void blender::draw::drw_curves_get_attribute_sampler_name (const StringRef layer_name, char r_sampler_name[32])
CurvesEvalCacheblender::draw::curves_get_eval_cache (Curves &curves_id)
static void blender::draw::create_edit_points_position_vbo (const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &, CurvesBatchCache &cache)
Expose via BKE callbacks
void blender::draw::DRW_curves_batch_cache_dirty_tag (Curves *curves, int mode)
void blender::draw::DRW_curves_batch_cache_validate (Curves *curves)
void blender::draw::DRW_curves_batch_cache_free (Curves *curves)
Garbage Collection
void blender::draw::DRW_curves_batch_cache_free_old (Curves *curves, int ctime)
Curves
blender::gpu::Batch * blender::draw::DRW_curves_batch_cache_get_edit_points (Curves *curves)
blender::gpu::Batch * blender::draw::DRW_curves_batch_cache_get_sculpt_curves_cage (Curves *curves)
blender::gpu::Batch * blender::draw::DRW_curves_batch_cache_get_edit_curves_handles (Curves *curves)
blender::gpu::Batch * blender::draw::DRW_curves_batch_cache_get_edit_curves_lines (Curves *curves)
blender::gpu::VertBufPtrblender::draw::DRW_curves_texture_for_evaluated_attribute (Curves *curves, StringRef name, bool &r_is_point_domain, bool &r_valid_attribute)
void blender::draw::DRW_curves_batch_cache_create_requested (Object *ob)

Detailed Description

Curves API for render engines.

Definition in file draw_cache_impl_curves.cc.

Macro Definition Documentation

◆ EDIT_CURVES_ACTIVE_HANDLE

#define EDIT_CURVES_ACTIVE_HANDLE   (1u << 2)

◆ EDIT_CURVES_BEZIER_HANDLE

#define EDIT_CURVES_BEZIER_HANDLE   (1u << 1)

Definition at line 54 of file draw_cache_impl_curves.cc.

Referenced by blender::draw::bezier_data_value().

◆ EDIT_CURVES_BEZIER_KNOT

#define EDIT_CURVES_BEZIER_KNOT   (1u << 3)

◆ EDIT_CURVES_HANDLE_TYPES_SHIFT

#define EDIT_CURVES_HANDLE_TYPES_SHIFT   (4u)

Definition at line 59 of file draw_cache_impl_curves.cc.

Referenced by blender::draw::bezier_data_value().

◆ EDIT_CURVES_NURBS_CONTROL_POINT

#define EDIT_CURVES_NURBS_CONTROL_POINT   (1u)

Definition at line 53 of file draw_cache_impl_curves.cc.

Referenced by blender::draw::create_edit_points_data().