nir: use ballot_bit_size when lowering ballot_bitfield_extract
authorDaniel Schürmann <daniel.schuermann@campus.tu-berlin.de>
Fri, 13 Apr 2018 13:05:24 +0000 (15:05 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 13 Apr 2018 22:52:22 +0000 (00:52 +0200)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/nir/nir_lower_subgroups.c

index 0d3c83b7951ff80761234ce2547227e10bd02403..e0e1063fc438dc5120914a5d2487c8cabb0fb345 100644 (file)
@@ -359,7 +359,7 @@ lower_subgroups_intrin(nir_builder *b, nir_intrinsic_instr *intrin,
          assert(intrin->src[1].is_ssa);
          return nir_i2b(b, nir_iand(b, nir_ushr(b, int_val,
                                                    intrin->src[1].ssa),
-                                       nir_imm_int(b, 1)));
+                                       nir_imm_intN_t(b, 1, options->ballot_bit_size)));
       case nir_intrinsic_ballot_bit_count_reduce:
          return nir_bit_count(b, int_val);
       case nir_intrinsic_ballot_find_lsb: