[Mesa-dev] [PATCH v3 7/9] glsl: add gl_InvocationID variable for ARB_gpu_shader5

Dave Airlie airlied at gmail.com
Wed Feb 5 02:15:36 CET 2014


On Wed, Feb 5, 2014 at 9:07 AM, Jordan Justen <jordan.l.justen at intel.com> wrote:
> v2:
>  * Make gl_InstanceID a system value

typo ^^ I assume you mean gl_InvocationID.

Dave.
>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Reviewed-by: Paul Berry <stereotype441 at gmail.com>
> ---
>  src/glsl/builtin_variables.cpp | 2 ++
>  src/mesa/main/mtypes.h         | 1 +
>  2 files changed, 3 insertions(+)
>
> diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
> index d6bc3c0..d9ed2db 100644
> --- a/src/glsl/builtin_variables.cpp
> +++ b/src/glsl/builtin_variables.cpp
> @@ -782,6 +782,8 @@ builtin_variable_generator::generate_gs_special_vars()
>     add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
>     if (state->ARB_viewport_array_enable)
>        add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
> +   if (state->ARB_gpu_shader5_enable)
> +      add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID");
>
>     /* Although gl_PrimitiveID appears in tessellation control and tessellation
>      * evaluation shaders, it has a different function there than it has in
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index b76b984..10d4206 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2015,6 +2015,7 @@ typedef enum
>     SYSTEM_VALUE_SAMPLE_ID,      /**< Fragment shader only */
>     SYSTEM_VALUE_SAMPLE_POS,     /**< Fragment shader only */
>     SYSTEM_VALUE_SAMPLE_MASK_IN, /**< Fragment shader only */
> +   SYSTEM_VALUE_INVOCATION_ID,  /**< Geometry shader only */
>     SYSTEM_VALUE_MAX             /**< Number of values */
>  } gl_system_value;
>
> --
> 1.8.5.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list