[Mesa-dev] [PATCH 1/3] glsl: add gl_HelperInvocation system value

Ilia Mirkin imirkin at alum.mit.edu
Mon Sep 14 14:43:26 PDT 2015


On Mon, Sep 14, 2015 at 4:35 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/glsl/builtin_variables.cpp             | 3 +++
>  src/glsl/shader_enums.h                    | 1 +
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
>  3 files changed, 5 insertions(+)
>
> diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
> index b5e2908..7ea5db8 100644
> --- a/src/glsl/builtin_variables.cpp
> +++ b/src/glsl/builtin_variables.cpp
> @@ -1050,6 +1050,9 @@ builtin_variable_generator::generate_fs_special_vars()
>        add_input(VARYING_SLOT_LAYER, int_t, "gl_Layer");
>        add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
>     }
> +
> +   if (state->is_version(450, 310))

Hmmm... this should probably be

state->ARB_ES3_1_compatibility_enable || state->is_version(450, 310).

Since that doesn't exist, perhaps i should just add it in /* ... */ to
be uncommented later? Or I guess I could go in and add all of those
ext enables in. What do people think? It's easy enough to do any of
these.

> +      add_system_value(SYSTEM_VALUE_FRAG_HELPER, bool_t, "gl_HelperInvocation");
>  }
>
>
> diff --git a/src/glsl/shader_enums.h b/src/glsl/shader_enums.h
> index 7c598b6..6bc93a5 100644
> --- a/src/glsl/shader_enums.h
> +++ b/src/glsl/shader_enums.h
> @@ -352,6 +352,7 @@ typedef enum
>     SYSTEM_VALUE_SAMPLE_ID,
>     SYSTEM_VALUE_SAMPLE_POS,
>     SYSTEM_VALUE_SAMPLE_MASK_IN,
> +   SYSTEM_VALUE_FRAG_HELPER,
>     /*@}*/
>
>     /**
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index c3a8c11..fc728d1 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4614,6 +4614,7 @@ const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
>     TGSI_SEMANTIC_SAMPLEID,
>     TGSI_SEMANTIC_SAMPLEPOS,
>     TGSI_SEMANTIC_SAMPLEMASK,
> +   0, /* gl_HelperInvocation */
>
>     /* Tessellation shaders
>      */
> --
> 2.4.6
>


More information about the mesa-dev mailing list