nir/types: Support vectors in glsl_get_length()
This makes it consistent with glsl_get_array_element() which returns the scalar type for vectors, column type for matrices, and array element type for arrays. Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22580>
This commit is contained in:

committed by
Marge Bot

parent
1e1c450659
commit
68c54c994a
@@ -3507,7 +3507,11 @@ glsl_get_cmat_description(const struct glsl_type *t)
|
|||||||
unsigned
|
unsigned
|
||||||
glsl_get_length(const struct glsl_type *t)
|
glsl_get_length(const struct glsl_type *t)
|
||||||
{
|
{
|
||||||
return glsl_type_is_matrix(t) ? t->matrix_columns : t->length;
|
if (glsl_type_is_matrix(t))
|
||||||
|
return t->matrix_columns;
|
||||||
|
else if (glsl_type_is_vector(t))
|
||||||
|
return t->vector_elements;
|
||||||
|
return t->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
|
Reference in New Issue
Block a user