mesa: Add helper function _mesa_is_alpha_test_enabled()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
This commit is contained in:
Anuj Phogat
2016-10-25 11:55:44 -07:00
parent 7fed07766d
commit 0295c792b4
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -1005,3 +1005,14 @@ _mesa_is_multisample_enabled(const struct gl_context *ctx)
ctx->DrawBuffer &&
_mesa_geometric_nonvalidated_samples(ctx->DrawBuffer) > 1;
}
/**
* Is alpha testing enabled and applicable to the currently bound
* framebuffer?
*/
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);
}
+3
View File
@@ -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 */