Blender V4.5
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
17struct GPUMaterial;
18namespace blender::gpu {
19class Batch;
20class VertBuf;
21} // namespace blender::gpu
22struct GPUUniformBuf;
23struct ModifierData;
24struct PTCacheEdit;
25struct ParticleSystem;
26struct TaskGraph;
27
28struct Curve;
29struct Curves;
30struct Lattice;
31struct Mesh;
32struct Object;
33struct Scene;
34struct PointCloud;
35struct Volume;
36struct GreasePencil;
37
39
40namespace blender::draw {
41
42struct ObjectRef;
43
44/* -------------------------------------------------------------------- */
47
48void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode);
51
54void DRW_mesh_batch_cache_free(void *batch_cache);
55
59
62
63void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode);
66
67void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode);
70
71void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode);
74
75void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grease_pencil, int mode);
78
80
81/* -------------------------------------------------------------------- */
84
85void DRW_batch_cache_free_old(Object *ob, int ctime);
86
91void DRW_mesh_batch_cache_free_old(Mesh *mesh, int ctime);
92void DRW_curves_batch_cache_free_old(Curves *curves, int ctime);
93void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime);
94
96
97/* -------------------------------------------------------------------- */
100
101void DRW_vertbuf_create_wiredata(gpu::VertBuf *vbo, int vert_len);
102
104
105/* -------------------------------------------------------------------- */
108
110
111blender::gpu::Batch *DRW_curve_batch_cache_get_wire_edge(Curve *cu);
113blender::gpu::Batch *DRW_curve_batch_cache_get_normal_edge(Curve *cu);
114blender::gpu::Batch *DRW_curve_batch_cache_get_edit_edges(Curve *cu);
115blender::gpu::Batch *DRW_curve_batch_cache_get_edit_verts(Curve *cu);
116
118
119/* -------------------------------------------------------------------- */
122
123blender::gpu::Batch *DRW_lattice_batch_cache_get_all_edges(Lattice *lt,
124 bool use_weight,
125 int actdef);
126blender::gpu::Batch *DRW_lattice_batch_cache_get_all_verts(Lattice *lt);
127blender::gpu::Batch *DRW_lattice_batch_cache_get_edit_verts(Lattice *lt);
128
130
131/* -------------------------------------------------------------------- */
134
142 StringRef name,
143 bool *r_is_point_domain);
144
145blender::gpu::Batch *DRW_curves_batch_cache_get_edit_points(Curves *curves);
146blender::gpu::Batch *DRW_curves_batch_cache_get_sculpt_curves_cage(Curves *curves);
147blender::gpu::Batch *DRW_curves_batch_cache_get_edit_curves_handles(Curves *curves);
148blender::gpu::Batch *DRW_curves_batch_cache_get_edit_curves_lines(Curves *curves);
149
151
153
154/* -------------------------------------------------------------------- */
157
159
160gpu::VertBuf **DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, StringRef name);
161blender::gpu::Batch *DRW_pointcloud_batch_cache_get_dots(Object *ob);
162blender::gpu::Batch *DRW_pointcloud_batch_cache_get_edit_dots(PointCloud *pointcloud);
163
165
167
168/* -------------------------------------------------------------------- */
171
172blender::gpu::Batch *DRW_volume_batch_cache_get_wireframes_face(Volume *volume);
173blender::gpu::Batch *DRW_volume_batch_cache_get_selection_surface(Volume *volume);
174
176
177/* -------------------------------------------------------------------- */
180
184void DRW_mesh_batch_cache_create_requested(TaskGraph &task_graph,
185 Object &ob,
186 Mesh &mesh,
187 const Scene &scene,
188 bool is_paint_mode,
189 bool use_hide);
190
191blender::gpu::Batch *DRW_mesh_batch_cache_get_all_verts(Mesh &mesh);
192blender::gpu::Batch *DRW_mesh_batch_cache_get_all_edges(Mesh &mesh);
193blender::gpu::Batch *DRW_mesh_batch_cache_get_loose_edges(Mesh &mesh);
194blender::gpu::Batch *DRW_mesh_batch_cache_get_edge_detection(Mesh &mesh, bool *r_is_manifold);
195blender::gpu::Batch *DRW_mesh_batch_cache_get_surface(Mesh &mesh);
196blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_edges(Mesh &mesh);
198 Mesh &mesh,
199 Span<const GPUMaterial *> materials);
200
202blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_texpaint_single(Object &object, Mesh &mesh);
203blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_vertpaint(Object &object, Mesh &mesh);
204blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_sculpt(Object &object, Mesh &mesh);
205blender::gpu::Batch *DRW_mesh_batch_cache_get_surface_weights(Mesh &mesh);
206blender::gpu::Batch *DRW_mesh_batch_cache_get_sculpt_overlays(Mesh &mesh);
208
210
211/* -------------------------------------------------------------------- */
214
215blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_triangles(Mesh &mesh);
216blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh);
217blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_edges(Mesh &mesh);
218blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_vert_normals(Mesh &mesh);
219blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh);
220blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh);
221blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh);
222
224
225/* -------------------------------------------------------------------- */
228
231blender::gpu::Batch *DRW_mesh_batch_cache_get_edges_with_select_id(Mesh &mesh);
232blender::gpu::Batch *DRW_mesh_batch_cache_get_verts_with_select_id(Mesh &mesh);
233
235
236/* -------------------------------------------------------------------- */
239
240blender::gpu::Batch *DRW_mesh_batch_cache_get_wireframes_face(Mesh &mesh);
241
243
244/* -------------------------------------------------------------------- */
247
256 Mesh &mesh,
257 float **tot_area,
258 float **tot_uv_area);
260 Mesh &mesh);
261blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh);
262blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_wireframe(Object &object, Mesh &mesh);
263blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_edges(Object &object, Mesh &mesh);
264blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh);
265blender::gpu::Batch *DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh);
266
268
269/* -------------------------------------------------------------------- */
272
273blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_faces(Object &object, Mesh &mesh);
274blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_wireframe(Object &object, Mesh &mesh);
275blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh &mesh);
276
278
279/* -------------------------------------------------------------------- */
282
283/* Edit mesh bit-flags (is this the right place?). */
284enum {
293 /* Beware to not go over 1 << 7 (it's a byte flag). */
294 /* NOTE: Grease pencil edit curve use another type of data format that allows for this value. */
296};
297
298enum {
307 /* Beware to not go over 1 << 7 (it's a byte flag). */
308};
309
311
312/* -------------------------------------------------------------------- */
315
316blender::gpu::Batch *DRW_particles_batch_cache_get_hair(Object *object,
317 ParticleSystem *psys,
318 ModifierData *md);
319blender::gpu::Batch *DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys);
320blender::gpu::Batch *DRW_particles_batch_cache_get_edit_strands(Object *object,
321 ParticleSystem *psys,
322 PTCacheEdit *edit,
323 bool use_weight);
325 ParticleSystem *psys,
326 PTCacheEdit *edit);
327blender::gpu::Batch *DRW_particles_batch_cache_get_edit_tip_points(Object *object,
328 ParticleSystem *psys,
329 PTCacheEdit *edit);
330
331/* Particle data are stored in world space. If an object is instanced, the associated particle
332 * systems need to be offset appropriately. */
333float4x4 DRW_particles_dupli_matrix_get(const ObjectRef &ob_ref);
334
336
337} // 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)
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)
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:71
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_surface_edges(Mesh &mesh)
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)
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)
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_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)
float4x4 DRW_particles_dupli_matrix_get(const ObjectRef &ob_ref)
void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime)
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)
gpu::VertBuf ** DRW_curves_texture_for_evaluated_attribute(Curves *curves, StringRef name, bool *r_is_point_domain)
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)
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)
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_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)
MatBase< float, 4, 4 > float4x4