spirv: Only emit functions which are actually used
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 19 Oct 2017 17:11:22 +0000 (10:11 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 2 Dec 2017 16:07:35 +0000 (08:07 -0800)
commit6bd876dcaa4403b30eedd5ebe66bfadcef1f1a0c
tree769f3abfb15b350a4e878d01af9a243a6f2e2ffa
parentf5aad36d2e5bd7d699cd6bbbfc8c9866c815f52e
spirv: Only emit functions which are actually used

Instead of emitting absolutely everything, just emit the few functions
that are actually referenced in some way by the entrypoint.  This should
save us quite a bit of time when handed large shader modules containing
many entrypoints.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_cfg.c
src/compiler/spirv/vtn_private.h