From 8a7c2c4192aff7f34e50dac83bd793e0247fc604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 8 Jul 2019 11:56:57 +0200 Subject: Fix T66351 Wireframe display in sculpt-mode broke when hiding parts --- source/blender/gpu/intern/gpu_buffers.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 241b3bd553f..59b0857c177 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -374,6 +374,7 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3], /* Fill the only the line buffer. */ GPUIndexBufBuilder elb_lines; GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, tottri * 3, INT_MAX); + int vert_idx = 0; for (i = 0; i < face_indices_len; ++i) { const MLoopTri *lt = &looptri[face_indices[i]]; @@ -384,9 +385,10 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3], } /* TODO skip "non-real" edges. */ - GPU_indexbuf_add_line_verts(&elb_lines, i * 3 + 0, i * 3 + 1); - GPU_indexbuf_add_line_verts(&elb_lines, i * 3 + 1, i * 3 + 2); - GPU_indexbuf_add_line_verts(&elb_lines, i * 3 + 2, i * 3 + 0); + GPU_indexbuf_add_line_verts(&elb_lines, vert_idx * 3 + 0, vert_idx * 3 + 1); + GPU_indexbuf_add_line_verts(&elb_lines, vert_idx * 3 + 1, vert_idx * 3 + 2); + GPU_indexbuf_add_line_verts(&elb_lines, vert_idx * 3 + 2, vert_idx * 3 + 0); + vert_idx++; } buffers->index_lines_buf = GPU_indexbuf_build(&elb_lines); } -- cgit v1.2.3