diff options
author | marha <marha@users.sourceforge.net> | 2011-12-25 17:27:22 +0100 |
---|---|---|
committer | Marc Haesen <marc@hc-consult.be> | 2011-12-25 17:27:22 +0100 |
commit | 0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1 (patch) | |
tree | d449668fac922e358f442aeb82d0936ca786ed72 /mesalib/src/mesa/drivers/common/meta.c | |
parent | 0b3f475361d87764004432f541e34bb86af1b9f3 (diff) | |
download | vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.tar.gz vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.tar.bz2 vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.zip |
mesa xkeyboard-config xserver git update 25 dec 2011
Diffstat (limited to 'mesalib/src/mesa/drivers/common/meta.c')
-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(); } |