summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2016-10-24 16:03:00 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-09 14:17:31 +0000
commit678b4f6372effa1710fd2387de65d29cfc180796 (patch)
tree7c5a55d9e58221d62a358fca5c53abda057b36fb
parent8ab9842d2e258147a2e84367fdd1d8a846df8d08 (diff)
downloadexternal_mesa3d-678b4f6372effa1710fd2387de65d29cfc180796.zip
external_mesa3d-678b4f6372effa1710fd2387de65d29cfc180796.tar.gz
external_mesa3d-678b4f6372effa1710fd2387de65d29cfc180796.tar.bz2
i965: Fix GPU hang related to multiple render targets and alpha testing
This patch should have been the part of commit e592f7df. In a situation when there are multiple render targets with alpha testing enabled, if fragment shader doesn't write to draw buffer zero, it causes the GPU hang on SKL. No GPU hang is seen on HSW. Simulator gives a warning for all gen6+ h/w: "Illegal render target write message length 0xa expected 0xc" This patch fixes the GPU hang as well as the simulator warning with new piglit test fbo-mrt-alphatest-no-buffer-zero-write: https://patchwork.freedesktop.org/patch/118212 No regressions in Jenkins CI system. Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (cherry picked from commit b9df2251c17e3ce52fa55c81f492591e08c3ee04)
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 921cc00..afb1057 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3673,6 +3673,12 @@ lower_fb_write_logical_send(const fs_builder &bld, fs_inst *inst,
*/
setup_color_payload(bld, key, &sources[length], src0_alpha, 1);
length++;
+ } else if (key->replicate_alpha && inst->target != 0) {
+ /* Handle the case when fragment shader doesn't write to draw buffer
+ * zero. No need to call setup_color_payload() for src0_alpha because
+ * alpha value will be undefined.
+ */
+ length++;
}
setup_color_payload(bld, key, &sources[length], color0, components);