i965/vs: Map scalar VS input locations properly; avoid tons of MOVs.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 14 Aug 2015 22:15:11 +0000 (15:15 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 10 Oct 2015 18:40:19 +0000 (11:40 -0700)
commit2953c3d76178d7589947e6ea1dbd902b7b02b3d4
tree1b3d2df2c32ea524178bedb86855beac78798c1d
parent6842ad79125371e7e61baac8e6b8a77583f79065
i965/vs: Map scalar VS input locations properly; avoid tons of MOVs.

Previously, we used nir_lower_io with the scalar type_size function,
which mapped VERT_ATTRIB_* locations to...some numbers.  Then, in
fs_visitor::nir_setup_inputs(), we created temporaries indexed by
those numbers, and emitted MOVs from the actual ATTR registers to
those temporaries.  Virtually all of these were copy propagated away,
but it's still ugly.

This patch reworks our input lowering to produce NIR lower_input
intrinsics that properly index into the ATTR file, so we can access
it directly.

No changes in shader-db.

v2: Fix unreachable() message (Ken), update commit message (Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_nir.c