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-01-16 10:40:38 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-16 10:40:38 +0300
commitbc66cd9868746ce92dd6de004a8b8e6a0188defe (patch)
tree709174bdf08407a7c06d9fd4c10b3523ab3487b0 /source/blender/draw/intern/draw_cache_impl_subdivision.cc
parent3574f2730d2a42cda2881d26209b8dc53b1d2047 (diff)
Fix T94865: GPU subdiv crash switching to texpaint area
The crash is due to the fact that GPU subdivision extraction routines for edit data (including UVs) only worked for BMesh. However, a Mesh based version is still needed for texture painting. This adds the missing components. This also ensures all data are properly initialized (at least the ones revealed by the bug).
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_subdivision.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_subdivision.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc
index 3e6cd01e7cb..e975d213e22 100644
--- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc
+++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc
@@ -1676,6 +1676,10 @@ void draw_subdiv_init_mesh_render_data(DRWSubdivCache *cache,
mr->poly_len = mesh->totpoly;
mr->loop_len = mesh->totloop;
mr->extract_type = MR_EXTRACT_MESH;
+ mr->toolsettings = toolsettings;
+ mr->v_origindex = static_cast<int *>(CustomData_get_layer(&mr->me->vdata, CD_ORIGINDEX));
+ mr->e_origindex = static_cast<int *>(CustomData_get_layer(&mr->me->edata, CD_ORIGINDEX));
+ mr->p_origindex = static_cast<int *>(CustomData_get_layer(&mr->me->pdata, CD_ORIGINDEX));
/* MeshRenderData is only used for generating edit mode data here. */
if (!cache->bm) {
@@ -1686,7 +1690,6 @@ void draw_subdiv_init_mesh_render_data(DRWSubdivCache *cache,
BM_mesh_elem_table_ensure(bm, BM_EDGE | BM_FACE | BM_VERT);
mr->bm = bm;
- mr->toolsettings = toolsettings;
mr->eed_act = BM_mesh_active_edge_get(bm);
mr->efa_act = BM_mesh_active_face_get(bm, false, true);
mr->eve_act = BM_mesh_active_vert_get(bm);
@@ -1696,9 +1699,6 @@ void draw_subdiv_init_mesh_render_data(DRWSubdivCache *cache,
mr->freestyle_edge_ofs = CustomData_get_offset(&bm->edata, CD_FREESTYLE_EDGE);
mr->freestyle_face_ofs = CustomData_get_offset(&bm->pdata, CD_FREESTYLE_FACE);
#endif
- mr->v_origindex = static_cast<int *>(CustomData_get_layer(&mr->me->vdata, CD_ORIGINDEX));
- mr->e_origindex = static_cast<int *>(CustomData_get_layer(&mr->me->edata, CD_ORIGINDEX));
- mr->p_origindex = static_cast<int *>(CustomData_get_layer(&mr->me->pdata, CD_ORIGINDEX));
}
/**