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-02-14 12:09:06 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-02-14 16:48:44 +0300
commit993839ce85137ac37a978f49ae894703a39dbf6a (patch)
treef0e4edc59548d029f425f9dff150d170ab2463d6 /source/blender/draw/intern/draw_subdivision.h
parent3a9a37d6dccb0a981b1fad0cda977b4a445341a1 (diff)
Fix T95177: GPU subdiv crashes mirror modifier in edit-mode
The issue has two causes: on one hand origin indices were not handled properly, on the other hand the extraction type (Mesh, BMesh, or mapped) was not detected correctly. For the second case reuse the MeshRenderData creation from the coarse code path so that we make the same decisions. Loose geometry extraction had to be updated to properly handle the BMesh cases. For the origin indices, in some cases (for edges and faces), the arrays used by the subdivision code already have the origin indices baked into them, so mapping them a second time through the origin index layer is wrong, and could cause out of bounds accesses. For vertices especially, we would use two arrays: one for mapping subdivision vertices to coarse vertices, and another one to map coarse vertices to subdivision loops used for the selection index buffer. The second one is now removed (which saves a bit of memory) as it is did not have the proper data setup for use with the origin indices and we can easily compute it using the first array anyway.
Diffstat (limited to 'source/blender/draw/intern/draw_subdivision.h')
-rw-r--r--source/blender/draw/intern/draw_subdivision.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_subdivision.h b/source/blender/draw/intern/draw_subdivision.h
index eeef2156e35..65e845c21a4 100644
--- a/source/blender/draw/intern/draw_subdivision.h
+++ b/source/blender/draw/intern/draw_subdivision.h
@@ -143,7 +143,17 @@ void DRW_create_subdivision(const struct Scene *scene,
struct Mesh *mesh,
struct MeshBatchCache *batch_cache,
struct MeshBufferCache *mbc,
- const struct ToolSettings *toolsettings);
+ const bool is_editmode,
+ const bool is_paint_mode,
+ const bool is_mode_active,
+ const float obmat[4][4],
+ const bool do_final,
+ const bool do_uvedit,
+ const bool use_subsurf_fdots,
+ const ToolSettings *ts,
+ const bool use_hide);
+
+void DRW_subdivide_loose_geom(DRWSubdivCache *subdiv_cache, struct MeshBufferCache *cache);
void DRW_subdiv_cache_free(struct Subdiv *subdiv);