[Mesa-dev] [PATCH 3/4] mesa: Add helper function _mesa_is_alpha_to_coverage_enabled()

Anuj Phogat anuj.phogat at gmail.com
Tue Oct 25 23:09:32 UTC 2016


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 src/mesa/main/framebuffer.c | 9 +++++++++
 src/mesa/main/framebuffer.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index f19f3af..3aff102 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -1012,3 +1012,12 @@ _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);
 }
+
+bool
+_mesa_is_alpha_to_coverage_enabled(const struct gl_context *ctx)
+{
+   bool buffer0_is_integer = ctx->DrawBuffer->_IntegerBuffers & 0x1;
+   return (ctx->Multisample.SampleAlphaToCoverage &&
+           _mesa_is_multisample_enabled(ctx) &&
+           !buffer0_is_integer);
+}
diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h
index a6adb1c..745c1da 100644
--- a/src/mesa/main/framebuffer.h
+++ b/src/mesa/main/framebuffer.h
@@ -152,4 +152,7 @@ _mesa_is_multisample_enabled(const struct gl_context *ctx);
 extern bool
 _mesa_is_alpha_test_enabled(const struct gl_context *ctx);
 
+extern bool
+_mesa_is_alpha_to_coverage_enabled(const struct gl_context *ctx);
+
 #endif /* FRAMEBUFFER_H */
-- 
2.5.5



More information about the mesa-dev mailing list