aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_wm.c
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-07-01 23:30:55 +1200
committerChris Forbes <[email protected]>2013-07-06 12:41:54 +1200
commit1415a1884c59aff37d0f1a53447ef389dd9f9b39 (patch)
tree978bff42ccd93554de68f87da561f6b7a2bd9510 /src/mesa/drivers/dri/i965/brw_wm.c
parent9ef49cfd841a8cbf280a1a2b66ce90f710e44687 (diff)
i965: fix alpha test for MRT
Include src0 alpha in the RT write message when using MRT, so it is used for the alpha test instead of the normal per-RT alpha value. Fixes broken rendering in Dota2 under Wine [FDO #62647]. No Piglit regressions on Ivybridge. V2: reuse (and simplify) existing sample_alpha_to_coverage flag in the FS key, rather than adding another redundant one. Signed-off-by: Chris Forbes <[email protected]> Reviewd-by: Paul Berry <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62647 NOTE: This is a candidate for the stable branches.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 6eb4a1dd105..5f681f6caf3 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -277,8 +277,8 @@ brw_wm_debug_recompile(struct brw_context *brw,
old_key->flat_shade, key->flat_shade);
found |= key_debug(intel, "number of color buffers",
old_key->nr_color_regions, key->nr_color_regions);
- found |= key_debug(intel, "sample alpha to coverage",
- old_key->sample_alpha_to_coverage, key->sample_alpha_to_coverage);
+ found |= key_debug(intel, "MRT alpha test or alpha-to-coverage",
+ old_key->replicate_alpha, key->replicate_alpha);
found |= key_debug(intel, "rendering to FBO",
old_key->render_to_fbo, key->render_to_fbo);
found |= key_debug(intel, "fragment color clamping",
@@ -461,8 +461,10 @@ static void brw_wm_populate_key( struct brw_context *brw,
/* _NEW_BUFFERS */
key->nr_color_regions = ctx->DrawBuffer->_NumColorDrawBuffers;
- /* _NEW_MULTISAMPLE */
- key->sample_alpha_to_coverage = ctx->Multisample.SampleAlphaToCoverage;
+
+ /* _NEW_MULTISAMPLE, _NEW_COLOR, _NEW_BUFFERS */
+ key->replicate_alpha = ctx->DrawBuffer->_NumColorDrawBuffers > 1 &&
+ (ctx->Multisample.SampleAlphaToCoverage || ctx->Color.AlphaEnabled);
/* BRW_NEW_VUE_MAP_GEOM_OUT */
if (intel->gen < 6)