nir/split_vars: Don't split arrays of cooperative matrix types

glsl_type_is_vector_or_scalar would more accruately be called "can be an
r-value that isn't an array, structure, or matrix. This optimization
pass really shouldn't do anything to cooperative matrices. These
matrices will eventually be lowered to something else (dependent on the
backend), and that thing may (or may not) be handled by this or another
pass.

Fixes: 2d0f4f2c17 ("compiler/types: Add support for Cooperative Matrix types")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25871>
(cherry picked from commit 18d8a96a00)
This commit is contained in:
Ian Romanick
2023-10-24 13:09:13 -07:00
committed by Eric Engestrom
parent c9040f482e
commit c23ba4e83a
2 changed files with 10 additions and 2 deletions

View File

@@ -1224,7 +1224,7 @@
"description": "nir/split_vars: Don't split arrays of cooperative matrix types",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2d0f4f2c17b79830e9780a68bc473718d4abd4ad",
"notes": null

View File

@@ -87,7 +87,15 @@ num_array_levels_in_array_of_vector_type(const struct glsl_type *type)
if (glsl_type_is_array_or_matrix(type)) {
num_levels++;
type = glsl_get_array_element(type);
} else if (glsl_type_is_vector_or_scalar(type)) {
} else if (glsl_type_is_vector_or_scalar(type) &&
!glsl_type_is_cmat(type)) {
/* glsl_type_is_vector_or_scalar would more accruately be called "can
* be an r-value that isn't an array, structure, or matrix. This
* optimization pass really shouldn't do anything to cooperative
* matrices. These matrices will eventually be lowered to something
* else (dependent on the backend), and that thing may (or may not)
* be handled by this or another pass.
*/
return num_levels;
} else {
/* Not an array of vectors */