From 9c9c314e419e4085250e892be55ab67a71625458 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 27 Feb 2020 15:43:55 -0500 Subject: vbo: fold code from vbo_exec_fixup_vertex to vbo_exec_wrap_upgrade_vertex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Mathias Fröhlich Part-of: --- src/mesa/vbo/vbo_exec_api.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 29773fbba4d..8906ddd6703 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -240,7 +240,7 @@ vbo_exec_copy_to_current(struct vbo_exec_context *exec) */ static void vbo_exec_wrap_upgrade_vertex(struct vbo_exec_context *exec, - GLuint attr, GLuint newSize) + GLuint attr, GLuint newSize, GLenum newType) { struct gl_context *ctx = exec->ctx; struct vbo_context *vbo = vbo_context(ctx); @@ -278,6 +278,8 @@ vbo_exec_wrap_upgrade_vertex(struct vbo_exec_context *exec, /* Fix up sizes: */ exec->vtx.attr[attr].size = newSize; + exec->vtx.attr[attr].active_size = newSize; + exec->vtx.attr[attr].type = newType; exec->vtx.vertex_size += newSize - oldSize; exec->vtx.vertex_size_no_pos = exec->vtx.vertex_size - exec->vtx.attr[0].size; exec->vtx.max_vert = vbo_compute_max_verts(exec); @@ -411,7 +413,7 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr, /* New size is larger. Need to flush existing vertices and get * an enlarged vertex format. */ - vbo_exec_wrap_upgrade_vertex(exec, attr, newSize); + vbo_exec_wrap_upgrade_vertex(exec, attr, newSize, newType); } else if (newSize < exec->vtx.attr[attr].active_size) { GLuint i; @@ -423,10 +425,9 @@ vbo_exec_fixup_vertex(struct gl_context *ctx, GLuint attr, */ for (i = newSize; i <= exec->vtx.attr[attr].size; i++) exec->vtx.attrptr[attr][i-1] = id[i-1]; - } - exec->vtx.attr[attr].active_size = newSize; - exec->vtx.attr[attr].type = newType; + exec->vtx.attr[attr].active_size = newSize; + } } -- cgit v1.2.3