Commit de518f38 authored by Jason Ekstrand's avatar Jason Ekstrand

spirv: Add a vtn_constant_value helper

Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
parent 9779f343
...@@ -639,6 +639,12 @@ bool ...@@ -639,6 +639,12 @@ bool
vtn_set_instruction_result_type(struct vtn_builder *b, SpvOp opcode, vtn_set_instruction_result_type(struct vtn_builder *b, SpvOp opcode,
const uint32_t *w, unsigned count); 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_ssa_value(struct vtn_builder *b, uint32_t value_id);
struct vtn_ssa_value *vtn_create_ssa_value(struct vtn_builder *b, struct vtn_ssa_value *vtn_create_ssa_value(struct vtn_builder *b,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment