i965: Remove fixed-function texture projection avoidance optimization.
i965: Remove fixed-function texture projection avoidance optimization.

This optimization attempts to avoid extra attribute interpolation
instructions for texture coordinates where the W-component is 1.0.

Unfortunately, it requires a lot of complexity: the brw_wm_input_sizes
state atom (all the brw_vs_constval.c code) needs to run on each draw.
It computes the input_size_masks array, then uses that to compute
proj_attrib_mask.  Differences in proj_attrib_mask can cause
state-dependent fragment shader recompiles.  We also often fail to guess
proj_attrib_mask for the fragment shader precompile, causing us to
needlessly compile it twice.

Furthermore, this optimization only applies to fixed-function programs;
it does not help modern GLSL-based programs at all.  Generally, older
fixed-function programs run fine on modern hardware anyway.

The optimization has existed in some form since the initial commit.  When
we rewrote the fragment shader backend, we dropped it for a while.  Eric
readded it in commit eb30820f268608cf451da32de69723036dddbc62 as part of
an attempt to cure a ~1% performance regression caused by converting the
fixed-function fragment shader generation code from Mesa IR to GLSL IR.
However, no performance data was included in the commit message, so it's
unclear whether or not it was successful.

Time has passed, so I decided to re-measure this.  Surprisingly,
Eric's OpenArena timedemo actually runs /faster/ after removing this and
the brw_wm_input_sizes atom.  On Ivybridge at 1024x768, I measured a
1.39532% +/- 0.91833% increase in FPS (n = 55).  On Ironlake, there was
no statistically significant difference (n = 37).

Signed-off-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>

djreep81/glsl-optimizer,mcanthony/glsl-optimizer,metora/MesaGLSLCompiler,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,djreep81/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer