diff options
author | Ian Romanick <[email protected]> | 2010-10-05 16:18:56 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-10-08 14:21:22 -0700 |
commit | fd2aa7d313b2546dc25f9f7810a0b3767ee679f9 (patch) | |
tree | b2a352bf103dc5b65cbe1e9284f4f83e213ad73d /src/glsl | |
parent | dd93035a4df9daaad8cb47f2cc412d5dd3a9e3c8 (diff) |
glsl: Slight refactor of error / warning checking for ARB_fcc layout
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/glsl_parser.ypp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/glsl/glsl_parser.ypp b/src/glsl/glsl_parser.ypp index 9d311093ba6..649f4379af9 100644 --- a/src/glsl/glsl_parser.ypp +++ b/src/glsl/glsl_parser.ypp @@ -977,11 +977,11 @@ layout_qualifier_id_list: layout_qualifier_id: IDENTIFIER { + bool got_one = false; + $$.i = 0; if (state->ARB_fragment_coord_conventions_enable) { - bool got_one = false; - if (strcmp($1, "origin_upper_left") == 0) { got_one = true; $$.q.origin_upper_left = 1; @@ -989,21 +989,19 @@ layout_qualifier_id: got_one = true; $$.q.pixel_center_integer = 1; } - - if (state->ARB_fragment_coord_conventions_warn && got_one) { - _mesa_glsl_warning(& @1, state, - "GL_ARB_fragment_coord_conventions layout " - "identifier `%s' used\n", $1); - } } /* If the identifier didn't match any known layout identifiers, * emit an error. */ - if ($$.i == 0) { + if (!got_one) { _mesa_glsl_error(& @1, state, "unrecognized layout identifier " "`%s'\n", $1); YYERROR; + } else if (state->ARB_fragment_coord_conventions_warn) { + _mesa_glsl_warning(& @1, state, + "GL_ARB_fragment_coord_conventions layout " + "identifier `%s' used\n", $1); } } ; |