OSDN Git Service

nir/types: Add a scalar type constructor
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 30 Apr 2015 03:56:17 +0000 (20:56 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 31 Aug 2015 23:58:20 +0000 (16:58 -0700)
src/glsl/nir/nir_types.cpp
src/glsl/nir/nir_types.h

index f2894d4..f93a52b 100644 (file)
@@ -185,6 +185,12 @@ glsl_vec4_type(void)
 }
 
 const glsl_type *
+glsl_scalar_type(enum glsl_base_type base_type)
+{
+   return glsl_type::get_instance(base_type, 1, 1);
+}
+
+const glsl_type *
 glsl_vector_type(enum glsl_base_type base_type, unsigned components)
 {
    assert(components > 1 && components <= 4);
index dd53577..40a80ec 100644 (file)
@@ -81,6 +81,7 @@ const struct glsl_type *glsl_uint_type(void);
 const struct glsl_type *glsl_bool_type(void);
 
 const struct glsl_type *glsl_vec4_type(void);
+const struct glsl_type *glsl_scalar_type(enum glsl_base_type base_type);
 const struct glsl_type *glsl_vector_type(enum glsl_base_type base_type,
                                          unsigned components);
 const struct glsl_type *glsl_matrix_type(enum glsl_base_type base_type,