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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-26 12:38:27 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-26 12:43:17 +0300
commitdad4703ec577adccd252151fc893a24e023ec587 (patch)
treedb73feed3ae7c712b72991dd3ab627200326d258
parent42fde5d32b35bef65f292461d800ebc36f35396f (diff)
Fix T55320: Sculpt Mode with dyntopo and smooth shading drawing bug.
We have to discard the batch in smooth case, because we are modifying the index buffer (flat shading don't need it, only changes vertex buffer on redraw, which is safe). Many thanks to @fclem for his help on debuging/understanding what was wrong here!
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index df8dbb03284..462785a5dcb 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -791,11 +791,14 @@ void GPU_pbvh_bmesh_buffers_update(
tottri = gpu_bmesh_face_visible_count(bm_faces);
if (buffers->smooth) {
+ /* Smooth needs to recreate index buffer, so we have to invalidate the batch. */
+ GWN_BATCH_DISCARD_SAFE(buffers->triangles);
/* Count visible vertices */
totvert = gpu_bmesh_vert_visible_count(bm_unique_verts, bm_other_verts);
}
- else
+ else {
totvert = tottri * 3;
+ }
if (!tottri) {
buffers->tot_tri = 0;