[Mesa-dev] [PATCH v3 055/104] spirv: Record the type of functions

Jason Ekstrand jason at jlekstrand.net
Tue Apr 3 18:33:22 UTC 2018


---
 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 37024e6..54616d6 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 a64f4a8..6f2fcc7 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -217,6 +217,8 @@ struct vtn_block {
 struct vtn_function {
    struct exec_node node;
 
+   struct vtn_type *type;
+
    bool referenced;
    bool emitted;
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list