From 3fc3798677545610f624c0887065e9cb6fcc6db2 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 22 Mar 2018 18:44:06 -0700 Subject: [PATCH] spirv: Record the type of functions Acked-by: Rob Clark Acked-by: Bas Nieuwenhuizen Acked-by: Dave Airlie Reviewed-by: Kenneth Graunke --- src/compiler/spirv/vtn_cfg.c | 4 ++-- src/compiler/spirv/vtn_private.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c index 6e6f221..efae35c 100644 --- a/src/compiler/spirv/vtn_cfg.c +++ b/src/compiler/spirv/vtn_cfg.c @@ -56,8 +56,8 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode, struct vtn_value *val = vtn_push_value(b, w[2], vtn_value_type_function); val->func = b->func; - const struct vtn_type *func_type = - vtn_value(b, w[4], vtn_value_type_type)->type; + b->func->type = vtn_value(b, w[4], vtn_value_type_type)->type; + const struct vtn_type *func_type = b->func->type; vtn_assert(func_type->return_type->type == result_type); diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index bd4d28b..9703163 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -221,6 +221,8 @@ struct vtn_block { struct vtn_function { struct exec_node node; + struct vtn_type *type; + bool referenced; bool emitted; -- 2.7.4