[Mesa-dev] [PATCH 10/26] nir/builder: Add a helper for creating undefs
Rob Clark
robdclark at gmail.com
Sat Mar 26 16:29:05 UTC 2016
On Fri, Mar 25, 2016 at 7:12 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
Reviewed-by: Rob Clark <robdclark at gmail.com>
> ---
> src/compiler/nir/nir_builder.h | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
> index e9c409b..3dc7c25 100644
> --- a/src/compiler/nir/nir_builder.h
> +++ b/src/compiler/nir/nir_builder.h
> @@ -75,6 +75,20 @@ nir_builder_cf_insert(nir_builder *build, nir_cf_node *cf)
> }
>
> static inline nir_ssa_def *
> +nir_ssa_undef(nir_builder *build, unsigned num_components, unsigned bit_size)
> +{
> + nir_ssa_undef_instr *undef =
> + nir_ssa_undef_instr_create(build->shader, num_components);
> + undef->def.bit_size = bit_size;
> + if (!undef)
> + return NULL;
> +
> + nir_instr_insert(nir_before_cf_list(&build->impl->body), &undef->instr);
> +
> + return &undef->def;
> +}
> +
> +static inline nir_ssa_def *
> nir_build_imm(nir_builder *build, unsigned num_components, nir_const_value value)
> {
> nir_load_const_instr *load_const =
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> 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