From 4d13e35315ed7ae166d221e87d5dce26ed1e9b92 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 16 Jun 2020 09:08:02 +0200 Subject: [PATCH] spirv: do not set num_components for non-vectorized mbcnt_amd intrinsic Fixes: 167fa2887f0 ("nir/validate: validate intr->num_components") Signed-off-by: Samuel Pitoiset Reviewed-by: Rob Clark Part-of: --- src/compiler/spirv/vtn_amd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/spirv/vtn_amd.c b/src/compiler/spirv/vtn_amd.c index d893bd07a34..f180e3bf060 100644 --- a/src/compiler/spirv/vtn_amd.c +++ b/src/compiler/spirv/vtn_amd.c @@ -91,7 +91,8 @@ vtn_handle_amd_shader_ballot_instruction(struct vtn_builder *b, SpvOp ext_opcode nir_intrinsic_instr *intrin = nir_intrinsic_instr_create(b->nb.shader, op); nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, dest_type, NULL); - intrin->num_components = intrin->dest.ssa.num_components; + if (nir_intrinsic_infos[op].src_components[0] == 0) + intrin->num_components = intrin->dest.ssa.num_components; for (unsigned i = 0; i < num_args; i++) intrin->src[i] = nir_src_for_ssa(vtn_ssa_value(b, w[i + 5])->def); -- 2.30.2