summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-27 15:43:55 -0500
committerMarek Olšák <[email protected]>2020-03-04 19:54:43 -0500
commit9c9c314e419e4085250e892be55ab67a71625458 (patch)
treea635aa332105a6391d88f6281a1a00a5d05d9400 /src/mesa
parent8205042be60ccfe8d1661767e6f293c97d33e2cd (diff)
vbo: fold code from vbo_exec_fixup_vertex to vbo_exec_wrap_upgrade_vertex
Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c11
1 files changed, 6 insertions, 5 deletions
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;
+ }
}