diff options
author | Fredrik Höglund <[email protected]> | 2013-05-11 19:23:46 +0200 |
---|---|---|
committer | Fredrik Höglund <[email protected]> | 2013-11-07 16:20:44 +0100 |
commit | 6a650fa787d8762762712049879897d7e257001e (patch) | |
tree | 20e3da5933c6dc16151cdb66ca8ea0ff09cff461 | |
parent | c6a3fb69c6a0d993f111518f12b34dde3925c190 (diff) |
mesa: Restore gl_array_object::NewArray
This will be used by the ARB_vertex_attrib_binding implementation.
This reverts commit db38e9a0e179441f59274f6f2a751912c29872e2.
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r-- | src/mesa/main/enable.c | 2 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 3 | ||||
-rw-r--r-- | src/mesa/main/state.c | 1 | ||||
-rw-r--r-- | src/mesa/main/varray.c | 4 |
4 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index dd6a772f96c..c047f5df2c5 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -135,6 +135,8 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) else arrayObj->_Enabled &= ~flag; + arrayObj->NewArrays |= flag; + if (ctx->Driver.Enable) { ctx->Driver.Enable( ctx, cap, state ); } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b5c5583d6d3..500f6701de7 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1513,6 +1513,9 @@ struct gl_array_object /** Mask of VERT_BIT_* values indicating which arrays are enabled */ GLbitfield64 _Enabled; + /** Mask of VERT_BIT_* values indicating changed/dirty arrays */ + GLbitfield64 NewArrays; + /** * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs * we can determine the max legal (in bounds) glDrawElements array index. diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 23926410b34..bf216312b83 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -430,6 +430,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) new_state = ctx->NewState | new_prog_state; ctx->NewState = 0; ctx->Driver.UpdateState(ctx, new_state); + ctx->Array.ArrayObj->NewArrays = 0x0; } diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index dee476abbae..24cd324cb99 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -286,6 +286,7 @@ update_array(struct gl_context *ctx, ctx->Array.ArrayBufferObj); ctx->NewState |= _NEW_ARRAY; + ctx->Array.ArrayObj->NewArrays |= VERT_BIT(attrib); } @@ -537,6 +538,7 @@ _mesa_EnableVertexAttribArray(GLuint index) FLUSH_VERTICES(ctx, _NEW_ARRAY); arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_TRUE; arrayObj->_Enabled |= VERT_BIT_GENERIC(index); + arrayObj->NewArrays |= VERT_BIT_GENERIC(index); } } @@ -562,6 +564,7 @@ _mesa_DisableVertexAttribArray(GLuint index) FLUSH_VERTICES(ctx, _NEW_ARRAY); arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled = GL_FALSE; arrayObj->_Enabled &= ~VERT_BIT_GENERIC(index); + arrayObj->NewArrays |= VERT_BIT_GENERIC(index); } } @@ -1161,6 +1164,7 @@ _mesa_VertexAttribDivisor(GLuint index, GLuint divisor) if (array->InstanceDivisor != divisor) { FLUSH_VERTICES(ctx, _NEW_ARRAY); array->InstanceDivisor = divisor; + ctx->Array.ArrayObj->NewArrays |= VERT_BIT(VERT_ATTRIB_GENERIC(index)); } } |