[Bf-blender-cvs] [227d8f4651a] temp-texture-painting-gpu: Fixed crash when painting on not all PBVH nodes.

Jeroen Bakker noreply at git.blender.org
Fri Sep 30 16:06:17 CEST 2022


Commit: 227d8f4651a4c54b154362e2ee15100b9cf372e6
Author: Jeroen Bakker
Date:   Fri Sep 30 16:05:50 2022 +0200
Branches: temp-texture-painting-gpu
https://developer.blender.org/rB227d8f4651a4c54b154362e2ee15100b9cf372e6

Fixed crash when painting on not all PBVH nodes.

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

M	source/blender/editors/sculpt_paint/sculpt_paint_image.cc

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
index 428ed672f78..f3b1c8144c8 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
@@ -527,6 +527,10 @@ static void gpu_painting_paint_step(TexturePaintingUserData &data,
 
   for (PBVHNode *node : MutableSpan<PBVHNode *>(data.nodes, data.nodes_len)) {
     NodeData &node_data = BKE_pbvh_pixels_node_data_get(*node);
+    /* TODO: Fix this! We should check for nodes that have been tagged. */
+    if (!node_data.triangles.gpu_buffer) {
+      continue;
+    }
 
     for (UDIMTilePixels &tile_pixels : node_data.tiles) {
       if (tile_pixels.tile_number != image_tile.get_tile_number()) {
@@ -644,8 +648,6 @@ static void dispatch_gpu_batches(TexturePaintingUserData &data)
 {
   SculptSession &ss = *data.ob->sculpt;
   if (!ss.mode.texture_paint.gpu_data) {
-    /* Currently expected for final redraw. */
-    printf("%s: No batches found to draw\n", __func__);
     return;
   }



More information about the Bf-blender-cvs mailing list