40 for (const int face_index : range) {
41 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
42 EditLoopData face_value = {};
43 mesh_render_data_face_flag(mr, &face, offsets, face_value);
44 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
45 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
46 const int index = BM_elem_index_get(loop);
47 EditLoopData &value = vbo_data[index];
49 mesh_render_data_loop_flag(mr, loop, offsets, value);
50 mesh_render_data_loop_edge_flag(mr, loop, offsets, value);
65 for (const int face_index : range) {
66 const IndexRange face = faces[face_index];
67 BMFace *face_orig = bm_original_face_get(mr, face_index);
69 vbo_data.slice(face).fill({});
72 for (const int corner : face) {
73 EditLoopData &value = vbo_data[corner];
75 BMVert *vert = bm_original_vert_get(mr, corner_verts[corner]);
76 BMEdge *edge = bm_original_edge_get(mr, corner_edges[corner]);
79 BMLoop *l = BM_face_edge_share_loop(face_orig, edge);
80 mesh_render_data_loop_flag(mr, l, offsets, value);
81 mesh_render_data_loop_edge_flag(mr, l, offsets, value);
84 if (edge == nullptr) {
87 const int corner_prev = bke::mesh::face_corner_prev(face, corner);
88 edge = bm_original_edge_get(mr, corner_edges[corner_prev]);
92 BMLoop *l = BM_face_edge_share_loop(face_orig, edge);
93 mesh_render_data_loop_edge_flag(mr, l, offsets, value);
120 const int subdiv_quad_index,
121 const BMFace *coarse_quad,
125 uint start_loop_idx = subdiv_quad_index * 4;
126 uint end_loop_idx = (subdiv_quad_index + 1) * 4;
129 for (
uint i = start_loop_idx;
i < end_loop_idx;
i++) {
130 const int vert_origindex = subdiv_loop_vert_index[
i];
131 int edge_origindex = subdiv_loop_edge_index[
i];
134 *edit_loop_data = edit_loop_data_face;
136 if (vert_origindex != -1 && edge_origindex != -1) {
144 if (edge_origindex == -1) {
147 const uint loop_index_last = (
i == start_loop_idx) ? end_loop_idx - 1 :
i - 1;
148 edge_origindex = subdiv_loop_edge_index[loop_index_last];
150 if (edge_origindex != -1) {
172 for (const int subdiv_quad : range) {
173 const int coarse_face = subdiv_loop_face_index[subdiv_quad * 4];
174 extract_edituv_data_iter_subdiv_bm(mr,
176 subdiv_loop_vert_index,
177 subdiv_loop_edge_index,
179 BM_face_at_index(mr.bm, coarse_face),
197 for (const int subdiv_quad : range) {
198 const int coarse_face = subdiv_loop_face_index[subdiv_quad * 4];
199 extract_edituv_data_iter_subdiv_bm(mr,
201 subdiv_loop_vert_index,
202 subdiv_loop_edge_index,
204 bm_original_face_get(mr, coarse_face),
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
BLI_INLINE BMEdge * BM_edge_at_index(BMesh *bm, const int index)
BMLoop * BM_face_edge_share_loop(BMFace *f, BMEdge *e)
Return the Loop Shared by Face and Edge.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
BMUVOffsets BM_uv_map_offsets_get(const BMesh *bm)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr T * data() const
static void extract_edituv_data_bm(const MeshRenderData &mr, MutableSpan< EditLoopData > vbo_data)
void mesh_render_data_loop_flag(const MeshRenderData &mr, const BMLoop *l, const BMUVOffsets &offsets, EditLoopData &eattr)
static const GPUVertFormat & edituv_data_format()
static void extract_edituv_data_mesh(const MeshRenderData &mr, MutableSpan< EditLoopData > vbo_data)
void mesh_render_data_face_flag(const MeshRenderData &mr, const BMFace *efa, const BMUVOffsets &offsets, EditLoopData &eattr)
static void extract_edituv_subdiv_data_mesh(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, MutableSpan< EditLoopData > vbo_data)
void mesh_render_data_loop_edge_flag(const MeshRenderData &mr, const BMLoop *l, const BMUVOffsets &offsets, EditLoopData &eattr)
gpu::VertBufPtr extract_edituv_data(const MeshRenderData &mr)
static void extract_edituv_subdiv_data_bm(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, MutableSpan< EditLoopData > vbo_data)
static void extract_edituv_data_iter_subdiv_bm(const MeshRenderData &mr, const BMUVOffsets &offsets, const Span< int > subdiv_loop_vert_index, const Span< int > subdiv_loop_edge_index, const int subdiv_quad_index, const BMFace *coarse_quad, MutableSpan< EditLoopData > vbo_data)
gpu::VertBufPtr extract_edituv_data_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
gpu::VertBuf * verts_orig_index
gpu::VertBuf * edges_orig_index
int * subdiv_loop_face_index
MeshExtractType extract_type
OffsetIndices< int > faces