spirv: do not set num_components for non-vectorized mbcnt_amd intrinsic
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 Jun 2020 07:08:02 +0000 (09:08 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 17 Jun 2020 06:57:13 +0000 (06:57 +0000)
Fixes: 167fa2887f0 ("nir/validate: validate intr->num_components")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5493>

src/compiler/spirv/vtn_amd.c

index d893bd07a341789dfa16504893fac6abcbf11a98..f180e3bf0608fa84342716d38dfe70e386c863d3 100644 (file)
@@ -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);