spirv: Generalize OpSelect
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Mon, 22 Apr 2019 16:45:53 +0000 (09:45 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 4 Jun 2019 00:20:54 +0000 (17:20 -0700)
commit81586e9f534eb531d137ce6dce38265548227b0b
tree73cf81502e26d13915a7621a2aca26a2db43fd2e
parent17630291e516efcc8940a8e4de45586ca9a578b5
spirv: Generalize OpSelect

SPIR-V 1.4 supports OpSelect over any composite type, and also allows
scalar boolean condition for vector types -- a case which we already
handled to support old GLSLang.

Added a helper function to recursively perform nir_bcsel, that makes
easier to support structs.

v2: Replace asserts() with vtn_fail_if().  (Jason)

v3: Simplify Condition and Result types verifications.  (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/spirv_to_nir.c