nir: Add a glsl_vec_type() helper.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 18 Dec 2015 08:42:03 +0000 (00:42 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Dec 2015 01:21:47 +0000 (17:21 -0800)
I need access to glsl_type::vec2_type from C.  Wrapping vec() also gives
us access to vec3 if we need it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/nir/nir_types.cpp
src/glsl/nir/nir_types.h

index 135591a..41ac546 100644 (file)
@@ -168,6 +168,12 @@ glsl_float_type(void)
 }
 
 const glsl_type *
+glsl_vec_type(unsigned n)
+{
+   return glsl_type::vec(n);
+}
+
+const glsl_type *
 glsl_vec4_type(void)
 {
    return glsl_type::vec4_type;
index b0b5184..64a75f6 100644 (file)
@@ -75,6 +75,7 @@ bool glsl_type_is_matrix(const struct glsl_type *type);
 
 const struct glsl_type *glsl_void_type(void);
 const struct glsl_type *glsl_float_type(void);
+const struct glsl_type *glsl_vec_type(unsigned n);
 const struct glsl_type *glsl_vec4_type(void);
 const struct glsl_type *glsl_uint_type(void);
 const struct glsl_type *glsl_array_type(const struct glsl_type *base,