Differential D14773 Diff 50892 source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
| Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | static void extract_edituv_points_iter_poly_mesh(const MeshRenderData *mr, | ||||
| void *_data) | void *_data) | ||||
| { | { | ||||
| MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | ||||
| const MLoop *mloop = mr->mloop; | const MLoop *mloop = mr->mloop; | ||||
| const int ml_index_end = mp->loopstart + mp->totloop; | const int ml_index_end = mp->loopstart + mp->totloop; | ||||
| for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { | for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { | ||||
| const MLoop *ml = &mloop[ml_index]; | const MLoop *ml = &mloop[ml_index]; | ||||
| const bool real_vert = (mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && | const bool real_vert = !mr->v_origindex || mr->v_origindex[ml->v] != ORIGINDEX_NONE; | ||||
| mr->v_origindex[ml->v] != ORIGINDEX_NONE); | |||||
| edituv_point_add( | edituv_point_add( | ||||
| data, ((mp->flag & ME_HIDE) != 0) || !real_vert, (mp->flag & ME_FACE_SEL) != 0, ml_index); | data, ((mp->flag & ME_HIDE) != 0) || !real_vert, (mp->flag & ME_FACE_SEL) != 0, ml_index); | ||||
| } | } | ||||
| } | } | ||||
| static void extract_edituv_points_finish(const MeshRenderData *UNUSED(mr), | static void extract_edituv_points_finish(const MeshRenderData *UNUSED(mr), | ||||
| struct MeshBatchCache *UNUSED(cache), | struct MeshBatchCache *UNUSED(cache), | ||||
| void *buf, | void *buf, | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | ||||
| int *subdiv_loop_vert_index = (int *)GPU_vertbuf_get_data(subdiv_cache->verts_orig_index); | int *subdiv_loop_vert_index = (int *)GPU_vertbuf_get_data(subdiv_cache->verts_orig_index); | ||||
| uint start_loop_idx = subdiv_quad_index * 4; | uint start_loop_idx = subdiv_quad_index * 4; | ||||
| uint end_loop_idx = (subdiv_quad_index + 1) * 4; | uint end_loop_idx = (subdiv_quad_index + 1) * 4; | ||||
| for (uint i = start_loop_idx; i < end_loop_idx; i++) { | for (uint i = start_loop_idx; i < end_loop_idx; i++) { | ||||
| const int vert_origindex = subdiv_loop_vert_index[i]; | const int vert_origindex = subdiv_loop_vert_index[i]; | ||||
| const bool real_vert = (mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && | const bool real_vert = !mr->v_origindex || (vert_origindex != -1 && | ||||
| vert_origindex != -1 && | |||||
| mr->v_origindex[vert_origindex] != ORIGINDEX_NONE); | mr->v_origindex[vert_origindex] != ORIGINDEX_NONE); | ||||
| edituv_point_add(data, | edituv_point_add(data, | ||||
| ((coarse_quad->flag & ME_HIDE) != 0) || !real_vert, | ((coarse_quad->flag & ME_HIDE) != 0) || !real_vert, | ||||
| (coarse_quad->flag & ME_FACE_SEL) != 0, | (coarse_quad->flag & ME_FACE_SEL) != 0, | ||||
| i); | i); | ||||
| } | } | ||||
| } | } | ||||
| static void extract_edituv_points_finish_subdiv(const struct DRWSubdivCache *UNUSED(subdiv_cache), | static void extract_edituv_points_finish_subdiv(const struct DRWSubdivCache *UNUSED(subdiv_cache), | ||||
| ▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines | |||||