i965/vs: Take attributes into account when deciding urb_entry_size.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 18 Jan 2012 12:53:40 +0000 (04:53 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 18 Jan 2012 22:42:04 +0000 (14:42 -0800)
commit2e712e41db0c0676e9f30fc73172c0e8de8d84d4
tree3a2672ae7b1f6ac3be61c9701333190f7e71b041
parent81da773f841aa69debc473537750c475e6261e37
i965/vs: Take attributes into account when deciding urb_entry_size.

Both the VF and VS share space in the URB.  First, the VF stores
attributes (shader inputs) there.  The VS then reads the attributes,
executes, and reuses the space to store varyings (shader outputs).

Thus, we need to calculate the amount of URB space necessary for inputs,
outputs, and pick whichever is greater.

The old VS backend correctly did this (brw_vs_emit.c:408), but the new
VS backend only considered outputs.

Fixes vertex scrambling in GLBenchmark PRO on Ivybridge.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41318
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp