nir/types: add a helper to transpose a matrix type

This commit is contained in:
Connor Abbott 2015-06-18 17:34:12 -07:00
parent de4c31a085
commit 0e86ab7c0a
2 changed files with 9 additions and 0 deletions

View file

@ -270,3 +270,10 @@ glsl_function_type(const glsl_type *return_type,
{
return glsl_type::get_function_instance(return_type, params, num_params);
}
const glsl_type *
glsl_transposed_type(const struct glsl_type *type)
{
return glsl_type::get_instance(type->base_type, type->matrix_columns,
type->vector_elements);
}

View file

@ -103,6 +103,8 @@ const struct glsl_type * glsl_function_type(const struct glsl_type *return_type,
const struct glsl_function_param *params,
unsigned num_params);
const struct glsl_type *glsl_transposed_type(const struct glsl_type *type);
#ifdef __cplusplus
}
#endif