vtn: Fix vtn_mediump_downconvert_value() for transposed matrices

We forgot to set the actual value. This meant that whenever we actually
needed to use the transposed matrix we would immediately segfault.

Cc: mesa-stable
(cherry picked from commit 048d2a0c68)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40488>
This commit is contained in:
Connor Abbott 2026-02-20 17:25:45 -05:00 committed by Eric Engestrom
parent 8af93595b9
commit e234dcf62c
2 changed files with 6 additions and 6 deletions

View file

@ -74,7 +74,7 @@
"description": "vtn: Fix vtn_mediump_downconvert_value() for transposed matrices",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -159,11 +159,12 @@ vtn_mediump_downconvert_value(struct vtn_builder *b, struct vtn_ssa_value *src)
if (!src)
return src;
struct vtn_ssa_value *srcmp = vtn_create_ssa_value(b, src->type);
if (src->transposed) {
srcmp->transposed = vtn_mediump_downconvert_value(b, src->transposed);
struct vtn_ssa_value *transposed =
vtn_mediump_downconvert_value(b, src->transposed);
return vtn_ssa_transpose(b, transposed);
} else {
struct vtn_ssa_value *srcmp = vtn_create_ssa_value(b, src->type);
enum glsl_base_type base_type = glsl_get_base_type(src->type);
if (glsl_type_is_vector_or_scalar(src->type)) {
@ -173,9 +174,8 @@ vtn_mediump_downconvert_value(struct vtn_builder *b, struct vtn_ssa_value *src)
for (int i = 0; i < glsl_get_matrix_columns(src->type); i++)
srcmp->elems[i]->def = vtn_mediump_downconvert(b, base_type, src->elems[i]->def);
}
return srcmp;
}
return srcmp;
}
static struct vtn_ssa_value *