radeonsi: zero init using the correct components count

This fixes the replay of the trace attached to
https://gitlab.freedesktop.org/mesa/mesa/-/issues/7530 which
would otherwise fail with an LLVM error:
  "All operands to PHI node must be the same type as the PHI node!"

Fixes: ae4379d81e ("ac/nir: export some undef as zero")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19189>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2022-10-20 10:12:42 +02:00
parent 152b90efcd
commit 434e74e658

View file

@ -5091,7 +5091,7 @@ static void visit_ssa_undef(struct ac_nir_context *ctx, const nir_ssa_undef_inst
} else {
LLVMValueRef zero = LLVMConstInt(type, 0, false);
if (num_components > 1) {
zero = ac_build_gather_values_extended(&ctx->ac, &zero, 4, 0, false);
zero = ac_build_gather_values_extended(&ctx->ac, &zero, num_components, 0, false);
}
ctx->ssa_defs[instr->def.index] = zero;
}