From 784dd51198433e5c299da4a7742c68d21d68d1c1 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 16 Apr 2012 03:34:22 +0200 Subject: mesa,vbo: properly detect when vertex arrays need to be recalculated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This moves the RebindArrays flag into the vbo module, consolidates the code, and adds missing vbo_draw_method calls. Also with this change, the vertex arrays are not needlessly recalculated twice. The issue with the old code was: - If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set. - _mesa_update_state is called and the vp_varying_inputs change causes regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM. - The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets the recalculate_inputs flag to TRUE again. - The new code sets the flag to FALSE after the second _mesa_update_state, because there can't possibly be any change which would require recalculating the arrays. Reviewed-by: Brian Paul Reviewed-by: Mathias Fröhlich --- src/mesa/main/state.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa/main/state.c') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 2e9f021619f..c953efc8127 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -582,8 +582,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) ctx->NewState = 0; ctx->Driver.UpdateState(ctx, new_state); ctx->Array.NewState = 0; - if (!ctx->Array.RebindArrays) - ctx->Array.RebindArrays = (new_state & (_NEW_ARRAY | _NEW_PROGRAM)) != 0; } -- cgit v1.2.3