aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/nir_types.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp
index 6995a897d60..2b4ff0702f2 100644
--- a/src/compiler/nir_types.cpp
+++ b/src/compiler/nir_types.cpp
@@ -493,31 +493,22 @@ glsl_transposed_type(const struct glsl_type *type)
const glsl_type *
glsl_channel_type(const glsl_type *t)
{
- switch (glsl_get_base_type(t)) {
- case GLSL_TYPE_ARRAY: {
- const glsl_type *base = glsl_channel_type(glsl_get_array_element(t));
- return glsl_array_type(base, glsl_get_length(t));
- }
+ switch (t->base_type) {
+ case GLSL_TYPE_ARRAY:
+ return glsl_array_type(glsl_channel_type(t->fields.array), t->length);
case GLSL_TYPE_UINT:
- return glsl_uint_type();
case GLSL_TYPE_INT:
- return glsl_int_type();
case GLSL_TYPE_FLOAT:
- return glsl_float_type();
- case GLSL_TYPE_BOOL:
- return glsl_bool_type();
- case GLSL_TYPE_DOUBLE:
- return glsl_double_type();
- case GLSL_TYPE_UINT64:
- return glsl_uint64_t_type();
- case GLSL_TYPE_INT64:
- return glsl_int64_t_type();
case GLSL_TYPE_FLOAT16:
- return glsl_float16_t_type();
+ case GLSL_TYPE_DOUBLE:
+ case GLSL_TYPE_UINT8:
+ case GLSL_TYPE_INT8:
case GLSL_TYPE_UINT16:
- return glsl_uint16_t_type();
case GLSL_TYPE_INT16:
- return glsl_int16_t_type();
+ case GLSL_TYPE_UINT64:
+ case GLSL_TYPE_INT64:
+ case GLSL_TYPE_BOOL:
+ return glsl_type::get_instance(t->base_type, 1, 1);
default:
unreachable("Unhandled base type glsl_channel_type()");
}