[Mesa-dev] [PATCH] ac/nir: don't put lod into args if it's zero.

Marek Olšák maraeo at gmail.com
Wed Mar 7 20:45:11 UTC 2018


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

Marek

On Tue, Mar 6, 2018 at 10:26 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> If it's zero but put it in args we still end up consuming a
> register for it.
>
> This fixes some spilling in the NIR paths in Dirt Rally that
> isn't seen with TGSI.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/common/ac_nir_to_llvm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index f808dc89490..432b88a59b0 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -5094,8 +5094,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
>         }
>
>         /* Pack LOD */
> -       if (lod && ((instr->op == nir_texop_txl && !lod_is_zero) ||
> -                   instr->op == nir_texop_txf)) {
> +       if (lod && ((instr->op == nir_texop_txl || instr->op == nir_texop_txf) && !lod_is_zero)) {
>                 address[count++] = lod;
>         } else if (instr->op == nir_texop_txf_ms && sample_index) {
>                 address[count++] = sample_index;
> --
> 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