[Mesa-dev] [PATCH] ac/nir: Add float cast before shadow comparator clamp.

Marek Olšák maraeo at gmail.com
Tue Aug 1 20:57:00 UTC 2017


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

Marek

On Tue, Aug 1, 2017 at 12:27 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> LLVM complained about passing an i32 to a float clamp.
>
> Signed-off-by: Bas Nieuwenhuizen <basni at google.com>
> Fixes: 0f9e32519bb "ac/nir: clamp shadow texture comparison value on VI"
> ---
>  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 530b5817af3..0ad5475e9cb 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -4492,7 +4492,8 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
>
>         /* Pack depth comparison value */
>         if (instr->is_shadow && comparator) {
> -               LLVMValueRef z = llvm_extract_elem(&ctx->ac, comparator, 0);
> +               LLVMValueRef z = to_float(&ctx->ac,
> +                                         llvm_extract_elem(&ctx->ac, comparator, 0));
>
>                 /* TC-compatible HTILE promotes Z16 and Z24 to Z32_FLOAT,
>                  * so the depth comparison value isn't clamped for Z16 and
> --
> 2.13.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