vbo: simplify some code in vbo_exec_End()
authorBrian Paul <brianp@vmware.com>
Fri, 16 Oct 2015 02:33:52 +0000 (20:33 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 20 Oct 2015 18:52:41 +0000 (12:52 -0600)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
src/mesa/vbo/vbo_exec_api.c

index f519f8a4e61e2019b6b7e95398196b20371645dd..3f87ac44265f2cdcafb15284843247bba4cd2a0b 100644 (file)
@@ -821,11 +821,10 @@ static void GLAPIENTRY vbo_exec_End( void )
 
    if (exec->vtx.prim_count > 0) {
       /* close off current primitive */
-      int idx = exec->vtx.vert_count;
-      int i = exec->vtx.prim_count - 1;
+      struct _mesa_prim *last_prim = &exec->vtx.prim[exec->vtx.prim_count - 1];
 
-      exec->vtx.prim[i].end = 1;
-      exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start;
+      last_prim->end = 1;
+      last_prim->count = exec->vtx.vert_count - last_prim->start;
 
       try_vbo_merge(exec);
    }