i965/fs: Simplify texture destination fixups
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 3 May 2016 18:57:30 +0000 (11:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 5 May 2016 23:25:21 +0000 (16:25 -0700)
commit3ba228f9978cbabc2b4731327454dd91a208c317
tree7e968f2ed0406b6962ffdeaddf190e758fb74889
parent7de0ae634eebbf798ace46d1acbdd687ebf07586
i965/fs: Simplify texture destination fixups

There are a few different fixups that we have to do for texture
destinations that re-arrange channels, fix hardware vs. API mismatches, or
just shrink the result to fit in the NIR destination.  These were all being
done in a somewhat haphazard manner.  This commit replaces all of the
shuffling with a single LOAD_PAYLOAD operation at the end and makes it much
easier to insert fixups between the texture instruction itself and the
LOAD_PAYLOAD.

Shader-db results on Haswell:

   total instructions in shared programs: 6227035 -> 6226669 (-0.01%)
   instructions in affected programs: 19119 -> 18753 (-1.91%)
   helped: 85
   HURT: 0

   total cycles in shared programs: 56491626 -> 56476126 (-0.03%)
   cycles in affected programs: 672420 -> 656920 (-2.31%)
   helped: 92
   HURT: 42
src/mesa/drivers/dri/i965/brw_fs_nir.cpp