ir3/nir: Call nir_lower_subgroups

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6752>
This commit is contained in:
Connor Abbott 2020-09-11 13:31:44 +02:00 committed by Marge Bot
parent 68b8b9e9e1
commit 8176657ead

View file

@ -486,6 +486,28 @@ ir3_nir_post_finalize(struct ir3_compiler *compiler, nir_shader *s)
NIR_PASS_V(s, nir_lower_mediump_io, nir_var_shader_out, 0, false);
}
if (s->info.stage == MESA_SHADER_COMPUTE) {
bool progress = false;
NIR_PASS(progress, s, nir_lower_subgroups, &(nir_lower_subgroups_options) {
.subgroup_size = 128,
.ballot_bit_size = 32,
.ballot_components = 4,
.lower_to_scalar = true,
.lower_vote_eq = true,
.lower_subgroup_masks = true,
.lower_read_invocation_to_cond = true,
});
progress = false;
NIR_PASS(progress, s, ir3_nir_lower_subgroup_id_cs);
/* ir3_nir_lower_subgroup_id_cs creates extra compute intrinsics which
* we need to lower again.
*/
if (progress)
NIR_PASS_V(s, nir_lower_compute_system_values, NULL);
}
/* we cannot ensure that ir3_finalize_nir() is only called once, so
* we also need to do trig workarounds here:
*/