glsl: Enable ARB_fragment_coord_conventions functionality in GLSL 1.50.
authorPaul Berry <stereotype441@gmail.com>
Tue, 6 Aug 2013 19:17:17 +0000 (12:17 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 9 Aug 2013 17:35:06 +0000 (10:35 -0700)
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@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ast_to_hir.cpp
src/glsl/glsl_parser.yy

index 482ab3c05a4b53fe49b6479c17f30cc2ee3f8b78..bfdf8e3791fbb9254dcaf936b2b2a59eb7e6ed58 100644 (file)
@@ -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) {
index a847d2a2d5cc8263e80871e3627abe5757d14302..e3a57ea0251e4ac7b9831310f3e0b47ab396c5c6 100644 (file)
@@ -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) {