[Mesa-dev] [PATCH 01/10] mesa: Track changes to transform feedback state.

Eric Anholt eric at anholt.net
Mon Dec 5 14:50:55 PST 2011


On Mon,  5 Dec 2011 09:40:44 -0800, Paul Berry <stereotype441 at gmail.com> wrote:
> This patch adds a new bit to the ctx->NewState bitfield,
> _NEW_TRANSFORM_FEEDBACK, to track state changes that affect
> ctx->TransformFeedback.  This bit can be used by driver back-ends to
> avoid expensive recomputations when transform feedback state has not
> been modified.
> ---
>  src/mesa/main/mtypes.h            |    1 +
>  src/mesa/main/transformfeedback.c |    9 ++++++++-
>  2 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 33b00c6..fc494f7 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -3051,6 +3051,7 @@ struct gl_matrix_stack
>  #define _NEW_PROGRAM_CONSTANTS (1 << 27)
>  #define _NEW_BUFFER_OBJECT     (1 << 28)
>  #define _NEW_FRAG_CLAMP        (1 << 29)
> +#define _NEW_TRANSFORM_FEEDBACK (1 << 30) /**< gl_context::TransformFeedback */
>  #define _NEW_ALL ~0
>  /*@}*/
>  
> diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
> index 11abd03..a1809db 100644
> --- a/src/mesa/main/transformfeedback.c
> +++ b/src/mesa/main/transformfeedback.c
> @@ -376,6 +376,7 @@ _mesa_BeginTransformFeedback(GLenum mode)
>        return;
>     }
>  
> +   ctx->NewState |= _NEW_TRANSFORM_FEEDBACK;
>     obj->Active = GL_TRUE;
>     ctx->TransformFeedback.Mode = mode;


These statechanges should probably be flagged using FLUSH_VERTICES(ctx,
_NEW_TRANSFORM_FEEDBACK), since we're about to change something that
would be used by existing glBegin()/glEnd() rendering that is batched up
in the vbo module.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111205/28cce126/attachment-0001.pgp>


More information about the mesa-dev mailing list