summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-08-22 22:16:01 -0700
committerJason Ekstrand <[email protected]>2018-03-07 12:13:47 -0800
commitde518f38e53bceef40e4262bf7c3eeb66837fe8f (patch)
treea83ac66c7415149376215dfc2e495c1477df7703
parent9779f34326a6d01f4b026202c72d77dc968fd174 (diff)
spirv: Add a vtn_constant_value helper
Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
-rw-r--r--src/compiler/spirv/vtn_private.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 3e49df4dac8..817f78ce42d 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -639,6 +639,12 @@ bool
vtn_set_instruction_result_type(struct vtn_builder *b, SpvOp opcode,
const uint32_t *w, unsigned count);
+static inline nir_constant *
+vtn_constant_value(struct vtn_builder *b, uint32_t value_id)
+{
+ return vtn_value(b, value_id, vtn_value_type_constant)->constant;
+}
+
struct vtn_ssa_value *vtn_ssa_value(struct vtn_builder *b, uint32_t value_id);
struct vtn_ssa_value *vtn_create_ssa_value(struct vtn_builder *b,