[Mesa-dev] [PATCH] radv/ac/llvm: trim texture return values

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Oct 26 16:36:03 UTC 2016


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Wed, Oct 26, 2016 at 3:04 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> The intrinsic engine asserts in llvm due to this,
> as we put a vec4 into a vec1, and the next instruction
> isn't expecting it.
>
> So trim the vector at the end before inserting it.
>
> Reported-by: Christoph Haag <haagch+mesadev at frickel.club>
> Cc: "13.0" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/common/ac_nir_to_llvm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index c3f3fe8..e4efcf6 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -3525,7 +3525,8 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
>                 LLVMValueRef z = LLVMBuildExtractElement(ctx->builder, result, two, "");
>                 z = LLVMBuildSDiv(ctx->builder, z, six, "");
>                 result = LLVMBuildInsertElement(ctx->builder, result, z, two, "");
> -       }
> +       } else if (instr->dest.ssa.num_components != 4)
> +               result = trim_vector(ctx, result, instr->dest.ssa.num_components);
>
>  write_result:
>         if (result) {
> --
> 2.5.5
>
> _______________________________________________
> 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