spirv: Record the type of functions
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 23 Mar 2018 01:44:06 +0000 (18:44 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 23 Jun 2018 03:15:57 +0000 (20:15 -0700)
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/spirv/vtn_cfg.c
src/compiler/spirv/vtn_private.h

index 6e6f221040d38316cd0cddd6e7296871b8839999..efae35ccc1ea8dca958a531464383ea2efc8a450 100644 (file)
@@ -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);
 
index bd4d28b4f37d94671863e26cb1020e9bdd9d4bf0..97031632e0146b9385418b9778629e74afed8579 100644 (file)
@@ -221,6 +221,8 @@ struct vtn_block {
 struct vtn_function {
    struct exec_node node;
 
+   struct vtn_type *type;
+
    bool referenced;
    bool emitted;