Blender V5.0
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
19struct GPUMaterial;
20namespace blender::gpu {
21class Batch;
22class UniformBuf;
23class VertBuf;
24} // namespace blender::gpu
25struct ModifierData;
26struct PTCacheEdit;
27struct ParticleSystem;
28struct TaskGraph;
29
30struct Curve;
31struct Curves;
32struct Lattice;
33struct Mesh;
34struct Object;
35struct Scene;
36struct PointCloud;
37struct Volume;
38struct GreasePencil;
39
41
42namespace blender::draw {
43
44class ObjectRef;
45
46/* -------------------------------------------------------------------- */
49
50void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode);
53
56void DRW_mesh_batch_cache_free(void *batch_cache);
57
61
64
65void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode);
68
69void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode);
72
73void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode);
76
77void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grease_pencil, int mode);
80
82
83/* -------------------------------------------------------------------- */
86
87void DRW_batch_cache_free_old(Object *ob, int ctime);
88
93void DRW_mesh_batch_cache_free_old(Mesh *mesh, int ctime);
94void DRW_curves_batch_cache_free_old(Curves *curves, int ctime);
95void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime);
96
98
99/* -------------------------------------------------------------------- */
102
103void DRW_vertbuf_create_wiredata(gpu::VertBuf *vbo, int vert_len);
104
106
107/* -------------------------------------------------------------------- */
110
112
113blender::gpu::Batch *DRW_curve_batch_cache_get_wire_edge(Curve *cu);
115blender::gpu::Batch *DRW_curve_batch_cache_get_normal_edge(Curve *cu);
116blender::gpu::Batch *DRW_curve_batch_cache_get_edit_edges(Curve *cu);
117blender::gpu::Batch *DRW_curve_batch_cache_get_edit_verts(Curve *cu);
118
120
121/* -------------------------------------------------------------------- */
124
125blender::gpu::Batch *DRW_lattice_batch_cache_get_all_edges(Lattice *lt,
126 bool use_weight,
127 int actdef);
128blender::gpu::Batch *DRW_lattice_batch_cache_get_all_verts(Lattice *lt);
129blender::gpu::Batch *DRW_lattice_batch_cache_get_edit_verts(Lattice *lt);
130
132
133/* -------------------------------------------------------------------- */
136
144 StringRef name,
145 bool &r_is_point_domain,
146 bool &r_valid_attribute);
147
148blender::gpu::Batch *DRW_curves_batch_cache_get_edit_points(Curves *curves);
149blender::gpu::Batch *DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves);
150blender::gpu::Batch *DRW_curves_batch_cache_get_edit_curves_handles(Curves *curves);
151blender::gpu::Batch *DRW_curves_batch_cache_get_edit_curves_lines(Curves *curves);
152
154
156
157/* -------------------------------------------------------------------- */
160
162
163gpu::VertBuf **DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, StringRef name);
164blender::gpu::Batch *DRW_pointcloud_batch_cache_get_dots(Object *ob);
165blender::gpu::Batch *DRW_pointcloud_batch_cache_get_edit_dots(PointCloud *pointcloud);
166
168
170
171/* -------------------------------------------------------------------- */
174
175blender::gpu::Batch *DRW_volume_batch_cache_get_wireframes_face(Volume *volume);
176blender::gpu::Batch *DRW_volume_batch_cache_get_selection_surface(Volume *volume);
177
179
180/* -------------------------------------------------------------------- */
183
187void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
188 Object &ob,
189 Mesh &mesh,
190 const Scene &scene,
191 bool is_paint_mode,
192 bool use_hide);
193
194blender::gpu::Batch *DRW_mesh_batch_cache_get_all_verts(Mesh &mesh);
195blender::gpu::Batch *DRW_mesh_batch_cache_get_paint_overlay_verts(Mesh &mesh);
196blender::gpu::Batch *DRW_mesh_batch_cache_get_all_edges(Mesh &mesh);
197blender::gpu::Batch *DRW_mesh_batch_cache_get_loose_edges(Mesh &mesh);
198blender::gpu::Batch *DRW_mesh_batch_cache_get_edge_detection(Mesh &mesh, bool *r_is_manifold);
199blender::gpu::Batch *DRW_mesh_batch_cache_get_surface(Mesh &mesh);
200blender::gpu::Batch *DRW_mesh_batch_cache_get_paint_overlay_surface(Mesh &mesh);
201blender::gpu::Batch *DRW_mesh_batch_cache_get_paint_overlay_edges(Mesh &mesh);
203 Mesh &mesh,
204 Span<const GPUMaterial *> materials);
205
207blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_texpaint_single(Object &object, Mesh &mesh);
208blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_vertpaint(Object &object, Mesh &mesh);
209blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_sculpt(Object &object, Mesh &mesh);
210blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_weights(Mesh &mesh);
211blender::gpu::Batch *DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh);
213
215
216/* -------------------------------------------------------------------- */
219
220blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_triangles(Mesh &mesh);
221blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh);
222blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_edges(Mesh &mesh);
223blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_vert_normals(Mesh &mesh);
224blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh);
225blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh);
226blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh);
227
229
230/* -------------------------------------------------------------------- */
233
236blender::gpu::Batch *DRW_mesh_batch_cache_get_edges_with_select_id(Mesh &mesh);
237blender::gpu::Batch *DRW_mesh_batch_cache_get_verts_with_select_id(Mesh &mesh);
238
240
241/* -------------------------------------------------------------------- */
244
245blender::gpu::Batch *DRW_mesh_batch_cache_get_wireframes_face(Mesh &mesh);
246
248
249/* -------------------------------------------------------------------- */
252
261 Mesh &mesh,
262 float **tot_area,
263 float **tot_uv_area);
265 Mesh &mesh);
266blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh);
267blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_wireframe(Object &object, Mesh &mesh);
268blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_edges(Object &object, Mesh &mesh);
269blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh);
270blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh);
271
273
274/* -------------------------------------------------------------------- */
277
278blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_faces(Object &object, Mesh &mesh);
279blender::gpu::Batch *DRW_mesh_batch_cache_get_all_uv_wireframe(Object &object, Mesh &mesh);
280blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_wireframe(Object &object, Mesh &mesh);
281blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh &mesh);
282
284
285/* -------------------------------------------------------------------- */
288
289/* Edit mesh bit-flags (is this the right place?). */
290enum {
299 /* Beware to not go over 1 << 7 (it's a byte flag). */
300 /* NOTE: Grease pencil edit curve use another type of data format that allows for this value. */
302};
303
304enum {
313 /* Beware to not go over 1 << 7 (it's a byte flag). */
314};
315
317
318/* -------------------------------------------------------------------- */
321
322blender::gpu::Batch *DRW_particles_batch_cache_get_hair(Object *object,
323 ParticleSystem *psys,
324 ModifierData *md);
325blender::gpu::Batch *DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys);
326blender::gpu::Batch *DRW_particles_batch_cache_get_edit_strands(Object *object,
327 ParticleSystem *psys,
328 PTCacheEdit *edit,
329 bool use_weight);
331 ParticleSystem *psys,
332 PTCacheEdit *edit);
333blender::gpu::Batch *DRW_particles_batch_cache_get_edit_tip_points(Object *object,
334 ParticleSystem *psys,
335 PTCacheEdit *edit);
336
338
339} // namespace blender::draw
eMeshBatchDirtyMode
Definition BKE_mesh.h:37
struct Curve Curve
struct Curves Curves
struct GreasePencil GreasePencil
struct Lattice Lattice
struct Object Object
struct ParticleSystem ParticleSystem
struct PointCloud PointCloud
struct Scene Scene
struct Volume Volume
void DRW_mesh_batch_cache_validate(Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_lattice_batch_cache_get_all_verts(Lattice *lt)
void DRW_curves_batch_cache_validate(Curves *curves)
blender::gpu::Batch * DRW_mesh_batch_cache_get_loose_edges(Mesh &mesh)
void DRW_grease_pencil_batch_cache_validate(GreasePencil *grease_pencil)
blender::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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface_texpaint_single(Object &object, Mesh &mesh)
blender::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:72
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_curves_batch_cache_get_edit_points(Curves *curves)
blender::gpu::Batch * DRW_mesh_batch_cache_get_facedots_with_select_id(Mesh &mesh)
blender::gpu::Batch * DRW_lattice_batch_cache_get_all_edges(Lattice *lt, bool use_weight, int actdef)
blender::gpu::Batch * DRW_particles_batch_cache_get_edit_inner_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
blender::gpu::Batch * DRW_curve_batch_cache_get_wire_edge(Curve *cu)
void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode)
blender::gpu::Batch * DRW_lattice_batch_cache_get_edit_verts(Lattice *lt)
blender::gpu::Batch * DRW_curve_batch_cache_get_edit_verts(Curve *cu)
void DRW_curves_batch_cache_free_old(Curves *curves, int ctime)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_wireframe(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_particles_batch_cache_get_edit_tip_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
void DRW_lattice_batch_cache_free(Lattice *lt)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grease_pencil)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh &mesh)
blender::gpu::Batch * DRW_volume_batch_cache_get_selection_surface(Volume *volume)
blender::gpu::Batch * DRW_curve_batch_cache_get_edit_edges(Curve *cu)
void DRW_curve_batch_cache_validate(Curve *cu)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface(Mesh &mesh)
blender::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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface_weights(Mesh &mesh)
blender::gpu::Batch * DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys)
blender::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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh)
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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface_vertpaint(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_wireframes_face(Mesh &mesh)
void DRW_volume_batch_cache_free(Volume *volume)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface_sculpt(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_all_edges(Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_paint_overlay_verts(Mesh &mesh)
blender::gpu::Batch * DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh)
blender::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)
void DRW_mesh_batch_cache_free(void *batch_cache)
blender::gpu::Batch * DRW_pointcloud_batch_cache_get_dots(Object *ob)
blender::gpu::Batch * DRW_curve_batch_cache_get_normal_edge(Curve *cu)
blender::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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh)
void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime)
blender::gpu::Batch * DRW_mesh_batch_cache_get_all_uv_wireframe(Object &object, Mesh &mesh)
blender::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)
blender::gpu::Batch * DRW_volume_batch_cache_get_wireframes_face(Volume *volume)
blender::gpu::Batch * DRW_pointcloud_batch_cache_get_edit_dots(PointCloud *pointcloud)
void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode)
gpu::VertBuf ** DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, StringRef name)
void DRW_pointcloud_batch_cache_create_requested(Object *ob)
void DRW_pointcloud_batch_cache_validate(PointCloud *pointcloud)
blender::gpu::Batch * DRW_mesh_batch_cache_get_verts_with_select_id(Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_paint_overlay_surface(Mesh &mesh)
void DRW_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
blender::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)
blender::gpu::Batch * DRW_curves_batch_cache_get_edit_curves_lines(Curves *curves)
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_vert_normals(Mesh &mesh)
blender::gpu::Batch * DRW_particles_batch_cache_get_hair(Object *object, ParticleSystem *psys, ModifierData *md)
blender::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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edges_with_select_id(Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(Object &object, Mesh &mesh, float **tot_area, float **tot_uv_area)
blender::gpu::Batch * DRW_mesh_batch_cache_get_paint_overlay_edges(Mesh &mesh)
blender::gpu::VertBufPtr & DRW_curves_texture_for_evaluated_attribute(Curves *curves, StringRef name, bool &r_is_point_domain, bool &r_valid_attribute)
blender::gpu::Batch * DRW_mesh_batch_cache_get_all_verts(Mesh &mesh)
blender::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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_uv_wireframe(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
const char * name