46 for (const int i : range) {
47 loose_edge_data[i * 2 + 0] = edges[loose_edges[i]][0];
48 loose_edge_data[i * 2 + 1] = edges[loose_edges[i]][1];
63 for (const int face_index : range) {
64 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
65 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
66 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
67 const int index = BM_elem_index_get(loop);
68 corners_data[index] = BM_elem_index_get(loop->v);
74 const Span<int> loose_edges = mr.loose_edges;
76 for (const int i : range) {
77 const BMEdge &edge = *BM_edge_at_index(&const_cast<BMesh &>(bm), loose_edges[i]);
78 loose_edge_data[i * 2 + 0] = BM_elem_index_get(edge.v1);
79 loose_edge_data[i * 2 + 1] = BM_elem_index_get(edge.v2);
83 array_utils::copy(mr.loose_verts, loose_vert_data);
108 for (const int i : range) {
109 loose_edge_data[i * 2 + 0] = orig_index_edge[loose_edges[i]];
110 loose_edge_data[i * 2 + 1] = orig_index_edge[loose_edges[i]];
117 for (const int i : range) {
118 loose_edge_data[i * 2 + 0] = loose_edges[i];
119 loose_edge_data[i * 2 + 1] = loose_edges[i];
132 for (const int face_index : range) {
133 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
134 const BMLoop *loop = BM_FACE_FIRST_LOOP(&face);
135 for ([[maybe_unused]] const int i : IndexRange(face.len)) {
136 const int index = BM_elem_index_get(loop);
137 corners_data[index] = BM_elem_index_get(loop->e);
143 const Span<int> loose_edges = mr.loose_edges;
145 for (const int i : range) {
146 loose_edge_data[i * 2 + 0] = loose_edges[i];
147 loose_edge_data[i * 2 + 1] = loose_edges[i];
170 for (const int face : range) {
171 vbo_data.slice(faces[face]).fill(orig_index_face[face]);
184 for (const int face_index : range) {
185 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
186 const IndexRange face_range(BM_elem_index_get(BM_FACE_FIRST_LOOP(&face)), face.len);
187 vbo_data.slice(face_range).fill(face_index);
217 loose_edges.
size() * verts_per_edge);
219 const int2 edge = coarse_edges[loose_edges[
i]];
251 if (vbo_data[
i] == -1) {
271 loose_edges.
size() * verts_per_edge);
273 const int edge = loose_edges[
i];
275 data.slice(
i * verts_per_edge, verts_per_edge).fill(index);
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr int64_t size() const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr MutableSpan take_back(const int64_t n) const
constexpr T * data() const
constexpr MutableSpan take_front(const int64_t n) const
constexpr const T * data() const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
void copy(const GVArray &src, GMutableSpan dst, int64_t grain_size=4096)
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, int64_t grain_size=4096)
void fill_index_range(MutableSpan< T > span, const T start=0)
int subdiv_loose_edges_num(const MeshRenderData &mr, const DRWSubdivCache &cache)
static void extract_vert_index_bm(const MeshRenderData &mr, MutableSpan< int > vbo_data)
static void extract_face_index_bm(const MeshRenderData &mr, MutableSpan< int > vbo_data)
int subdiv_verts_per_coarse_edge(const DRWSubdivCache &cache)
gpu::VertBufPtr extract_edge_index(const MeshRenderData &mr)
gpu::VertBufPtr draw_subdiv_init_origindex_buffer(int32_t *vert_origindex, uint num_loops, uint loose_len)
gpu::VertBufPtr extract_vert_index_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr)
gpu::VertBufPtr extract_face_dot_index(const MeshRenderData &mr)
static gpu::VertBufPtr create_vbo(const int size)
static void extract_edge_index_bm(const MeshRenderData &mr, MutableSpan< int > vbo_data)
int subdiv_full_vbo_size(const MeshRenderData &mr, const DRWSubdivCache &cache)
gpu::VertBufPtr extract_face_index_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr)
static void extract_vert_index_mesh(const MeshRenderData &mr, MutableSpan< int > vbo_data)
gpu::VertBufPtr extract_edge_index_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr)
static void extract_edge_idx_loose_geom_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr, MutableSpan< int32_t > vbo_data)
static void extract_edge_index_mesh(const MeshRenderData &mr, MutableSpan< int > vbo_data)
static void extract_vert_idx_loose_geom_subdiv(const DRWSubdivCache &subdiv_cache, const MeshRenderData &mr, MutableSpan< int32_t > vbo_data)
gpu::VertBufPtr extract_vert_index(const MeshRenderData &mr)
void extract_mesh_loose_edge_data(const Span< T > vert_data, const Span< int2 > edges, const Span< int > loose_edges, MutableSpan< T > gpu_data)
gpu::VertBufPtr extract_face_index(const MeshRenderData &mr)
static void extract_face_index_mesh(const MeshRenderData &mr, MutableSpan< int > vbo_data)
std::unique_ptr< gpu::VertBuf, gpu::VertBufDeleter > VertBufPtr
void build_reverse_map(OffsetIndices< int > offsets, MutableSpan< int > r_map)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< int32_t, 2 > int2
gpu::VertBuf * verts_orig_index
gpu::VertBuf * edges_orig_index
int * subdiv_loop_face_index
const int * orig_index_vert
MeshExtractType extract_type
const int * orig_index_face
const int * orig_index_edge
OffsetIndices< int > faces