i965/vs: Generalize computation of array strides in preparation for GS.
authorPaul Berry <stereotype441@gmail.com>
Fri, 22 Mar 2013 18:26:34 +0000 (11:26 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 11 Apr 2013 16:25:26 +0000 (09:25 -0700)
commitdefdb310b76ad30c192a087292e86377f4ea0d83
treebed83bbbf720fc4ed3e050f641c1eb80d078e199
parent444fce6398556118629ef01204a7d8ff7af0bea3
i965/vs: Generalize computation of array strides in preparation for GS.

Geometry shader inputs are arrays, but they use an unusual array
layout: instead of all array elements for a given geometry shader
input being stored consecutively, all geometry shader inputs are
interleaved into one giant array.  As a result, the array stride we
use to access geometry shader inputs must be equal to the size of the
input VUE, rather than the size of the array element.

This patch introduces a new virtual function,
vec4_visitor::compute_array_stride(), which will allow geometry shader
compilation to specialize the computation of array stride to account
for the unusual layout of geometry shader input arrays.  It also
renames the local variable that the ir_dereference_array visitor uses
to store the stride, to avoid confusion.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp