[Mesa-dev] [PATCH 52/61] spirv: Record the type of functions
Jason Ekstrand
jason at jlekstrand.net
Fri Mar 23 21:42:58 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 12d68d6..692e3b6 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 e4f4e64..7f4cda8 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -215,6 +215,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