diff options
author | Brian Paul <[email protected]> | 2018-01-15 14:34:53 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-01-17 11:17:56 -0700 |
commit | 5d78440d5830e5f38ac4b3094aadcd436db18365 (patch) | |
tree | be910ca238ca2f35b38dac716bb9670b18de8906 /src/mesa/vbo/vbo_save_draw.c | |
parent | 8e4efdc895eacca931b94a0c1fa01aae5c34463b (diff) |
vbo: lift common code out of switch cases
Both switch cases began with the same code.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_save_draw.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index b63a9a8b869..41010225c3c 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -158,14 +158,14 @@ bind_vertex_list(struct gl_context *ctx, buffer_offset = 0; } - /* Install the default (ie Current) attributes first, then overlay - * all active ones. - */ + /* Install the default (ie Current) attributes first */ + for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) { + save->inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr]; + } + + /* Overlay other active attributes */ switch (get_program_mode(ctx)) { case VP_NONE: - for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) { - save->inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr]; - } for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { save->inputs[VERT_ATTRIB_GENERIC(attr)] = &vbo->currval[VBO_ATTRIB_MAT_FRONT_AMBIENT+attr]; @@ -173,9 +173,6 @@ bind_vertex_list(struct gl_context *ctx, map = vbo->map_vp_none; break; case VP_ARB: - for (attr = 0; attr < VERT_ATTRIB_FF_MAX; attr++) { - save->inputs[attr] = &vbo->currval[VBO_ATTRIB_POS+attr]; - } for (attr = 0; attr < VERT_ATTRIB_GENERIC_MAX; attr++) { save->inputs[VERT_ATTRIB_GENERIC(attr)] = &vbo->currval[VBO_ATTRIB_GENERIC0+attr]; |