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).
826d3af i965/fs: Add ARB_fragment_program support to the NIR backend.
src/mesa/drivers/dri/i965/brw_fs.cpp | 16 ++++----
src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 61 +++++++++++++++++++++---------
2 files changed, 51 insertions(+), 26 deletions(-)
Upstream: cgit.freedesktop.org