nir: add nir_opt_shrink_load pass
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 29 Jan 2018 16:19:00 +0000 (17:19 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 6 Feb 2018 22:08:39 +0000 (23:08 +0100)
commite68562b94b79f5ce17f5804f8d7308faf57bd3f0
treeb3900a4674aa485ed0605c3ab96093149f2ba5f0
parente2ea9e11910a10ae10d6491d913ab1d57f97a0d4
nir: add nir_opt_shrink_load pass

This is a very simple pass that just shrinks load_push_constant
intrinsics when some components are unused. For now, it can just
shrink vec4 to vec3, vec3 to vec2 and so on.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_opt_shrink_load_constant.c [new file with mode: 0644]