[Mesa-dev] [PATCH] radv: fix invalid element type when filling vertex input default values

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Feb 15 17:01:34 UTC 2019


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

On Fri, Feb 15, 2019 at 3:57 PM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> The elements added into a vector should have the same type as the
> first one, otherwise this hits an assertion in LLVM.
>
> Fixes: 4b3549c0846 ("radv: reduce the number of loaded channels for vertex input fetches")
> reported-by: Philip Rebohle <philip.rebohle at tu-dortmund.de>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_nir_to_llvm.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c
> index f1fc392292a..28221b2889a 100644
> --- a/src/amd/vulkan/radv_nir_to_llvm.c
> +++ b/src/amd/vulkan/radv_nir_to_llvm.c
> @@ -2089,8 +2089,10 @@ radv_fixup_vertex_input_fetches(struct radv_shader_context *ctx,
>                 elemtype = LLVMTypeOf(value);
>         }
>
> -       for (unsigned i = num_channels; i < 4; i++)
> +       for (unsigned i = num_channels; i < 4; i++) {
>                 chan[i] = i == 3 ? one : zero;
> +               chan[i] = ac_to_float(&ctx->ac, chan[i]);
> +       }
>
>         return ac_build_gather_values(&ctx->ac, chan, 4);
>  }
> --
> 2.20.1
>
> _______________________________________________
> 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