From 0322ccda4c450337bce30602be56941e097a44a7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 21 Sep 2024 15:25:05 -0400 Subject: [PATCH] hk: fix phi ordering undefined argument order means phis are busted. fixes crash starting castle crashers with an i386 gcc build of hk. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/vulkan/hk_cmd_meta.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/asahi/vulkan/hk_cmd_meta.c b/src/asahi/vulkan/hk_cmd_meta.c index b4d77401607..b8b2d5e9c88 100644 --- a/src/asahi/vulkan/hk_cmd_meta.c +++ b/src/asahi/vulkan/hk_cmd_meta.c @@ -587,8 +587,11 @@ build_image_copy_shader(const struct vk_meta_image_copy_key *key) nir_pop_if(b, NULL); if (key->block_based) { - nir_store_local_pixel_agx(b, nir_if_phi(b, value1, value2), - nir_imm_int(b, 1 << s), lid, .base = 0, + /* Must define the phi first so we validate. */ + nir_def *phi = nir_if_phi(b, value1, value2); + nir_def *mask = nir_imm_int(b, 1 << s); + + nir_store_local_pixel_agx(b, phi, mask, lid, .base = 0, .write_mask = 0xf, .format = isa_format, .explicit_coord = true); }