nir: fix a bug with constant folding non-per-component instructions
authorConnor Abbott <cwabbott0@gmail.com>
Sun, 25 Jan 2015 16:47:53 +0000 (11:47 -0500)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 27 Jan 2015 02:26:36 +0000 (21:26 -0500)
commitf1a9252defb77f3986305c6a1fc9592093b5a4e5
treed171e242c454cb15ee0c77013c6806309babae54
parent816f0515a2ca2dbacada24f7f79d65daf5c0fcf5
nir: fix a bug with constant folding non-per-component instructions

Before, we were only copying the first N channels, where N is the size
of the SSA destination, which is fine for per-component instructions,
but non-per-component instructions like fdot3 can have more source
components than destination components. Fix this using the helper
function introduced in the last patch.

v2: use new helper name

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_opt_constant_folding.c