From 3013ce766a90b7d70ab61362ee22f57de123f6ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 2 Nov 2020 01:57:48 -0500 Subject: [PATCH] vbo: only set count and end when closing _mesa_prim MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's already set everywhere except vbo_exec_wrap_buffers. This is a small optimization removing superfluous code. Reviewed-by: Zoltán Böszörményi Part-of: --- src/mesa/vbo/vbo_exec_api.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 451f655..ff46817 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -84,14 +84,14 @@ vbo_exec_wrap_buffers(struct vbo_exec_context *exec) struct gl_context *ctx = gl_context_from_vbo_exec(exec); struct _mesa_prim *last_prim = &exec->vtx.prim[exec->vtx.prim_count - 1]; const GLuint last_begin = last_prim->begin; - GLuint last_count; + GLuint last_count = 0; if (_mesa_inside_begin_end(ctx)) { last_prim->count = exec->vtx.vert_count - last_prim->start; + last_count = last_prim->count; + last_prim->end = 0; } - last_count = last_prim->count; - /* Special handling for wrapping GL_LINE_LOOP */ if (last_prim->mode == GL_LINE_LOOP && last_count > 0 && @@ -124,9 +124,7 @@ vbo_exec_wrap_buffers(struct vbo_exec_context *exec) if (_mesa_inside_begin_end(ctx)) { exec->vtx.prim[0].mode = ctx->Driver.CurrentExecPrimitive; exec->vtx.prim[0].begin = 0; - exec->vtx.prim[0].end = 0; exec->vtx.prim[0].start = 0; - exec->vtx.prim[0].count = 0; exec->vtx.prim_count++; if (exec->vtx.copied.nr == last_count) @@ -840,9 +838,7 @@ vbo_exec_Begin(GLenum mode) i = exec->vtx.prim_count++; exec->vtx.prim[i].mode = mode; exec->vtx.prim[i].begin = 1; - exec->vtx.prim[i].end = 0; exec->vtx.prim[i].start = exec->vtx.vert_count; - exec->vtx.prim[i].count = 0; ctx->Driver.CurrentExecPrimitive = mode; -- 2.7.4