diff options
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh_extractors.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh_extractors.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh_extractors.c b/source/blender/draw/intern/draw_cache_extract_mesh_extractors.c index 5bea8b085d8..0b46d0b6c7d 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh_extractors.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh_extractors.c @@ -106,83 +106,6 @@ const MeshExtract *mesh_extract_override_get(const MeshExtract *extractor, /** \} */ /* ---------------------------------------------------------------------- */ -/** \name Extract Face-dots Indices - * \{ */ - -static void *extract_fdots_init(const MeshRenderData *mr, - struct MeshBatchCache *UNUSED(cache), - void *UNUSED(buf)) -{ - GPUIndexBufBuilder *elb = MEM_mallocN(sizeof(*elb), __func__); - GPU_indexbuf_init(elb, GPU_PRIM_POINTS, mr->poly_len, mr->poly_len); - return elb; -} - -static void extract_fdots_iter_poly_bm(const MeshRenderData *UNUSED(mr), - BMFace *f, - const int f_index, - void *elb) -{ - if (!BM_elem_flag_test(f, BM_ELEM_HIDDEN)) { - GPU_indexbuf_set_point_vert(elb, f_index, f_index); - } - else { - GPU_indexbuf_set_point_restart(elb, f_index); - } -} - -static void extract_fdots_iter_poly_mesh(const MeshRenderData *mr, - const MPoly *mp, - const int mp_index, - void *elb) -{ - if (mr->use_subsurf_fdots) { - /* Check #ME_VERT_FACEDOT. */ - const MLoop *mloop = mr->mloop; - const int ml_index_end = mp->loopstart + mp->totloop; - for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { - const MLoop *ml = &mloop[ml_index]; - const MVert *mv = &mr->mvert[ml->v]; - if ((mv->flag & ME_VERT_FACEDOT) && !(mr->use_hide && (mp->flag & ME_HIDE))) { - GPU_indexbuf_set_point_vert(elb, mp_index, mp_index); - return; - } - } - GPU_indexbuf_set_point_restart(elb, mp_index); - } - else { - if (!(mr->use_hide && (mp->flag & ME_HIDE))) { - GPU_indexbuf_set_point_vert(elb, mp_index, mp_index); - } - else { - GPU_indexbuf_set_point_restart(elb, mp_index); - } - } -} - -static void extract_fdots_finish(const MeshRenderData *UNUSED(mr), - struct MeshBatchCache *UNUSED(cache), - void *buf, - void *elb) -{ - GPUIndexBuf *ibo = buf; - GPU_indexbuf_build_in_place(elb, ibo); - MEM_freeN(elb); -} - -const MeshExtract extract_fdots = { - .init = extract_fdots_init, - .iter_poly_bm = extract_fdots_iter_poly_bm, - .iter_poly_mesh = extract_fdots_iter_poly_mesh, - .finish = extract_fdots_finish, - .data_type = 0, - .use_threading = false, - .mesh_buffer_offset = offsetof(MeshBufferCache, ibo.fdots), -}; - -/** \} */ - -/* ---------------------------------------------------------------------- */ /** \name Extract Paint Mask Line Indices * \{ */ |