[Mesa-dev] [PATCH 2/4] mesa: Add helper function _mesa_is_alpha_test_enabled()

Brian Paul brianp at vmware.com
Wed Oct 26 00:14:44 UTC 2016


On 10/25/2016 04:09 PM, Anuj Phogat wrote:
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>   src/mesa/main/framebuffer.c | 7 +++++++
>   src/mesa/main/framebuffer.h | 3 +++
>   2 files changed, 10 insertions(+)
>
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index e1505fa..f19f3af 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -1005,3 +1005,10 @@ _mesa_is_multisample_enabled(const struct gl_context *ctx)
>             ctx->DrawBuffer &&
>             _mesa_geometric_nonvalidated_samples(ctx->DrawBuffer) > 1;
>   }
> +
> +bool
> +_mesa_is_alpha_test_enabled(const struct gl_context *ctx)
> +{
> +   bool buffer0_is_integer = ctx->DrawBuffer->_IntegerBuffers & 0x1;
> +   return (ctx->Color.AlphaEnabled && !buffer0_is_integer);
> +}
> diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h
> index 384f749..a6adb1c 100644
> --- a/src/mesa/main/framebuffer.h
> +++ b/src/mesa/main/framebuffer.h
> @@ -149,4 +149,7 @@ _mesa_is_front_buffer_drawing(const struct gl_framebuffer *fb);
>   extern bool
>   _mesa_is_multisample_enabled(const struct gl_context *ctx);
>
> +extern bool
> +_mesa_is_alpha_test_enabled(const struct gl_context *ctx);
> +
>   #endif /* FRAMEBUFFER_H */
>

Could you add a comment on this function such as:

/**
  * Is alpha testing enabled and applicable to the currently bound 
framebuffer?
  */

Same thing for _mesa_is_alpha_to_coverage_enabled()?

For patches 1-3, Reviewed-by: Brian Paul <brianp at vmware.com>




More information about the mesa-dev mailing list