i965/vec4: fix swizzle and writemask when loading an uniform with constant offset
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Wed, 19 Apr 2017 08:35:07 +0000 (10:35 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Thu, 18 May 2017 04:49:54 +0000 (06:49 +0200)
commit8aa6ada8384a961b37dfefec7f9e40e5a4e27ce7
tree3777d63c5880cd64337654759940225c5d1084c6
parent354f7f2cb9c7206e12646c79d8ff5becbaffa61b
i965/vec4: fix swizzle and writemask when loading an uniform with constant offset

It was setting XYWZ swizzle and writemask to all uniforms, no matter if they
were a vector or scalar, so this can lead to problems when loading them
to the push constant buffer.

Moreover, 'shift' calculation was designed to calculate the offset in
DWORDS, but it doesn't take into account DFs, so the calculated swizzle
for the later ones was wrong.

The indirect case is not changed because MOV INDIRECT will write
to all components. Added an assert to verify that these uniforms
are aligned.

v2:
- Fix 'shift' calculation (Curro)
- Set both swizzle and writemask.
- Add assert(shift == 0) for the indirect case.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/intel/compiler/brw_vec4_nir.cpp