diff options
author | Connor Abbott <[email protected]> | 2015-06-18 17:34:12 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-08-31 16:58:20 -0700 |
commit | a1e136711bc661f4471115396f6a477a5fe9f930 (patch) | |
tree | e9d9115346af63d97c8a34939951f70008424f66 | |
parent | 756b00389c4034331989299d0dd3505da02dfa78 (diff) |
nir/types: add a helper to transpose a matrix type
-rw-r--r-- | src/glsl/nir/nir_types.cpp | 7 | ||||
-rw-r--r-- | src/glsl/nir/nir_types.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp index 35421506545..d44d48095da 100644 --- a/src/glsl/nir/nir_types.cpp +++ b/src/glsl/nir/nir_types.cpp @@ -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); +} diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h index ceb131c9f47..60e1d9d96fc 100644 --- a/src/glsl/nir/nir_types.h +++ b/src/glsl/nir/nir_types.h @@ -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 |