Module: Mesa Branch: main Commit: 1179d83a89adc4a00900eee6d79c9a8b11639e1c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1179d83a89adc4a00900eee6d79c9a8b11639e1c
Author: Daniel Schürmann <dan...@schuermann.dev> Date: Thu Nov 2 15:38:46 2023 +0100 nir: remove info.fs.needs_all_helper_invocations Use info.uses_wide_subgroup_intrinsics instead. Reviewed-by: Georg Lehmann <dadschoo...@gmail.com> Reviewed-by: Caio Oliveira <caio.olive...@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26026> --- src/asahi/compiler/agx_compile.c | 2 +- src/compiler/nir/nir_gather_info.c | 4 ---- src/compiler/nir/nir_lower_discard_or_demote.c | 2 +- src/compiler/nir/nir_print.c | 1 - src/compiler/shader_info.h | 6 ------ src/intel/compiler/brw_fs.cpp | 2 +- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 7a1a738b9de..984dec90a30 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -3091,7 +3091,7 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key, nir->info.outputs_written & (VARYING_BIT_LAYER | VARYING_BIT_VIEWPORT); } else if (nir->info.stage == MESA_SHADER_FRAGMENT) { - out->disable_tri_merging = nir->info.fs.needs_all_helper_invocations || + out->disable_tri_merging = nir->info.uses_wide_subgroup_intrinsics || nir->info.fs.needs_quad_helper_invocations || nir->info.writes_memory; diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index d363d176343..20ece889fb7 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -758,9 +758,6 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader, case nir_intrinsic_shuffle_up: case nir_intrinsic_shuffle_down: case nir_intrinsic_write_invocation_amd: - if (shader->info.stage == MESA_SHADER_FRAGMENT) - shader->info.fs.needs_all_helper_invocations = true; - shader->info.uses_wide_subgroup_intrinsics = true; break; @@ -974,7 +971,6 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint) shader->info.fs.color_is_dual_source = false; shader->info.fs.uses_fbfetch_output = false; shader->info.fs.needs_quad_helper_invocations = false; - shader->info.fs.needs_all_helper_invocations = false; } if (shader->info.stage == MESA_SHADER_TESS_CTRL) { shader->info.tess.tcs_cross_invocation_inputs_read = 0; diff --git a/src/compiler/nir/nir_lower_discard_or_demote.c b/src/compiler/nir/nir_lower_discard_or_demote.c index b01a20ecdf9..06f672844e3 100644 --- a/src/compiler/nir/nir_lower_discard_or_demote.c +++ b/src/compiler/nir/nir_lower_discard_or_demote.c @@ -158,7 +158,7 @@ nir_lower_discard_or_demote(nir_shader *shader, NULL); shader->info.fs.uses_demote = true; } else if (!shader->info.fs.needs_quad_helper_invocations && - !shader->info.fs.needs_all_helper_invocations && + !shader->info.uses_wide_subgroup_intrinsics && shader->info.fs.uses_demote) { /* If we don't need any helper invocations, convert demote to discard. */ progress = nir_shader_intrinsics_pass(shader, lower_demote_to_discard, diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 76aaa5adf71..9c1b85cc394 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -2536,7 +2536,6 @@ print_shader_info(const struct shader_info *info, FILE *fp) print_nz_bool(fp, "color_is_dual_source", info->fs.color_is_dual_source); print_nz_bool(fp, "needs_quad_helper_invocations", info->fs.needs_quad_helper_invocations); - print_nz_bool(fp, "needs_all_helper_invocations", info->fs.needs_all_helper_invocations); print_nz_bool(fp, "uses_sample_qualifier", info->fs.uses_sample_qualifier); print_nz_bool(fp, "uses_sample_shading", info->fs.uses_sample_shading); print_nz_bool(fp, "early_fragment_tests", info->fs.early_fragment_tests); diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index a576b4a5bb4..687b076ffdd 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -422,12 +422,6 @@ typedef struct shader_info { */ bool needs_quad_helper_invocations:1; - /** - * True if this fragment shader requires helper invocations for - * all subgroup operations, not just quad ops and derivatives. - */ - bool needs_all_helper_invocations:1; - /** * Whether any inputs are declared with the "sample" qualifier. */ diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index ddb5f0143e7..6e6674576d5 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -7867,7 +7867,7 @@ brw_nir_populate_wm_prog_data(nir_shader *shader, */ prog_data->uses_vmask = devinfo->verx10 < 125 || shader->info.fs.needs_quad_helper_invocations || - shader->info.fs.needs_all_helper_invocations || + shader->info.uses_wide_subgroup_intrinsics || prog_data->coarse_pixel_dispatch != BRW_NEVER; prog_data->uses_src_w =