From: Jason Ekstrand Date: Wed, 23 Aug 2017 05:16:01 +0000 (-0700) Subject: spirv: Add a vtn_constant_value helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de518f38e53bceef40e4262bf7c3eeb66837fe8f;p=mesa.git spirv: Add a vtn_constant_value helper Reviewed-by: Lionel Landwerlin Reviewed-by: Iago Toral Quiroga --- 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,