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
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/* -------------------------------------------------------------------- */
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
81/* -------------------------------------------------------------------- */
85void DRW_batch_cache_free_old(Object *ob, int ctime);
86
92void DRW_curves_batch_cache_free_old(Curves *curves, int ctime);
93void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime);
94
97/* -------------------------------------------------------------------- */
101void DRW_vertbuf_create_wiredata(gpu::VertBuf *vbo, int vert_len);
102
105/* -------------------------------------------------------------------- */
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
119/* -------------------------------------------------------------------- */
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
131/* -------------------------------------------------------------------- */
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
154/* -------------------------------------------------------------------- */
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
168/* -------------------------------------------------------------------- */
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
177/* -------------------------------------------------------------------- */
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);
198 Mesh &mesh,
199 Span<const GPUMaterial *> materials);
200
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);
208
211/* -------------------------------------------------------------------- */
217blender::gpu::Batch *DRW_mesh_batch_cache_get_edit_edges(Mesh &mesh);
222
225/* -------------------------------------------------------------------- */
233
236/* -------------------------------------------------------------------- */
241
244/* -------------------------------------------------------------------- */
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
269/* -------------------------------------------------------------------- */
273blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_faces(Object &object, Mesh &mesh);
274blender::gpu::Batch *DRW_mesh_batch_cache_get_all_uv_wireframe(Object &object, Mesh &mesh);
275blender::gpu::Batch *DRW_mesh_batch_cache_get_uv_wireframe(Object &object, Mesh &mesh);
277
280/* -------------------------------------------------------------------- */
284/* Edit mesh bit-flags (is this the right place?). */
285enum {
294 /* Beware to not go over 1 << 7 (it's a byte flag). */
295 /* NOTE: Grease pencil edit curve use another type of data format that allows for this value. */
297};
298
299enum {
308 /* Beware to not go over 1 << 7 (it's a byte flag). */
309};
310
313/* -------------------------------------------------------------------- */
317blender::gpu::Batch *DRW_particles_batch_cache_get_hair(Object *object,
318 ParticleSystem *psys,
319 ModifierData *md);
320blender::gpu::Batch *DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys);
321blender::gpu::Batch *DRW_particles_batch_cache_get_edit_strands(Object *object,
322 ParticleSystem *psys,
323 PTCacheEdit *edit,
324 bool use_weight);
326 ParticleSystem *psys,
327 PTCacheEdit *edit);
328blender::gpu::Batch *DRW_particles_batch_cache_get_edit_tip_points(Object *object,
329 ParticleSystem *psys,
330 PTCacheEdit *edit);
331
332/* Particle data are stored in world space. If an object is instanced, the associated particle
333 * systems need to be offset appropriately. */
334float4x4 DRW_particles_dupli_matrix_get(const ObjectRef &ob_ref);
335
338} // namespace blender::draw
eMeshBatchDirtyMode
Definition BKE_mesh.h:37
Scene scene
StringRefNull name
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:71
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_surface_edges(Mesh &mesh)
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_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_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)
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)
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_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)
signed char int8_t
Definition stdint.h:75