[Bf-blender-cvs] [0793ced8ad7] master: Fix T89624: Vertex painting causes mesh to flicker

Germano Cavalcante noreply at git.blender.org
Fri Jul 16 21:20:38 CEST 2021


Commit: 0793ced8ad7a49143da28c037c9cd8b37838a2c8
Author: Germano Cavalcante
Date:   Fri Jul 16 16:18:54 2021 -0300
Branches: master
https://developer.blender.org/rB0793ced8ad7a49143da28c037c9cd8b37838a2c8

Fix T89624: Vertex painting causes mesh to flicker

The `ibo.lines_paint_mask` extractor doesn't have a callback to iterate
bmesh faces, this made `filter_into` ignore the extractor.

===================================================================

M	source/blender/draw/intern/draw_cache_extract_mesh.cc

===================================================================

diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc
index 344150014ed..6d71b01b7e0 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.cc
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc
@@ -76,27 +76,23 @@ struct ExtractorRunData {
 
 class ExtractorRunDatas : public Vector<ExtractorRunData> {
  public:
-  void filter_into(ExtractorRunDatas &result, eMRIterType iter_type) const
+  void filter_into(ExtractorRunDatas &result, eMRIterType iter_type, const bool is_mesh) const
   {
     for (const ExtractorRunData &data : *this) {
       const MeshExtract *extractor = data.extractor;
-      if ((iter_type & MR_ITER_LOOPTRI) && extractor->iter_looptri_bm) {
-        BLI_assert(extractor->iter_looptri_mesh);
+      if ((iter_type & MR_ITER_LOOPTRI) && *(&extractor->iter_looptri_bm + is_mesh)) {
         result.append(data);
         continue;
       }
-      if ((iter_type & MR_ITER_POLY) && extractor->iter_poly_bm) {
-        BLI_assert(extractor->iter_poly_mesh);
+      if ((iter_type & MR_ITER_POLY) && *(&extractor->iter_poly_bm + is_mesh)) {
         result.append(data);
         continue;
       }
-      if ((iter_type & MR_ITER_LEDGE) && extractor->iter_ledge_bm) {
-        BLI_assert(extractor->iter_ledge_mesh);
+      if ((iter_type & MR_ITER_LEDGE) && *(&extractor->iter_ledge_bm + is_mesh)) {
         result.append(data);
         continue;
       }
-      if ((iter_type & MR_ITER_LVERT) && extractor->iter_lvert_bm) {
-        BLI_assert(extractor->iter_lvert_mesh);
+      if ((iter_type & MR_ITER_LVERT) && *(&extractor->iter_lvert_bm + is_mesh)) {
         result.append(data);
         continue;
       }
@@ -427,7 +423,7 @@ BLI_INLINE void extract_task_range_run_iter(const MeshRenderData *mr,
       return;
   }
 
-  extractors->filter_into(range_data.extractors, iter_type);
+  extractors->filter_into(range_data.extractors, iter_type, is_mesh);
   BLI_task_parallel_range(0, stop, &range_data, func, settings);
 }



More information about the Bf-blender-cvs mailing list