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/mesh_extractors/extract_mesh_ibo_lines_adjacency.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/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc')
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
index 59db4ca6445..2b01b6801c2 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc
@@ -218,6 +218,24 @@ static void extract_lines_adjacency_iter_subdiv(const DRWSubdivCache *subdiv_cac
lines_adjacency_triangle(v0, v2, v3, l0, l2, l3, data);
}
+static void extract_lines_adjacency_iter_subdiv_bm(const DRWSubdivCache *subdiv_cache,
+ const MeshRenderData *mr,
+ void *_data,
+ uint subdiv_quad_index,
+ const BMFace *UNUSED(coarse_quad))
+{
+ extract_lines_adjacency_iter_subdiv(subdiv_cache, mr, _data, subdiv_quad_index);
+}
+
+static void extract_lines_adjacency_iter_subdiv_mesh(const DRWSubdivCache *subdiv_cache,
+ const MeshRenderData *mr,
+ void *_data,
+ uint subdiv_quad_index,
+ const MPoly *UNUSED(coarse_quad))
+{
+ extract_lines_adjacency_iter_subdiv(subdiv_cache, mr, _data, subdiv_quad_index);
+}
+
static void extract_lines_adjacency_finish_subdiv(const DRWSubdivCache *UNUSED(subdiv_cache),
const MeshRenderData *mr,
struct MeshBatchCache *cache,
@@ -237,7 +255,8 @@ constexpr MeshExtract create_extractor_lines_adjacency()
extractor.iter_looptri_mesh = extract_lines_adjacency_iter_looptri_mesh;
extractor.finish = extract_lines_adjacency_finish;
extractor.init_subdiv = extract_lines_adjacency_init_subdiv;
- extractor.iter_subdiv = extract_lines_adjacency_iter_subdiv;
+ extractor.iter_subdiv_bm = extract_lines_adjacency_iter_subdiv_bm;
+ extractor.iter_subdiv_mesh = extract_lines_adjacency_iter_subdiv_mesh;
extractor.finish_subdiv = extract_lines_adjacency_finish_subdiv;
extractor.data_type = MR_DATA_NONE;
extractor.data_size = sizeof(MeshExtract_LineAdjacency_Data);