[Mesa-dev] [PATCH] st/glsl_to_nir: disable io lowering to temps for tess

Marek Olšák maraeo at gmail.com
Wed Jan 17 00:34:09 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Jan 11, 2018 at 3:47 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> Lowering these to temps makes a big mess, and results in some
> piglit test failures. Also the radeonsi backend (the only backend
> to support tess) has support for indirects so there is no need to
> lower them anyway.
>
> Fixes the following piglit tests on radeonsi:
>
> tests/spec/arb_tessellation_shader/execution/variable-indexing/tes-input-array-vec3-index-rd.shader_test
> tests/spec/arb_tessellation_shader/execution/variable-indexing/tes-input-array-vec4-index-rd.shader_test
> ---
>  src/mesa/state_tracker/st_glsl_to_nir.cpp | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> index 99d620926a..6e3a1548f4 100644
> --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
> @@ -490,9 +490,12 @@ st_nir_get_mesa_program(struct gl_context *ctx,
>     set_st_program(prog, shader_program, nir);
>     prog->nir = nir;
>
> -   NIR_PASS_V(nir, nir_lower_io_to_temporaries,
> -              nir_shader_get_entrypoint(nir),
> -              true, true);
> +   if (nir->info.stage != MESA_SHADER_TESS_CTRL &&
> +       nir->info.stage != MESA_SHADER_TESS_EVAL) {
> +      NIR_PASS_V(nir, nir_lower_io_to_temporaries,
> +                 nir_shader_get_entrypoint(nir),
> +                 true, true);
> +   }
>     NIR_PASS_V(nir, nir_lower_global_vars_to_local);
>     NIR_PASS_V(nir, nir_split_var_copies);
>     NIR_PASS_V(nir, nir_lower_var_copies);
> @@ -665,7 +668,8 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog,
>
>     NIR_PASS_V(nir, nir_split_var_copies);
>     NIR_PASS_V(nir, nir_lower_var_copies);
> -   if (nir->info.stage != MESA_SHADER_TESS_CTRL)
> +   if (nir->info.stage != MESA_SHADER_TESS_CTRL &&
> +       nir->info.stage != MESA_SHADER_TESS_EVAL)
>        NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects);
>
>     if (nir->info.stage == MESA_SHADER_VERTEX) {
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list