[Mesa-dev] [PATCH v2 1/3] glsl: add gl_HelperInvocation system value
Ilia Mirkin
imirkin at alum.mit.edu
Thu Nov 12 09:32:24 PST 2015
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
v1 -> v2: changed name of sysval to longer thing that matches GL name
src/glsl/builtin_variables.cpp | 3 +++
src/glsl/nir/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 c30fb92..b06c1bc 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -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");
}
diff --git a/src/glsl/nir/shader_enums.h b/src/glsl/nir/shader_enums.h
index d1cf7ca..dd0e0ba 100644
--- a/src/glsl/nir/shader_enums.h
+++ b/src/glsl/nir/shader_enums.h
@@ -396,6 +396,7 @@ typedef enum
SYSTEM_VALUE_SAMPLE_ID,
SYSTEM_VALUE_SAMPLE_POS,
SYSTEM_VALUE_SAMPLE_MASK_IN,
+ SYSTEM_VALUE_HELPER_INVOCATION,
/*@}*/
/**
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9ee6f8f..b565127 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -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
*/
--
2.4.10
More information about the mesa-dev
mailing list