diff options
author | Paul Berry <[email protected]> | 2011-12-21 11:08:51 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2011-12-23 09:43:18 -0800 |
commit | cb045880b113b0042d8dfb7e4cdf76e6cc76c1d1 (patch) | |
tree | a8b7e60241333d71a192727f0b8bc82a7b2adf7a /src | |
parent | 772d4fef42d79c5efb3a7eb255ff0e1fdb88ada3 (diff) |
mesa: Pause transform feedback during meta ops.
Fixes piglit tests "EXT_transform_feedback/generatemipmap buffer" and
"EXT_transform_feedback/generatemipmap prims_written" on i965 Gen6.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 144fa12f1f4..e622673949a 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -65,6 +65,7 @@ #include "main/teximage.h" #include "main/texparam.h" #include "main/texstate.h" +#include "main/transformfeedback.h" #include "main/uniforms.h" #include "main/varray.h" #include "main/viewport.h" @@ -181,6 +182,7 @@ struct save_state /** Miscellaneous (always disabled) */ GLboolean Lighting; GLboolean RasterDiscard; + GLboolean TransformFeedbackNeedsResume; }; /** @@ -423,6 +425,15 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) memset(save, 0, sizeof(*save)); save->SavedState = state; + /* Pausing transform feedback needs to be done early, or else we won't be + * able to change other state. + */ + save->TransformFeedbackNeedsResume = + ctx->TransformFeedback.CurrentObject->Active && + !ctx->TransformFeedback.CurrentObject->Paused; + if (save->TransformFeedbackNeedsResume) + _mesa_PauseTransformFeedback(); + if (state & MESA_META_ALPHA_TEST) { save->AlphaEnabled = ctx->Color.AlphaEnabled; save->AlphaFunc = ctx->Color.AlphaFunc; @@ -988,6 +999,8 @@ _mesa_meta_end(struct gl_context *ctx) if (save->RasterDiscard) { _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_TRUE); } + if (save->TransformFeedbackNeedsResume) + _mesa_ResumeTransformFeedback(); } |