diff options
author | Kenneth Graunke <[email protected]> | 2015-12-18 00:42:03 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-12-22 17:21:47 -0800 |
commit | 2bcf98940703bee4485e323f4a9e28e2c6fe41fd (patch) | |
tree | cfee62ef73244e4f0884baa52c12f4da2d706982 /src | |
parent | 0daf51e130f89d1e83fa897ef8df9229829f5b18 (diff) |
nir: Add a glsl_vec_type() helper.
I need access to glsl_type::vec2_type from C. Wrapping vec() also gives
us access to vec3 if we need it.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/nir/nir_types.cpp | 6 | ||||
-rw-r--r-- | src/glsl/nir/nir_types.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp index 135591ab97d..41ac54673d9 100644 --- a/src/glsl/nir/nir_types.cpp +++ b/src/glsl/nir/nir_types.cpp @@ -168,6 +168,12 @@ glsl_float_type(void) } const glsl_type * +glsl_vec_type(unsigned n) +{ + return glsl_type::vec(n); +} + +const glsl_type * glsl_vec4_type(void) { return glsl_type::vec4_type; diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h index b0b51842a43..64a75f607d5 100644 --- a/src/glsl/nir/nir_types.h +++ b/src/glsl/nir/nir_types.h @@ -75,6 +75,7 @@ bool glsl_type_is_matrix(const struct glsl_type *type); const struct glsl_type *glsl_void_type(void); const struct glsl_type *glsl_float_type(void); +const struct glsl_type *glsl_vec_type(unsigned n); const struct glsl_type *glsl_vec4_type(void); const struct glsl_type *glsl_uint_type(void); const struct glsl_type *glsl_array_type(const struct glsl_type *base, |