diff options
author | Jason Ekstrand <[email protected]> | 2017-03-07 16:46:17 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-03-14 07:36:40 -0700 |
commit | 9084b1db305cab0943f04b074d742c743364840f (patch) | |
tree | b0d71723fdc0d8d38d3498a876cf58f0cebfebfa /src/compiler/nir | |
parent | a136884139c42a9ab96c659cbfe44149b1bbffdb (diff) |
nir: Add a get_nir_type_for_glsl_base_type helper
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index dd1e4077857..57b8be3dde2 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -680,9 +680,9 @@ nir_alu_type_get_base_type(nir_alu_type type) } static inline nir_alu_type -nir_get_nir_type_for_glsl_type(const struct glsl_type *type) +nir_get_nir_type_for_glsl_base_type(enum glsl_base_type base_type) { - switch (glsl_get_base_type(type)) { + switch (base_type) { case GLSL_TYPE_BOOL: return nir_type_bool32; break; @@ -709,6 +709,12 @@ nir_get_nir_type_for_glsl_type(const struct glsl_type *type) } } +static inline nir_alu_type +nir_get_nir_type_for_glsl_type(const struct glsl_type *type) +{ + return nir_get_nir_type_for_glsl_base_type(glsl_get_base_type(type)); +} + nir_op nir_type_conversion_op(nir_alu_type src, nir_alu_type dst); typedef enum { |