41#define MAX_FACE_PER_SEGMENT 5
42#define MAX_HAIR_SUBDIV 4
72 int additional_subdivision_;
77 int additional_subdivision)
78 : points_by_curve_storage_(points_by_curve_storage),
79 evaluated_points_by_curve_storage_(evaluated_points_by_curve_storage),
80 additional_subdivision_(additional_subdivision)
86 if (points_by_curve_storage_.is_empty()) {
89 return points_by_curve_storage_.size() - 1;
94 if (points_by_curve_storage_.is_empty()) {
97 return points_by_curve_storage_.last();
102 if (additional_subdivision_ == 0) {
106 return evaluated_points_by_curve_storage_.last();
111 return 1 << additional_subdivision_;
119#define CURVES_EVAL_SHADER_NUM 5
199 std::array<gpu::Batch *, MAX_FACE_PER_SEGMENT>
batch;
217 int face_per_segment);
220 gpu::Batch *
batch_get(
int evaluated_point_count,
222 int face_per_segment,
248 int face_per_segment);
263 const int face_per_segment,
266 std::optional<StringRef> active_uv_name);
271 const int face_per_segment,
274 std::optional<StringRef> active_uv_name);
static constexpr int GPU_MAX_ATTR
detail::PassBase< command::DrawMultiBuf > Sub
void curves_bind_resources(PassMain::Sub &sub_ps, CurvesModule &module, CurvesEvalCache &cache, const int face_per_segment, GPUMaterial *gpu_material, gpu::VertBufPtr &indirection_buf, const std::optional< StringRef > active_uv_name)
CurvesEvalCache & curves_get_eval_cache(Curves &curves_id)
void drw_curves_get_attribute_sampler_name(const StringRef layer_name, char r_sampler_name[32])
@ CURVES_EVAL_LENGTH_INTERCEPT
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
static struct PyModuleDef module
gpu::VertBufPtr curves_cyclic_buf
gpu::VertBufPtr evaluated_time_buf
gpu::VertBufPtr evaluated_attributes_buf[GPU_MAX_ATTR]
void ensure_bezier(const bke::CurvesGeometry &curves)
gpu::VertBufPtr curves_resolution_buf
gpu::VertBufPtr indirection_ribbon_buf
int last_attr_matching_time
std::array< gpu::Batch *, MAX_FACE_PER_SEGMENT > batch
gpu::VertBufPtr curves_length_buf
std::array< bool, GPU_MAX_ATTR > attributes_point_domain
gpu::VertBufPtr curves_type_buf
gpu::VertBufPtr bezier_offsets_buf
void ensure_common(const bke::CurvesGeometry &curves)
void discard_attributes()
gpu::VertBufPtr indirection_cylinder_buf
gpu::VertBufPtr control_weights_buf
gpu::Batch * batch_get(int evaluated_point_count, int curve_count, int face_per_segment, bool use_cyclic, bool &r_over_limit)
gpu::VertBufPtr & indirection_buf_get(CurvesModule &module, const bke::CurvesGeometry &curves, int face_per_segment)
gpu::VertBufPtr evaluated_pos_rad_buf
gpu::VertBufPtr evaluated_points_by_curve_buf
void ensure_attributes(struct CurvesModule &module, const bke::CurvesGeometry &curves, const GPUMaterial *gpu_material)
void ensure_positions(CurvesModule &module, const bke::CurvesGeometry &curves)
gpu::VertBufPtr curve_attributes_buf[GPU_MAX_ATTR]
VectorSet< std::string > attr_used_over_time
gpu::VertBufPtr points_by_curve_buf
gpu::VertBufPtr curves_order_buf
gpu::VertBufPtr handles_positions_right_buf
VectorSet< std::string > attr_used
gpu::VertBufPtr handles_positions_left_buf
void ensure_attribute(struct CurvesModule &module, const bke::CurvesGeometry &curves, StringRef name, int index)
void ensure_nurbs(const bke::CurvesGeometry &curves)
gpu::VertBufPtr basis_cache_offset_buf
gpu::VertBufPtr basis_cache_buf
ParticleDrawSource(Vector< int > &points_by_curve_storage, Vector< int > &evaluated_points_by_curve_storage, int additional_subdivision)
OffsetIndices< int > evaluated_points_by_curve()
int evaluated_points_num()
ParticleSpans particles_get()
OffsetIndices< int > points_by_curve()
void foreach_strand(FunctionRef< void(Span< ParticleCacheKey >)> callback)
Span< ParticleCacheKey * > parent
Span< ParticleCacheKey * > children