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 <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
This commit is contained in:
Paul Berry
2012-08-02 08:18:12 -07:00
committed by Ian Romanick
parent 534ec62152
commit d4a24745b8
5 changed files with 47 additions and 17 deletions

View File

@@ -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);
}