[Mesa-dev] [PATCH 15/22] compiler/spirv: implement 16-bit exp and log
Jason Ekstrand
jason at jlekstrand.net
Thu May 17 14:07:04 UTC 2018
Rb
On May 17, 2018 01:48:43 Iago Toral Quiroga <itoral at igalia.com> wrote:
> ---
> src/compiler/spirv/vtn_glsl450.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/spirv/vtn_glsl450.c
> b/src/compiler/spirv/vtn_glsl450.c
> index 70e3eb80c4c..324e8b5874a 100644
> --- a/src/compiler/spirv/vtn_glsl450.c
> +++ b/src/compiler/spirv/vtn_glsl450.c
> @@ -194,7 +194,7 @@ build_fclamp(nir_builder *b,
> static nir_ssa_def *
> build_exp(nir_builder *b, nir_ssa_def *x)
> {
> - return nir_fexp2(b, nir_fmul(b, x, nir_imm_float(b, M_LOG2E)));
> + return nir_fexp2(b, nir_fmul(b, x, nir_imm_floatN_t(b, M_LOG2E,
> x->bit_size)));
> }
>
> /**
> @@ -203,7 +203,8 @@ build_exp(nir_builder *b, nir_ssa_def *x)
> static nir_ssa_def *
> build_log(nir_builder *b, nir_ssa_def *x)
> {
> - return nir_fmul(b, nir_flog2(b, x), nir_imm_float(b, 1.0 / M_LOG2E));
> + return nir_fmul(b, nir_flog2(b, x),
> + nir_imm_floatN_t(b, 1.0 / M_LOG2E, x->bit_size));
> }
>
> /**
> --
> 2.14.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