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>
This commit is contained in:
Jason Ekstrand
2017-10-19 10:11:22 -07:00
parent f5aad36d2e
commit 6bd876dcaa
3 changed files with 25 additions and 7 deletions

View File

@@ -159,6 +159,9 @@ struct vtn_block {
struct vtn_function {
struct exec_node node;
bool referenced;
bool emitted;
nir_function_impl *impl;
struct vtn_block *start_block;