30 corner_tris.
cast<uint32_t>().data(),
46 for (const int face : range) {
47 if (!hide_poly.is_empty() && hide_poly[face]) {
50 const IndexRange mesh_range = bke::mesh::face_triangles_range(faces, face);
51 const Span<uint3> mesh_tris = corner_tris.slice(mesh_range).cast<uint3>();
52 MutableSpan<uint3> ibo_tris = data.slice(face_tri_offsets[face], mesh_tris.size());
53 ibo_tris.copy_from(mesh_tris);
71 for (const int face_index : range) {
72 const BMFace &face = *BM_face_at_index(&bm, face_index);
73 if (BM_elem_flag_test(&face, BM_ELEM_HIDDEN)) {
76 const int corner_index = BM_elem_index_get(BM_FACE_FIRST_LOOP(&face));
77 const IndexRange bm_tris(poly_to_tri_count(face_index, corner_index),
78 bke::mesh::face_triangles_num(face.len));
79 const IndexRange ibo_tris(face_tri_offsets[face_index], bm_tris.size());
80 for (const int i : bm_tris.index_range()) {
81 data[ibo_tris[i]] = uint3(BM_elem_index_get(looptris[bm_tris[i]][0]),
82 BM_elem_index_get(looptris[bm_tris[i]][1]),
83 BM_elem_index_get(looptris[bm_tris[i]][2]));
104 const int start = mat_start * 3;
105 const int len = mat_tri_len * 3;
107 mat_start += mat_tri_len;
128 const int start = subdiv_cache.
mat_start[
i] * 6;
blender::MutableSpan< uint32_t > GPU_indexbuf_get_data(GPUIndexBufBuilder *)
blender::gpu::IndexBuf * GPU_indexbuf_build_on_device(uint index_len)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
blender::gpu::IndexBuf * GPU_indexbuf_build_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices)
blender::gpu::IndexBuf * GPU_indexbuf_create_subrange(blender::gpu::IndexBuf *elem_src, uint start, uint length)
blender::gpu::IndexBuf * GPU_indexbuf_build_from_memory(GPUPrimType prim_type, const uint32_t *data, int32_t data_len, int32_t index_min, int32_t index_max, bool uses_restart_indices)
BMesh const char void * data
IndexRange index_range() const
Span< NewT > constexpr cast() const
constexpr int64_t size() const
void draw_subdiv_build_tris_buffer(const DRWSubdivCache &cache, gpu::IndexBuf *subdiv_tris, const int material_count)
gpu::IndexBufPtr extract_tris_subdiv(const DRWSubdivCache &subdiv_cache, MeshBatchCache &cache)
static gpu::IndexBufPtr extract_tris_bmesh(const MeshRenderData &mr, const SortedFaceData &face_sorted)
gpu::IndexBufPtr extract_tris(const MeshRenderData &mr, const SortedFaceData &face_sorted)
static gpu::IndexBufPtr extract_tris_mesh(const MeshRenderData &mr, const SortedFaceData &face_sorted)
void create_material_subranges(const SortedFaceData &face_sorted, gpu::IndexBuf &tris_ibo, MutableSpan< gpu::IndexBufPtr > ibos)
std::unique_ptr< IndexBuf, IndexBufDeleter > IndexBufPtr
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< uint32_t, 3 > uint3
blender::Array< std::array< BMLoop *, 3 > > looptris
uint num_subdiv_triangles
Array< gpu::IndexBufPtr > tris_per_mat
MeshExtractType extract_type
VArraySpan< bool > hide_poly
OffsetIndices< int > faces
std::optional< Array< int > > face_tri_offsets
Array< int > tris_num_by_material