i965/fs: fix offset when loading double vector input varyings
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Thu, 26 May 2016 05:56:37 +0000 (07:56 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 6 Jun 2016 10:37:16 +0000 (12:37 +0200)
commit2d6f82a294ad1ab1eab0020cf65df5ecc9591272
treedecdcf3485aa507eaf0901e6cd41becc713a25e0
parentcb30727648fea301cfff1647d947bfab540c3bf6
i965/fs: fix offset when loading double vector input varyings

When we are not packing a double input varying, we might need to
read its data in a non-aligned to 64-bit offset, so we read
the wrong data. This is happening when using explicit locations
in varyings because Mesa disables packing varying for that case.

const_index is in 32-bit size units but offset() is multiplying
it by destination type size units. When operating with double
input varyings, const_index value could be not aligned to 64 bits.
To fix it, we load the double vector as if it was a float based vector
with twice the number of components.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp