glsl: add gl_HelperInvocation system value
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 14 Sep 2015 20:13:43 +0000 (16:13 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 12 Nov 2015 22:58:23 +0000 (17:58 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/builtin_variables.cpp
src/glsl/nir/shader_enums.h
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index c30fb92..b06c1bc 100644 (file)
@@ -1059,6 +1059,9 @@ builtin_variable_generator::generate_fs_special_vars()
       var = add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
       var->data.interpolation = INTERP_QUALIFIER_FLAT;
    }
+
+   if (state->is_version(450, 310)/* || state->ARB_ES3_1_compatibility_enable*/)
+      add_system_value(SYSTEM_VALUE_HELPER_INVOCATION, bool_t, "gl_HelperInvocation");
 }
 
 
index d1cf7ca..dd0e0ba 100644 (file)
@@ -396,6 +396,7 @@ typedef enum
    SYSTEM_VALUE_SAMPLE_ID,
    SYSTEM_VALUE_SAMPLE_POS,
    SYSTEM_VALUE_SAMPLE_MASK_IN,
+   SYSTEM_VALUE_HELPER_INVOCATION,
    /*@}*/
 
    /**
index 9ee6f8f..b565127 100644 (file)
@@ -4408,6 +4408,7 @@ const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
    TGSI_SEMANTIC_SAMPLEID,
    TGSI_SEMANTIC_SAMPLEPOS,
    TGSI_SEMANTIC_SAMPLEMASK,
+   0, /* gl_HelperInvocation */
 
    /* Tessellation shaders
     */