nir: fix condition propagation when src has a swizzle
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 2 Nov 2018 11:10:36 +0000 (22:10 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 2 Nov 2018 13:44:01 +0000 (00:44 +1100)
commit769ae9fb7f8cea1d4a03e31f7f4a1c988e424c03
treece34146ee2f87276f21a81ae236afbb191f44d0d
parentb9dec214f5151f3ad87eb2faf982c57e5323f534
nir: fix condition propagation when src has a swizzle

We cannot use nir_build_alu() to create the new alu as it has no
way to know how many components of the src we will use. This
results in it guessing the max number of components from one of
its inputs.

Fixes the following CTS tests:

dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_frag
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_geom
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_tessc
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_vert

Fixes: 2975422ceb6c ("nir: propagates if condition evaluation down some alu chains")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_if.c