summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-08-22 13:23:59 -0700
committerJason Ekstrand <[email protected]>2017-11-07 10:37:52 -0800
commit28da82f9783091cb3e79586962f98a5bc165cff8 (patch)
tree17ab49d93f9d1264993a8d38662c62537b3010dd /src/intel/compiler/brw_nir.c
parent1ca3a9442760b6f7ffcc624bdc527fc7dbc70825 (diff)
nir: Add a new subgroups lowering pass
This commit pulls nir_lower_read_invocations_to_scalar along with most of the guts of nir_opt_intrinsics (which mostly does subgroup lowering) into a new nir_lower_subgroups pass. There are various other bits of subgroup lowering that we're going to want to do so it makes a bit more sense to keep it all together in one pass. We also move it in i965 to happen after nir_lower_system_values to ensure that because we want to handle the subgroup mask system value intrinsics here. Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_nir.c')
-rw-r--r--src/intel/compiler/brw_nir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
index e5ff6deb2f7..f599f748a8a 100644
--- a/src/intel/compiler/brw_nir.c
+++ b/src/intel/compiler/brw_nir.c
@@ -620,7 +620,6 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
OPT(nir_lower_tex, &tex_options);
OPT(nir_normalize_cubemap_coords);
- OPT(nir_lower_read_invocation_to_scalar);
OPT(nir_lower_global_vars_to_local);
@@ -637,6 +636,13 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
OPT(nir_lower_system_values);
+ const nir_lower_subgroups_options subgroups_options = {
+ .lower_to_scalar = true,
+ .lower_subgroup_masks = true,
+ .lower_vote_trivial = !is_scalar,
+ };
+ OPT(nir_lower_subgroups, &subgroups_options);
+
OPT(nir_lower_clip_cull_distance_arrays);
nir_variable_mode indirect_mask = 0;