This returns the float16 version of a float type.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3822>
unreachable("Invalid base type");
}
+const glsl_type *glsl_type::get_float16_type() const
+{
+ assert(this->base_type == GLSL_TYPE_FLOAT);
+
+ return get_instance(GLSL_TYPE_FLOAT16,
+ this->vector_elements,
+ this->matrix_columns,
+ this->explicit_stride,
+ this->interface_row_major);
+}
static void
hash_free_type_function(struct hash_entry *entry)
*/
const glsl_type *get_bare_type() const;
+ /**
+ * Gets the float16 version of this type.
+ */
+ const glsl_type *get_float16_type() const;
+
/**
* Get the instance of a built-in scalar, vector, or matrix type
*/
}
}
+const glsl_type *
+glsl_float16_type(const struct glsl_type *type)
+{
+ return type->get_float16_type();
+}
+
void
glsl_get_natural_size_align_bytes(const struct glsl_type *type,
unsigned *size, unsigned *align)
const struct glsl_type *glsl_channel_type(const struct glsl_type *type);
+const struct glsl_type *glsl_float16_type(const struct glsl_type *type);
+
void glsl_get_natural_size_align_bytes(const struct glsl_type *type,
unsigned *size, unsigned *align);