aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_function.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-08-02 08:18:12 -0700
committerIan Romanick <[email protected]>2012-12-06 12:13:21 -0800
commitd4a24745b84be49b0ede285ef795847ebca70916 (patch)
tree9fda4f785509bc6d762e74c417438950f6461738 /src/glsl/ast_function.cpp
parent534ec62152e70ed8f6467feaf07b2db2197e11b1 (diff)
glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.
This patch turns on the following features for GLSL ES 3.00: - Array constructors, whole array assignment, and array comparisons. - Second and third operands of ?: may be arrays. - Use of "in" and "out" qualifiers on globals. - Bitwise and modulus operators. - Integral vertex shader inputs. - Range-checking of literal integers. - array.length method. - Function calls may be constant expressions. - Integral varyings must be qualified with "flat". - Interpolation and centroid qualifiers may not be applied to vertex shader inputs. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
Diffstat (limited to 'src/glsl/ast_function.cpp')
-rw-r--r--src/glsl/ast_function.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 8a5979fb3e2..b56a3c72339 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -275,9 +275,10 @@ generate_call(exec_list *instructions, ir_function_signature *sig,
/* If the function call is a constant expression, don't generate any
* instructions; just generate an ir_constant.
*
- * Function calls were first allowed to be constant expressions in GLSL 1.20.
+ * Function calls were first allowed to be constant expressions in GLSL
+ * 1.20 and GLSL ES 3.00.
*/
- if (state->is_version(120, 0)) {
+ if (state->is_version(120, 300)) {
ir_constant *value = sig->constant_expression_value(actual_parameters, NULL);
if (value != NULL) {
return value;
@@ -1243,7 +1244,7 @@ ast_function_expression::hir(exec_list *instructions,
}
if (constructor_type->is_array()) {
- if (!state->check_version(120, 0, &loc,
+ if (!state->check_version(120, 300, &loc,
"array constructors forbidden")) {
return ir_rvalue::error_value(ctx);
}