i965: Rework the unlit centroid workaround.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 2 Aug 2016 03:59:08 +0000 (20:59 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 5 Aug 2016 08:43:52 +0000 (01:43 -0700)
commit875341c69b99dea7942a68c9060aa31a459e93fc
tree26b757501816bb14a1571d93a0cf35b96a0d5af0
parentb521083ffb351b7fe2521a47731a46cdbb614117
i965: Rework the unlit centroid workaround.

Previously, for every input, we moved the dispatch mask to the flag
register, then emitted two predicated PLN instructions, one with
centroid barycentric coordinates (for normal pixels), and one with
pixel barycentric coordinates (for unlit helper pixels).

Instead, we can simply emit a set of predicated MOVs at the top of
the program which copy the pixel barycentric coordinates over the
centroid ones for unlit helper pixel channels.  Then, we can just
use normal PLNs.

On Sandybridge:

total instructions in shared programs: 7538470 -> 7534500 (-0.05%)
instructions in affected programs: 101268 -> 97298 (-3.92%)
helped: 705
HURT: 9 (all of which are SIMD16 programs)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp