Mesa (master): glsl: Enable ARB_fragment_coord_conventions functionality in GLSL 1.50.

Paul Berry stereotype441 at kemper.freedesktop.org
Fri Aug 9 17:48:03 UTC 2013


Module: Mesa
Branch: master
Commit: 417dc8081ba123fb93c34a3b14cd174dbce702f5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=417dc8081ba123fb93c34a3b14cd174dbce702f5

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Aug  6 12:17:17 2013 -0700

glsl: Enable ARB_fragment_coord_conventions functionality in GLSL 1.50.

GLSL 1.50 incorporates the functionality of the
ARB_fragment_coord_conventions extension, so we need to make this
functionality available even if the extension isn't enabled.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/glsl/ast_to_hir.cpp |    3 ++-
 src/glsl/glsl_parser.yy |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 482ab3c..bfdf8e3 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2332,7 +2332,8 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl,
       earlier->type = var->type;
       delete var;
       var = NULL;
-   } else if (state->ARB_fragment_coord_conventions_enable
+   } else if ((state->ARB_fragment_coord_conventions_enable ||
+               state->is_version(150, 0))
 	      && strcmp(var->name, "gl_FragCoord") == 0
 	      && earlier->type == var->type
 	      && earlier->mode == var->mode) {
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index a847d2a..e3a57ea 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1158,7 +1158,8 @@ layout_qualifier_id:
       memset(& $$, 0, sizeof($$));
 
       /* Layout qualifiers for ARB_fragment_coord_conventions. */
-      if (!$$.flags.i && state->ARB_fragment_coord_conventions_enable) {
+      if (!$$.flags.i && (state->ARB_fragment_coord_conventions_enable ||
+                          state->is_version(150, 0))) {
          if (strcmp($1, "origin_upper_left") == 0) {
             $$.flags.q.origin_upper_left = 1;
          } else if (strcmp($1, "pixel_center_integer") == 0) {




More information about the mesa-commit mailing list