Lines Matching refs:intrin
68 lower_read_invocation_to_scalar(nir_builder *b, nir_intrinsic_instr *intrin) in lower_read_invocation_to_scalar() argument
71 assert(intrin->dest.ssa.num_components > 1); in lower_read_invocation_to_scalar()
73 nir_ssa_def *value = nir_ssa_for_src(b, intrin->src[0], in lower_read_invocation_to_scalar()
74 intrin->num_components); in lower_read_invocation_to_scalar()
77 for (unsigned i = 0; i < intrin->num_components; i++) { in lower_read_invocation_to_scalar()
79 nir_intrinsic_instr_create(b->shader, intrin->intrinsic); in lower_read_invocation_to_scalar()
81 1, intrin->dest.ssa.bit_size, NULL); in lower_read_invocation_to_scalar()
87 if (intrin->intrinsic == nir_intrinsic_read_invocation) in lower_read_invocation_to_scalar()
88 nir_src_copy(&chan_intrin->src[1], &intrin->src[1], chan_intrin); in lower_read_invocation_to_scalar()
95 return nir_vec(b, reads, intrin->num_components); in lower_read_invocation_to_scalar()
99 lower_subgroups_intrin(nir_builder *b, nir_intrinsic_instr *intrin, in lower_subgroups_intrin() argument
102 switch (intrin->intrinsic) { in lower_subgroups_intrin()
106 return nir_ssa_for_src(b, intrin->src[0], 1); in lower_subgroups_intrin()
121 if (options->lower_to_scalar && intrin->num_components > 1) in lower_subgroups_intrin()
122 return lower_read_invocation_to_scalar(b, intrin); in lower_subgroups_intrin()
138 intrin->dest.ssa.bit_size); in lower_subgroups_intrin()
145 switch (intrin->intrinsic) { in lower_subgroups_intrin()
168 intrin->dest.ssa.num_components, in lower_subgroups_intrin()
169 intrin->dest.ssa.bit_size); in lower_subgroups_intrin()
173 if (intrin->dest.ssa.num_components == 1 && in lower_subgroups_intrin()
174 intrin->dest.ssa.bit_size == options->ballot_bit_size) in lower_subgroups_intrin()
182 nir_src_copy(&ballot->src[0], &intrin->src[0], ballot); in lower_subgroups_intrin()
186 intrin->dest.ssa.num_components, in lower_subgroups_intrin()
187 intrin->dest.ssa.bit_size); in lower_subgroups_intrin()
210 nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); in lower_subgroups_impl() local
213 nir_ssa_def *lower = lower_subgroups_intrin(&b, intrin, options); in lower_subgroups_impl()
217 nir_ssa_def_rewrite_uses(&intrin->dest.ssa, nir_src_for_ssa(lower)); in lower_subgroups_impl()