[Mesa-dev] [PATCH 1/3] meta: Don't leak alpha function/reference value changes.

Brian Paul brianp at vmware.com
Tue Nov 2 07:52:08 PDT 2010


On 11/01/2010 08:06 PM, Francisco Jerez wrote:
> ---
>   src/mesa/drivers/common/meta.c |    5 +++++
>   1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index 9615b52..7ad1e72 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -104,6 +104,8 @@ struct save_state
>
>      /** META_ALPHA_TEST */
>      GLboolean AlphaEnabled;
> +   GLenum AlphaFunc;
> +   GLclampf AlphaRef;
>
>      /** META_BLEND */
>      GLbitfield BlendEnabled;
> @@ -328,6 +330,8 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
>
>      if (state&  META_ALPHA_TEST) {
>         save->AlphaEnabled = ctx->Color.AlphaEnabled;
> +      save->AlphaFunc = ctx->Color.AlphaFunc;
> +      save->AlphaRef = ctx->Color.AlphaRef;
>         if (ctx->Color.AlphaEnabled)
>            _mesa_set_enable(ctx, GL_ALPHA_TEST, GL_FALSE);
>      }
> @@ -577,6 +581,7 @@ _mesa_meta_end(struct gl_context *ctx)
>      if (state&  META_ALPHA_TEST) {
>         if (ctx->Color.AlphaEnabled != save->AlphaEnabled)
>            _mesa_set_enable(ctx, GL_ALPHA_TEST, save->AlphaEnabled);
> +      _mesa_AlphaFunc(save->AlphaFunc, save->AlphaRef);
>      }
>
>      if (state&  META_BLEND) {


Signed-off-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list