[Mesa-dev] [PATCH 1/2] nir: Add src and dest constructors
Connor Abbott
cwabbott0 at gmail.com
Wed Jan 21 12:06:11 PST 2015
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
On Wed, Jan 21, 2015 at 2:14 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
> src/glsl/nir/nir.h | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
> index 5ebfc5a..7b5794d 100644
> --- a/src/glsl/nir/nir.h
> +++ b/src/glsl/nir/nir.h
> @@ -482,6 +482,43 @@ typedef struct {
> bool is_ssa;
> } nir_dest;
>
> +static inline nir_src
> +nir_src_for_ssa(nir_ssa_def *def)
> +{
> + nir_src src;
> +
> + src.is_ssa = true;
> + src.ssa = def;
> +
> + return src;
> +}
> +
> +static inline nir_src
> +nir_src_for_reg(nir_register *reg)
> +{
> + nir_src src;
> +
> + src.is_ssa = false;
> + src.reg.reg = reg;
> + src.reg.indirect = NULL;
> + src.reg.base_offset = 0;
> +
> + return src;
> +}
> +
> +static inline nir_dest
> +nir_dest_for_reg(nir_register *reg)
> +{
> + nir_dest dest;
> +
> + dest.is_ssa = false;
> + dest.reg.reg = reg;
> + dest.reg.indirect = NULL;
> + dest.reg.base_offset = 0;
> +
> + return dest;
> +}
> +
> nir_src nir_src_copy(nir_src src, void *mem_ctx);
> nir_dest nir_dest_copy(nir_dest dest, void *mem_ctx);
>
> --
> 2.2.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list