OSDN Git Service

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)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 8 Nov 2018 16:04:53 +0000 (16:04 +0000)
commit6adbf17ce91fbc907935af0b8e1c7d2eb26dd9a9
tree247aa1751762656e191a93bca0287f4a7fc2402c
parentd5e33d2aa6cc7484a1a6bed2cd65d18f62f55f49
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>
(cherry picked from commit 769ae9fb7f8cea1d4a03e31f7f4a1c988e424c03)
src/compiler/nir/nir_opt_if.c