summaryrefslogtreecommitdiffstats
path: root/src/glsl/hir_field_selection.cpp
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-08-05 09:57:01 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-12-06 12:13:21 -0800
commit0d9bba6e43ab45c8eb758b4e29f4ed085a9398c9 (patch)
treedbed6d4d902330c0c10f906c49ee7fb541a0a358 /src/glsl/hir_field_selection.cpp
parente3ded7fe628d5a842f2fae0da355a4034cff27cf (diff)
downloadexternal_mesa3d-0d9bba6e43ab45c8eb758b4e29f4ed085a9398c9.zip
external_mesa3d-0d9bba6e43ab45c8eb758b4e29f4ed085a9398c9.tar.gz
external_mesa3d-0d9bba6e43ab45c8eb758b4e29f4ed085a9398c9.tar.bz2
glsl: Make use of new _mesa_glsl_parse_state::check_version() function.
Previous to this patch, we were not very consistent about the errors we generate when a shader tried to use a feature that is prohibited in the current GLSL version. Some error messages failed to mention the GLSL version currently in use (or did so inaccurately), and some error messages failed to mention the first GLSL version in which the given feature is allowed. This patch reworks all of the error checks to use the check_version() function, which produces error messages in a standard form (approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION ($REQUIRED_GLSL_VERSION required)."). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Carl Worth <cworth@cworth.org>
Diffstat (limited to 'src/glsl/hir_field_selection.cpp')
-rw-r--r--src/glsl/hir_field_selection.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp
index 260b415..a18227f 100644
--- a/src/glsl/hir_field_selection.cpp
+++ b/src/glsl/hir_field_selection.cpp
@@ -72,8 +72,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
}
} else if (expr->subexpressions[1] != NULL) {
/* Handle "method calls" in GLSL 1.20 - namely, array.length() */
- if (state->language_version < 120)
- _mesa_glsl_error(&loc, state, "Methods not supported in GLSL 1.10.");
+ state->check_version(120, 0, &loc, "Methods not supported");
ast_expression *call = expr->subexpressions[1];
assert(call->oper == ast_function_call);