i965/fs: Add ARB_fragment_program support to the NIR backend.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 30 Jan 2015 09:16:49 +0000 (01:16 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 28 Mar 2015 04:16:34 +0000 (21:16 -0700)
commit826d3afb8f421a62020308813397e541e672381e
tree141f78590b6de732c142d6ca91bcbb154835eace
parentbf2c3bc316cbfcc19d1bb65ab7410784ed7a3dac
i965/fs: Add ARB_fragment_program support to the NIR backend.

Use prog_to_nir where we would normally call glsl_to_nir, handle program
parameter lists, and skip a few things that don't exist.

Using NIR generates much better shader code than Mesa IR, since we get
real optimizations, as opposed to prog_optimize:

total instructions in shared programs: 314007 -> 279892 (-10.86%)
instructions in affected programs:     285173 -> 251058 (-11.96%)
helped:                                2001
HURT:                                  67
GAINED:                                4
LOST:                                  7

v2: Change early return in nir_setup_uniforms to if/else (Jordan).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp