nir/search: Allow for matching variables based on types
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 29 Jan 2015 00:29:21 +0000 (16:29 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 30 Jan 2015 01:07:45 +0000 (17:07 -0800)
commit026b5cc79274af4a681d3ef41ccfd3b5fa5dc050
treee1cd37daf11ba9959350897bfbb3286f130fdbec
parentd8999bcdce6a3c8ab63f06c7028fd6e927bb9acb
nir/search: Allow for matching variables based on types

This allows you to match on an unknown value but only if it is of a given
type.  90% of the uses of this are for matching only booleans, but adding
the generality of arbitrary types is no more complex.

nir_algebraic.py doesn't handle this yet but that's ok because the C
language will ensure that the default type on all variables is void.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/nir/nir_search.c
src/glsl/nir/nir_search.h