Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-23 06:01:12 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-03-24 10:55:52 +0300
commit3bc0e39850a1c4c8e45bd393960acf2d483090da (patch)
tree01f4ac0e140ff960f1bb7734ef1ecefe9fca1fe2
parent1f3547fb3e4c41277cc48a36e56d032c2ba7677e (diff)
Fix T96372: UV editor selection display wrong with GPU subdivision
Vertices were not drawn properly as the logic for mapped mesh was used in the BMesh case. Edge display would ignore subdivided edges which would come from coarse edges when setting display flags.
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc7
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc18
2 files changed, 19 insertions, 6 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
index cd71beb1f02..3967271f852 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
@@ -435,7 +435,7 @@ static void extract_edituv_points_init_subdiv(const DRWSubdivCache *subdiv_cache
}
static void extract_edituv_points_iter_subdiv_bm(const DRWSubdivCache *subdiv_cache,
- const MeshRenderData *mr,
+ const MeshRenderData *UNUSED(mr),
void *_data,
uint subdiv_quad_index,
const BMFace *coarse_quad)
@@ -447,11 +447,8 @@ static void extract_edituv_points_iter_subdiv_bm(const DRWSubdivCache *subdiv_ca
uint end_loop_idx = (subdiv_quad_index + 1) * 4;
for (uint i = start_loop_idx; i < end_loop_idx; i++) {
const int vert_origindex = subdiv_loop_vert_index[i];
- const bool real_vert = (mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) &&
- vert_origindex != -1 &&
- mr->v_origindex[vert_origindex] != ORIGINDEX_NONE);
edituv_point_add(data,
- (BM_elem_flag_test(coarse_quad, BM_ELEM_HIDDEN)) || !real_vert,
+ (BM_elem_flag_test(coarse_quad, BM_ELEM_HIDDEN) || vert_origindex == -1),
BM_elem_flag_test(coarse_quad, BM_ELEM_SELECT) != 0,
i);
}
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
index 3b0233ac267..e836775842b 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
@@ -153,7 +153,7 @@ static void extract_edituv_data_iter_subdiv_bm(const DRWSubdivCache *subdiv_cach
uint end_loop_idx = (subdiv_quad_index + 1) * 4;
for (uint i = start_loop_idx; i < end_loop_idx; i++) {
const int vert_origindex = subdiv_loop_vert_index[i];
- const int edge_origindex = subdiv_loop_edge_index[i];
+ int edge_origindex = subdiv_loop_edge_index[i];
EditLoopData *edit_loop_data = &data->vbo_data[i];
memset(edit_loop_data, 0, sizeof(EditLoopData));
@@ -165,6 +165,22 @@ static void extract_edituv_data_iter_subdiv_bm(const DRWSubdivCache *subdiv_cach
mesh_render_data_loop_flag(mr, l, data->cd_ofs, edit_loop_data);
mesh_render_data_loop_edge_flag(mr, l, data->cd_ofs, edit_loop_data);
}
+ else {
+ if (edge_origindex == -1) {
+ /* Find if the loop's vert is not part of an edit edge.
+ * For this, we check if the previous loop was on an edge. */
+ const uint loop_index_last = (i == start_loop_idx) ? end_loop_idx - 1 : i - 1;
+ edge_origindex = subdiv_loop_edge_index[loop_index_last];
+ }
+ if (edge_origindex != -1) {
+ /* Mapped points on an edge between two edit verts. */
+ BMEdge *eed = BM_edge_at_index(mr->bm, edge_origindex);
+ BMLoop *l = BM_face_edge_share_loop(const_cast<BMFace *>(coarse_quad), eed);
+ mesh_render_data_loop_edge_flag(mr, l, data->cd_ofs, edit_loop_data);
+ }
+ }
+
+ mesh_render_data_face_flag(mr, coarse_quad, data->cd_ofs, edit_loop_data);
}
}