[Mesa-dev] [PATCH 2/4] spirv: Use nir_imm_floatN_t for constants for GLSL450 builtins

Jason Ekstrand jason at jlekstrand.net
Tue Apr 17 18:45:47 UTC 2018


Thanks!  1 and 2 are

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Wed, Mar 21, 2018 at 12:34 PM, Neil Roberts <nroberts at igalia.com> wrote:

> There is an existing macro that is used to choose between either a
> float or a double immediate constant based on the bit size of the
> first operand to the builtin. This is now changed to use the new
> nir_imm_floatN_t helper function to reduce the number of places that
> make this decision.
> ---
>  src/compiler/spirv/vtn_glsl450.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/spirv/vtn_glsl450.c b/src/compiler/spirv/vtn_
> glsl450.c
> index 7d32914d516..50783fbfb4d 100644
> --- a/src/compiler/spirv/vtn_glsl450.c
> +++ b/src/compiler/spirv/vtn_glsl450.c
> @@ -513,7 +513,7 @@ vtn_nir_alu_op_for_spirv_glsl_opcode(struct
> vtn_builder *b,
>     }
>  }
>
> -#define NIR_IMM_FP(n, v) (src[0]->bit_size == 64 ? nir_imm_double(n, v) :
> nir_imm_float(n, v))
> +#define NIR_IMM_FP(n, v) (nir_imm_floatN_t(n, v, src[0]->bit_size))
>
>  static void
>  handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180417/e65b1642/attachment.html>


More information about the mesa-dev mailing list