i965/vec4: make offset() work in terms of a simd width and scalar components
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 3 Oct 2016 11:33:12 +0000 (13:33 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 27 Oct 2016 08:59:31 +0000 (10:59 +0200)
commit66fcfa6894ab61a8cb70955f4a4113729e4a8099
tree849fced6c4ce84a3dc8bffe4bd9179350ac6f57f
parentba63db1f2ecf78ab894fe411b4f27d8523cf952d
i965/vec4: make offset() work in terms of a simd width and scalar components

So that it has the same semantics as the scalar backend implementation. The
helper will now take a simd width (which is always 8 in vec4 mode) and step
as many scalar components as specified by that width, respecting the size of
the scalar channels.

v2 (Curro):
  - Remove the assertion in offset(), byte_offset() has the same checks.
  - Use byte_offset() directly instead of add_byte_offset().
  - Make things more clear by explicitly including the vertical stride
    in the byte offset expression.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_ir_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp