i965/vs: Unify URB entry size/read length calculations between backends.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 25 Aug 2015 23:59:12 +0000 (16:59 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 10 Oct 2015 18:40:19 +0000 (11:40 -0700)
commit031d3501322aee0a1474c7f2a9b79f9fa9947430
tree9990ca3bd85cef0b1075f108c884fc0e9a94fa12
parenta4e988f4814d80b27102c48020c4338a6d86c6da
i965/vs: Unify URB entry size/read length calculations between backends.

Both the vec4 and scalar VS backends had virtually identical URB entry
size and read length calculations.  We can move those up a level to
backend-agnostic code and reuse it for both.

Unfortunately, the backends need to know nr_attributes to compute
first_non_payload_grf, so I had to store that in prog_data.  We could
use urb_read_length, but that's nr_attributes rounded up to a multiple
of two, so doing so would waste a register in some cases.

There's more code to be removed in the vec4 backend, but that will
come in a follow-on patch.

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