[Mesa-dev] [PATCH 25/26] nir: Add a helper for getting the current block from a cursor

Rob Clark robdclark at gmail.com
Sat Mar 26 16:10:26 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.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index 45f208a..03c1f76 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -1936,6 +1936,17 @@ typedef struct {
>     };
>  } nir_cursor;
>
> +static inline nir_block *
> +nir_cursor_current_block(nir_cursor cursor)
> +{
> +   if (cursor.option == nir_cursor_before_instr ||
> +       cursor.option == nir_cursor_after_instr) {
> +      return cursor.instr->block;
> +   } else {
> +      return cursor.block;
> +   }
> +}
> +
>  bool nir_cursors_equal(nir_cursor a, nir_cursor b);
>
>  static inline nir_cursor
> --
> 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