[Mesa-dev] [PATCH 2/3] glsl: allow invocations to be specified in ES 3.20 + exts

Ilia Mirkin imirkin at alum.mit.edu
Tue May 24 00:59:19 UTC 2016


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/compiler/glsl/builtin_variables.cpp | 3 ++-
 src/compiler/glsl/glsl_parser.yy        | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index ff8a7e2..e082572 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1067,7 +1067,8 @@ builtin_variable_generator::generate_gs_special_vars()
       var = add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
       var->data.interpolation = INTERP_QUALIFIER_FLAT;
    }
-   if (state->is_version(400, 0) || state->ARB_gpu_shader5_enable)
+   if (state->is_version(400, 320) || state->ARB_gpu_shader5_enable ||
+       state->EXT_geometry_shader_enable || state->OES_geometry_shader_enable)
       add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID");
 
    /* Although gl_PrimitiveID appears in tessellation control and tessellation
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 3885688..835602b 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1596,8 +1596,10 @@ layout_qualifier_id:
       if (match_layout_qualifier("invocations", $1, state) == 0) {
          $$.flags.q.invocations = 1;
          $$.invocations = new(ctx) ast_layout_expression(@1, $3);
-         if (!state->is_version(400, 0) &&
-             !state->ARB_gpu_shader5_enable) {
+         if (!state->is_version(400, 320) &&
+             !state->ARB_gpu_shader5_enable &&
+             !state->EXT_geometry_shader_enable &&
+             !state->OES_geometry_shader_enable) {
             _mesa_glsl_error(& @3, state,
                              "GL_ARB_gpu_shader5 invocations "
                              "qualifier specified", $3);
-- 
2.7.3



More information about the mesa-dev mailing list