31 if (selection.is_empty()) {
35 if (use_face_select) {
36 for (const int face : range) {
37 flags.slice(faces[face]).fill(selection[face] ? 1 : 0);
41 const Span<int> corner_verts = mr.corner_verts;
42 for (const int face : range) {
43 for (const int corner : faces[face]) {
44 flags[corner] = selection[corner_verts[corner]] ? 1 : 0;
49 if (!mr.hide_poly.is_empty()) {
50 const Span<bool> hide_poly = mr.hide_poly;
51 for (const int face : range) {
52 if (hide_poly[face]) {
53 flags.slice(faces[face]).fill(-1);
57 if (mr.edit_bmesh && mr.orig_index_vert) {
58 const Span<int> corner_verts = mr.corner_verts;
59 const Span<int> orig_indices(mr.orig_index_vert, mr.verts_num);
60 for (const int face : range) {
61 for (const int corner : faces[face]) {
62 if (orig_indices[corner_verts[corner]] == ORIGINDEX_NONE) {
76 for (const int face_index : range) {
77 const BMFace &face = *BM_face_at_index(&const_cast<BMesh &>(bm), face_index);
78 if (BM_elem_flag_test(&face, BM_ELEM_HIDDEN)) {
79 const IndexRange face_range(BM_elem_index_get(BM_FACE_FIRST_LOOP(&face)), face.len);
80 flags.slice(face_range).fill(-1);
89 gpu::VertAttrType::SINT_32);
126 const int default_value = 0;
static constexpr IndexRange from_begin_end(const int64_t begin, const int64_t end)
constexpr MutableSpan take_back(const int64_t n) const
constexpr T * data() const
constexpr void fill(const T &value) const
constexpr MutableSpan take_front(const int64_t n) const
constexpr bool is_empty() const
constexpr bool is_empty() const
IndexRange index_range() const
static const GPUVertFormat & get_paint_overlay_flag_format()
void draw_subdiv_build_paint_overlay_flag_buffer(const DRWSubdivCache &cache, gpu::VertBuf &flags)
int subdiv_full_vbo_size(const MeshRenderData &mr, const DRWSubdivCache &cache)
static void extract_edit_flags_bm(const MeshRenderData &mr, MutableSpan< int > flags)
gpu::VertBufPtr extract_paint_overlay_flags_subdiv(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache)
gpu::VertBufPtr extract_paint_overlay_flags(const MeshRenderData &mr)
static void update_loose_flags(const MeshRenderData &mr, const DRWSubdivCache &subdiv_cache, gpu::VertBuf &flags)
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 * GPU_vertbuf_create_on_device(const GPUVertFormat &format, uint v_len)
GPUVertFormat GPU_vertformat_from_attribute(StringRef name, gpu::VertAttrType type)
void GPU_vertbuf_use(gpu::VertBuf *)
void GPU_vertbuf_update_sub(gpu::VertBuf *verts, uint start, uint len, const void *data)
void GPU_vertbuf_data_alloc(gpu::VertBuf &verts, uint v_len)
const int * orig_index_vert
MeshExtractType extract_type
VArraySpan< bool > select_vert
VArraySpan< bool > select_poly
VArraySpan< bool > hide_poly
OffsetIndices< int > faces