[Mesa-dev] [Mesa-dev, 3/7] nir: Add gl_LocalInvocationID variable

Kristian Høgsberg krh at bitplanet.net
Thu Sep 10 10:23:06 PDT 2015


Jordan Justen <jordan.l.justen at intel.com> writes:

> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> ---
> src/glsl/nir/nir_intrinsics.h          | 1 +
>  src/glsl/nir/nir_lower_system_values.c | 3 +++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h
> index bc6e6b8..29b5e64 100644
> --- a/src/glsl/nir/nir_intrinsics.h
> +++ b/src/glsl/nir/nir_intrinsics.h
> @@ -137,6 +137,7 @@ SYSTEM_VALUE(sample_id, 1)
>  SYSTEM_VALUE(sample_pos, 2)
>  SYSTEM_VALUE(sample_mask_in, 1)
>  SYSTEM_VALUE(invocation_id, 1)
> +SYSTEM_VALUE(local_invocation_id, 3)
>  
>  /*
>   * The first and only index is the base address to load from.  Indirect
> diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c
> index a6eec65..ee375ea 100644
> --- a/src/glsl/nir/nir_lower_system_values.c
> +++ b/src/glsl/nir/nir_lower_system_values.c
> @@ -70,6 +70,9 @@ convert_instr(nir_intrinsic_instr *instr)
>     case SYSTEM_VALUE_INVOCATION_ID:
>        op = nir_intrinsic_load_invocation_id;
>        break;
> +   case SYSTEM_VALUE_LOCAL_INVOCATION_ID:
> +      op = nir_intrinsic_load_local_invocation_id;
> +      break;
>     default:
>        unreachable("not reached");
>     }


More information about the mesa-dev mailing list