summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-16 03:34:22 +0200
committerMarek Olšák <[email protected]>2012-04-19 14:47:21 +0200
commit784dd51198433e5c299da4a7742c68d21d68d1c1 (patch)
tree82bfb55116d13e2738114f321a33bd69d60892a2 /src/mesa/vbo/vbo_exec.c
parent0de5a21470b3bff9b7c8714e5d960d5ed9d01b9c (diff)
mesa,vbo: properly detect when vertex arrays need to be recalculated
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 <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_exec.c')
-rw-r--r--src/mesa/vbo/vbo_exec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 05c3ec1ae9d..fd5e0f8911b 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -85,6 +85,10 @@ void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state )
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
+ if (new_state & (_NEW_PROGRAM|_NEW_ARRAY)) {
+ exec->array.recalculate_inputs = GL_TRUE;
+ }
+
if (new_state & (_NEW_PROGRAM|_NEW_EVAL))
exec->eval.recalculate_maps = 1;