Blender V5.3
draw_cache_extract_mesh.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2017 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "BKE_attribute.hh"
12
13#include "DNA_mesh_types.h"
14#include "DNA_scene_types.h"
15
16#include "BLI_map.hh"
17#include "BLI_set.hh"
18#include "BLI_task.hh"
19
20#include "GPU_capabilities.hh"
21#include "GPU_debug.hh"
22
23#include "draw_cache_extract.hh"
24#include "draw_subdivision.hh"
25
27
28// #define DEBUG_TIME
29
30#ifdef DEBUG_TIME
32#endif
33
34namespace blender::draw {
35
36/* ---------------------------------------------------------------------- */
39
41 Span<IBOType> ibo_requests,
42 Span<VBOType> vbo_requests,
43 MeshBufferCache &cache)
44{
45 const bool request_face_normals = vbo_requests.contains(VBOType::CornerNormal) ||
46 vbo_requests.contains(VBOType::FaceDotNormal) ||
47 vbo_requests.contains(VBOType::EdgeFactor) ||
48 vbo_requests.contains(VBOType::MeshAnalysis);
49 const bool request_corner_normals = vbo_requests.contains(VBOType::CornerNormal);
50 const bool force_corner_normals = vbo_requests.contains(VBOType::Tangents);
51
52 if (request_face_normals) {
54 }
55 if ((request_corner_normals && mr.normals_domain == bke::MeshNormalDomain::Corner &&
57 force_corner_normals)
58 {
60 }
61
62 const bool calc_loose_geom = ibo_requests.contains(IBOType::Lines) ||
63 ibo_requests.contains(IBOType::LinesLoose) ||
64 ibo_requests.contains(IBOType::Points) ||
65 vbo_requests.contains(VBOType::Position) ||
66 vbo_requests.contains(VBOType::EditData) ||
67 vbo_requests.contains(VBOType::VertexNormal) ||
68 vbo_requests.contains(VBOType::IndexVert) ||
69 vbo_requests.contains(VBOType::IndexEdge) ||
70 vbo_requests.contains(VBOType::EdgeFactor);
71
72 if (calc_loose_geom) {
74 }
75}
76
78
79/* ---------------------------------------------------------------------- */
82
88static bool use_normals_simplify(const Scene &scene, const MeshRenderData &mr)
89{
90 if (!(scene.r.mode & R_SIMPLIFY) || !(scene.r.mode & R_SIMPLIFY_NORMALS)) {
91 return false;
92 }
93 if (!mr.mesh) {
94 return true;
95 }
96 const Mesh &mesh = *mr.mesh;
97 const std::optional<bke::AttributeMetaData> meta_data = mesh.attributes().lookup_meta_data(
98 "custom_normal");
99 if (!meta_data) {
100 return false;
101 }
102 if (meta_data->domain == bke::AttrDomain::Corner &&
103 meta_data->data_type == bke::AttrType::Int16_2D)
104 {
105 return true;
106 }
107 return false;
108}
109
111 const Scene &scene,
112 MeshBatchCache &cache,
113 MeshBufferCache &mbc,
114 const Span<IBOType> ibo_requests,
115 const Span<VBOType> vbo_requests,
116 Object &object,
117 Mesh &mesh,
118 const bool is_editmode,
119 const bool is_paint_mode,
120 const bool do_final,
121 const bool do_uvedit,
122 const bool use_hide)
123{
124 if (ibo_requests.is_empty() && vbo_requests.is_empty()) {
125 return;
126 }
127
128 MeshBufferList &buffers = mbc.buff;
129
130 Vector<IBOType, 16> ibos_to_create;
131 for (const IBOType request : ibo_requests) {
132 if (!buffers.ibos.contains(request)) {
133 ibos_to_create.append(request);
134 }
135 }
136
137 Vector<VBOType, 16> vbos_to_create;
138 for (const VBOType request : vbo_requests) {
139 if (!buffers.vbos.contains(request)) {
140 vbos_to_create.append(request);
141 }
142 }
143
144 if (ibos_to_create.is_empty() && vbos_to_create.is_empty()) {
145 return;
146 }
147
148#ifdef DEBUG_TIME
149 SCOPED_TIMER(__func__);
150#endif
151
153 object, mesh, is_editmode, is_paint_mode, do_final, do_uvedit, use_hide, scene.toolsettings);
154
157
158 ensure_dependency_data(mr, ibo_requests, vbo_requests, mbc);
159
160 Array<gpu::IndexBufPtr, 16> created_ibos(ibos_to_create.size());
161
162 {
163 /* Because lines and loose lines are stored in the same buffer, they're handled separately
164 * rather than from potentially multiple threads in the parallel_for_each loop below. */
165 const int lines_index = ibos_to_create.as_span().first_index_try(IBOType::Lines);
166 const int loose_lines_index = ibos_to_create.as_span().first_index_try(IBOType::LinesLoose);
167 if (lines_index != -1 || loose_lines_index != -1) {
168 extract_lines(mr,
169 lines_index == -1 ? nullptr : &created_ibos[lines_index],
170 loose_lines_index == -1 ? nullptr : &created_ibos[loose_lines_index],
171 cache.no_loose_wire);
172 }
173 }
174
175 threading::parallel_for_each(ibos_to_create.index_range(), [&](const int i) {
176 switch (ibos_to_create[i]) {
177 case IBOType::Tris:
178 created_ibos[i] = extract_tris(mr, mesh_render_data_faces_sorted_ensure(mr, mbc));
179 break;
180 case IBOType::Lines:
181 case IBOType::LinesLoose:
182 /* Handled as a special case above. */
183 break;
184 case IBOType::Points:
185 created_ibos[i] = extract_points(mr);
186 break;
187 case IBOType::FaceDots:
188 created_ibos[i] = extract_face_dots(mr);
189 break;
190 case IBOType::LinesPaintMask:
191 created_ibos[i] = extract_lines_paint_mask(mr);
192 break;
193 case IBOType::LinesAdjacency:
194 created_ibos[i] = extract_lines_adjacency(mr, cache.is_manifold);
195 break;
196 case IBOType::UVTris:
197 created_ibos[i] = extract_edituv_tris(mr, false);
198 break;
199 case IBOType::EditUVTris:
200 created_ibos[i] = extract_edituv_tris(mr, true);
201 break;
202 case IBOType::AllUVLines:
203 created_ibos[i] = extract_edituv_lines(mr, UvExtractionMode::All);
204 break;
205 case IBOType::UVLines:
206 created_ibos[i] = extract_edituv_lines(mr, UvExtractionMode::Selection);
207 break;
208 case IBOType::EditUVLines:
209 created_ibos[i] = extract_edituv_lines(mr, UvExtractionMode::Edit);
210 break;
211 case IBOType::EditUVPoints:
212 created_ibos[i] = extract_edituv_points(mr);
213 break;
214 case IBOType::EditUVFaceDots:
215 created_ibos[i] = extract_edituv_face_dots(mr);
216 break;
217 }
218 });
219
220 Array<gpu::VertBufPtr, 16> created_vbos(vbos_to_create.size());
221
222 const bool do_hq_normals = (scene.r.perf_flag & SCE_PERF_HQ_NORMALS) != 0 ||
224
225 /* These buffers are copied to face corners on the GPU, which is only possible from this thread
226 * rather than from the worker threads in the parallel_for_each loop below. */
227 for (const int i : vbos_to_create.index_range()) {
228 const VBOType type = vbos_to_create[i];
229 if (type == VBOType::Position) {
230 created_vbos[i] = extract_positions(mr, mbc);
231 }
232 else if (type == VBOType::CornerNormal) {
233 created_vbos[i] = extract_normals(mr, mbc, do_hq_normals);
234 }
235 else if (type == VBOType::VertexNormal) {
236 created_vbos[i] = extract_vert_normals(mr, mbc);
237 }
238 else if (type == VBOType::VertexGroupWeight) {
239 created_vbos[i] = extract_weights(mr, cache, mbc);
240 }
241 else if (type == VBOType::Orco) {
242 created_vbos[i] = extract_orco(mr, mbc);
243 }
244 else if (type == VBOType::AttrViewer) {
245 created_vbos[i] = extract_attr_viewer(mr, mbc);
246 }
247 else if (type >= VBOType::Attr0 && type <= VBOType::Attr15) {
248 const int8_t attr_index = int8_t(type) - int8_t(VBOType::Attr0);
249 created_vbos[i] = extract_attribute(mr, mbc, cache.attr_used[attr_index]);
250 }
251 }
252
253 threading::parallel_for_each(vbos_to_create.index_range(), [&](const int i) {
254 switch (vbos_to_create[i]) {
255 case VBOType::Position:
256 case VBOType::CornerNormal:
257 case VBOType::VertexGroupWeight:
258 case VBOType::VertexNormal:
259 case VBOType::Orco:
260 case VBOType::AttrViewer:
261 case VBOType::Attr0:
262 case VBOType::Attr1:
263 case VBOType::Attr2:
264 case VBOType::Attr3:
265 case VBOType::Attr5:
266 case VBOType::Attr6:
267 case VBOType::Attr7:
268 case VBOType::Attr8:
269 case VBOType::Attr9:
270 case VBOType::Attr10:
271 case VBOType::Attr11:
272 case VBOType::Attr12:
273 case VBOType::Attr13:
274 case VBOType::Attr14:
275 case VBOType::Attr15:
276 break;
277 case VBOType::EdgeFactor:
278 created_vbos[i] = extract_edge_factor(mr);
279 break;
280 break;
281 case VBOType::UVs:
282 created_vbos[i] = extract_uv_maps(mr, cache);
283 break;
284 case VBOType::Tangents:
285 created_vbos[i] = extract_tangents(mr, cache, do_hq_normals);
286 break;
287 case VBOType::SculptData:
288 created_vbos[i] = extract_sculpt_data(mr);
289 break;
290 case VBOType::EditData:
291 created_vbos[i] = extract_edit_data(mr);
292 break;
293 case VBOType::EditUVData:
294 created_vbos[i] = extract_edituv_data(mr);
295 break;
296 case VBOType::EditUVStretchArea:
297 created_vbos[i] = extract_edituv_stretch_area(mr, cache.tot_area, cache.tot_uv_area);
298 break;
299 case VBOType::EditUVStretchAngle:
300 created_vbos[i] = extract_edituv_stretch_angle(mr);
301 break;
302 case VBOType::MeshAnalysis:
303 created_vbos[i] = extract_mesh_analysis(mr, object.object_to_world());
304 break;
305 case VBOType::FaceDotPosition:
306 created_vbos[i] = extract_face_dots_position(mr);
307 break;
308 case VBOType::FaceDotNormal:
309 created_vbos[i] = extract_face_dot_normals(mr, do_hq_normals);
310 break;
311 case VBOType::FaceDotUV:
312 created_vbos[i] = extract_face_dots_uv(mr);
313 break;
314 case VBOType::FaceDotEditUVData:
315 created_vbos[i] = extract_face_dots_edituv_data(mr);
316 break;
317 case VBOType::SkinRoots:
318 created_vbos[i] = extract_skin_roots(mr);
319 break;
320 case VBOType::IndexVert:
321 created_vbos[i] = extract_vert_index(mr);
322 break;
323 case VBOType::IndexEdge:
324 created_vbos[i] = extract_edge_index(mr);
325 break;
326 case VBOType::IndexFace:
327 created_vbos[i] = extract_face_index(mr);
328 break;
329 case VBOType::IndexFaceDot:
330 created_vbos[i] = extract_face_dot_index(mr);
331 break;
332 case VBOType::PaintOverlayFlag:
333 created_vbos[i] = extract_paint_overlay_flags(mr);
334 break;
335 }
336 });
337
338 for (const int i : ibos_to_create.index_range()) {
339 buffers.ibos.add_new(ibos_to_create[i], std::move(created_ibos[i]));
340 }
341 for (const int i : vbos_to_create.index_range()) {
342 buffers.vbos.add_new(vbos_to_create[i], std::move(created_vbos[i]));
343 }
344}
345
347
348/* ---------------------------------------------------------------------- */
351
353 MeshBufferCache &mbc,
354 const Span<IBOType> ibo_requests,
355 const Span<VBOType> vbo_requests,
356 DRWSubdivCache &subdiv_cache,
357 MeshRenderData &mr)
358{
359 if (ibo_requests.is_empty() && vbo_requests.is_empty()) {
360 return;
361 }
362 MeshBufferList &buffers = mbc.buff;
363
366 DRW_subdivide_loose_geom(subdiv_cache, mbc);
367
368 Set<IBOType, 16> ibos_to_create;
369 for (const IBOType request : ibo_requests) {
370 if (!buffers.ibos.contains(request)) {
371 ibos_to_create.add_new(request);
372 }
373 }
374
375 Set<VBOType, 16> vbos_to_create;
376 for (const VBOType request : vbo_requests) {
377 if (!buffers.vbos.contains(request)) {
378 vbos_to_create.add_new(request);
379 }
380 }
381
382 if (ibos_to_create.is_empty() && vbos_to_create.is_empty()) {
383 return;
384 }
385
386 static gpu::DebugScope subdiv_extract_scope = {"SubdivExtraction"};
387 auto capture = subdiv_extract_scope.scoped_capture();
388
389 if (vbos_to_create.contains(VBOType::Position) || vbos_to_create.contains(VBOType::Orco)) {
390 gpu::VertBufPtr orco_vbo;
391 /* Don't use `add_new` because #VBOType::Orco might be requested after #VBOType::Position
392 * already exists. It's inefficient to build the position VBO a second time but that's the API
393 * that GPU subdivision provides. */
394 buffers.vbos.add(
397 subdiv_cache, mr, vbos_to_create.contains(VBOType::Orco) ? &orco_vbo : nullptr));
398 if (orco_vbo) {
399 buffers.vbos.add_new(VBOType::Orco, std::move(orco_vbo));
400 }
401 }
402 if (vbos_to_create.contains(VBOType::CornerNormal)) {
403 /* The corner normals calculation uses positions and normals stored in the `pos` VBO. */
404 buffers.vbos.add_new(
406 extract_normals_subdiv(mr, subdiv_cache, *buffers.vbos.lookup(VBOType::Position)));
407 }
408 if (vbos_to_create.contains(VBOType::EdgeFactor)) {
409 buffers.vbos.add_new(
411 extract_edge_factor_subdiv(subdiv_cache, mr, *buffers.vbos.lookup(VBOType::Position)));
412 }
413 if (ibos_to_create.contains(IBOType::Lines) || ibos_to_create.contains(IBOType::LinesLoose)) {
414 gpu::IndexBufPtr lines_ibo;
415 gpu::IndexBufPtr lines_loose_ibo;
416 extract_lines_subdiv(subdiv_cache,
417 mr,
418 ibos_to_create.contains(IBOType::Lines) ? &lines_ibo : nullptr,
419 ibos_to_create.contains(IBOType::LinesLoose) ? &lines_loose_ibo : nullptr,
420 cache.no_loose_wire);
421 if (lines_ibo) {
422 buffers.ibos.add_new(IBOType::Lines, std::move(lines_ibo));
423 }
424 if (lines_loose_ibo) {
425 buffers.ibos.add_new(IBOType::LinesLoose, std::move(lines_loose_ibo));
426 }
427 }
428 if (ibos_to_create.contains(IBOType::Tris)) {
429 buffers.ibos.add_new(IBOType::Tris, extract_tris_subdiv(subdiv_cache, cache));
430 }
431 if (ibos_to_create.contains(IBOType::Points)) {
432 buffers.ibos.add_new(IBOType::Points, extract_points_subdiv(mr, subdiv_cache));
433 }
434 if (vbos_to_create.contains(VBOType::EditData)) {
435 buffers.vbos.add_new(VBOType::EditData, extract_edit_data_subdiv(mr, subdiv_cache));
436 }
437 if (vbos_to_create.contains(VBOType::Tangents)) {
438 buffers.vbos.add_new(VBOType::Tangents, extract_tangents_subdiv(mr, subdiv_cache, cache));
439 }
440 if (vbos_to_create.contains(VBOType::IndexVert)) {
441 buffers.vbos.add_new(VBOType::IndexVert, extract_vert_index_subdiv(subdiv_cache, mr));
442 }
443 if (vbos_to_create.contains(VBOType::IndexEdge)) {
444 buffers.vbos.add_new(VBOType::IndexEdge, extract_edge_index_subdiv(subdiv_cache, mr));
445 }
446 if (vbos_to_create.contains(VBOType::IndexFace)) {
447 buffers.vbos.add_new(VBOType::IndexFace, extract_face_index_subdiv(subdiv_cache, mr));
448 }
449 if (vbos_to_create.contains(VBOType::VertexGroupWeight)) {
450 buffers.vbos.add_new(VBOType::VertexGroupWeight,
451 extract_weights_subdiv(mr, subdiv_cache, cache, mbc));
452 }
453 if (vbos_to_create.contains(VBOType::FaceDotNormal) ||
454 vbos_to_create.contains(VBOType::FaceDotPosition) ||
455 ibos_to_create.contains(IBOType::FaceDots))
456 {
457 gpu::VertBufPtr face_dot_position_vbo;
458 gpu::VertBufPtr face_dot_normal_vbo;
459 gpu::IndexBufPtr face_dot_ibo;
460
461 /* We use only one extractor for face dots, as the work is done in a single compute shader. */
463 subdiv_cache,
464 face_dot_position_vbo,
465 vbos_to_create.contains(VBOType::FaceDotNormal) ? &face_dot_normal_vbo : nullptr,
466 face_dot_ibo);
467 if (vbos_to_create.contains(VBOType::FaceDotPosition)) {
468 buffers.vbos.add_new(VBOType::FaceDotPosition, std::move(face_dot_position_vbo));
469 }
470 if (face_dot_normal_vbo) {
471 buffers.vbos.add_new(VBOType::FaceDotNormal, std::move(face_dot_normal_vbo));
472 }
473 if (ibos_to_create.contains(IBOType::FaceDots)) {
474 buffers.ibos.add_new(IBOType::FaceDots, std::move(face_dot_ibo));
475 }
476 }
477 if (vbos_to_create.contains(VBOType::PaintOverlayFlag)) {
478 buffers.vbos.add_new(VBOType::PaintOverlayFlag,
479 extract_paint_overlay_flags_subdiv(mr, subdiv_cache));
480 }
481 if (ibos_to_create.contains(IBOType::LinesPaintMask)) {
482 buffers.ibos.add_new(IBOType::LinesPaintMask,
483 extract_lines_paint_mask_subdiv(mr, subdiv_cache));
484 }
485 if (ibos_to_create.contains(IBOType::LinesAdjacency)) {
486 buffers.ibos.add_new(IBOType::LinesAdjacency,
487 extract_lines_adjacency_subdiv(subdiv_cache, cache.is_manifold));
488 }
489 if (vbos_to_create.contains(VBOType::SculptData)) {
490 buffers.vbos.add_new(VBOType::SculptData, extract_sculpt_data_subdiv(mr, subdiv_cache));
491 }
492 if (vbos_to_create.contains(VBOType::UVs)) {
493 /* Make sure UVs are computed before edituv stuffs. */
494 buffers.vbos.add_new(VBOType::UVs, extract_uv_maps_subdiv(subdiv_cache, cache));
495 }
496 if (ibos_to_create.contains(IBOType::AllUVLines)) {
497 buffers.ibos.add_new(IBOType::AllUVLines,
499 }
500 if (ibos_to_create.contains(IBOType::UVLines)) {
501 buffers.ibos.add_new(
504 }
505 if (vbos_to_create.contains(VBOType::EditUVStretchArea)) {
506 buffers.vbos.add_new(
508 extract_edituv_stretch_area_subdiv(mr, subdiv_cache, cache.tot_area, cache.tot_uv_area));
509 }
510 if (vbos_to_create.contains(VBOType::EditUVStretchAngle)) {
511 buffers.vbos.add_new(VBOType::EditUVStretchAngle,
512 extract_edituv_stretch_angle_subdiv(mr, subdiv_cache, cache));
513 }
514 if (vbos_to_create.contains(VBOType::EditUVData)) {
515 buffers.vbos.add_new(VBOType::EditUVData, extract_edituv_data_subdiv(mr, subdiv_cache));
516 }
517 if (ibos_to_create.contains(IBOType::EditUVTris)) {
518 buffers.ibos.add_new(IBOType::EditUVTris, extract_edituv_tris_subdiv(mr, subdiv_cache));
519 }
520 if (ibos_to_create.contains(IBOType::EditUVLines)) {
521 buffers.ibos.add_new(IBOType::EditUVLines,
523 }
524 if (ibos_to_create.contains(IBOType::EditUVPoints)) {
525 buffers.ibos.add_new(IBOType::EditUVPoints, extract_edituv_points_subdiv(mr, subdiv_cache));
526 }
527 for (const int8_t i : IndexRange(GPU_MAX_ATTR)) {
528 const VBOType request = VBOType(int8_t(VBOType::Attr0) + i);
529 if (vbos_to_create.contains(request)) {
530 buffers.vbos.add_new(request,
531 extract_attribute_subdiv(mr, mbc, subdiv_cache, cache.attr_used[i]));
532 }
533 }
534}
535
537
538} // namespace blender::draw
Utility defines for timing/benchmarks.
#define SCOPED_TIMER(name)
Definition BLI_timeit.hh:64
bool contains(const Key &key) const
Definition BLI_set.hh:310
bool is_empty() const
Definition BLI_set.hh:614
void add_new(const Key &key)
Definition BLI_set.hh:233
constexpr bool is_empty() const
Definition BLI_span.hh:264
constexpr bool contains(const T &value) const
Definition BLI_span.hh:281
int64_t size() const
void append(const T &value)
bool is_empty() const
IndexRange index_range() const
Span< T > as_span() const
Extraction of Mesh data into VBO to feed to GPU.
void mesh_render_data_update_face_normals(MeshRenderData &mr)
gpu::IndexBufPtr extract_lines_adjacency_subdiv(const DRWSubdivCache &subdiv_cache, bool &r_is_manifold)
gpu::VertBufPtr extract_edit_data_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
static void ensure_dependency_data(MeshRenderData &mr, Span< IBOType > ibo_requests, Span< VBOType > vbo_requests, MeshBufferCache &cache)
gpu::IndexBufPtr extract_edituv_lines_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, UvExtractionMode mode)
gpu::IndexBufPtr extract_points_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
gpu::VertBufPtr extract_tangents_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const MeshBatchCache &cache)
gpu::VertBufPtr extract_edituv_stretch_angle_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const MeshBatchCache &cache)
gpu::VertBufPtr extract_attribute_subdiv(const MeshRenderData &mr, MeshBufferCache &cache, const DRWSubdivCache &subdiv_cache, StringRef name)
void DRW_subdivide_loose_geom(DRWSubdivCache &subdiv_cache, const MeshBufferCache &cache)
gpu::VertBufPtr extract_vert_index_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr)
gpu::VertBufPtr extract_weights_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, const MeshBatchCache &batch_cache, MeshBufferCache &cache)
gpu::VertBufPtr extract_normals(const MeshRenderData &mr, MeshBufferCache &cache, bool use_hq)
gpu::VertBufPtr extract_sculpt_data_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
gpu::IndexBufPtr extract_edituv_tris_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
void extract_lines(const MeshRenderData &mr, gpu::IndexBufPtr *lines, gpu::IndexBufPtr *lines_loose, bool &no_loose_wire)
gpu::VertBufPtr extract_orco(const MeshRenderData &mr, MeshBufferCache &cache)
gpu::VertBufPtr extract_positions_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr, gpu::VertBufPtr *orco_vbo)
gpu::IndexBufPtr extract_edituv_points_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
gpu::VertBufPtr extract_positions(const MeshRenderData &mr, MeshBufferCache &cache)
gpu::VertBufPtr extract_face_index_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr)
void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache &cache, MeshBufferCache &mbc, Span< IBOType > ibo_requests, Span< VBOType > vbo_requests, DRWSubdivCache &subdiv_cache, MeshRenderData &mr)
gpu::VertBufPtr extract_edge_index_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr)
gpu::VertBufPtr extract_paint_overlay_flags_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
gpu::VertBufPtr extract_weights(const MeshRenderData &mr, const MeshBatchCache &batch_cache, MeshBufferCache &cache)
gpu::IndexBufPtr extract_tris_subdiv(const DRWSubdivCache &subdiv_cache, MeshBatchCache &cache)
void mesh_render_data_update_corner_normals(MeshRenderData &mr)
void extract_face_dots_subdiv(const DRWSubdivCache &subdiv_cache, gpu::VertBufPtr &fdots_pos, gpu::VertBufPtr *fdots_nor, gpu::IndexBufPtr &fdots)
gpu::VertBufPtr extract_edge_factor_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr, gpu::VertBuf &pos)
gpu::VertBufPtr extract_normals_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, gpu::VertBuf &pos)
gpu::VertBufPtr extract_attr_viewer(const MeshRenderData &mr, MeshBufferCache &cache)
void mesh_buffer_cache_create_requested(TaskGraph &task_graph, const Scene &scene, MeshBatchCache &cache, MeshBufferCache &mbc, Span< IBOType > ibo_requests, Span< VBOType > vbo_requests, Object &object, Mesh &mesh, bool is_editmode, bool is_paint_mode, bool do_final, bool do_uvedit, bool use_hide)
static bool use_normals_simplify(const Scene &scene, const MeshRenderData &mr)
gpu::VertBufPtr extract_edituv_stretch_area_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, float &tot_area, float &tot_uv_area)
MeshRenderData mesh_render_data_create(Object &object, Mesh &mesh, const bool is_editmode, const bool is_paint_mode, const bool do_final, const bool do_uvedit, const bool use_hide, const ToolSettings *ts)
void mesh_render_data_update_loose_geom(MeshRenderData &mr, MeshBufferCache &cache)
gpu::IndexBufPtr extract_lines_paint_mask_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
gpu::VertBufPtr extract_vert_normals(const MeshRenderData &mr, MeshBufferCache &cache)
gpu::VertBufPtr extract_uv_maps_subdiv(const DRWSubdivCache &subdiv_cache, const MeshBatchCache &cache)
gpu::VertBufPtr extract_attribute(const MeshRenderData &mr, MeshBufferCache &cache, StringRef name)
gpu::VertBufPtr extract_edituv_data_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
void extract_lines_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr, gpu::IndexBufPtr *lines, gpu::IndexBufPtr *lines_loose, bool &no_loose_wire)
std::unique_ptr< IndexBuf, IndexBufDeleter > IndexBufPtr
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
void parallel_for_each(Range &&range, const Function &function)
Definition BLI_task.hh:31
bool GPU_use_hq_normals_workaround()
signed char int8_t
Definition BKE_text.h:76
bke::MeshRuntime * runtime
struct RenderData r
struct ToolSettings * toolsettings
VectorSet< std::string > attr_used
Map< IBOType, std::unique_ptr< gpu::IndexBuf, gpu::IndexBufDeleter > > ibos
Map< VBOType, std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > > vbos
bke::MeshNormalDomain normals_domain
ScopedCapture scoped_capture()
Definition GPU_debug.hh:156