i965/fs: Split pull parameter decision making from mechanical demoting.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 10 Mar 2014 20:14:03 +0000 (13:14 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Mar 2014 17:11:26 +0000 (10:11 -0700)
commitd9f339eccd87413d9f6bf6dd6217db01630f12f8
treec9d1317222c005b80c04778630df6d520a591293
parent2163e0fd5a6bf2ac95aef331c30f010cb6e39cab
i965/fs: Split pull parameter decision making from mechanical demoting.

move_uniform_array_access_to_pull_constants() and setup_pull_constants()
both have two parts:

1. Decide which UNIFORM registers to demote to pull constants, and
   assign locations.
2. Mechanically rewrite the instruction stream to pull the uniform
   value into a temporary VGRF and use that, eliminating the UNIFORM
   file access.

In order to support pull constants in SIMD16 mode, we will need to make
decisions exactly once, but rewrite both instruction streams.
Separating these two tasks will make this easier.

This patch introduces a new helper, demote_pull_constants(), which
takes care of rewriting the instruction stream, in both cases.

For the moment, a single invocation of demote_pull_constants can't
safely handle both reladdr and non-reladdr tasks, since the two callers
still use different names for uniforms due to remove_dead_constants()
remapping of things.  So, we get an ugly boolean parameter saying
which to do.  This will go away.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h