nir/types: Add a scalar type constructor

This commit is contained in:
Jason Ekstrand 2015-04-29 20:56:17 -07:00
parent befecb3c55
commit 366366c7f7
2 changed files with 7 additions and 0 deletions

View file

@ -184,6 +184,12 @@ glsl_vec4_type(void)
return glsl_type::vec4_type;
}
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)
{

View 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,