From 5045efa4aa2bd335b2b0110b6af792fbc4fcba7e Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 1 May 2015 11:27:44 -0700 Subject: [PATCH] nir/spirv: Add a vtn_untyped_value helper --- src/glsl/nir/spirv_to_nir.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index 8e043100c37..7f74c9708d9 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -92,14 +92,21 @@ vtn_push_value(struct vtn_builder *b, uint32_t value_id, } static struct vtn_value * -vtn_value(struct vtn_builder *b, uint32_t value_id, - enum vtn_value_type value_type) +vtn_untyped_value(struct vtn_builder *b, uint32_t value_id) { assert(value_id < b->value_id_bound); - assert(b->values[value_id].value_type == value_type); return &b->values[value_id]; } +static struct vtn_value * +vtn_value(struct vtn_builder *b, uint32_t value_id, + enum vtn_value_type value_type) +{ + struct vtn_value *val = vtn_untyped_value(b, value_id); + assert(val->value_type == value_type); + return val; +} + static char * vtn_string_literal(struct vtn_builder *b, const uint32_t *words, unsigned word_count) -- 2.30.2