aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/framebuffer.c
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2016-10-25 11:55:44 -0700
committerAnuj Phogat <[email protected]>2016-11-07 16:13:02 -0800
commit0295c792b4b47865ddf7760ebe2980fc6f7a536b (patch)
tree8b1c6230ad55669be27e9e44d548ba37f1628e16 /src/mesa/main/framebuffer.c
parent7fed07766dde7b551c0d85f709ea74c0c460bcaa (diff)
mesa: Add helper function _mesa_is_alpha_test_enabled()
Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r--src/mesa/main/framebuffer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index e1505fa9709..361ed668587 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -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);
+}