Mesa (9.0): intel/i965: Disable SampleAlphaToOne if dual source blending enabled

Ian Romanick idr at kemper.freedesktop.org
Fri Oct 5 22:56:06 UTC 2012


Module: Mesa
Branch: 9.0
Commit: c566267f5c3b480c1a805790c45fc13ab52c98e2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c566267f5c3b480c1a805790c45fc13ab52c98e2

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Fri Sep 21 15:16:38 2012 -0700

intel/i965: Disable SampleAlphaToOne if dual source blending enabled

>From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
DWord 1, Bit 30 (AlphaToOne Enable):
"If Dual Source Blending is enabled, this bit must be disabled"

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit ea0d08872724b5e31e9e32db2338e15fdfdcc4de)

---

 src/mesa/drivers/dri/i965/gen6_cc.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c
index 6aeaaa2..e9c7f50 100644
--- a/src/mesa/drivers/dri/i965/gen6_cc.c
+++ b/src/mesa/drivers/dri/i965/gen6_cc.c
@@ -174,8 +174,17 @@ gen6_upload_blend_state(struct brw_context *brw)
          /* _NEW_MULTISAMPLE */
          blend[b].blend1.alpha_to_coverage =
             ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToCoverage;
-         blend[b].blend1.alpha_to_one =
-            ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToOne;
+
+	/* From SandyBridge PRM, volume 2 Part 1, section 8.2.3, BLEND_STATE:
+	 * DWord 1, Bit 30 (AlphaToOne Enable):
+	 * "If Dual Source Blending is enabled, this bit must be disabled"
+	 */
+	 if (ctx->Color.Blend[b]._UsesDualSrc)
+            blend[b].blend1.alpha_to_one = false;
+	 else
+	    blend[b].blend1.alpha_to_one =
+	       ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToOne;
+
          blend[b].blend1.alpha_to_coverage_dither = (brw->intel.gen >= 7);
       }
       else {




More information about the mesa-commit mailing list