From: Samuel Pitoiset Date: Tue, 16 Jun 2020 07:08:02 +0000 (+0200) Subject: spirv: do not set num_components for non-vectorized mbcnt_amd intrinsic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4d13e35315ed7ae166d221e87d5dce26ed1e9b92;p=mesa.git 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: --- 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);