nir/types: add a helper to transpose a matrix type
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 19 Jun 2015 00:34:12 +0000 (17:34 -0700)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 19 Jun 2015 00:34:12 +0000 (17:34 -0700)
src/glsl/nir/nir_types.cpp
src/glsl/nir/nir_types.h

index 3542150654567f6526bdd9179ed2493127fbcdd4..d44d48095da254e13d7a7a75d398fb1d89cf15da 100644 (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);
+}
index ceb131c9f47d76883a8464175575d08f2c0931cf..60e1d9d96fcee795787a0d97ff814ee69ef2c98f 100644 (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