i965/ir: Skip eliminate_find_live_channel() for stages with sparse thread dispatch.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 16 Sep 2016 00:20:23 +0000 (17:20 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 21 Sep 2016 10:45:46 +0000 (13:45 +0300)
commitf57f526fc5cfaedf26b2becf8f1899d5de0d0461
tree5bbd786fffec71aac38a61002d85bf69a175e443
parent8a468d186e6fc27c26dd12ba989192e7596f667a
i965/ir: Skip eliminate_find_live_channel() for stages with sparse thread dispatch.

The eliminate_find_live_channel optimization eliminates
FIND_LIVE_CHANNEL instructions in cases where control flow is known to
be uniform, and replaces them with 'MOV 0', which in turn unblocks
subsequent elimination of the BROADCAST instruction frequently used on
the result of FIND_LIVE_CHANNEL.  This is however not correct in
per-sample fragment shader dispatch because the PSD can dispatch a
fully unlit sample under certain conditions.  Disable the optimization
in that case.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
v2: Add devinfo argument to brw_stage_has_packed_dispatch() to
    implement hardware generation check.
src/mesa/drivers/dri/i965/brw_compiler.h
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_vec4.cpp