+
+ /* OpenGL specification 3.3 (page 196), section 4.1.3 says:
+ * "If drawbuffer zero is not NONE and the buffer it references has an
+ * integer format, the SAMPLE_ALPHA_TO_COVERAGE and SAMPLE_ALPHA_TO_ONE
+ * operations are skipped."
+ */
+ if(!is_buffer_zero_integer_format) {
+ /* _NEW_MULTISAMPLE */
+ blend[b].blend1.alpha_to_coverage =
+ ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToCoverage;
+
+ /* 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"
+ */
+ WARN_ONCE(ctx->Color.Blend[b]._UsesDualSrc &&
+ ctx->Multisample._Enabled &&
+ ctx->Multisample.SampleAlphaToOne,
+ "HW workaround: disabling alpha to one with dual src "
+ "blending\n");
+ 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->gen >= 7);
+ }
+ else {
+ blend[b].blend1.alpha_to_coverage = false;
+ blend[b].blend1.alpha_to_one = false;
+ }