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 c30fb9226e57868aae5244f54fa00346c4cac061..b06c1bc5c12e147b04250f9e60db4478febf214c 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 d1cf7ca04cca4e44b7d0e16d067133ab5fa95400..dd0e0bad8066e21c865722d3bd0553868b6b83df 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 9ee6f8f89be6944e1aa8018a355111a26d5abb6c..b56512706b0bae9eb1c6443ee6a5763e1bdedb9d 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
     */