From fb94747b6639ba976aaaaba5a37aa2fe56999310 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Nov 2010 10:00:58 -0600 Subject: gallivm: added lp_elem_type() --- src/gallium/auxiliary/gallivm/lp_bld_type.c | 16 ++++++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_type.h | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'src/gallium') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.c b/src/gallium/auxiliary/gallivm/lp_bld_type.c index 06f1aae6dc..5205c7ada9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_type.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c @@ -187,6 +187,22 @@ lp_build_int32_vec4_type(void) } +/** + * Create element of vector type + */ +struct lp_type +lp_elem_type(struct lp_type type) +{ + struct lp_type res_type; + + assert(type.length > 1); + res_type = type; + res_type.length = 1; + + return res_type; +} + + /** * Create unsigned integer type variation of given type. */ diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.h b/src/gallium/auxiliary/gallivm/lp_bld_type.h index fec1d3dfbc..a135d0df84 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_type.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_type.h @@ -364,6 +364,10 @@ lp_unorm8_vec4_type(void) } +struct lp_type +lp_elem_type(struct lp_type type); + + struct lp_type lp_uint_type(struct lp_type type); -- cgit v1.2.3