[Mesa-dev] [PATCH] glsl: allow local_size qualifiers in compute shader regardless of version

Miklós Máté mtmkls at gmail.com
Fri Aug 26 16:42:59 UTC 2016


Tomb Raider 2013 uses #version 420 in compute shaders, and current Mesa
rejects them, because the local size qualifiers require 430.

Signed-off-by: Miklós Máté <mtmkls at gmail.com>
---
 src/compiler/glsl/glsl_parser.yy | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index 4043dae..6857443 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1615,10 +1615,9 @@ layout_qualifier_id:
       for (int i = 0; i < 3; i++) {
          if (match_layout_qualifier(local_size_qualifiers[i], $1,
                                     state) == 0) {
-            if (!state->has_compute_shader()) {
+            if (state->stage != MESA_SHADER_COMPUTE) {
                _mesa_glsl_error(& @3, state,
-                                "%s qualifier requires GLSL 4.30 or "
-                                "GLSL ES 3.10 or ARB_compute_shader",
+                                "%s qualifier is only allowed in compute shader",
                                 local_size_qualifiers[i]);
                YYERROR;
             } else {
-- 
2.9.3



More information about the mesa-dev mailing list