diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-26 12:38:27 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-26 12:43:17 +0300 |
commit | dad4703ec577adccd252151fc893a24e023ec587 (patch) | |
tree | db73feed3ae7c712b72991dd3ab627200326d258 /source | |
parent | 42fde5d32b35bef65f292461d800ebc36f35396f (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!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 5 |
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; |