i965/fs: Simplify and fix buggy stride/offset calculations using subscript().
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 2 Sep 2016 02:16:01 +0000 (19:16 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 14 Sep 2016 21:50:56 +0000 (14:50 -0700)
commit62aaef6c83e4eb354bd7f15803db01e90d22fc34
treed98f66e18fb8454b07cc60b85389fa9b16c63eba
parent3b7b90878770530ad3da44c6beb1401c40f1ffd6
i965/fs: Simplify and fix buggy stride/offset calculations using subscript().

These were bashing the 'offset' and 'stride' values of several
registers without taking the previous value into account, which
probably didn't matter in practice for optimize_frontfacing_ternary()
because the 'tmp' register already had a known region, but it would
have given the wrong region as result in the other cases in
lower_integer_multiplication().  subscript(..., i) is a more
straightforward way to take the i-th field of a given type from each
channel of a register which should give the right answer as result
regardless of the original 'offset' and 'stride' parameters of the
register region.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_nir.cpp