[Mesa-dev] [PATCH 4/9] nir: Add intrinsics for SYSTEM_VALUE_BASE_VERTEX and VERTEX_ID_ZERO_BASE

Ian Romanick idr at freedesktop.org
Wed Mar 11 10:31:11 PDT 2015


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 03/09/2015 01:58 AM, Kenneth Graunke wrote:
> Ian and I added these around the time Connor was developing NIR.  Now
> that both exist, we should make them work together!
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/glsl/nir/nir_intrinsics.h          | 2 ++
>  src/glsl/nir/nir_lower_system_values.c | 6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h
> index 3bf102f..8e28765 100644
> --- a/src/glsl/nir/nir_intrinsics.h
> +++ b/src/glsl/nir/nir_intrinsics.h
> @@ -95,6 +95,8 @@ ATOMIC(read, NIR_INTRINSIC_CAN_ELIMINATE)
>  
>  SYSTEM_VALUE(front_face, 1)
>  SYSTEM_VALUE(vertex_id, 1)
> +SYSTEM_VALUE(vertex_id_zero_base, 1)
> +SYSTEM_VALUE(base_vertex, 1)
>  SYSTEM_VALUE(instance_id, 1)
>  SYSTEM_VALUE(sample_id, 1)
>  SYSTEM_VALUE(sample_pos, 2)
> diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c
> index 328d4f1..a6eec65 100644
> --- a/src/glsl/nir/nir_lower_system_values.c
> +++ b/src/glsl/nir/nir_lower_system_values.c
> @@ -49,6 +49,12 @@ convert_instr(nir_intrinsic_instr *instr)
>     case SYSTEM_VALUE_VERTEX_ID:
>        op = nir_intrinsic_load_vertex_id;
>        break;
> +   case SYSTEM_VALUE_VERTEX_ID_ZERO_BASE:
> +      op = nir_intrinsic_load_vertex_id_zero_base;
> +      break;
> +   case SYSTEM_VALUE_BASE_VERTEX:
> +      op = nir_intrinsic_load_base_vertex;
> +      break;
>     case SYSTEM_VALUE_INSTANCE_ID:
>        op = nir_intrinsic_load_instance_id;
>        break;
> 



More information about the mesa-dev mailing list