i965/fs: Save push constant location information.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 7 Mar 2014 10:10:14 +0000 (02:10 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Mar 2014 17:11:21 +0000 (10:11 -0700)
commit7c7627781feca0c8738da66425d6c530ea598dc4
treee24035dd4adda143e3bb58db6a44f01facb921ef
parentde77efde91401919fe7282a4b07300a10185792b
i965/fs: Save push constant location information.

Previously, both move_uniform_array_access_to_pull_constants() and
setup_pull_constants() maintained stack-local arrays with this
information.  Storing this information will allow it to be used from
multiple functions, allowing us to split and move code around.

We'll also eventually want to pass pull constant location information
to the SIMD16 compile.  Saving this information will help us do that.

Unfortunately, the two functions *cannot* share the contents of the
array just yet.  remove_dead_constants() renumbers all the UNIFORM
registers to be contiguous starting at zero, so the two functions
talk about uniforms using different names.  We can't even remap them,
since move_uniform_array_access_to_pull_constants() deletes UNIFORM
registers that are only accessed with reladdr, so remove_dead_constants
can't even see them.

This situation will improve in the next few patches.

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
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp