Blender V5.3
draw_cache_impl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <cstdint>
12
14#include "BLI_span.hh"
15#include "BLI_string_ref.hh"
16
17#include "GPU_vertex_buffer.hh"
18
19namespace blender {
20
21struct GPUMaterial;
22namespace draw {
23struct MeshBatchCache;
24class View;
25}; // namespace draw
26namespace gpu {
27class Batch;
28class BottomLevelAS;
29class UniformBuf;
30class VertBuf;
31} // namespace gpu
32struct ModifierData;
33struct PTCacheEdit;
34struct ParticleSystem;
35struct TaskGraph;
36
37struct Curve;
38struct Curves;
39struct Lattice;
40struct Mesh;
41struct Object;
42struct Scene;
43struct PointCloud;
44struct Volume;
45struct GreasePencil;
46
48
49namespace draw {
50
51class ObjectRef;
52
53/* -------------------------------------------------------------------- */
56
57void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode);
58void DRW_curve_batch_cache_validate(Curve *cu);
59void DRW_curve_batch_cache_free(Curve *cu);
60
63void DRW_mesh_batch_cache_free(draw::MeshBatchCache *batch_cache);
64
65void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode);
66void DRW_lattice_batch_cache_validate(Lattice *lt);
67void DRW_lattice_batch_cache_free(Lattice *lt);
68
69void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode);
70void DRW_particle_batch_cache_free(ParticleSystem *psys);
71
72void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode);
73void DRW_curves_batch_cache_validate(Curves *curves);
74void DRW_curves_batch_cache_free(Curves *curves);
75
76void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode);
77void DRW_pointcloud_batch_cache_validate(PointCloud *pointcloud);
78void DRW_pointcloud_batch_cache_free(PointCloud *pointcloud);
79
80void DRW_gsplat_batch_cache_dirty_tag(PointCloud *pointcloud, int mode);
81void DRW_gsplat_batch_cache_validate(PointCloud *pointcloud);
82void DRW_gsplat_batch_cache_free(PointCloud *pointcloud);
83
84void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode);
85void DRW_volume_batch_cache_validate(Volume *volume);
86void DRW_volume_batch_cache_free(Volume *volume);
87
88void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grease_pencil, int mode);
89void DRW_grease_pencil_batch_cache_validate(GreasePencil *grease_pencil);
90void DRW_grease_pencil_batch_cache_free(GreasePencil *grease_pencil);
91
93
94/* -------------------------------------------------------------------- */
97
98void DRW_batch_cache_free_old(Object *ob, int ctime);
99
104void DRW_mesh_batch_cache_free_old(Mesh *mesh, int ctime);
105void DRW_curves_batch_cache_free_old(Curves *curves, int ctime);
106void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime);
107void DRW_gsplat_batch_cache_free_old(PointCloud *pointcloud, int ctime);
108
110
111/* -------------------------------------------------------------------- */
114
115void DRW_vertbuf_create_wiredata(gpu::VertBuf *vbo, int vert_len);
116
118
119/* -------------------------------------------------------------------- */
122
123void DRW_curve_batch_cache_create_requested(Object *ob, const Scene *scene);
124
125gpu::Batch *DRW_curve_batch_cache_get_wire_edge(Curve *cu);
127gpu::Batch *DRW_curve_batch_cache_get_normal_edge(Curve *cu);
128gpu::Batch *DRW_curve_batch_cache_get_edit_edges(Curve *cu);
129gpu::Batch *DRW_curve_batch_cache_get_edit_verts(Curve *cu);
130
132
133/* -------------------------------------------------------------------- */
136
137gpu::Batch *DRW_lattice_batch_cache_get_all_edges(Lattice *lt, bool use_weight, int actdef);
138gpu::Batch *DRW_lattice_batch_cache_get_all_verts(Lattice *lt);
139gpu::Batch *DRW_lattice_batch_cache_get_edit_verts(Lattice *lt);
140
142
143/* -------------------------------------------------------------------- */
146
154 StringRef name,
155 bool &r_is_point_domain,
156 bool &r_valid_attribute);
157
158gpu::Batch *DRW_curves_batch_cache_get_edit_points(Curves *curves);
159gpu::Batch *DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves);
160gpu::Batch *DRW_curves_batch_cache_get_edit_curves_handles(Curves *curves);
161gpu::Batch *DRW_curves_batch_cache_get_edit_curves_lines(Curves *curves);
162
164
166
167/* -------------------------------------------------------------------- */
170
171gpu::VertBuf *DRW_pointcloud_position_and_radius_buffer_get(Object *ob);
172
173gpu::VertBuf **DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, StringRef name);
174gpu::Batch *DRW_pointcloud_batch_cache_get_dots(Object *ob);
175gpu::Batch *DRW_pointcloud_batch_cache_get_edit_dots(Object *ob);
176
178
180
181/* -------------------------------------------------------------------- */
184
185gpu::VertBuf **DRW_gsplat_evaluated_attribute(PointCloud *pointcloud, StringRef name);
186gpu::Batch *DRW_gsplat_batch_cache_get_dots(Object *ob);
187gpu::Batch *DRW_gsplat_batch_cache_get_edit_dots(Object *ob);
188
190
192
193/* -------------------------------------------------------------------- */
196
197gpu::Batch *DRW_volume_batch_cache_get_wireframes_face(Volume *volume);
198gpu::Batch *DRW_volume_batch_cache_get_selection_surface(Volume *volume);
199
201
202/* -------------------------------------------------------------------- */
205
209void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
210 Object &ob,
211 Mesh &mesh,
212 const Scene &scene,
213 bool is_paint_mode,
214 bool use_hide);
215
220gpu::Batch *DRW_mesh_batch_cache_get_edge_detection(Mesh &mesh, bool *r_is_manifold);
221gpu::Batch *DRW_mesh_batch_cache_get_surface(Mesh &mesh);
225 Mesh &mesh,
226 Span<const GPUMaterial *> materials);
227
235
237
239
240/* -------------------------------------------------------------------- */
243
251
253
254/* -------------------------------------------------------------------- */
257
262
264
265/* -------------------------------------------------------------------- */
268
270
272
273/* -------------------------------------------------------------------- */
276
285 Mesh &mesh,
286 float **tot_area,
287 float **tot_uv_area);
294
296
297/* -------------------------------------------------------------------- */
300
305
307
308/* -------------------------------------------------------------------- */
311
312/* Edit mesh bit-flags (is this the right place?). */
313enum {
322 /* Beware to not go over 1 << 7 (it's a byte flag). */
323 /* NOTE: Grease pencil edit curve use another type of data format that allows for this value. */
325};
326
327enum {
336 /* Beware to not go over 1 << 7 (it's a byte flag). */
337};
338
340
341/* -------------------------------------------------------------------- */
344
346 ParticleSystem *psys,
347 ModifierData *md);
350 ParticleSystem *psys,
351 PTCacheEdit *edit,
352 bool use_weight);
354 ParticleSystem *psys,
355 PTCacheEdit *edit);
357 ParticleSystem *psys,
358 PTCacheEdit *edit);
359
361
362} // namespace draw
363} // namespace blender
void DRW_mesh_batch_cache_validate(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Object &object, Mesh &mesh)
gpu::Batch * DRW_lattice_batch_cache_get_all_verts(Lattice *lt)
void DRW_curves_batch_cache_validate(Curves *curves)
gpu::Batch * DRW_mesh_batch_cache_get_loose_edges(Mesh &mesh)
void DRW_grease_pencil_batch_cache_validate(GreasePencil *grease_pencil)
gpu::Batch * DRW_gsplat_batch_cache_get_dots(Object *ob)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_edges(Object &object, Mesh &mesh)
void DRW_particle_batch_cache_free(ParticleSystem *psys)
void DRW_lattice_batch_cache_validate(Lattice *lt)
gpu::Batch * DRW_mesh_batch_cache_get_surface_texpaint_single(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_edges(Mesh &mesh)
void DRW_vertbuf_create_wiredata(gpu::VertBuf *vbo, const int vert_len)
Definition draw_cache.cc:74
gpu::Batch * DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh)
gpu::Batch * DRW_curves_batch_cache_get_edit_points(Curves *curves)
gpu::Batch * DRW_mesh_batch_cache_get_facedots_with_select_id(Mesh &mesh)
gpu::Batch * DRW_lattice_batch_cache_get_all_edges(Lattice *lt, bool use_weight, int actdef)
gpu::Batch * DRW_particles_batch_cache_get_edit_inner_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
gpu::Batch * DRW_curve_batch_cache_get_wire_edge(Curve *cu)
void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
gpu::Batch * DRW_lattice_batch_cache_get_edit_verts(Lattice *lt)
gpu::Batch * DRW_curve_batch_cache_get_edit_verts(Curve *cu)
void DRW_curves_batch_cache_free_old(Curves *curves, int ctime)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_wireframe(Object &object, Mesh &mesh)
gpu::Batch * DRW_particles_batch_cache_get_edit_tip_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
void DRW_mesh_batch_cache_free(draw::MeshBatchCache *batch_cache)
void DRW_lattice_batch_cache_free(Lattice *lt)
gpu::Batch * DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grease_pencil)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh &mesh)
gpu::Batch * DRW_volume_batch_cache_get_selection_surface(Volume *volume)
gpu::Batch * DRW_curve_batch_cache_get_edit_edges(Curve *cu)
void DRW_curve_batch_cache_validate(Curve *cu)
gpu::Batch * DRW_mesh_batch_cache_get_surface(Mesh &mesh)
gpu::Batch * DRW_pointcloud_batch_cache_get_edit_dots(Object *ob)
gpu::Batch * DRW_particles_batch_cache_get_edit_strands(Object *object, ParticleSystem *psys, PTCacheEdit *edit, bool use_weight)
void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
gpu::Batch * DRW_mesh_batch_cache_get_surface_weights(Mesh &mesh)
gpu::Batch * DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys)
gpu::Batch * DRW_curves_batch_cache_get_edit_curves_handles(Curves *curves)
Span< gpu::Batch * > DRW_mesh_batch_cache_get_surface_shaded(Object &object, Mesh &mesh, Span< const GPUMaterial * > materials)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh)
void DRW_gsplat_batch_cache_create_requested(Object *ob)
void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grease_pencil, int mode)
void DRW_curve_batch_cache_create_requested(Object *ob, const Scene *scene)
gpu::Batch * DRW_mesh_batch_cache_get_surface_vertpaint(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_wireframes_face(Mesh &mesh)
void DRW_volume_batch_cache_free(Volume *volume)
gpu::Batch * DRW_mesh_batch_cache_get_surface_sculpt(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_all_edges(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_paint_overlay_verts(Mesh &mesh)
gpu::Batch * DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves)
gpu::Batch * DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edge_detection(Mesh &mesh, bool *r_is_manifold)
void DRW_mesh_batch_cache_free_old(Mesh *mesh, int ctime)
gpu::Batch * DRW_pointcloud_batch_cache_get_dots(Object *ob)
gpu::Batch * DRW_curve_batch_cache_get_normal_edge(Curve *cu)
gpu::Batch * DRW_mesh_batch_cache_get_edit_triangles(Mesh &mesh)
void DRW_volume_batch_cache_validate(Volume *volume)
Span< gpu::Batch * > DRW_mesh_batch_cache_get_surface_texpaint(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh)
void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime)
gpu::Batch * DRW_mesh_batch_cache_get_all_uv_wireframe(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_triangles_with_select_id(Mesh &mesh)
void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode)
void DRW_curve_batch_cache_free(Curve *cu)
gpu::Batch * DRW_volume_batch_cache_get_wireframes_face(Volume *volume)
void DRW_gsplat_batch_cache_validate(PointCloud *pointcloud)
void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode)
gpu::VertBuf ** DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, StringRef name)
gpu::VertBuf ** DRW_gsplat_evaluated_attribute(PointCloud *pointcloud, StringRef name)
void DRW_pointcloud_batch_cache_create_requested(Object *ob)
void DRW_pointcloud_batch_cache_validate(PointCloud *pointcloud)
gpu::Batch * DRW_mesh_batch_cache_get_verts_with_select_id(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_paint_overlay_surface(Mesh &mesh)
void DRW_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
gpu::Batch * DRW_mesh_batch_cache_get_surface_viewer_attribute(Mesh &mesh)
void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph, Object &ob, Mesh &mesh, const Scene &scene, bool is_paint_mode, bool use_hide)
gpu::Batch * DRW_curves_batch_cache_get_edit_curves_lines(Curves *curves)
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
gpu::Batch * DRW_mesh_batch_cache_get_edit_vert_normals(Mesh &mesh)
void DRW_gsplat_batch_cache_free(PointCloud *pointcloud)
gpu::Batch * DRW_gsplat_batch_cache_get_edit_dots(Object *ob)
gpu::Batch * DRW_particles_batch_cache_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
gpu::Batch * DRW_mesh_batch_cache_get_uv_faces(Object &object, Mesh &mesh)
void DRW_pointcloud_batch_cache_free(PointCloud *pointcloud)
void DRW_batch_cache_free_old(Object *ob, int ctime)
gpu::Batch * DRW_mesh_batch_cache_get_edges_with_select_id(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(Object &object, Mesh &mesh, float **tot_area, float **tot_uv_area)
gpu::Batch * DRW_mesh_batch_cache_get_paint_overlay_edges(Mesh &mesh)
gpu::VertBufPtr & DRW_curves_texture_for_evaluated_attribute(Curves *curves, StringRef name, bool &r_is_point_domain, bool &r_valid_attribute)
gpu::Batch * DRW_mesh_batch_cache_get_all_verts(Mesh &mesh)
gpu::Batch * DRW_curve_batch_cache_get_wire_edge_viewer_attribute(Curve *cu)
void DRW_curves_batch_cache_free(Curves *curves)
void DRW_curves_batch_cache_create_requested(Object *ob)
gpu::VertBuf * DRW_pointcloud_position_and_radius_buffer_get(Object *ob)
void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode)
void DRW_gsplat_batch_cache_free_old(PointCloud *pointcloud, int ctime)
gpu::Batch * DRW_mesh_batch_cache_get_uv_wireframe(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh)
void DRW_gsplat_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
gpu::BottomLevelAS * DRW_mesh_batch_cache_get_surface_blas(Mesh &mesh)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
BMesh Iterators.
eMeshBatchDirtyMode
Definition BKE_mesh.h:47
signed char int8_t
Definition BKE_text.h:76