Mesa (master): vbo: mark vertex arrays as dirty when re-binding

Marek Olšák mareko at kemper.freedesktop.org
Tue Mar 8 22:44:54 UTC 2011


Module: Mesa
Branch: master
Commit: ef58598c1cf2ac689f67c75b2f477f2c404fce98
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef58598c1cf2ac689f67c75b2f477f2c404fce98

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Mar  7 19:34:34 2011 +0100

vbo: mark vertex arrays as dirty when re-binding

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=34378

---

 src/mesa/vbo/vbo_exec_array.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 5818b13..98d6bad 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -461,6 +461,14 @@ recalculate_input_bindings(struct gl_context *ctx)
 	 inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i];
          const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
       }
+
+      /* There is no need to make _NEW_ARRAY dirty here for the TnL program,
+       * because it already takes care of invalidating the state necessary
+       * to revalidate vertex arrays. Not marking the state as dirty also
+       * improves performance (quite significantly in some apps).
+       */
+      if (!ctx->VertexProgram._MaintainTnlProgram)
+         ctx->NewState |= _NEW_ARRAY;
       break;
 
    case VP_NV:
@@ -486,6 +494,8 @@ recalculate_input_bindings(struct gl_context *ctx)
 	 inputs[i] = &vbo->generic_currval[i - VERT_ATTRIB_GENERIC0];
          const_inputs |= 1 << i;
       }
+
+      ctx->NewState |= _NEW_ARRAY;
       break;
 
    case VP_ARB:
@@ -521,8 +531,9 @@ recalculate_input_bindings(struct gl_context *ctx)
 	    inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i];
             const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i);
          }
-
       }
+
+      ctx->NewState |= _NEW_ARRAY;
       break;
    }
 




More information about the mesa-commit mailing list