From 3be28b42e295958ccbc3731dd67839705fcdfd9f Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 25 Feb 2025 18:38:26 -0600 Subject: [PATCH] vtn: Support cooperative matrices in OpConstantNull Cooperative matrix initializers are a single scalar value that gets broadcasted to the entire matrix. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12679 Fixes: b98f87612bc1 ("spirv: Implement SPV_KHR_cooperative_matrix") Reviewed-by: Samuel Pitoiset Part-of: (cherry picked from commit 7c47a3d0f7a8180abb12f9cac7762320148abde3) --- .pick_status.json | 2 +- src/compiler/spirv/spirv_to_nir.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 201fa93fc84..a04829e23c5 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2024,7 +2024,7 @@ "description": "vtn: Support cooperative matrices in OpConstantNull", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b98f87612bc14fe88184dc099d9d4f8e6b3b23cb", "notes": null diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index e1851672fa5..f91658b5330 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2228,6 +2228,7 @@ vtn_null_constant(struct vtn_builder *b, struct vtn_type *type) switch (type->base_type) { case vtn_base_type_scalar: case vtn_base_type_vector: + case vtn_base_type_cooperative_matrix: c->is_null_constant = true; /* Nothing to do here. It's already initialized to zero */ break;