diff options
author | Paul Berry <[email protected]> | 2012-08-02 06:45:30 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-12-06 12:13:21 -0800 |
commit | dc9f9d8e66ac3ec934a82d25da7b76902f775802 (patch) | |
tree | 1b316c5a26a3d71636759c420bb3061c36d9ac75 /src/glsl/glsl_parser.yy | |
parent | d9bfaa104ed4debeff6c7d69daf4d9cc85cadb8d (diff) |
glsl: Compute version_string on the fly.
Fixes a bug where version_string would be left uninitialized if no
GLSL "#version" directive was used.
Reviewed-by: Kenneth Graunke <[email protected]>
Acked-by: Carl Worth <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser.yy')
-rw-r--r-- | src/glsl/glsl_parser.yy | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 03e05ff1bf3..e68a601c89e 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -289,14 +289,11 @@ version_statement: } state->language_version = $2; - state->version_string = - glsl_compute_version_string(state, state->es_shader, - state->language_version); if (!supported) { _mesa_glsl_error(& @2, state, "%s is not supported. " "Supported versions are: %s\n", - state->version_string, + state->get_version_string(), state->supported_version_string); } @@ -316,7 +313,7 @@ pragma_statement: if (state->language_version == 110) { _mesa_glsl_warning(& @1, state, "pragma `invariant(all)' not supported in %s", - state->version_string); + state->get_version_string()); } else { state->all_invariant = true; } @@ -1501,7 +1498,7 @@ precision_qualifier: "precision qualifier forbidden " "in %s (1.30 or later " "required)\n", - state->version_string); + state->get_version_string()); $$ = ast_precision_high; } @@ -1511,7 +1508,7 @@ precision_qualifier: "precision qualifier forbidden " "in %s (1.30 or later " "required)\n", - state->version_string); + state->get_version_string()); $$ = ast_precision_medium; } @@ -1521,7 +1518,7 @@ precision_qualifier: "precision qualifier forbidden " "in %s (1.30 or later " "required)\n", - state->version_string); + state->get_version_string()); $$ = ast_precision_low; } |