Blender V4.5
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.h"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#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_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_curves_private.hh"

Go to the source code of this file.

Classes

struct  blender::draw::CurvesBatchCache
struct  blender::draw::PositionAndParameter

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::discard_attributes (CurvesEvalCache &eval_cache)
static void blender::draw::clear_edit_data (CurvesBatchCache *cache)
static void blender::draw::clear_final_data (CurvesEvalFinalCache &final_cache)
static void blender::draw::clear_eval_data (CurvesEvalCache &eval_cache)
static void blender::draw::clear_batch_cache (Curves &curves)
static CurvesBatchCacheblender::draw::get_batch_cache (Curves &curves)
static void blender::draw::fill_points_position_time_vbo (const OffsetIndices< int > points_by_curve, const Span< float3 > positions, MutableSpan< PositionAndParameter > posTime_data, MutableSpan< float > hairLength_data)
static void blender::draw::create_points_position_time_vbo (const bke::CurvesGeometry &curves, CurvesEvalCache &cache)
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::extract_curve_lines (const OffsetIndices< int > points_by_curve, const VArray< bool > &cyclic, const IndexMask &selection, const int cyclic_segment_offset, 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 void blender::draw::alloc_final_attribute_vbo (CurvesEvalCache &cache, const GPUVertFormat &format, const int index, const char *)
static gpu::VertBufPtr blender::draw::ensure_control_point_attribute (const Curves &curves_id, const StringRef name, const GPUVertFormat &format, bool &r_is_point_domain)
static void blender::draw::ensure_final_attribute (const Curves &curves, const StringRef name, const int index, CurvesEvalCache &cache)
static void blender::draw::fill_curve_offsets_vbos (const OffsetIndices< int > points_by_curve, GPUVertBufRaw &data_step, GPUVertBufRaw &seg_step)
static void blender::draw::create_curve_offsets_vbos (const OffsetIndices< int > points_by_curve, CurvesEvalCache &cache)
static void blender::draw::alloc_final_points_vbo (CurvesEvalCache &cache)
static void blender::draw::calc_final_indices (const bke::CurvesGeometry &curves, CurvesEvalCache &cache, const int thickness_res)
static bool blender::draw::ensure_attributes (const Curves &curves, CurvesBatchCache &cache, const GPUMaterial *gpu_material)
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])
bool blender::draw::curves_ensure_procedural_data (Curves *curves_id, CurvesEvalCache **r_cache, const GPUMaterial *gpu_material, const int subdiv, const int thickness_res)
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)
gpu::VertBuf ** blender::draw::DRW_curves_texture_for_evaluated_attribute (Curves *curves, StringRef name, bool *r_is_point_domain)
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 52 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)

Definition at line 56 of file draw_cache_impl_curves.cc.

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

◆ EDIT_CURVES_HANDLE_TYPES_SHIFT

#define EDIT_CURVES_HANDLE_TYPES_SHIFT   (4u)

Definition at line 57 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 51 of file draw_cache_impl_curves.cc.

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