Blender V4.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
11struct GPUMaterial;
12namespace blender::gpu {
13class Batch;
14class VertBuf;
15} // namespace blender::gpu
16struct GPUUniformBuf;
17struct ModifierData;
18struct PTCacheEdit;
19struct ParticleSystem;
20struct TaskGraph;
21
22struct Curve;
23struct Curves;
24struct Lattice;
25struct Mesh;
26struct PointCloud;
27struct Volume;
28struct bGPdata;
29struct GreasePencil;
30
31#include "BKE_mesh.h"
32
33namespace blender::draw {
34
35/* -------------------------------------------------------------------- */
38
39void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode);
42
44void DRW_mesh_batch_cache_validate(Object &object, Mesh &mesh);
45void DRW_mesh_batch_cache_free(void *batch_cache);
46
50
53
56
57void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode);
60
61void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode);
64
65void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode);
68
69void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grase_pencil, int mode);
72
74
75/* -------------------------------------------------------------------- */
78
79void DRW_batch_cache_free_old(Object *ob, int ctime);
80
85void DRW_mesh_batch_cache_free_old(Mesh *mesh, int ctime);
86void DRW_curves_batch_cache_free_old(Curves *curves, int ctime);
87void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime);
88
90
91/* -------------------------------------------------------------------- */
94
95void DRW_vertbuf_create_wiredata(gpu::VertBuf *vbo, int vert_len);
96
98
99/* -------------------------------------------------------------------- */
102
104
106
107blender::gpu::Batch *DRW_curve_batch_cache_get_wire_edge(Curve *cu);
109blender::gpu::Batch *DRW_curve_batch_cache_get_normal_edge(Curve *cu);
110blender::gpu::Batch *DRW_curve_batch_cache_get_edit_edges(Curve *cu);
111blender::gpu::Batch *DRW_curve_batch_cache_get_edit_verts(Curve *cu);
112
114
115/* -------------------------------------------------------------------- */
118
119blender::gpu::Batch *DRW_lattice_batch_cache_get_all_edges(Lattice *lt,
120 bool use_weight,
121 int actdef);
122blender::gpu::Batch *DRW_lattice_batch_cache_get_all_verts(Lattice *lt);
123blender::gpu::Batch *DRW_lattice_batch_cache_get_edit_verts(Lattice *lt);
124
126
127/* -------------------------------------------------------------------- */
130
131int DRW_curves_material_count_get(const Curves *curves);
132
140 const char *name,
141 bool *r_is_point_domain);
142
143blender::gpu::Batch *DRW_curves_batch_cache_get_edit_points(Curves *curves);
144blender::gpu::Batch *DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves);
145blender::gpu::Batch *DRW_curves_batch_cache_get_edit_curves_handles(Curves *curves);
146blender::gpu::Batch *DRW_curves_batch_cache_get_edit_curves_lines(Curves *curves);
147
149
151
152/* -------------------------------------------------------------------- */
155
156int DRW_pointcloud_material_count_get(const PointCloud *pointcloud);
157
159
160gpu::VertBuf **DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, const char *name);
161blender::gpu::Batch *DRW_pointcloud_batch_cache_get_dots(Object *ob);
162
164
166
167/* -------------------------------------------------------------------- */
170
171int DRW_volume_material_count_get(const Volume *volume);
172
173blender::gpu::Batch *DRW_volume_batch_cache_get_wireframes_face(Volume *volume);
174blender::gpu::Batch *DRW_volume_batch_cache_get_selection_surface(Volume *volume);
175
177
178/* -------------------------------------------------------------------- */
181
185void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
186 Object &ob,
187 Mesh &mesh,
188 const Scene &scene,
189 bool is_paint_mode,
190 bool use_hide);
191
192blender::gpu::Batch *DRW_mesh_batch_cache_get_all_verts(Mesh &mesh);
193blender::gpu::Batch *DRW_mesh_batch_cache_get_all_edges(Mesh &mesh);
194blender::gpu::Batch *DRW_mesh_batch_cache_get_loose_edges(Mesh &mesh);
195blender::gpu::Batch *DRW_mesh_batch_cache_get_edge_detection(Mesh &mesh, bool *r_is_manifold);
196blender::gpu::Batch *DRW_mesh_batch_cache_get_surface(Mesh &mesh);
197blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_edges(Object &object, Mesh &mesh);
198blender::gpu::Batch **DRW_mesh_batch_cache_get_surface_shaded(Object &object,
199 Mesh &mesh,
200 GPUMaterial **gpumat_array,
201 uint gpumat_array_len);
202
203blender::gpu::Batch **DRW_mesh_batch_cache_get_surface_texpaint(Object &object, Mesh &mesh);
204blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_texpaint_single(Object &object, Mesh &mesh);
205blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_vertpaint(Object &object, Mesh &mesh);
206blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_sculpt(Object &object, Mesh &mesh);
207blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_weights(Mesh &mesh);
208blender::gpu::Batch *DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh);
210
212
213/* -------------------------------------------------------------------- */
216
217blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_triangles(Mesh &mesh);
218blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh);
219blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_edges(Mesh &mesh);
220blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_vert_normals(Mesh &mesh);
221blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh);
222blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh);
223blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh);
224
226
227/* -------------------------------------------------------------------- */
230
233blender::gpu::Batch *DRW_mesh_batch_cache_get_edges_with_select_id(Mesh &mesh);
234blender::gpu::Batch *DRW_mesh_batch_cache_get_verts_with_select_id(Mesh &mesh);
235
237
238/* -------------------------------------------------------------------- */
241
242blender::gpu::Batch *DRW_mesh_batch_cache_get_wireframes_face(Mesh &mesh);
243
245
246/* -------------------------------------------------------------------- */
249
258 Mesh &mesh,
259 float **tot_area,
260 float **tot_uv_area);
262 Mesh &mesh);
263blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh);
264blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_edges(Object &object, Mesh &mesh);
265blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh);
266blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh);
267
269
270/* -------------------------------------------------------------------- */
273
274blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_edges(Object &object, Mesh &mesh);
275blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh &mesh);
276
278
279/* -------------------------------------------------------------------- */
282
283gpu::VertBuf *DRW_mesh_batch_cache_pos_vertbuf_get(Mesh &mesh);
284
285int DRW_mesh_material_count_get(const Object &object, const Mesh &mesh);
286
287/* Edit mesh bitflags (is this the right place?) */
288enum {
297 /* Beware to not go over 1 << 7 (it's a byte flag). */
298 /* NOTE: Grease pencil edit curve use another type of data format that allows for this value. */
300};
301
302enum {
311 /* Beware to not go over 1 << 7 (it's a byte flag). */
312};
313
315
316/* -------------------------------------------------------------------- */
319
320blender::gpu::Batch *DRW_particles_batch_cache_get_hair(Object *object,
321 ParticleSystem *psys,
322 ModifierData *md);
323blender::gpu::Batch *DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys);
324blender::gpu::Batch *DRW_particles_batch_cache_get_edit_strands(Object *object,
325 ParticleSystem *psys,
326 PTCacheEdit *edit,
327 bool use_weight);
329 ParticleSystem *psys,
330 PTCacheEdit *edit);
331blender::gpu::Batch *DRW_particles_batch_cache_get_edit_tip_points(Object *object,
332 ParticleSystem *psys,
333 PTCacheEdit *edit);
334
336
337} // namespace blender::draw
eMeshBatchDirtyMode
Definition BKE_mesh.h:37
unsigned int uint
struct Curve Curve
struct Curves Curves
struct bGPdata bGPdata
struct GreasePencil GreasePencil
struct Lattice Lattice
struct Mesh Mesh
struct Object Object
struct ParticleSystem ParticleSystem
struct PointCloud PointCloud
struct Scene Scene
struct Volume Volume
int DRW_curves_material_count_get(const Curves *curves)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Object &object, Mesh &mesh)
void DRW_gpencil_batch_cache_dirty_tag(bGPdata *gpd)
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)
blender::gpu::Batch ** DRW_mesh_batch_cache_get_surface_shaded(Object &object, Mesh &mesh, GPUMaterial **gpumat_array, uint gpumat_array_len)
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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh)
void DRW_grease_pencil_batch_cache_validate(GreasePencil *grase_pencil)
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_particles_batch_cache_get_edit_tip_points(Object *object, ParticleSystem *psys, PTCacheEdit *edit)
int DRW_mesh_material_count_get(const Object &object, const Mesh &mesh)
void DRW_lattice_batch_cache_free(Lattice *lt)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh)
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)
blender::gpu::Batch ** DRW_mesh_batch_cache_get_surface_texpaint(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh)
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_curves_batch_cache_get_sculpt_curves_cage(Curves *curves)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grase_pencil)
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)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh)
void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime)
void DRW_gpencil_batch_cache_free(bGPdata *gpd)
blender::gpu::Batch * DRW_mesh_batch_cache_get_uv_edges(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)
gpu::VertBuf * DRW_mesh_batch_cache_pos_vertbuf_get(Mesh &mesh)
int DRW_curve_material_count_get(const Curve *cu)
void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode)
gpu::VertBuf ** DRW_curves_texture_for_evaluated_attribute(Curves *curves, const char *name, bool *r_is_point_domain)
void DRW_pointcloud_batch_cache_create_requested(Object *ob)
void DRW_pointcloud_batch_cache_validate(PointCloud *pointcloud)
void DRW_mesh_batch_cache_validate(Object &object, Mesh &mesh)
int DRW_pointcloud_material_count_get(const PointCloud *pointcloud)
blender::gpu::Batch * DRW_mesh_batch_cache_get_verts_with_select_id(Mesh &mesh)
void DRW_vertbuf_create_wiredata(blender::gpu::VertBuf *vbo, const int vert_len)
blender::gpu::Batch * DRW_mesh_batch_cache_get_sculpt_overlays(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_grease_pencil_batch_cache_dirty_tag(GreasePencil *grase_pencil, int mode)
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)
gpu::VertBuf ** DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, const char *name)
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)
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_all_verts(Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_surface_edges(Object &object, 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)
int DRW_volume_material_count_get(const Volume *volume)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh)