diff options
author | Paul Berry <[email protected]> | 2011-11-22 11:53:46 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2011-12-07 16:38:00 -0800 |
commit | a98ceee0ee3692783047c6f8f9f6bf6afbf4dd3b (patch) | |
tree | 3444e6dc78e3d2f0253e5454be681edda770cdf7 /src/mesa/main/transformfeedback.c | |
parent | 63a6fd6603574c1c01324fbeb0863e39d3864c16 (diff) |
mesa: Track changes to transform feedback state.
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.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/transformfeedback.c')
-rw-r--r-- | src/mesa/main/transformfeedback.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 11abd037d5c..799245d4ed5 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -376,6 +376,7 @@ _mesa_BeginTransformFeedback(GLenum mode) return; } + FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); obj->Active = GL_TRUE; ctx->TransformFeedback.Mode = mode; @@ -398,6 +399,7 @@ _mesa_EndTransformFeedback(void) return; } + FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); ctx->TransformFeedback.CurrentObject->Active = GL_FALSE; assert(ctx->Driver.EndTransformFeedback); @@ -415,6 +417,7 @@ bind_buffer_range(struct gl_context *ctx, GLuint index, { struct gl_transform_feedback_object *obj = ctx->TransformFeedback.CurrentObject; + FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); /* The general binding point */ _mesa_reference_buffer_object(ctx, @@ -650,7 +653,9 @@ _mesa_TransformFeedbackVaryings(GLuint program, GLsizei count, shProg->TransformFeedback.BufferMode = bufferMode; - /* The varyings won't be used until shader link time */ + /* No need to set _NEW_TRANSFORM_FEEDBACK (or invoke FLUSH_VERTICES) since + * the varyings won't be used until shader link time. + */ } @@ -874,6 +879,7 @@ _mesa_PauseTransformFeedback(void) return; } + FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); obj->Paused = GL_TRUE; assert(ctx->Driver.PauseTransformFeedback); @@ -899,6 +905,7 @@ _mesa_ResumeTransformFeedback(void) return; } + FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK); obj->Paused = GL_FALSE; assert(ctx->Driver.ResumeTransformFeedback); |