[Mesa-dev] [RFCv2 02/13] gallium: add NIR as a possible IR

Marek Olšák maraeo at gmail.com
Tue Nov 10 04:27:59 PST 2015


On Sun, Nov 8, 2015 at 9:12 PM, Rob Clark <robdclark at gmail.com> wrote:
> ---
>  src/gallium/include/pipe/p_defines.h | 1 +
>  src/gallium/include/pipe/p_state.h   | 7 +++++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index 0a9d98d..572461f 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -718,6 +718,7 @@ enum pipe_shader_ir
>     PIPE_SHADER_IR_TGSI = 0,
>     PIPE_SHADER_IR_LLVM,
>     PIPE_SHADER_IR_NATIVE,
> +   PIPE_SHADER_IR_NIR,
>  };
>
>  /**
> diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
> index f1c4b49..7eee709 100644
> --- a/src/gallium/include/pipe/p_state.h
> +++ b/src/gallium/include/pipe/p_state.h
> @@ -221,6 +221,12 @@ struct pipe_stream_output_info
>   *
>   * TODO pipe_compute_state should probably get similar treatment to handle
>   * multiple IR's in a cleaner way..
> + *
> + * NOTE: since the nir_shader is reference counted, the semantics are a bit
> + * different from create_xyz_state(ir=TGSI).  The driver takes ownership of
> + * the nir_shader (and must nir_shader_unref()) at some point.  If state
> + * trackers need to hang on to the IR (for example, variant management), it
> + * should increment the refcnt before calling create_xyz_shader(ir=NIR).

Sounds good.

Marek


More information about the mesa-dev mailing list