diff options
author | marha <marha@users.sourceforge.net> | 2011-12-25 17:34:25 +0100 |
---|---|---|
committer | Marc Haesen <marc@hc-consult.be> | 2011-12-25 17:34:25 +0100 |
commit | 7fd4689bd7bac15dcc0ab13d4689a11e2c303681 (patch) | |
tree | c5bd75a1fc913dcb08d03525d87638e66fa8aad2 /mesalib/src/mesa/drivers/common | |
parent | 1a9e93b01e2339579bf9a0fae0db0f83b653aab7 (diff) | |
parent | 0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1 (diff) | |
download | vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.tar.gz vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.tar.bz2 vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/drivers/common')
-rw-r--r-- | mesalib/src/mesa/drivers/common/meta.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index c5c59ebee..e62267394 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/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" @@ -180,6 +181,8 @@ struct save_state /** Miscellaneous (always disabled) */ GLboolean Lighting; + GLboolean RasterDiscard; + GLboolean TransformFeedbackNeedsResume; }; /** @@ -422,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; @@ -702,6 +714,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) save->Lighting = ctx->Light.Enabled; if (ctx->Light.Enabled) _mesa_set_enable(ctx, GL_LIGHTING, GL_FALSE); + save->RasterDiscard = ctx->RasterDiscard; + if (ctx->RasterDiscard) + _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_FALSE); } } @@ -981,6 +996,11 @@ _mesa_meta_end(struct gl_context *ctx) if (save->Lighting) { _mesa_set_enable(ctx, GL_LIGHTING, GL_TRUE); } + if (save->RasterDiscard) { + _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_TRUE); + } + if (save->TransformFeedbackNeedsResume) + _mesa_ResumeTransformFeedback(); } |