[Mesa-dev] [PATCH 23/31] radv/ac: handle case of swizzle with single components in get_alu_src.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Tue Jan 24 23:03:40 UTC 2017


How are you hitting this? The enclosing if is (need_swizzle ||
num_components != src_components) and if src_components =
num_components = 1, then need_swizzle should be false?

On Fri, Jan 20, 2017 at 4:03 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This gets hit with some geom shaders.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/common/ac_nir_to_llvm.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index 92e2b44..97e352b 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -844,7 +844,10 @@ static LLVMValueRef get_alu_src(struct nir_to_llvm_context *ctx,
>                     LLVMConstInt(ctx->i32, src.swizzle[2], false),
>                     LLVMConstInt(ctx->i32, src.swizzle[3], false)};
>
> -               if (src_components > 1 && num_components == 1) {
> +               if (src_components == 1 && num_components == 1) {
> +                       value = LLVMBuildExtractElement(ctx->builder, value,
> +                                                       masks[0], "");
> +               } else if (src_components > 1 && num_components == 1) {
>                         value = LLVMBuildExtractElement(ctx->builder, value,
>                                                         masks[0], "");
>                 } else if (src_components == 1 && num_components > 1) {
> --
> 2.9.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