diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2024-05-08 10:46:50 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-05-09 07:55:00 +0000 |
commit | 920025533ec891e77658fa5682ec60433d66168b (patch) | |
tree | b339ab5bb554723662cd123d6cf9f80fdc42746d | |
parent | 1545dc94b4f871caf75bf64cf45c571ba2ee5e1f (diff) | |
download | mesa3d-920025533ec891e77658fa5682ec60433d66168b.tar.gz |
broadcom/compiler: do not run lowering I/O for FS
This lowering is applied only for vertex and geometry shaders. So detect
earlier this situation and do not go ahead with other shader.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29102>
-rw-r--r-- | src/broadcom/compiler/v3d_nir_lower_io.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/broadcom/compiler/v3d_nir_lower_io.c b/src/broadcom/compiler/v3d_nir_lower_io.c index 08184596f2a..a8f35f138dd 100644 --- a/src/broadcom/compiler/v3d_nir_lower_io.c +++ b/src/broadcom/compiler/v3d_nir_lower_io.c @@ -322,10 +322,7 @@ v3d_nir_lower_io_instr(struct v3d_compile *c, nir_builder *b, break; case nir_intrinsic_store_output: - if (c->s->info.stage == MESA_SHADER_VERTEX || - c->s->info.stage == MESA_SHADER_GEOMETRY) { - v3d_nir_lower_vpm_output(c, b, intr, state); - } + v3d_nir_lower_vpm_output(c, b, intr, state); break; case nir_intrinsic_emit_vertex: @@ -621,22 +618,18 @@ emit_gs_vpm_output_header_prolog(struct v3d_compile *c, nir_builder *b, bool v3d_nir_lower_io(nir_shader *s, struct v3d_compile *c) { + if (s->info.stage != MESA_SHADER_VERTEX && + s->info.stage != MESA_SHADER_GEOMETRY) { + return false; + } + struct v3d_nir_lower_io_state state = { 0 }; /* Set up the layout of the VPM outputs. */ - switch (s->info.stage) { - case MESA_SHADER_VERTEX: + if (s->info.stage == MESA_SHADER_VERTEX) v3d_nir_setup_vpm_layout_vs(c, &state); - break; - case MESA_SHADER_GEOMETRY: + else v3d_nir_setup_vpm_layout_gs(c, &state); - break; - case MESA_SHADER_FRAGMENT: - case MESA_SHADER_COMPUTE: - break; - default: - unreachable("Unsupported shader stage"); - } nir_foreach_function_impl(impl, s) { nir_builder b = nir_builder_create(impl); @@ -654,7 +647,7 @@ v3d_nir_lower_io(nir_shader *s, struct v3d_compile *c) b.cursor = nir_after_block(last); if (s->info.stage == MESA_SHADER_VERTEX) { v3d_nir_emit_ff_vpm_outputs(c, &b, &state); - } else if (s->info.stage == MESA_SHADER_GEOMETRY) { + } else { emit_gs_vpm_output_header_prolog(c, &b, &state); } @@ -663,10 +656,7 @@ v3d_nir_lower_io(nir_shader *s, struct v3d_compile *c) nir_metadata_dominance); } - if (s->info.stage == MESA_SHADER_VERTEX || - s->info.stage == MESA_SHADER_GEOMETRY) { - v3d_nir_lower_io_update_output_var_base(c, &state); - } + v3d_nir_lower_io_update_output_var_base(c, &state); /* It is really unlikely that we don't get progress here, and fully * filtering when not would make code more complex, but we are still |