From: Krzysztof Czurylo Date: Thu, 21 Aug 2008 22:01:20 +0000 (-0700) Subject: Call _ae_update_state when array enable state changes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f4fd3a4322a3d7c63207999e08b07ba46b0fc66;p=mesa.git Call _ae_update_state when array enable state changes Basically, the application enables client vertex and color arrays, renders something, then disables color array, and renders something else (using vertex array only). Even though the color array is disabled (and the pointer is no longer valid), the driver still tries to read color data from this array (which results in an exception). This is because enabling/disabling array does not trigger _ae_update_state() and the list of enabled arrays is not updated. _ae_update_state() it's called on the first state validation only (as all the "dirty" flags are set at the beginning). Any further change to client arrays' state has no effect. --- diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 9fe979a6b2e..827d84765af 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -38,6 +38,7 @@ #include "enums.h" #include "math/m_matrix.h" #include "math/m_xform.h" +#include "api_arrayelt.h" @@ -129,6 +130,9 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_ARRAY); ctx->Array.NewState |= flag; + + _ae_invalidate_state(ctx, _NEW_ARRAY); + *var = state; if (state)