20 "pos", gpu::VertAttrType::SFLOAT_32_32_32);
27 "norAndFlag", gpu::VertAttrType::SFLOAT_32_32_32_32);
39 for (const int face : range) {
40 const Span<int> face_verts = corner_verts.slice(faces[face]);
41 const int *vert = std::find_if(face_verts.begin(), face_verts.end(), [&](const int vert) {
42 return facedot_tags[vert].test();
44 if (vert == face_verts.end()) {
45 vbo_data[face] = float3(0);
48 vbo_data[face] = positions[*vert];
55 for (const int face : range) {
56 vbo_data[face] = bke::mesh::face_center_calc(positions, corner_verts.slice(faces[face]));
66 for (const int face_index : range) {
67 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
68 if (mr.bm_vert_coords.is_empty()) {
69 BM_face_calc_center_median(&face, vbo_data[face_index]);
72 BM_face_calc_center_median_vcos(&bm, &face, vbo_data[face_index], mr.bm_vert_coords);
107 subdiv_cache, fdots_pos.get(), fdots_nor ? fdots_nor->get() :
nullptr, fdots.get());
blender::gpu::IndexBuf * GPU_indexbuf_build_on_device(uint index_len)
blender::gpu::VertBuf * GPU_vertbuf_create_on_device(const GPUVertFormat &format, uint v_len)
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
constexpr T * data() const
static const GPUVertFormat & get_fdots_pos_format()
static const GPUVertFormat & get_fdots_nor_format_subdiv()
void draw_subdiv_build_fdots_buffers(const DRWSubdivCache &cache, gpu::VertBuf *fdots_pos, gpu::VertBuf *fdots_nor, gpu::IndexBuf *fdots_indices)
static void extract_face_dot_positions_bm(const MeshRenderData &mr, MutableSpan< float3 > vbo_data)
void extract_face_dots_subdiv(const DRWSubdivCache &subdiv_cache, gpu::VertBufPtr &fdots_pos, gpu::VertBufPtr *fdots_nor, gpu::IndexBufPtr &fdots)
static void extract_face_dot_positions_mesh(const MeshRenderData &mr, MutableSpan< float3 > vbo_data)
gpu::VertBufPtr extract_face_dots_position(const MeshRenderData &mr)
std::unique_ptr< IndexBuf, IndexBufDeleter > IndexBufPtr
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))
VecBase< float, 3 > float3
MeshRuntimeHandle * runtime
Span< float3 > vert_positions
MeshExtractType extract_type
OffsetIndices< int > faces