i965/vs: Fix a subtlety in the nr_attributes == 0 workaround.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 26 Aug 2015 00:09:40 +0000 (17:09 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 10 Oct 2015 18:40:19 +0000 (11:40 -0700)
commit6842ad79125371e7e61baac8e6b8a77583f79065
tree860b0495eb721a36c9bb21f2e42297d0348d0d68
parent031d3501322aee0a1474c7f2a9b79f9fa9947430
i965/vs: Fix a subtlety in the nr_attributes == 0 workaround.

nr_attributes is used to compute first_non_payload_grf, which is the
first register we're allowed to use for ordinary register allocation.

The hardware requires us to read at least one pair of values, but we're
completely free to overwrite that garbage register with whatever we like.

Instead of altering nr_attributes, we should alter urb_read_length, which
only affects the amount we ask the VF to read.  This should save us a
register in trivial cases (which admittedly isn't very useful).

While we're at it, improve the explanation in the comments.

v2: Actually do what I said (caught by Ilia).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_vs.c