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:
authorClément Foucault <foucault.clem@gmail.com>2018-10-09 18:54:40 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-09 18:55:19 +0300
commitc630ce3f6d1502f106ce7a7b51707970c95b2c0a (patch)
treeedd75e713a3c5a7064f3d2e37850b8cc1b96523e
parentd2eb7e8dfacb3b8d475e4c31d4bd8b3f64cf5b2b (diff)
Fix T57097: Crash when adding a Texture Slot in Texture Paint mode
Was caused by the use of a batch that was using a discarded index buffer.
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index abf6db99f17..43ae3f5f483 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1843,9 +1843,15 @@ static void mesh_batch_cache_discard_shaded_tri(MeshBatchCache *cache)
GPU_BATCH_DISCARD_SAFE(cache->shaded_triangles[i]);
}
}
-
+ if (cache->texpaint_triangles) {
+ for (int i = 0; i < cache->mat_len; ++i) {
+ /* They use shaded_triangles_in_order */
+ GPU_BATCH_DISCARD_SAFE(cache->texpaint_triangles[i]);
+ }
+ }
MEM_SAFE_FREE(cache->shaded_triangles_in_order);
MEM_SAFE_FREE(cache->shaded_triangles);
+ MEM_SAFE_FREE(cache->texpaint_triangles);
MEM_SAFE_FREE(cache->auto_layer_names);
MEM_SAFE_FREE(cache->auto_layer_is_srgb);