gallivm: added lp_elem_type()
authorBrian Paul <brianp@vmware.com>
Thu, 4 Nov 2010 16:00:58 +0000 (10:00 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 4 Nov 2010 16:00:58 +0000 (10:00 -0600)
src/gallium/auxiliary/gallivm/lp_bld_type.c
src/gallium/auxiliary/gallivm/lp_bld_type.h

index 06f1aae6dcc1c604c02defabddb6cf2476677ff8..5205c7ada91ae284ce86a8ba7e58f81b7ab21529 100644 (file)
@@ -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.
  */
index fec1d3dfbc637ba552234bd1fb8f08c045eff54a..a135d0df847d9885a024aea355ec8474c36ba0bc 100644 (file)
@@ -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);