Sculpt: Fix over-allocation of wireframe index buffers

The lines index buffers were twice as big as they needed to be.
The init function already multiplies by the number of indices in
the primitive type.
This commit is contained in:
Hans Goudey
2024-06-06 22:24:41 -04:00
committed by Hans Goudey
parent 39894f4beb
commit a9907c4ed9

View File

@@ -1069,7 +1069,7 @@ static gpu::IndexBuf *create_index_faces(const PBVH_GPU_Args &args)
}
GPUIndexBufBuilder elb_lines;
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, edge_count * 2, INT_MAX);
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, edge_count, INT_MAX);
int vertex_i = 0;
for (const int tri_i : args.prim_indices) {
@@ -1100,7 +1100,7 @@ static gpu::IndexBuf *create_index_faces(const PBVH_GPU_Args &args)
static gpu::IndexBuf *create_index_bmesh(const PBVH_GPU_Args &args, const int visible_faces_num)
{
GPUIndexBufBuilder elb_lines;
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, visible_faces_num * 3 * 2, INT_MAX);
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, visible_faces_num * 3, INT_MAX);
int v_index = 0;