nir/serialize: fix vec8 and vec16
authorKarol Herbst <kherbst@redhat.com>
Mon, 2 Dec 2019 14:22:49 +0000 (15:22 +0100)
committerKarol Herbst <kherbst@redhat.com>
Wed, 11 Dec 2019 12:00:44 +0000 (13:00 +0100)
commit676232d76fdce1421d4294ac578daa717d976a2f
tree54ea4852988b977bb7e7d90ae5c7d9e2a34f01c9
parent2e44bfc14f5c2e44ed820257615c2008955bc5bf
nir/serialize: fix vec8 and vec16

Nir serializes uses nir_ssa_alu_instr_src_components in a few places to
determine how many components a src has, but that's not what this function
returns. It simply returns how many channels are used, which is still fine
for most of the code.

This was breaking code like this:

vec16 32 ssa_1 = intrinsic load_global
vec1  32 ssa_2 = fmax ssa_1.a, ssa_2.b

v2: make the 16bit encoding work for identify swizzles again

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/compiler/nir/nir_serialize.c