nir/split_64bit_vec3_and_vec4: Handle 64-bit matrix types.

The offset handling should already work for flattening to our split vars,
just need to make sure we have enough (or any!) array elements.

Fixes: #7154
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13288>
This commit is contained in:
Emma Anholt
2023-02-23 11:02:20 -08:00
committed by Marge Bot
parent 5f79e78911
commit 106019a5d8
2 changed files with 3 additions and 7 deletions

View File

@@ -147,8 +147,9 @@ get_var_pair(nir_builder *b, nir_variable *old_var,
new_var->xy->type = glsl_dvec_type(2);
new_var->zw->type = glsl_dvec_type(old_components - 2);
if (glsl_type_is_array(old_var->type)) {
unsigned array_size = glsl_get_aoa_size(old_var->type);
if (glsl_type_is_array_or_matrix(old_var->type)) {
const struct glsl_type *element_type = glsl_without_array(old_var->type);
unsigned array_size = glsl_get_aoa_size(old_var->type) * glsl_get_matrix_columns(element_type);
new_var->xy->type = glsl_array_type(new_var->xy->type,
array_size, 0);
new_var->zw->type = glsl_array_type(new_var->zw->type,