[Mesa-dev] [PATCH 2/9] nir: Add SYSTEM_VALUE_BASE_VERTEX_ID instrinsics

Kenneth Graunke kenneth at whitecape.org
Thu Nov 30 19:40:57 UTC 2017


On Friday, November 10, 2017 9:53:30 AM PST Antia Puentes wrote:
> Reviewed-by: Neil Roberts <nroberts at igalia.com>
> ---
>  src/compiler/nir/nir.c             | 4 ++++
>  src/compiler/nir/nir_gather_info.c | 1 +
>  src/compiler/nir/nir_intrinsics.h  | 1 +
>  3 files changed, 6 insertions(+)
> 
> diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
> index 7380bf436a8..6f0477b0676 100644
> --- a/src/compiler/nir/nir.c
> +++ b/src/compiler/nir/nir.c
> @@ -1913,6 +1913,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
>        return nir_intrinsic_load_base_instance;
>     case SYSTEM_VALUE_VERTEX_ID_ZERO_BASE:
>        return nir_intrinsic_load_vertex_id_zero_base;
> +   case SYSTEM_VALUE_BASE_VERTEX_ID:
> +      return nir_intrinsic_load_base_vertex_id;
>     case SYSTEM_VALUE_BASE_VERTEX:
>        return nir_intrinsic_load_base_vertex;
>     case SYSTEM_VALUE_INVOCATION_ID:
> @@ -1982,6 +1984,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
>        return SYSTEM_VALUE_BASE_INSTANCE;
>     case nir_intrinsic_load_vertex_id_zero_base:
>        return SYSTEM_VALUE_VERTEX_ID_ZERO_BASE;
> +   case nir_intrinsic_load_base_vertex_id:
> +      return SYSTEM_VALUE_BASE_VERTEX_ID;
>     case nir_intrinsic_load_base_vertex:
>        return SYSTEM_VALUE_BASE_VERTEX;
>     case nir_intrinsic_load_invocation_id:
> diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c
> index 13cdae39eca..cf2abb8b8ed 100644
> --- a/src/compiler/nir/nir_gather_info.c
> +++ b/src/compiler/nir/nir_gather_info.c
> @@ -232,6 +232,7 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader)
>     case nir_intrinsic_load_vertex_id:
>     case nir_intrinsic_load_vertex_id_zero_base:
>     case nir_intrinsic_load_base_vertex:
> +   case nir_intrinsic_load_base_vertex_id:
>     case nir_intrinsic_load_base_instance:
>     case nir_intrinsic_load_instance_id:
>     case nir_intrinsic_load_sample_id:
> diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h
> index 20bef339ac4..78123dd927a 100644
> --- a/src/compiler/nir/nir_intrinsics.h
> +++ b/src/compiler/nir/nir_intrinsics.h
> @@ -326,6 +326,7 @@ SYSTEM_VALUE(frag_coord, 4, 0, xx, xx, xx)
>  SYSTEM_VALUE(front_face, 1, 0, xx, xx, xx)
>  SYSTEM_VALUE(vertex_id, 1, 0, xx, xx, xx)
>  SYSTEM_VALUE(vertex_id_zero_base, 1, 0, xx, xx, xx)
> +SYSTEM_VALUE(base_vertex_id, 1, 0, xx, xx, xx)
>  SYSTEM_VALUE(base_vertex, 1, 0, xx, xx, xx)
>  SYSTEM_VALUE(instance_id, 1, 0, xx, xx, xx)
>  SYSTEM_VALUE(base_instance, 1, 0, xx, xx, xx)
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

(perhaps s/base_vertex_id/first_vertex/g to go with my suggestion on
patch 1...)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171130/516bcec1/attachment-0001.sig>


More information about the mesa-dev mailing list