summaryrefslogtreecommitdiff
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/Makefile7
-rw-r--r--src/glsl/Makefile.am7
-rw-r--r--src/glsl/README46
-rw-r--r--src/glsl/SConscript7
-rw-r--r--src/glsl/TODO26
-rw-r--r--src/glsl/ast_function.cpp2
-rw-r--r--src/glsl/ast_to_hir.cpp63
-rw-r--r--src/glsl/builtin_function.cpp3460
-rw-r--r--src/glsl/builtin_types.h23
-rw-r--r--src/glsl/builtin_variables.h7
-rw-r--r--src/glsl/builtins/ir/atan49
-rw-r--r--src/glsl/builtins/ir/distance10
-rw-r--r--src/glsl/builtins/ir/dot2
-rw-r--r--src/glsl/builtins/ir/equal72
-rw-r--r--src/glsl/builtins/ir/faceforward2
-rw-r--r--src/glsl/builtins/ir/greaterThan54
-rw-r--r--src/glsl/builtins/ir/greaterThanEqual54
-rw-r--r--src/glsl/builtins/ir/length2
-rw-r--r--src/glsl/builtins/ir/lessThan54
-rw-r--r--src/glsl/builtins/ir/lessThanEqual54
-rw-r--r--src/glsl/builtins/ir/matrixCompMult54
-rw-r--r--src/glsl/builtins/ir/mix18
-rw-r--r--src/glsl/builtins/ir/noise18
-rw-r--r--src/glsl/builtins/ir/noise275
-rw-r--r--src/glsl/builtins/ir/noise387
-rw-r--r--src/glsl/builtins/ir/noise4111
-rw-r--r--src/glsl/builtins/ir/normalize2
-rw-r--r--src/glsl/builtins/ir/notEqual72
-rw-r--r--src/glsl/builtins/ir/outerProduct54
-rw-r--r--src/glsl/builtins/ir/reflect2
-rw-r--r--src/glsl/builtins/ir/refract14
-rw-r--r--src/glsl/builtins/ir/smoothstep38
-rw-r--r--src/glsl/builtins/ir/step36
-rw-r--r--src/glsl/builtins/ir/transpose162
-rw-r--r--src/glsl/builtins/profiles/100.frag300
-rw-r--r--src/glsl/builtins/profiles/100.vert300
-rwxr-xr-xsrc/glsl/builtins/tools/generate_builtins.py6
-rw-r--r--src/glsl/glcpp/glcpp-parse.c446
-rw-r--r--src/glsl/glcpp/glcpp-parse.h7
-rw-r--r--src/glsl/glcpp/glcpp-parse.y10
-rw-r--r--src/glsl/glcpp/glcpp.c3
-rw-r--r--src/glsl/glcpp/glcpp.h4
-rw-r--r--src/glsl/glcpp/pp.c4
-rw-r--r--src/glsl/glsl_lexer.cpp424
-rw-r--r--src/glsl/glsl_lexer.lpp24
-rw-r--r--src/glsl/glsl_parser.cpp1450
-rw-r--r--src/glsl/glsl_parser.h18
-rw-r--r--src/glsl/glsl_parser.ypp127
-rw-r--r--src/glsl/glsl_parser_extras.cpp82
-rw-r--r--src/glsl/glsl_parser_extras.h3
-rw-r--r--src/glsl/glsl_types.cpp19
-rw-r--r--src/glsl/glsl_types.h8
-rw-r--r--src/glsl/ir.cpp44
-rw-r--r--src/glsl/ir.h48
-rw-r--r--src/glsl/ir_algebraic.cpp2
-rw-r--r--src/glsl/ir_clone.cpp4
-rw-r--r--src/glsl/ir_constant_expression.cpp40
-rw-r--r--src/glsl/ir_constant_propagation.cpp18
-rw-r--r--src/glsl/ir_copy_propagation.cpp26
-rw-r--r--src/glsl/ir_hierarchical_visitor.cpp1
-rw-r--r--src/glsl/ir_hierarchical_visitor.h7
-rw-r--r--src/glsl/ir_hv_accept.cpp9
-rw-r--r--src/glsl/ir_if_return.cpp246
-rw-r--r--src/glsl/ir_if_simplification.cpp2
-rw-r--r--src/glsl/ir_import_prototypes.cpp2
-rw-r--r--src/glsl/ir_lower_jumps.cpp544
-rw-r--r--src/glsl/ir_mat_op_to_vec.cpp8
-rw-r--r--src/glsl/ir_mod_to_fract.cpp2
-rw-r--r--src/glsl/ir_optimization.h6
-rw-r--r--src/glsl/ir_print_visitor.cpp29
-rw-r--r--src/glsl/ir_reader.cpp76
-rw-r--r--src/glsl/ir_rvalue_visitor.cpp7
-rw-r--r--src/glsl/ir_validate.cpp66
-rw-r--r--src/glsl/ir_variable.cpp75
-rw-r--r--src/glsl/ir_visitor.h17
-rw-r--r--src/glsl/linker.cpp13
-rw-r--r--src/glsl/list.h40
-rw-r--r--src/glsl/loop_analysis.cpp496
-rw-r--r--src/glsl/loop_analysis.h230
-rw-r--r--src/glsl/loop_controls.cpp301
-rw-r--r--src/glsl/loop_unroll.cpp187
-rw-r--r--src/glsl/lower_noise.cpp71
-rw-r--r--src/glsl/main.cpp55
-rw-r--r--src/glsl/opt_redundant_jumps.cpp111
84 files changed, 7994 insertions, 2758 deletions
diff --git a/src/glsl/Makefile b/src/glsl/Makefile
index aedca0f0d1..1746e18ad6 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -50,10 +50,10 @@ CXX_SOURCES = \
ir_function_inlining.cpp \
ir_hierarchical_visitor.cpp \
ir_hv_accept.cpp \
- ir_if_return.cpp \
ir_if_simplification.cpp \
ir_if_to_cond_assign.cpp \
ir_import_prototypes.cpp \
+ ir_lower_jumps.cpp \
ir_mat_op_to_vec.cpp \
ir_mod_to_fract.cpp \
ir_noop_swizzle.cpp \
@@ -72,6 +72,11 @@ CXX_SOURCES = \
ir_vec_index_to_swizzle.cpp \
linker.cpp \
link_functions.cpp \
+ loop_analysis.cpp \
+ loop_controls.cpp \
+ loop_unroll.cpp \
+ lower_noise.cpp \
+ opt_redundant_jumps.cpp \
s_expression.cpp
LIBS = \
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 5728a8b63d..f62a85e893 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -62,7 +62,12 @@ glsl_SOURCES = \
ir_to_mesa.h \
ir_validate.cpp \
ir_vec_index_to_swizzle.cpp \
- linker.cpp
+ linker.cpp \
+ loop_analysis.cpp \
+ loop_controls.cpp \
+ loop_unroll.cpp \
+ lower_noise.cpp \
+ opt_redundant_jumps.cpp
BUILT_SOURCES = glsl_parser.h glsl_parser.cpp glsl_lexer.cpp
CLEANFILES = $(BUILT_SOURCES)
diff --git a/src/glsl/README b/src/glsl/README
index 2e501d6206..dd80a53d47 100644
--- a/src/glsl/README
+++ b/src/glsl/README
@@ -156,10 +156,10 @@ for the 965 fragment shader backend when that is developed.
Q: How should I expand instructions that take multiple backend instructions?
Sometimes you'll have to do the expansion in your code generation --
-see, for example, ir_to_mesa.cpp's handling of ir_binop_mul for
-matrices. However, in many cases you'll want to do a pass over the IR
-to convert non-native instructions to a series of native instructions.
-For example, for the Mesa backend we have ir_div_to_mul_rcp.cpp because
+see, for example, ir_to_mesa.cpp's handling of ir_unop_sqrt. However,
+in many cases you'll want to do a pass over the IR to convert
+non-native instructions to a series of native instructions. For
+example, for the Mesa backend we have ir_div_to_mul_rcp.cpp because
Mesa IR (and many hardware backends) only have a reciprocal
instruction, not a divide. Implementing non-native instructions this
way gives the chance for constant folding to occur, so (a / 2.0)
@@ -189,3 +189,41 @@ You may also need to update the backends if they will see the new expr type:
You can then use the new expression from builtins (if all backends
would rather see it), or scan the IR and convert to use your new
expression type (see ir_mod_to_fract, for example).
+
+Q: How is memory management handled in the compiler?
+
+The hierarchical memory allocator "talloc" developed for the Samba
+project is used, so that things like optimization passes don't have to
+worry about their garbage collection so much. It has a few nice
+features, including low performance overhead and good debugging
+support that's trivially available.
+
+Generally, each stage of the compile creates a talloc context and
+allocates its memory out of that or children of it. At the end of the
+stage, the pieces still live are stolen to a new context and the old
+one freed, or the whole context is kept for use by the next stage.
+
+For IR transformations, a temporary context is used, then at the end
+of all transformations, reparent_ir reparents all live nodes under the
+shader's IR list, and the old context full of dead nodes is freed.
+When developing a single IR transformation pass, this means that you
+want to allocate instruction nodes out of the temporary context, so if
+it becomes dead it doesn't live on as the child of a live node. At
+the moment, optimization passes aren't passed that temporary context,
+so they find it by calling talloc_parent() on a nearby IR node. The
+talloc_parent() call is expensive, so many passes will cache the
+result of the first talloc_parent(). Cleaning up all the optimization
+passes to take a context argument and not call talloc_parent() is left
+as an exercise.
+
+Q: What is the file naming convention in this directory?
+
+Initially, there really wasn't one. We have since adopted one:
+
+ - Files that implement code lowering passes should be named lower_*
+ (e.g., lower_noise.cpp).
+ - Files that implement optimization passes should be named opt_*.
+ - Files that implement a class that is used throught the code should
+ take the name of that class (e.g., ir_hierarchical_visitor.cpp).
+ - Files that contain code not fitting in one of the previous
+ categories should have a sensible name (e.g., glsl_parser.ypp).
diff --git a/src/glsl/SConscript b/src/glsl/SConscript
index a808a5bc5d..6e2ef2d61f 100644
--- a/src/glsl/SConscript
+++ b/src/glsl/SConscript
@@ -47,10 +47,10 @@ sources = [
'ir_function_inlining.cpp',
'ir_hierarchical_visitor.cpp',
'ir_hv_accept.cpp',
- 'ir_if_return.cpp',
'ir_if_simplification.cpp',
'ir_if_to_cond_assign.cpp',
'ir_import_prototypes.cpp',
+ 'ir_lower_jumps.cpp',
'ir_mat_op_to_vec.cpp',
'ir_mod_to_fract.cpp',
'ir_noop_swizzle.cpp',
@@ -69,6 +69,11 @@ sources = [
'ir_vec_index_to_swizzle.cpp',
'linker.cpp',
'link_functions.cpp',
+ 'loop_analysis.cpp',
+ 'loop_controls.cpp',
+ 'loop_unroll.cpp',
+ 'lower_noise.cpp',
+ 'opt_redundant_jumps.cpp',
's_expression.cpp',
]
diff --git a/src/glsl/TODO b/src/glsl/TODO
index 07ac5f5c6e..a3762384ff 100644
--- a/src/glsl/TODO
+++ b/src/glsl/TODO
@@ -1,30 +1,14 @@
-- Handle constant expressions of (struct == struct)
-
-- Handle constant expressions of (struct != struct)
-
-- Treat built-in functions with constant parameters as constant expressions.
- - Rewrite all built-in functions return a single expression.
- - Modify the HIR generator for functions to automatically inline built-in
- functions durning translation.
- - Care must be taken to handle both the 1.10 rules and the 1.20+ rules. In
- 1.10, built-in functions cannot be constant expressions.
-
- Detect code paths in non-void functions that don't reach a return statement
-- Handle over-riding built-in functions
- - Is the overload per-compilation unit or per-linked shader?
-
-- Handle redeclaration of built-in variables
- - Handle addition of qualifiers such as 'invariant' or 'centroid'.
- - Handle resizing of arrays.
- - Other? We'll have to look at the spec.
-
- Improve handling of constants and their initializers. Constant initializers
should never generate any code. This is trival for scalar constants. It is
also trivial for arrays, matrices, and vectors that are accessed with
constant index values. For others it is more complicated. Perhaps these
cases should be silently converted to uniforms?
+- Implement support for ir_binop_dot in ir_algebraic.cpp. Perform
+ transformations such as "dot(v, vec3(0.0, 1.0, 0.0))" -> v.y.
+
1.30 features:
- Implement AST-to-HIR conversion of bit-shift operators.
@@ -48,3 +32,7 @@
- Implement support for 1.30 style shadow compares which only return a float
instead of a vec4.
+
+- Implement support for gl_ClipDistance. This is non-trivial because
+ gl_ClipDistance is exposed as a float[8], but all hardware actually
+ implements it as vec4[2]. \ No newline at end of file
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 61012b850a..5d9d35b2d9 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -1063,7 +1063,7 @@ ast_function_expression::hir(exec_list *instructions,
* "It is an error to construct matrices from other matrices. This
* is reserved for future use."
*/
- if ((state->language_version <= 110) && (matrix_parameters > 0)
+ if (state->language_version == 110 && matrix_parameters > 0
&& constructor_type->is_matrix()) {
_mesa_glsl_error(& loc, state, "cannot construct `%s' from a "
"matrix in GLSL 1.10",
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 762f802c2b..31bb40dd13 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -62,6 +62,8 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
_mesa_glsl_initialize_variables(instructions, state);
_mesa_glsl_initialize_functions(instructions, state);
+ state->symbols->language_version = state->language_version;
+
state->current_function = NULL;
/* Section 4.2 of the GLSL 1.20 specification states:
@@ -514,6 +516,12 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
_mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment");
error_emitted = true;
}
+
+ if (state->es_shader && lhs->type->is_array()) {
+ _mesa_glsl_error(&lhs_loc, state, "whole array assignment is not "
+ "allowed in GLSL ES 1.00.");
+ error_emitted = true;
+ }
}
ir_rvalue *new_rhs = validate_assignment(state, lhs->type, rhs);
@@ -628,8 +636,8 @@ ast_expression::hir(exec_list *instructions,
ir_binop_greater,
ir_binop_lequal,
ir_binop_gequal,
- ir_binop_equal,
- ir_binop_nequal,
+ ir_binop_all_equal,
+ ir_binop_any_nequal,
ir_binop_bit_and,
ir_binop_bit_xor,
ir_binop_bit_or,
@@ -1125,6 +1133,17 @@ ast_expression::hir(exec_list *instructions,
type = op[1]->type;
}
+ /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec:
+ *
+ * "The second and third expressions must be the same type, but can
+ * be of any type other than an array."
+ */
+ if ((state->language_version <= 110) && type->is_array()) {
+ _mesa_glsl_error(& loc, state, "Second and third operands of ?: "
+ "operator must not be arrays.");
+ error_emitted = true;
+ }
+
ir_constant *cond_val = op[0]->constant_expression_value();
ir_constant *then_val = op[1]->constant_expression_value();
ir_constant *else_val = op[2]->constant_expression_value();
@@ -1461,7 +1480,7 @@ ast_compound_statement::hir(exec_list *instructions,
static const glsl_type *
-process_array_type(const glsl_type *base, ast_node *array_size,
+process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size,
struct _mesa_glsl_parse_state *state)
{
unsigned length = 0;
@@ -1497,6 +1516,12 @@ process_array_type(const glsl_type *base, ast_node *array_size,
}
}
}
+ } else if (state->es_shader) {
+ /* Section 10.17 of the GLSL ES 1.00 specification states that unsized
+ * array declarations have been removed from the language.
+ */
+ _mesa_glsl_error(loc, state, "unsized array declarations are not "
+ "allowed in GLSL ES 1.00.");
}
return glsl_type::get_array_instance(base, length);
@@ -1517,7 +1542,8 @@ ast_type_specifier::glsl_type(const char **name,
*name = this->type_name;
if (this->is_array) {
- type = process_array_type(type, this->array_size, state);
+ YYLTYPE loc = this->get_location();
+ type = process_array_type(&loc, type, this->array_size, state);
}
}
@@ -1604,7 +1630,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
qual_string);
}
- if (var->type->is_array() && (state->language_version >= 120)) {
+ if (var->type->is_array() && state->language_version != 110) {
var->array_lvalue = true;
}
}
@@ -1714,7 +1740,8 @@ ast_declarator_list::hir(exec_list *instructions,
}
if (decl->is_array) {
- var_type = process_array_type(decl_type, decl->array_size, state);
+ var_type = process_array_type(&loc, decl_type, decl->array_size,
+ state);
} else {
var_type = decl_type;
}
@@ -2129,7 +2156,7 @@ ast_parameter_declarator::hir(exec_list *instructions,
* call already handled the "vec4[..] foo" case.
*/
if (this->is_array) {
- type = process_array_type(type, this->array_size, state);
+ type = process_array_type(&loc, type, this->array_size, state);
}
if (type->array_size() == 0) {
@@ -2258,7 +2285,7 @@ ast_function::hir(exec_list *instructions,
* that the previously seen signature does not have an associated definition.
*/
f = state->symbols->get_function(name);
- if (f != NULL && !f->is_builtin) {
+ if (f != NULL && (state->es_shader || !f->has_builtin_signature())) {
sig = f->exact_matching_signature(&hir_parameters);
if (sig != NULL) {
const char *badvar = sig->qualifiers_match(&hir_parameters);
@@ -2694,16 +2721,26 @@ ast_struct_specifier::hir(exec_list *instructions,
decl_list->type->specifier->hir(instructions, state);
+ /* Section 10.9 of the GLSL ES 1.00 specification states that
+ * embedded structure definitions have been removed from the language.
+ */
+ if (state->es_shader && decl_list->type->specifier->structure != NULL) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state, "Embedded structure definitions are "
+ "not allowed in GLSL ES 1.00.");
+ }
+
const glsl_type *decl_type =
decl_list->type->specifier->glsl_type(& type_name, state);
foreach_list_typed (ast_declaration, decl, link,
&decl_list->declarations) {
- const struct glsl_type *const field_type =
- (decl->is_array)
- ? process_array_type(decl_type, decl->array_size, state)
- : decl_type;
-
+ const struct glsl_type *field_type = decl_type;
+ if (decl->is_array) {
+ YYLTYPE loc = decl->get_location();
+ field_type = process_array_type(&loc, decl_type, decl->array_size,
+ state);
+ }
fields[i].type = (field_type != NULL)
? field_type : glsl_type::error_type;
fields[i].name = decl->identifier;
diff --git a/src/glsl/builtin_function.cpp b/src/glsl/builtin_function.cpp
index 892b5aa857..1e633e3f3a 100644
--- a/src/glsl/builtin_function.cpp
+++ b/src/glsl/builtin_function.cpp
@@ -35,9 +35,11 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
+ GLcontext fakeCtx;
+ fakeCtx.API = API_OPENGL;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
- new(sh) _mesa_glsl_parse_state(NULL, target, sh);
+ new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
st->language_version = 130;
st->symbols->language_version = 130;
@@ -60,6 +62,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
if (st->error) {
printf("error reading builtin: %.35s ...\n", functions[i]);
+ printf("Info log:\n%s\n", st->info_log);
talloc_free(sh);
return NULL;
}
@@ -316,25 +319,23 @@ static const char *builtin_atan =
" (\n"
" (declare () float r)\n"
" (declare ( ) float abs_retval)\n"
- " (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) ))\n"
- ") \n"
+ " (assign (constant bool (1)) (x) (var_ref abs_retval) (call abs ((var_ref x) ))\n"
+ ")\n"
" (if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) (\n"
" (declare ( ) float atan_retval)\n"
- " (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))\n"
- ") \n"
- " (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) ) \n"
+ " (assign (constant bool (1)) (x) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))\n"
+ ")\n"
+ " (assign (constant bool (1)) (x) (var_ref r) (var_ref atan_retval) )\n"
" (if (expression bool < (var_ref x) (constant float (0.000000)) ) (\n"
- "\n"
- "\n"
" (if (expression bool >= (var_ref y) (constant float (0.000000)) ) (\n"
" (declare ( ) float assignment_tmp)\n"
- " (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) ) \n"
- " (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) \n"
+ " (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) )\n"
+ " (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )\n"
" )\n"
" (\n"
" (declare ( ) float assignment_tmp)\n"
- " (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) ) \n"
- " (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) ) \n"
+ " (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) )\n"
+ " (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )\n"
" ))\n"
"\n"
" )\n"
@@ -343,11 +344,9 @@ static const char *builtin_atan =
"\n"
" )\n"
" (\n"
- "\n"
" (declare () float sgn)\n"
- " (assign (constant bool (1)) (var_ref sgn) (expression float sign (var_ref y)))\n"
- " (assign (constant bool (1)) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965))))\n"
- "\n"
+ " (assign (constant bool (1)) (x) (var_ref sgn) (expression float sign (var_ref y)))\n"
+ " (assign (constant bool (1)) (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965))))\n"
" ))\n"
"\n"
" (return (var_ref r) )\n"
@@ -360,12 +359,10 @@ static const char *builtin_atan =
" (declare (in) vec2 y)\n"
" (declare (in) vec2 x))\n"
" ((declare () vec2 r)\n"
- " (assign (constant bool (1))\n"
- " (swiz x (var_ref r))\n"
+ " (assign (constant bool (1)) (x) (var_ref r)\n"
" (call atan ((swiz x (var_ref y))\n"
" (swiz x (var_ref x)))))\n"
- " (assign (constant bool (1))\n"
- " (swiz y (var_ref r))\n"
+ " (assign (constant bool (1)) (y) (var_ref r)\n"
" (call atan ((swiz y (var_ref y))\n"
" (swiz y (var_ref x)))))\n"
" (return (var_ref r))))\n"
@@ -375,16 +372,13 @@ static const char *builtin_atan =
" (declare (in) vec3 y)\n"
" (declare (in) vec3 x))\n"
" ((declare () vec3 r)\n"
- " (assign (constant bool (1))\n"
- " (swiz x (var_ref r))\n"
+ " (assign (constant bool (1)) (x) (var_ref r)\n"
" (call atan ((swiz x (var_ref y))\n"
" (swiz x (var_ref x)))))\n"
- " (assign (constant bool (1))\n"
- " (swiz y (var_ref r))\n"
+ " (assign (constant bool (1)) (y) (var_ref r)\n"
" (call atan ((swiz y (var_ref y))\n"
" (swiz y (var_ref x)))))\n"
- " (assign (constant bool (1))\n"
- " (swiz z (var_ref r))\n"
+ " (assign (constant bool (1)) (z) (var_ref r)\n"
" (call atan ((swiz z (var_ref y))\n"
" (swiz z (var_ref x)))))\n"
" (return (var_ref r))))\n"
@@ -394,20 +388,16 @@ static const char *builtin_atan =
" (declare (in) vec4 y)\n"
" (declare (in) vec4 x))\n"
" ((declare () vec4 r)\n"
- " (assign (constant bool (1))\n"
- " (swiz x (var_ref r))\n"
+ " (assign (constant bool (1)) (x) (var_ref r)\n"
" (call atan ((swiz x (var_ref y))\n"
" (swiz x (var_ref x)))))\n"
- " (assign (constant bool (1))\n"
- " (swiz y (var_ref r))\n"
+ " (assign (constant bool (1)) (y) (var_ref r)\n"
" (call atan ((swiz y (var_ref y))\n"
" (swiz y (var_ref x)))))\n"
- " (assign (constant bool (1))\n"
- " (swiz z (var_ref r))\n"
+ " (assign (constant bool (1)) (z) (var_ref r)\n"
" (call atan ((swiz z (var_ref y))\n"
" (swiz z (var_ref x)))))\n"
- " (assign (constant bool (1))\n"
- " (swiz w (var_ref r))\n"
+ " (assign (constant bool (1)) (w) (var_ref r)\n"
" (call atan ((swiz w (var_ref y))\n"
" (swiz w (var_ref x)))))\n"
" (return (var_ref r)))))\n"
@@ -735,16 +725,14 @@ static const char *builtin_distance =
" (parameters\n"
" (declare (in) float p0)\n"
" (declare (in) float p1))\n"
- " ((declare () float p)\n"
- " (assign (constant bool (1)) (var_ref p) (expression float - (var_ref p0) (var_ref p1)))\n"
- " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
+ " ((return (expression float abs (expression float - (var_ref p0) (var_ref p1))))))\n"
"\n"
" (signature float\n"
" (parameters\n"
" (declare (in) vec2 p0)\n"
" (declare (in) vec2 p1))\n"
" ((declare () vec2 p)\n"
- " (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))\n"
+ " (assign (constant bool (1)) (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))\n"
" (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
"\n"
" (signature float\n"
@@ -752,7 +740,7 @@ static const char *builtin_distance =
" (declare (in) vec3 p0)\n"
" (declare (in) vec3 p1))\n"
" ((declare () vec3 p)\n"
- " (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))\n"
+ " (assign (constant bool (1)) (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))\n"
" (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
"\n"
" (signature float\n"
@@ -760,7 +748,7 @@ static const char *builtin_distance =
" (declare (in) vec4 p0)\n"
" (declare (in) vec4 p1))\n"
" ((declare () vec4 p)\n"
- " (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))\n"
+ " (assign (constant bool (1)) (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))\n"
" (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n"
"))\n"
""
@@ -771,7 +759,7 @@ static const char *builtin_dot =
" (parameters\n"
" (declare (in) float arg0)\n"
" (declare (in) float arg1))\n"
- " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n"
+ " ((return (expression float * (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature float\n"
" (parameters\n"
@@ -799,121 +787,73 @@ static const char *builtin_equal =
" (parameters\n"
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec2\n"
" (parameters\n"
" (declare (in) bvec2 arg0)\n"
" (declare (in) bvec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) bvec3 arg0)\n"
" (declare (in) bvec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) bvec4 arg0)\n"
" (declare (in) bvec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec2\n"
" (parameters\n"
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec2\n"
" (parameters\n"
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))\n"
"))\n"
""
;
@@ -972,7 +912,7 @@ static const char *builtin_faceforward =
" (declare (in) float N)\n"
" (declare (in) float I)\n"
" (declare (in) float Nref))\n"
- " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n"
+ " ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0)))\n"
" ((return (var_ref N)))\n"
" ((return (expression float neg (var_ref N)))))))\n"
"\n"
@@ -1105,8 +1045,8 @@ static const char *builtin_greaterThan =
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1114,9 +1054,9 @@ static const char *builtin_greaterThan =
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1124,10 +1064,10 @@ static const char *builtin_greaterThan =
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1135,8 +1075,8 @@ static const char *builtin_greaterThan =
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1144,9 +1084,9 @@ static const char *builtin_greaterThan =
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1154,10 +1094,10 @@ static const char *builtin_greaterThan =
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1165,8 +1105,8 @@ static const char *builtin_greaterThan =
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1174,9 +1114,9 @@ static const char *builtin_greaterThan =
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1184,10 +1124,10 @@ static const char *builtin_greaterThan =
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"))\n"
""
@@ -1199,8 +1139,8 @@ static const char *builtin_greaterThanEqual =
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1208,9 +1148,9 @@ static const char *builtin_greaterThanEqual =
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1218,10 +1158,10 @@ static const char *builtin_greaterThanEqual =
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1229,8 +1169,8 @@ static const char *builtin_greaterThanEqual =
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1238,9 +1178,9 @@ static const char *builtin_greaterThanEqual =
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1248,10 +1188,10 @@ static const char *builtin_greaterThanEqual =
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1259,8 +1199,8 @@ static const char *builtin_greaterThanEqual =
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1268,9 +1208,9 @@ static const char *builtin_greaterThanEqual =
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1278,10 +1218,10 @@ static const char *builtin_greaterThanEqual =
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"))\n"
""
@@ -1315,7 +1255,7 @@ static const char *builtin_length =
" (signature float\n"
" (parameters\n"
" (declare (in) float arg0))\n"
- " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n"
+ " ((return (expression float abs (var_ref arg0)))))\n"
"\n"
" (signature float\n"
" (parameters\n"
@@ -1341,8 +1281,8 @@ static const char *builtin_lessThan =
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1350,9 +1290,9 @@ static const char *builtin_lessThan =
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1360,10 +1300,10 @@ static const char *builtin_lessThan =
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1371,8 +1311,8 @@ static const char *builtin_lessThan =
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1380,9 +1320,9 @@ static const char *builtin_lessThan =
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1390,10 +1330,10 @@ static const char *builtin_lessThan =
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1401,8 +1341,8 @@ static const char *builtin_lessThan =
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1410,9 +1350,9 @@ static const char *builtin_lessThan =
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1420,10 +1360,10 @@ static const char *builtin_lessThan =
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"))\n"
""
@@ -1435,8 +1375,8 @@ static const char *builtin_lessThanEqual =
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1444,9 +1384,9 @@ static const char *builtin_lessThanEqual =
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1454,10 +1394,10 @@ static const char *builtin_lessThanEqual =
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1465,8 +1405,8 @@ static const char *builtin_lessThanEqual =
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1474,9 +1414,9 @@ static const char *builtin_lessThanEqual =
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1484,10 +1424,10 @@ static const char *builtin_lessThanEqual =
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec2\n"
@@ -1495,8 +1435,8 @@ static const char *builtin_lessThanEqual =
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
" ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec3\n"
@@ -1504,9 +1444,9 @@ static const char *builtin_lessThanEqual =
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
" ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"\n"
" (signature bvec4\n"
@@ -1514,10 +1454,10 @@ static const char *builtin_lessThanEqual =
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
" ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
+ " (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
+ " (assign (constant bool (1)) (w) (var_ref temp) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
" (return (var_ref temp))))\n"
"))\n"
""
@@ -1577,8 +1517,8 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat2 x)\n"
" (declare (in) mat2 y))\n"
" ((declare () mat2 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat3\n"
@@ -1586,9 +1526,9 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat3 x)\n"
" (declare (in) mat3 y))\n"
" ((declare () mat3 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat4\n"
@@ -1596,10 +1536,10 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat4 x)\n"
" (declare (in) mat4 y))\n"
" ((declare () mat4 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat2x3\n"
@@ -1607,8 +1547,8 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat2x3 x)\n"
" (declare (in) mat2x3 y))\n"
" ((declare () mat2x3 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat3x2\n"
@@ -1616,9 +1556,9 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat3x2 x)\n"
" (declare (in) mat3x2 y))\n"
" ((declare () mat3x2 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat2x4\n"
@@ -1626,8 +1566,8 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat2x4 x)\n"
" (declare (in) mat2x4 y))\n"
" ((declare () mat2x4 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat4x2\n"
@@ -1635,10 +1575,10 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat4x2 x)\n"
" (declare (in) mat4x2 y))\n"
" ((declare () mat4x2 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat3x4\n"
@@ -1646,9 +1586,9 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat3x4 x)\n"
" (declare (in) mat3x4 y))\n"
" ((declare () mat3x4 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n"
"(return (var_ref z))))\n"
"\n"
" (signature mat4x3\n"
@@ -1656,10 +1596,10 @@ static const char *builtin_matrixCompMult =
" (declare (in) mat4x3 x)\n"
" (declare (in) mat4x3 y))\n"
" ((declare () mat4x3 z)\n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) \n"
- " (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) \n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))\n"
"(return (var_ref z))))\n"
"))\n"
""
@@ -1988,8 +1928,8 @@ static const char *builtin_mix =
" (declare (in) vec2 v1)\n"
" (declare (in) vec2 v2)\n"
" (declare (in) bvec2 a))\n"
- " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n"
- " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n"
+ " ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))\n"
+ " (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))\n"
" (return (var_ref v1))))\n"
"\n"
" (signature vec3\n"
@@ -1997,9 +1937,9 @@ static const char *builtin_mix =
" (declare (in) vec3 v1)\n"
" (declare (in) vec3 v2)\n"
" (declare (in) bvec3 a))\n"
- " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n"
- " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n"
- " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n"
+ " ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))\n"
+ " (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))\n"
+ " (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2)))\n"
" (return (var_ref v1))))\n"
"\n"
" (signature vec4\n"
@@ -2007,10 +1947,10 @@ static const char *builtin_mix =
" (declare (in) vec4 v1)\n"
" (declare (in) vec4 v2)\n"
" (declare (in) bvec4 a))\n"
- " ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))\n"
- " (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))\n"
- " (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))\n"
- " (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))\n"
+ " ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))\n"
+ " (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))\n"
+ " (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2)))\n"
+ " (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2)))\n"
" (return (var_ref v1))))\n"
"))\n"
""
@@ -2066,82 +2006,259 @@ static const char *builtin_noise1 =
" (signature float\n"
" (parameters\n"
" (declare (in) float x))\n"
- " ((return (constant float (0)))))\n"
+ " ((return (expression float noise (var_ref x)))))\n"
" (signature float\n"
" (parameters\n"
" (declare (in) vec2 x))\n"
- " ((return (constant float (0)))))\n"
+ " ((return (expression float noise (var_ref x)))))\n"
" (signature float\n"
" (parameters\n"
" (declare (in) vec3 x))\n"
- " ((return (constant float (0)))))\n"
+ " ((return (expression float noise (var_ref x)))))\n"
" (signature float\n"
" (parameters\n"
" (declare (in) vec4 x))\n"
- " ((return (constant float (0)))))\n"
+ " ((return (expression float noise (var_ref x)))))\n"
"))\n"
""
;
static const char *builtin_noise2 =
"((function noise2\n"
- " (signature vec2\n"
- " (parameters\n"
- " (declare (in) float x))\n"
- " ((return (constant vec2 (0 0)))))\n"
- " (signature vec2\n"
- " (parameters\n"
- " (declare (in) vec2 x))\n"
- " ((return (constant vec2 (0 0)))))\n"
- " (signature vec2\n"
- " (parameters\n"
- " (declare (in) vec3 x))\n"
- " ((return (constant vec2 (0 0)))))\n"
- " (signature vec2\n"
- " (parameters\n"
- " (declare (in) vec4 x))\n"
- " ((return (constant vec2 (0 0)))))\n"
+ " (signature vec2\n"
+ " (parameters (declare (in) vec4 p))\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () vec2 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters (declare (in) vec3 p))\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () vec2 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in ) vec2 p)\n"
+ " )\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () vec2 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
+ "\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in ) float p)\n"
+ " )\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () vec2 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
"))\n"
""
;
static const char *builtin_noise3 =
"((function noise3\n"
- " (signature vec3\n"
- " (parameters\n"
- " (declare (in) float x))\n"
- " ((return (constant vec3 (0 0 0)))))\n"
- " (signature vec3\n"
- " (parameters\n"
- " (declare (in) vec2 x))\n"
- " ((return (constant vec3 (0 0 0)))))\n"
- " (signature vec3\n"
- " (parameters\n"
- " (declare (in) vec3 x))\n"
- " ((return (constant vec3 (0 0 0)))))\n"
- " (signature vec3\n"
- " (parameters\n"
- " (declare (in) vec4 x))\n"
- " ((return (constant vec3 (0 0 0)))))\n"
+ " (signature vec3\n"
+ " (parameters (declare (in) vec4 p))\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () float c)\n"
+ " (declare () vec3 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters (declare (in) vec3 p))\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () float c)\n"
+ " (declare () vec3 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters (declare (in) vec2 p))\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () float c)\n"
+ " (declare () vec3 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
+ "\n"
+ " (signature vec3\n"
+ " (parameters (declare (in) float p))\n"
+ " (\n"
+ " (declare () float a)\n"
+ " (declare () float b)\n"
+ " (declare () float c)\n"
+ " (declare () vec3 t)\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))\n"
+ " (return (var_ref t))\n"
+ " ))\n"
"))\n"
""
;
static const char *builtin_noise4 =
"((function noise4\n"
- " (signature vec4\n"
- " (parameters\n"
- " (declare (in) float x))\n"
- " ((return (constant vec4 (0 0 0 0)))))\n"
- " (signature vec4\n"
- " (parameters\n"
- " (declare (in) vec2 x))\n"
- " ((return (constant vec4 (0 0 0 0)))))\n"
- " (signature vec4\n"
- " (parameters\n"
- " (declare (in) vec3 x))\n"
- " ((return (constant vec4 (0 0 0 0)))))\n"
- " (signature vec4\n"
- " (parameters\n"
- " (declare (in) vec4 x))\n"
- " ((return (constant vec4 (0 0 0 0)))))\n"
+ " (signature vec4\n"
+ " (parameters (declare (in) vec4 p))\n"
+ " (\n"
+ " (declare () float _x)\n"
+ " (declare () float _y)\n"
+ " (declare () float _z)\n"
+ " (declare () float _w)\n"
+ " (declare () vec4 _r)\n"
+ "\n"
+ " (declare () vec4 _p)\n"
+ " (assign (constant bool (1)) (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) )\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n"
+ " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n"
+ " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n"
+ " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n"
+ " (return (var_ref _r))\n"
+ " ))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters (declare (in) vec3 p))\n"
+ " (\n"
+ " (declare () float _x)\n"
+ " (declare () float _y)\n"
+ " (declare () float _z)\n"
+ " (declare () float _w)\n"
+ " (declare () vec4 _r)\n"
+ "\n"
+ " (declare () vec3 _p)\n"
+ " (assign (constant bool (1)) (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) )\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n"
+ " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n"
+ " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n"
+ " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n"
+ " (return (var_ref _r))\n"
+ " ))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters (declare (in) vec2 p))\n"
+ " (\n"
+ " (declare () float _x)\n"
+ " (declare () float _y)\n"
+ " (declare () float _z)\n"
+ " (declare () float _w)\n"
+ " (declare () vec4 _r)\n"
+ "\n"
+ " (declare () vec2 _p)\n"
+ " (assign (constant bool (1)) (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) )\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n"
+ " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n"
+ " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n"
+ " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n"
+ " (return (var_ref _r))\n"
+ " ))\n"
+ "\n"
+ " (signature vec4\n"
+ " (parameters (declare (in) float p))\n"
+ " (\n"
+ " (declare () float _x)\n"
+ " (declare () float _y)\n"
+ " (declare () float _z)\n"
+ " (declare () float _w)\n"
+ " (declare () vec4 _r)\n"
+ "\n"
+ " (declare () float _p)\n"
+ " (assign (constant bool (1)) (xy) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) )\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0 313.0 29.0 277.0)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))\n"
+ " (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0 313.0 29.0 277.0)))))\n"
+ "\n"
+ " (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))\n"
+ " (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))\n"
+ " (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))\n"
+ " (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))\n"
+ " (return (var_ref _r))\n"
+ " ))\n"
"))\n"
""
;
@@ -2150,7 +2267,7 @@ static const char *builtin_normalize =
" (signature float\n"
" (parameters\n"
" (declare (in) float arg0))\n"
- " ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))\n"
+ " ((return (expression float sign (var_ref arg0)))))\n"
"\n"
" (signature vec2\n"
" (parameters\n"
@@ -2194,121 +2311,73 @@ static const char *builtin_notEqual =
" (parameters\n"
" (declare (in) vec2 arg0)\n"
" (declare (in) vec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) vec3 arg0)\n"
" (declare (in) vec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) vec4 arg0)\n"
" (declare (in) vec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec2\n"
" (parameters\n"
" (declare (in) bvec2 arg0)\n"
" (declare (in) bvec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) bvec3 arg0)\n"
" (declare (in) bvec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) bvec4 arg0)\n"
" (declare (in) bvec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec2\n"
" (parameters\n"
" (declare (in) ivec2 arg0)\n"
" (declare (in) ivec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) ivec3 arg0)\n"
" (declare (in) ivec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) ivec4 arg0)\n"
" (declare (in) ivec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))\n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec2\n"
" (parameters\n"
" (declare (in) uvec2 arg0)\n"
" (declare (in) uvec2 arg1))\n"
- " ((declare () bvec2 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec3\n"
" (parameters\n"
" (declare (in) uvec3 arg0)\n"
" (declare (in) uvec3 arg1))\n"
- " ((declare () bvec3 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"\n"
" (signature bvec4\n"
" (parameters\n"
" (declare (in) uvec4 arg0)\n"
" (declare (in) uvec4 arg1))\n"
- " ((declare () bvec4 temp)\n"
- " (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1)))) \n"
- " (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1)))) \n"
- " (return (var_ref temp))))\n"
+ " ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))\n"
"))\n"
""
;
@@ -2319,8 +2388,8 @@ static const char *builtin_outerProduct =
" (declare (in) vec2 u)\n"
" (declare (in) vec2 v))\n"
" ((declare () mat2 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat2x3\n"
@@ -2328,8 +2397,8 @@ static const char *builtin_outerProduct =
" (declare (in) vec3 u)\n"
" (declare (in) vec2 v))\n"
" ((declare () mat2x3 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat2x4\n"
@@ -2337,8 +2406,8 @@ static const char *builtin_outerProduct =
" (declare (in) vec4 u)\n"
" (declare (in) vec2 v))\n"
" ((declare () mat2x4 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat3x2\n"
@@ -2346,9 +2415,9 @@ static const char *builtin_outerProduct =
" (declare (in) vec2 u)\n"
" (declare (in) vec3 v))\n"
" ((declare () mat3x2 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n"
" (return (var_ref m))\n"
" ))\n"
"\n"
@@ -2357,9 +2426,9 @@ static const char *builtin_outerProduct =
" (declare (in) vec3 u)\n"
" (declare (in) vec3 v))\n"
" ((declare () mat3 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat3x4\n"
@@ -2367,9 +2436,9 @@ static const char *builtin_outerProduct =
" (declare (in) vec4 u)\n"
" (declare (in) vec3 v))\n"
" ((declare () mat3x4 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat4x2\n"
@@ -2377,10 +2446,10 @@ static const char *builtin_outerProduct =
" (declare (in) vec2 u)\n"
" (declare (in) vec4 v))\n"
" ((declare () mat4x2 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n"
+ " (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat4x3\n"
@@ -2388,10 +2457,10 @@ static const char *builtin_outerProduct =
" (declare (in) vec3 u)\n"
" (declare (in) vec4 v))\n"
" ((declare () mat4x3 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))\n"
" (return (var_ref m))))\n"
"\n"
" (signature mat4\n"
@@ -2399,10 +2468,10 @@ static const char *builtin_outerProduct =
" (declare (in) vec4 u)\n"
" (declare (in) vec4 v))\n"
" ((declare () mat4 m)\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n"
- " (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n"
+ " (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))\n"
" (return (var_ref m))))\n"
"))\n"
""
@@ -2470,7 +2539,7 @@ static const char *builtin_reflect =
" (expression float *\n"
" (constant float (2.0))\n"
" (expression float *\n"
- " (expression float dot\n"
+ " (expression float *\n"
" (var_ref n)\n"
" (var_ref i))\n"
" (var_ref n)))))))\n"
@@ -2528,14 +2597,14 @@ static const char *builtin_refract =
" (declare (in) float n)\n"
" (declare (in) float eta))\n"
" ((declare () float k)\n"
- " (assign (constant bool (1)) (var_ref k)\n"
+ " (assign (constant bool (1)) (x) (var_ref k)\n"
" (expression float - (constant float (1.0))\n"
" (expression float * (var_ref eta)\n"
" (expression float * (var_ref eta)\n"
" (expression float - (constant float (1.0))\n"
" (expression float * \n"
- " (expression float dot (var_ref n) (var_ref i))\n"
- " (expression float dot (var_ref n) (var_ref i))))))))\n"
+ " (expression float * (var_ref n) (var_ref i))\n"
+ " (expression float * (var_ref n) (var_ref i))))))))\n"
" (if (expression bool < (var_ref k) (constant float (0.0)))\n"
" ((return (constant float (0.0))))\n"
" ((return (expression float -\n"
@@ -2543,7 +2612,7 @@ static const char *builtin_refract =
" (expression float *\n"
" (expression float +\n"
" (expression float * (var_ref eta)\n"
- " (expression float dot (var_ref n) (var_ref i)))\n"
+ " (expression float * (var_ref n) (var_ref i)))\n"
" (expression float sqrt (var_ref k)))\n"
" (var_ref n))))))))\n"
"\n"
@@ -2553,7 +2622,7 @@ static const char *builtin_refract =
" (declare (in) vec2 n)\n"
" (declare (in) float eta))\n"
" ((declare () float k)\n"
- " (assign (constant bool (1)) (var_ref k)\n"
+ " (assign (constant bool (1)) (x) (var_ref k)\n"
" (expression float - (constant float (1.0))\n"
" (expression float * (var_ref eta)\n"
" (expression float * (var_ref eta)\n"
@@ -2578,7 +2647,7 @@ static const char *builtin_refract =
" (declare (in) vec3 n)\n"
" (declare (in) float eta))\n"
" ((declare () float k)\n"
- " (assign (constant bool (1)) (var_ref k)\n"
+ " (assign (constant bool (1)) (x) (var_ref k)\n"
" (expression float - (constant float (1.0))\n"
" (expression float * (var_ref eta)\n"
" (expression float * (var_ref eta)\n"
@@ -2603,7 +2672,7 @@ static const char *builtin_refract =
" (declare (in) vec4 n)\n"
" (declare (in) float eta))\n"
" ((declare () float k)\n"
- " (assign (constant bool (1)) (var_ref k)\n"
+ " (assign (constant bool (1)) (x) (var_ref k)\n"
" (expression float - (constant float (1.0))\n"
" (expression float * (var_ref eta)\n"
" (expression float * (var_ref eta)\n"
@@ -2919,7 +2988,7 @@ static const char *builtin_smoothstep =
" (declare (in) float x))\n"
" ((declare () float t)\n"
"\n"
- " (assign (constant bool (1)) (var_ref t)\n"
+ " (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
@@ -2935,21 +3004,21 @@ static const char *builtin_smoothstep =
" ((declare () vec2 t)\n"
" (declare () vec2 retval)\n"
"\n"
- " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
"\n"
- " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (assign (constant bool (1)) (y) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
" (return (var_ref retval))\n"
" ))\n"
"\n"
@@ -2961,29 +3030,29 @@ static const char *builtin_smoothstep =
" ((declare () vec3 t)\n"
" (declare () vec3 retval)\n"
"\n"
- " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
"\n"
- " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (assign (constant bool (1)) (y) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
"\n"
- " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (assign (constant bool (1)) (z) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
" (return (var_ref retval))\n"
" ))\n"
"\n"
@@ -2996,37 +3065,37 @@ static const char *builtin_smoothstep =
" ((declare () vec4 t)\n"
" (declare () vec4 retval)\n"
"\n"
- " (assign (constant bool (1)) (swiz x (var_ref t))\n"
+ " (assign (constant bool (1)) (x) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))\n"
"\n"
- " (assign (constant bool (1)) (swiz y (var_ref t))\n"
+ " (assign (constant bool (1)) (y) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))\n"
"\n"
- " (assign (constant bool (1)) (swiz z (var_ref t))\n"
+ " (assign (constant bool (1)) (z) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))\n"
"\n"
- " (assign (constant bool (1)) (swiz w (var_ref t))\n"
+ " (assign (constant bool (1)) (w) (var_ref t)\n"
" (expression float max\n"
" (expression float min\n"
" (expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n"
" (constant float (1.0)))\n"
" (constant float (0.0))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
+ " (assign (constant bool (1)) (w) (var_ref retval) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))\n"
" (return (var_ref retval))\n"
" ))\n"
"\n"
@@ -3103,8 +3172,8 @@ static const char *builtin_step =
" (declare (in) float edge)\n"
" (declare (in) vec2 x))\n"
" ((declare () vec2 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n"
" (return (var_ref t))))\n"
"\n"
" (signature vec3\n"
@@ -3112,9 +3181,9 @@ static const char *builtin_step =
" (declare (in) float edge)\n"
" (declare (in) vec3 x))\n"
" ((declare () vec3 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n"
" (return (var_ref t))))\n"
"\n"
" (signature vec4\n"
@@ -3122,10 +3191,10 @@ static const char *builtin_step =
" (declare (in) float edge)\n"
" (declare (in) vec4 x))\n"
" ((declare () vec4 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n"
+ " (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))\n"
" (return (var_ref t))))\n"
"\n"
" (signature vec2\n"
@@ -3133,8 +3202,8 @@ static const char *builtin_step =
" (declare (in) vec2 edge)\n"
" (declare (in) vec2 x))\n"
" ((declare () vec2 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
" (return (var_ref t))))\n"
"\n"
" (signature vec3\n"
@@ -3142,9 +3211,9 @@ static const char *builtin_step =
" (declare (in) vec3 edge)\n"
" (declare (in) vec3 x))\n"
" ((declare () vec3 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n"
" (return (var_ref t))))\n"
"\n"
" (signature vec4\n"
@@ -3152,10 +3221,10 @@ static const char *builtin_step =
" (declare (in) vec4 edge)\n"
" (declare (in) vec4 x))\n"
" ((declare () vec4 t)\n"
- " (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
- " (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
- " (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge)))))\n"
- " (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n"
+ " (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))\n"
" (return (var_ref t))))\n"
"))\n"
"\n"
@@ -4638,135 +4707,135 @@ static const char *builtin_transpose =
" (parameters\n"
" (declare (in) mat2 m))\n"
" ((declare () mat2 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat3x2\n"
" (parameters\n"
" (declare (in) mat2x3 m))\n"
" ((declare () mat3x2 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat4x2\n"
" (parameters\n"
" (declare (in) mat2x4 m))\n"
" ((declare () mat4x2 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat2x3\n"
" (parameters\n"
" (declare (in) mat3x2 m))\n"
" ((declare () mat2x3 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat3\n"
" (parameters\n"
" (declare (in) mat3 m))\n"
" ((declare () mat3 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat4x3\n"
" (parameters\n"
" (declare (in) mat3x4 m))\n"
" ((declare () mat4x3 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat2x4\n"
" (parameters\n"
" (declare (in) mat4x2 m))\n"
" ((declare () mat2x4 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat3x4\n"
" (parameters\n"
" (declare (in) mat4x3 m))\n"
" ((declare () mat3x4 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3)))))\n"
"(return (var_ref t))))\n"
"\n"
" (signature mat4\n"
" (parameters\n"
" (declare (in) mat4 m))\n"
" ((declare () mat4 t)\n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3))))) \n"
- " (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3))))) \n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3)))))\n"
+ " (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3)))))\n"
"(return (var_ref t))))\n"
")\n"
"\n"
@@ -4774,6 +4843,2334 @@ static const char *builtin_transpose =
"\n"
""
;
+static const char *prototypes_for_100_frag =
+ "(\n"
+ "(function radians\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float degrees))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 degrees))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 degrees))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 degrees))\n"
+ " ()))\n"
+ "(function degrees\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float radians))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 radians))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 radians))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 radians))\n"
+ " ()))\n"
+ "(function sin\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function cos\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function tan\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function asin\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function acos\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function atan\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float y)\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 y)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 y)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 y)\n"
+ " (declare (in) vec4 x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float y_over_x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 y_over_x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 y_over_x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 y_over_x))\n"
+ " ()))\n"
+ "(function pow\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ()))\n"
+ "(function exp\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function log\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function exp2\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function log2\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function sqrt\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function inversesqrt\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function abs\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function sign\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function floor\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function ceil\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function fract\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function mod\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ()))\n"
+ "(function min\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float y))\n"
+ " ()))\n"
+ "(function max\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float y))\n"
+ " ()))\n"
+ "(function clamp\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 minVal)\n"
+ " (declare (in) vec2 maxVal))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 minVal)\n"
+ " (declare (in) vec3 maxVal))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 minVal)\n"
+ " (declare (in) vec4 maxVal))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ()))\n"
+ "(function mix\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y)\n"
+ " (declare (in) float a))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y)\n"
+ " (declare (in) vec2 a))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y)\n"
+ " (declare (in) vec3 a))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y)\n"
+ " (declare (in) vec4 a))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y)\n"
+ " (declare (in) float a))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y)\n"
+ " (declare (in) float a))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y)\n"
+ " (declare (in) float a))\n"
+ " ()))\n"
+ "(function step\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 edge)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 edge)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 edge)\n"
+ " (declare (in) vec4 x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function smoothstep\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 edge0)\n"
+ " (declare (in) vec2 edge1)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 edge0)\n"
+ " (declare (in) vec3 edge1)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 edge0)\n"
+ " (declare (in) vec4 edge1)\n"
+ " (declare (in) vec4 x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function length\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function distance\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float p0)\n"
+ " (declare (in) float p1))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec2 p0)\n"
+ " (declare (in) vec2 p1))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec3 p0)\n"
+ " (declare (in) vec3 p1))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec4 p0)\n"
+ " (declare (in) vec4 p1))\n"
+ " ()))\n"
+ "(function dot\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ()))\n"
+ "(function cross\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ()))\n"
+ "(function normalize\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function faceforward\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float N)\n"
+ " (declare (in) float I)\n"
+ " (declare (in) float Nref))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 N)\n"
+ " (declare (in) vec2 I)\n"
+ " (declare (in) vec2 Nref))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 N)\n"
+ " (declare (in) vec3 I)\n"
+ " (declare (in) vec3 Nref))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 N)\n"
+ " (declare (in) vec4 I)\n"
+ " (declare (in) vec4 Nref))\n"
+ " ()))\n"
+ "(function reflect\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float I)\n"
+ " (declare (in) float N))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 I)\n"
+ " (declare (in) vec2 N))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 I)\n"
+ " (declare (in) vec3 N))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 I)\n"
+ " (declare (in) vec4 N))\n"
+ " ()))\n"
+ "(function refract\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float I)\n"
+ " (declare (in) float N)\n"
+ " (declare (in) float eta))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 I)\n"
+ " (declare (in) vec2 N)\n"
+ " (declare (in) float eta))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 I)\n"
+ " (declare (in) vec3 N)\n"
+ " (declare (in) float eta))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 I)\n"
+ " (declare (in) vec4 N)\n"
+ " (declare (in) float eta))\n"
+ " ()))\n"
+ "(function matrixCompMult\n"
+ " (signature mat2\n"
+ " (parameters\n"
+ " (declare (in) mat2 x)\n"
+ " (declare (in) mat2 y))\n"
+ " ())\n"
+ " (signature mat3\n"
+ " (parameters\n"
+ " (declare (in) mat3 x)\n"
+ " (declare (in) mat3 y))\n"
+ " ())\n"
+ " (signature mat4\n"
+ " (parameters\n"
+ " (declare (in) mat4 x)\n"
+ " (declare (in) mat4 y))\n"
+ " ()))\n"
+ "(function lessThan\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function lessThanEqual\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function greaterThan\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function greaterThanEqual\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function equal\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x)\n"
+ " (declare (in) bvec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x)\n"
+ " (declare (in) bvec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x)\n"
+ " (declare (in) bvec4 y))\n"
+ " ()))\n"
+ "(function notEqual\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x)\n"
+ " (declare (in) bvec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x)\n"
+ " (declare (in) bvec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x)\n"
+ " (declare (in) bvec4 y))\n"
+ " ()))\n"
+ "(function any\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x))\n"
+ " ()))\n"
+ "(function all\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x))\n"
+ " ()))\n"
+ "(function not\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x))\n"
+ " ()))\n"
+ "(function texture2D\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec2 coord))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec2 coord)\n"
+ " (declare (in) float bias))\n"
+ " ()))\n"
+ "(function texture2DProj\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec3 coord))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec4 coord))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec3 coord)\n"
+ " (declare (in) float bias))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec4 coord)\n"
+ " (declare (in) float bias))\n"
+ " ()))\n"
+ "(function textureCube\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) samplerCube sampler)\n"
+ " (declare (in) vec3 coord))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) samplerCube sampler)\n"
+ " (declare (in) vec3 coord)\n"
+ " (declare (in) float bias))\n"
+ " ())))"
+;
+static const char *functions_for_100_frag [] = {
+ builtin_abs,
+ builtin_acos,
+ builtin_all,
+ builtin_any,
+ builtin_asin,
+ builtin_atan,
+ builtin_ceil,
+ builtin_clamp,
+ builtin_cos,
+ builtin_cross,
+ builtin_degrees,
+ builtin_distance,
+ builtin_dot,
+ builtin_equal,
+ builtin_exp,
+ builtin_exp2,
+ builtin_faceforward,
+ builtin_floor,
+ builtin_fract,
+ builtin_greaterThan,
+ builtin_greaterThanEqual,
+ builtin_inversesqrt,
+ builtin_length,
+ builtin_lessThan,
+ builtin_lessThanEqual,
+ builtin_log,
+ builtin_log2,
+ builtin_matrixCompMult,
+ builtin_max,
+ builtin_min,
+ builtin_mix,
+ builtin_mod,
+ builtin_normalize,
+ builtin_not,
+ builtin_notEqual,
+ builtin_pow,
+ builtin_radians,
+ builtin_reflect,
+ builtin_refract,
+ builtin_sign,
+ builtin_sin,
+ builtin_smoothstep,
+ builtin_sqrt,
+ builtin_step,
+ builtin_tan,
+ builtin_texture2D,
+ builtin_texture2DProj,
+ builtin_textureCube,
+};
+static const char *prototypes_for_100_vert =
+ "(\n"
+ "(function radians\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float degrees))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 degrees))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 degrees))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 degrees))\n"
+ " ()))\n"
+ "(function degrees\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float radians))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 radians))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 radians))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 radians))\n"
+ " ()))\n"
+ "(function sin\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function cos\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function tan\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function asin\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function acos\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float angle))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 angle))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 angle))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 angle))\n"
+ " ()))\n"
+ "(function atan\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float y)\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 y)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 y)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 y)\n"
+ " (declare (in) vec4 x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float y_over_x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 y_over_x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 y_over_x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 y_over_x))\n"
+ " ()))\n"
+ "(function pow\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ()))\n"
+ "(function exp\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function log\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function exp2\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function log2\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function sqrt\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function inversesqrt\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function abs\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function sign\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function floor\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function ceil\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function fract\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function mod\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ()))\n"
+ "(function min\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float y))\n"
+ " ()))\n"
+ "(function max\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float y))\n"
+ " ()))\n"
+ "(function clamp\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 minVal)\n"
+ " (declare (in) vec2 maxVal))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 minVal)\n"
+ " (declare (in) vec3 maxVal))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 minVal)\n"
+ " (declare (in) vec4 maxVal))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) float minVal)\n"
+ " (declare (in) float maxVal))\n"
+ " ()))\n"
+ "(function mix\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y)\n"
+ " (declare (in) float a))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y)\n"
+ " (declare (in) vec2 a))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y)\n"
+ " (declare (in) vec3 a))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y)\n"
+ " (declare (in) vec4 a))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y)\n"
+ " (declare (in) float a))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y)\n"
+ " (declare (in) float a))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y)\n"
+ " (declare (in) float a))\n"
+ " ()))\n"
+ "(function step\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 edge)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 edge)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 edge)\n"
+ " (declare (in) vec4 x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) float edge)\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function smoothstep\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 edge0)\n"
+ " (declare (in) vec2 edge1)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 edge0)\n"
+ " (declare (in) vec3 edge1)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 edge0)\n"
+ " (declare (in) vec4 edge1)\n"
+ " (declare (in) vec4 x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) float edge0)\n"
+ " (declare (in) float edge1)\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function length\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function distance\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float p0)\n"
+ " (declare (in) float p1))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec2 p0)\n"
+ " (declare (in) vec2 p1))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec3 p0)\n"
+ " (declare (in) vec3 p1))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec4 p0)\n"
+ " (declare (in) vec4 p1))\n"
+ " ()))\n"
+ "(function dot\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x)\n"
+ " (declare (in) float y))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ()))\n"
+ "(function cross\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ()))\n"
+ "(function normalize\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float x))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x))\n"
+ " ()))\n"
+ "(function faceforward\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float N)\n"
+ " (declare (in) float I)\n"
+ " (declare (in) float Nref))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 N)\n"
+ " (declare (in) vec2 I)\n"
+ " (declare (in) vec2 Nref))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 N)\n"
+ " (declare (in) vec3 I)\n"
+ " (declare (in) vec3 Nref))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 N)\n"
+ " (declare (in) vec4 I)\n"
+ " (declare (in) vec4 Nref))\n"
+ " ()))\n"
+ "(function reflect\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float I)\n"
+ " (declare (in) float N))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 I)\n"
+ " (declare (in) vec2 N))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 I)\n"
+ " (declare (in) vec3 N))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 I)\n"
+ " (declare (in) vec4 N))\n"
+ " ()))\n"
+ "(function refract\n"
+ " (signature float\n"
+ " (parameters\n"
+ " (declare (in) float I)\n"
+ " (declare (in) float N)\n"
+ " (declare (in) float eta))\n"
+ " ())\n"
+ " (signature vec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 I)\n"
+ " (declare (in) vec2 N)\n"
+ " (declare (in) float eta))\n"
+ " ())\n"
+ " (signature vec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 I)\n"
+ " (declare (in) vec3 N)\n"
+ " (declare (in) float eta))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 I)\n"
+ " (declare (in) vec4 N)\n"
+ " (declare (in) float eta))\n"
+ " ()))\n"
+ "(function matrixCompMult\n"
+ " (signature mat2\n"
+ " (parameters\n"
+ " (declare (in) mat2 x)\n"
+ " (declare (in) mat2 y))\n"
+ " ())\n"
+ " (signature mat3\n"
+ " (parameters\n"
+ " (declare (in) mat3 x)\n"
+ " (declare (in) mat3 y))\n"
+ " ())\n"
+ " (signature mat4\n"
+ " (parameters\n"
+ " (declare (in) mat4 x)\n"
+ " (declare (in) mat4 y))\n"
+ " ()))\n"
+ "(function lessThan\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function lessThanEqual\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function greaterThan\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function greaterThanEqual\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ()))\n"
+ "(function equal\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x)\n"
+ " (declare (in) bvec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x)\n"
+ " (declare (in) bvec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x)\n"
+ " (declare (in) bvec4 y))\n"
+ " ()))\n"
+ "(function notEqual\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) vec2 x)\n"
+ " (declare (in) vec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) vec3 x)\n"
+ " (declare (in) vec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) vec4 x)\n"
+ " (declare (in) vec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) ivec2 x)\n"
+ " (declare (in) ivec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) ivec3 x)\n"
+ " (declare (in) ivec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) ivec4 x)\n"
+ " (declare (in) ivec4 y))\n"
+ " ())\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x)\n"
+ " (declare (in) bvec2 y))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x)\n"
+ " (declare (in) bvec3 y))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x)\n"
+ " (declare (in) bvec4 y))\n"
+ " ()))\n"
+ "(function any\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x))\n"
+ " ()))\n"
+ "(function all\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x))\n"
+ " ())\n"
+ " (signature bool\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x))\n"
+ " ()))\n"
+ "(function not\n"
+ " (signature bvec2\n"
+ " (parameters\n"
+ " (declare (in) bvec2 x))\n"
+ " ())\n"
+ " (signature bvec3\n"
+ " (parameters\n"
+ " (declare (in) bvec3 x))\n"
+ " ())\n"
+ " (signature bvec4\n"
+ " (parameters\n"
+ " (declare (in) bvec4 x))\n"
+ " ()))\n"
+ "(function texture2D\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec2 coord))\n"
+ " ()))\n"
+ "(function texture2DProj\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec3 coord))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec4 coord))\n"
+ " ()))\n"
+ "(function texture2DLod\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec2 coord)\n"
+ " (declare (in) float lod))\n"
+ " ()))\n"
+ "(function texture2DProjLod\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec3 coord)\n"
+ " (declare (in) float lod))\n"
+ " ())\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) sampler2D sampler)\n"
+ " (declare (in) vec4 coord)\n"
+ " (declare (in) float lod))\n"
+ " ()))\n"
+ "(function textureCube\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) samplerCube sampler)\n"
+ " (declare (in) vec3 coord))\n"
+ " ()))\n"
+ "(function textureCubeLod\n"
+ " (signature vec4\n"
+ " (parameters\n"
+ " (declare (in) samplerCube sampler)\n"
+ " (declare (in) vec3 coord)\n"
+ " (declare (in) float lod))\n"
+ " ())))"
+;
+static const char *functions_for_100_vert [] = {
+ builtin_abs,
+ builtin_acos,
+ builtin_all,
+ builtin_any,
+ builtin_asin,
+ builtin_atan,
+ builtin_ceil,
+ builtin_clamp,
+ builtin_cos,
+ builtin_cross,
+ builtin_degrees,
+ builtin_distance,
+ builtin_dot,
+ builtin_equal,
+ builtin_exp,
+ builtin_exp2,
+ builtin_faceforward,
+ builtin_floor,
+ builtin_fract,
+ builtin_greaterThan,
+ builtin_greaterThanEqual,
+ builtin_inversesqrt,
+ builtin_length,
+ builtin_lessThan,
+ builtin_lessThanEqual,
+ builtin_log,
+ builtin_log2,
+ builtin_matrixCompMult,
+ builtin_max,
+ builtin_min,
+ builtin_mix,
+ builtin_mod,
+ builtin_normalize,
+ builtin_not,
+ builtin_notEqual,
+ builtin_pow,
+ builtin_radians,
+ builtin_reflect,
+ builtin_refract,
+ builtin_sign,
+ builtin_sin,
+ builtin_smoothstep,
+ builtin_sqrt,
+ builtin_step,
+ builtin_tan,
+ builtin_texture2D,
+ builtin_texture2DLod,
+ builtin_texture2DProj,
+ builtin_texture2DProjLod,
+ builtin_textureCube,
+ builtin_textureCubeLod,
+};
static const char *prototypes_for_110_frag =
"(\n"
"(function radians\n"
@@ -16819,7 +19216,7 @@ static const char *functions_for_EXT_texture_array_vert [] = {
builtin_texture2DArray,
builtin_texture2DArrayLod,
};
-static gl_shader *builtin_profiles[10];
+static gl_shader *builtin_profiles[12];
void *builtin_mem_ctx = NULL;
@@ -16828,6 +19225,7 @@ _mesa_glsl_release_functions(void)
{
talloc_free(builtin_mem_ctx);
builtin_mem_ctx = NULL;
+ memset(builtin_profiles, 0, sizeof(builtin_profiles));
}
static void
@@ -16862,71 +19260,85 @@ _mesa_glsl_initialize_functions(exec_list *instructions,
state->num_builtins_to_link = 0;
- if (state->target == fragment_shader && state->language_version == 110) {
+ if (state->target == fragment_shader && state->language_version == 100) {
_mesa_read_profile(state, instructions, 0,
+ prototypes_for_100_frag,
+ functions_for_100_frag,
+ Elements(functions_for_100_frag));
+ }
+
+ if (state->target == vertex_shader && state->language_version == 100) {
+ _mesa_read_profile(state, instructions, 1,
+ prototypes_for_100_vert,
+ functions_for_100_vert,
+ Elements(functions_for_100_vert));
+ }
+
+ if (state->target == fragment_shader && state->language_version == 110) {
+ _mesa_read_profile(state, instructions, 2,
prototypes_for_110_frag,
functions_for_110_frag,
Elements(functions_for_110_frag));
}
if (state->target == vertex_shader && state->language_version == 110) {
- _mesa_read_profile(state, instructions, 1,
+ _mesa_read_profile(state, instructions, 3,
prototypes_for_110_vert,
functions_for_110_vert,
Elements(functions_for_110_vert));
}
if (state->target == fragment_shader && state->language_version == 120) {
- _mesa_read_profile(state, instructions, 2,
+ _mesa_read_profile(state, instructions, 4,
prototypes_for_120_frag,
functions_for_120_frag,
Elements(functions_for_120_frag));
}
if (state->target == vertex_shader && state->language_version == 120) {
- _mesa_read_profile(state, instructions, 3,
+ _mesa_read_profile(state, instructions, 5,
prototypes_for_120_vert,
functions_for_120_vert,
Elements(functions_for_120_vert));
}
if (state->target == fragment_shader && state->language_version == 130) {
- _mesa_read_profile(state, instructions, 4,
+ _mesa_read_profile(state, instructions, 6,
prototypes_for_130_frag,
functions_for_130_frag,
Elements(functions_for_130_frag));
}
if (state->target == vertex_shader && state->language_version == 130) {
- _mesa_read_profile(state, instructions, 5,
+ _mesa_read_profile(state, instructions, 7,
prototypes_for_130_vert,
functions_for_130_vert,
Elements(functions_for_130_vert));
}
if (state->target == fragment_shader && state->ARB_texture_rectangle_enable) {
- _mesa_read_profile(state, instructions, 6,
+ _mesa_read_profile(state, instructions, 8,
prototypes_for_ARB_texture_rectangle_frag,
functions_for_ARB_texture_rectangle_frag,
Elements(functions_for_ARB_texture_rectangle_frag));
}
if (state->target == vertex_shader && state->ARB_texture_rectangle_enable) {
- _mesa_read_profile(state, instructions, 7,
+ _mesa_read_profile(state, instructions, 9,
prototypes_for_ARB_texture_rectangle_vert,
functions_for_ARB_texture_rectangle_vert,
Elements(functions_for_ARB_texture_rectangle_vert));
}
if (state->target == fragment_shader && state->EXT_texture_array_enable) {
- _mesa_read_profile(state, instructions, 8,
+ _mesa_read_profile(state, instructions, 10,
prototypes_for_EXT_texture_array_frag,
functions_for_EXT_texture_array_frag,
Elements(functions_for_EXT_texture_array_frag));
}
if (state->target == vertex_shader && state->EXT_texture_array_enable) {
- _mesa_read_profile(state, instructions, 9,
+ _mesa_read_profile(state, instructions, 11,
prototypes_for_EXT_texture_array_vert,
functions_for_EXT_texture_array_vert,
Elements(functions_for_EXT_texture_array_vert));
diff --git a/src/glsl/builtin_types.h b/src/glsl/builtin_types.h
index 7b94aac666..6dabbf0d32 100644
--- a/src/glsl/builtin_types.h
+++ b/src/glsl/builtin_types.h
@@ -51,16 +51,8 @@ const glsl_type glsl_type::builtin_core_types[] = {
glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"),
glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"),
glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"),
- glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
- "sampler1D"),
- glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
- "sampler1DShadow"),
glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT,
"sampler2D"),
- glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
- "sampler2DShadow"),
- glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
- "sampler3D"),
glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT,
"samplerCube"),
};
@@ -178,6 +170,21 @@ const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = {
};
/*@}*/
+/** \name Types in GLSL 1.10 (but not GLSL ES 1.00)
+ */
+/*@{*/
+const glsl_type glsl_type::builtin_110_types[] = {
+ glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
+ "sampler1D"),
+ glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
+ "sampler1DShadow"),
+ glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
+ "sampler2DShadow"),
+ glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
+ "sampler3D"),
+};
+/*@}*/
+
/** \name Types added in GLSL 1.20
*/
/*@{*/
diff --git a/src/glsl/builtin_variables.h b/src/glsl/builtin_variables.h
index a7dbe480e9..a34c67e348 100644
--- a/src/glsl/builtin_variables.h
+++ b/src/glsl/builtin_variables.h
@@ -39,6 +39,13 @@ static const builtin_variable builtin_core_fs_variables[] = {
{ ir_var_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" },
{ ir_var_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" },
{ ir_var_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" },
+};
+
+static const builtin_variable builtin_100ES_fs_variables[] = {
+ { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" },
+};
+
+static const builtin_variable builtin_110_fs_variables[] = {
{ ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" },
};
diff --git a/src/glsl/builtins/ir/atan b/src/glsl/builtins/ir/atan
index 04e1898f9f..6dc99d74d3 100644
--- a/src/glsl/builtins/ir/atan
+++ b/src/glsl/builtins/ir/atan
@@ -55,23 +55,23 @@
(
(declare () float r)
(declare ( ) float abs_retval)
- (assign (constant bool (1)) (var_ref abs_retval) (call abs ((var_ref x) ))
-)
+ (assign (constant bool (1)) (x) (var_ref abs_retval) (call abs ((var_ref x) ))
+)
(if (expression bool > (var_ref abs_retval) (constant float (0.000100)) ) (
(declare ( ) float atan_retval)
- (assign (constant bool (1)) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))
-)
- (assign (constant bool (1)) (var_ref r) (var_ref atan_retval) )
+ (assign (constant bool (1)) (x) (var_ref atan_retval) (call atan ((expression float / (var_ref y) (var_ref x) ) ))
+)
+ (assign (constant bool (1)) (x) (var_ref r) (var_ref atan_retval) )
(if (expression bool < (var_ref x) (constant float (0.000000)) ) (
(if (expression bool >= (var_ref y) (constant float (0.000000)) ) (
(declare ( ) float assignment_tmp)
- (assign (constant bool (1)) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) )
- (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) )
+ (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float + (var_ref r) (constant float (3.141593)) ) )
+ (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )
)
(
(declare ( ) float assignment_tmp)
- (assign (constant bool (1)) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) )
- (assign (constant bool (1)) (var_ref r) (var_ref assignment_tmp) )
+ (assign (constant bool (1)) (x) (var_ref assignment_tmp) (expression float - (var_ref r) (constant float (3.141593)) ) )
+ (assign (constant bool (1)) (x) (var_ref r) (var_ref assignment_tmp) )
))
)
@@ -81,8 +81,8 @@
)
(
(declare () float sgn)
- (assign (constant bool (1)) (var_ref sgn) (expression float sign (var_ref y)))
- (assign (constant bool (1)) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965))))
+ (assign (constant bool (1)) (x) (var_ref sgn) (expression float sign (var_ref y)))
+ (assign (constant bool (1)) (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965))))
))
(return (var_ref r) )
@@ -95,12 +95,10 @@
(declare (in) vec2 y)
(declare (in) vec2 x))
((declare () vec2 r)
- (assign (constant bool (1))
- (swiz x (var_ref r))
+ (assign (constant bool (1)) (x) (var_ref r)
(call atan ((swiz x (var_ref y))
(swiz x (var_ref x)))))
- (assign (constant bool (1))
- (swiz y (var_ref r))
+ (assign (constant bool (1)) (y) (var_ref r)
(call atan ((swiz y (var_ref y))
(swiz y (var_ref x)))))
(return (var_ref r))))
@@ -110,16 +108,13 @@
(declare (in) vec3 y)
(declare (in) vec3 x))
((declare () vec3 r)
- (assign (constant bool (1))
- (swiz x (var_ref r))
+ (assign (constant bool (1)) (x) (var_ref r)
(call atan ((swiz x (var_ref y))
(swiz x (var_ref x)))))
- (assign (constant bool (1))
- (swiz y (var_ref r))
+ (assign (constant bool (1)) (y) (var_ref r)
(call atan ((swiz y (var_ref y))
(swiz y (var_ref x)))))
- (assign (constant bool (1))
- (swiz z (var_ref r))
+ (assign (constant bool (1)) (z) (var_ref r)
(call atan ((swiz z (var_ref y))
(swiz z (var_ref x)))))
(return (var_ref r))))
@@ -129,20 +124,16 @@
(declare (in) vec4 y)
(declare (in) vec4 x))
((declare () vec4 r)
- (assign (constant bool (1))
- (swiz x (var_ref r))
+ (assign (constant bool (1)) (x) (var_ref r)
(call atan ((swiz x (var_ref y))
(swiz x (var_ref x)))))
- (assign (constant bool (1))
- (swiz y (var_ref r))
+ (assign (constant bool (1)) (y) (var_ref r)
(call atan ((swiz y (var_ref y))
(swiz y (var_ref x)))))
- (assign (constant bool (1))
- (swiz z (var_ref r))
+ (assign (constant bool (1)) (z) (var_ref r)
(call atan ((swiz z (var_ref y))
(swiz z (var_ref x)))))
- (assign (constant bool (1))
- (swiz w (var_ref r))
+ (assign (constant bool (1)) (w) (var_ref r)
(call atan ((swiz w (var_ref y))
(swiz w (var_ref x)))))
(return (var_ref r)))))
diff --git a/src/glsl/builtins/ir/distance b/src/glsl/builtins/ir/distance
index a2309c484f..7789ca6314 100644
--- a/src/glsl/builtins/ir/distance
+++ b/src/glsl/builtins/ir/distance
@@ -3,16 +3,14 @@
(parameters
(declare (in) float p0)
(declare (in) float p1))
- ((declare () float p)
- (assign (constant bool (1)) (var_ref p) (expression float - (var_ref p0) (var_ref p1)))
- (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))
+ ((return (expression float abs (expression float - (var_ref p0) (var_ref p1))))))
(signature float
(parameters
(declare (in) vec2 p0)
(declare (in) vec2 p1))
((declare () vec2 p)
- (assign (constant bool (1)) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))
+ (assign (constant bool (1)) (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))
(return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))
(signature float
@@ -20,7 +18,7 @@
(declare (in) vec3 p0)
(declare (in) vec3 p1))
((declare () vec3 p)
- (assign (constant bool (1)) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))
+ (assign (constant bool (1)) (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))
(return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))
(signature float
@@ -28,6 +26,6 @@
(declare (in) vec4 p0)
(declare (in) vec4 p1))
((declare () vec4 p)
- (assign (constant bool (1)) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))
+ (assign (constant bool (1)) (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))
(return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))
))
diff --git a/src/glsl/builtins/ir/dot b/src/glsl/builtins/ir/dot
index a91a6d2c56..1f27f32359 100644
--- a/src/glsl/builtins/ir/dot
+++ b/src/glsl/builtins/ir/dot
@@ -3,7 +3,7 @@
(parameters
(declare (in) float arg0)
(declare (in) float arg1))
- ((return (expression float dot (var_ref arg0) (var_ref arg1)))))
+ ((return (expression float * (var_ref arg0) (var_ref arg1)))))
(signature float
(parameters
diff --git a/src/glsl/builtins/ir/equal b/src/glsl/builtins/ir/equal
index c394776770..f6578dc1e3 100644
--- a/src/glsl/builtins/ir/equal
+++ b/src/glsl/builtins/ir/equal
@@ -3,119 +3,71 @@
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) bvec2 arg0)
(declare (in) bvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) bvec3 arg0)
(declare (in) bvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) bvec4 arg0)
(declare (in) bvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 all_equal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool == (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool == (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool == (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool == (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 all_equal (var_ref arg0) (var_ref arg1)))))
))
diff --git a/src/glsl/builtins/ir/faceforward b/src/glsl/builtins/ir/faceforward
index d170397238..35b79571c6 100644
--- a/src/glsl/builtins/ir/faceforward
+++ b/src/glsl/builtins/ir/faceforward
@@ -4,7 +4,7 @@
(declare (in) float N)
(declare (in) float I)
(declare (in) float Nref))
- ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))
+ ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0)))
((return (var_ref N)))
((return (expression float neg (var_ref N)))))))
diff --git a/src/glsl/builtins/ir/greaterThan b/src/glsl/builtins/ir/greaterThan
index ce7bd29bed..f5489008ed 100644
--- a/src/glsl/builtins/ir/greaterThan
+++ b/src/glsl/builtins/ir/greaterThan
@@ -4,8 +4,8 @@
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -13,9 +13,9 @@
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -23,10 +23,10 @@
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -34,8 +34,8 @@
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -43,9 +43,9 @@
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -53,10 +53,10 @@
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -64,8 +64,8 @@
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -73,9 +73,9 @@
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -83,9 +83,9 @@
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool > (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool > (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool > (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool > (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))
diff --git a/src/glsl/builtins/ir/greaterThanEqual b/src/glsl/builtins/ir/greaterThanEqual
index de1a9f9516..d00354042a 100644
--- a/src/glsl/builtins/ir/greaterThanEqual
+++ b/src/glsl/builtins/ir/greaterThanEqual
@@ -4,8 +4,8 @@
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -13,9 +13,9 @@
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -23,10 +23,10 @@
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -34,8 +34,8 @@
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -43,9 +43,9 @@
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -53,10 +53,10 @@
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -64,8 +64,8 @@
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -73,9 +73,9 @@
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -83,9 +83,9 @@
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool >= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool >= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool >= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool >= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))
diff --git a/src/glsl/builtins/ir/length b/src/glsl/builtins/ir/length
index 89ff7f3ef1..b72334ee8a 100644
--- a/src/glsl/builtins/ir/length
+++ b/src/glsl/builtins/ir/length
@@ -2,7 +2,7 @@
(signature float
(parameters
(declare (in) float arg0))
- ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))
+ ((return (expression float abs (var_ref arg0)))))
(signature float
(parameters
diff --git a/src/glsl/builtins/ir/lessThan b/src/glsl/builtins/ir/lessThan
index 52113b7046..e29288a972 100644
--- a/src/glsl/builtins/ir/lessThan
+++ b/src/glsl/builtins/ir/lessThan
@@ -4,8 +4,8 @@
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -13,9 +13,9 @@
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -23,10 +23,10 @@
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -34,8 +34,8 @@
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -43,9 +43,9 @@
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -53,10 +53,10 @@
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -64,8 +64,8 @@
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -73,9 +73,9 @@
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -83,9 +83,9 @@
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool < (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool < (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool < (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool < (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))
diff --git a/src/glsl/builtins/ir/lessThanEqual b/src/glsl/builtins/ir/lessThanEqual
index 4b240be5d1..669f2341d4 100644
--- a/src/glsl/builtins/ir/lessThanEqual
+++ b/src/glsl/builtins/ir/lessThanEqual
@@ -4,8 +4,8 @@
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -13,9 +13,9 @@
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -23,10 +23,10 @@
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -34,8 +34,8 @@
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -43,9 +43,9 @@
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -53,10 +53,10 @@
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
(signature bvec2
@@ -64,8 +64,8 @@
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
(return (var_ref temp))))
(signature bvec3
@@ -73,9 +73,9 @@
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
(return (var_ref temp))))
(signature bvec4
@@ -83,9 +83,9 @@
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
+ (assign (constant bool (1)) (x) (var_ref temp) (expression bool <= (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
+ (assign (constant bool (1)) (y) (var_ref temp) (expression bool <= (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
+ (assign (constant bool (1)) (z) (var_ref temp) (expression bool <= (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
+ (assign (constant bool (1)) (w) (var_ref temp) (expression bool <= (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
(return (var_ref temp))))
))
diff --git a/src/glsl/builtins/ir/matrixCompMult b/src/glsl/builtins/ir/matrixCompMult
index 538da18a79..4be9b03e31 100644
--- a/src/glsl/builtins/ir/matrixCompMult
+++ b/src/glsl/builtins/ir/matrixCompMult
@@ -4,8 +4,8 @@
(declare (in) mat2 x)
(declare (in) mat2 y))
((declare () mat2 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(return (var_ref z))))
(signature mat3
@@ -13,9 +13,9 @@
(declare (in) mat3 x)
(declare (in) mat3 y))
((declare () mat3 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(return (var_ref z))))
(signature mat4
@@ -23,10 +23,10 @@
(declare (in) mat4 x)
(declare (in) mat4 y))
((declare () mat4 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
(return (var_ref z))))
(signature mat2x3
@@ -34,8 +34,8 @@
(declare (in) mat2x3 x)
(declare (in) mat2x3 y))
((declare () mat2x3 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(return (var_ref z))))
(signature mat3x2
@@ -43,9 +43,9 @@
(declare (in) mat3x2 x)
(declare (in) mat3x2 y))
((declare () mat3x2 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(return (var_ref z))))
(signature mat2x4
@@ -53,8 +53,8 @@
(declare (in) mat2x4 x)
(declare (in) mat2x4 y))
((declare () mat2x4 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
(return (var_ref z))))
(signature mat4x2
@@ -62,10 +62,10 @@
(declare (in) mat4x2 x)
(declare (in) mat4x2 y))
((declare () mat4x2 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
(return (var_ref z))))
(signature mat3x4
@@ -73,9 +73,9 @@
(declare (in) mat3x4 x)
(declare (in) mat3x4 y))
((declare () mat3x4 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
(return (var_ref z))))
(signature mat4x3
@@ -83,9 +83,9 @@
(declare (in) mat4x3 x)
(declare (in) mat4x3 y))
((declare () mat4x3 z)
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
- (assign (constant bool (1)) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))
(return (var_ref z))))
))
diff --git a/src/glsl/builtins/ir/mix b/src/glsl/builtins/ir/mix
index 6bc6f0a43e..a31f0fa708 100644
--- a/src/glsl/builtins/ir/mix
+++ b/src/glsl/builtins/ir/mix
@@ -61,8 +61,8 @@
(declare (in) vec2 v1)
(declare (in) vec2 v2)
(declare (in) bvec2 a))
- ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
- (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
+ ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))
+ (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))
(return (var_ref v1))))
(signature vec3
@@ -70,9 +70,9 @@
(declare (in) vec3 v1)
(declare (in) vec3 v2)
(declare (in) bvec3 a))
- ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
- (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
- (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))
+ ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))
+ (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))
+ (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2)))
(return (var_ref v1))))
(signature vec4
@@ -80,9 +80,9 @@
(declare (in) vec4 v1)
(declare (in) vec4 v2)
(declare (in) bvec4 a))
- ((assign (swiz x (var_ref a)) (swiz x (var_ref v1)) (swiz x (var_ref v2)))
- (assign (swiz y (var_ref a)) (swiz y (var_ref v1)) (swiz y (var_ref v2)))
- (assign (swiz z (var_ref a)) (swiz z (var_ref v1)) (swiz z (var_ref v2)))
- (assign (swiz w (var_ref a)) (swiz w (var_ref v1)) (swiz w (var_ref v2)))
+ ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))
+ (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))
+ (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2)))
+ (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2)))
(return (var_ref v1))))
))
diff --git a/src/glsl/builtins/ir/noise1 b/src/glsl/builtins/ir/noise1
index eb7be35857..115505610a 100644
--- a/src/glsl/builtins/ir/noise1
+++ b/src/glsl/builtins/ir/noise1
@@ -2,17 +2,17 @@
(signature float
(parameters
(declare (in) float x))
- ((return (constant float (0)))))
+ ((return (expression float noise (var_ref x)))))
(signature float
(parameters
(declare (in) vec2 x))
- ((return (constant float (0)))))
+ ((return (expression float noise (var_ref x)))))
(signature float
(parameters
(declare (in) vec3 x))
- ((return (constant float (0)))))
+ ((return (expression float noise (var_ref x)))))
(signature float
(parameters
(declare (in) vec4 x))
- ((return (constant float (0)))))
+ ((return (expression float noise (var_ref x)))))
))
diff --git a/src/glsl/builtins/ir/noise2 b/src/glsl/builtins/ir/noise2
index ae4443a704..008f8b00f1 100644
--- a/src/glsl/builtins/ir/noise2
+++ b/src/glsl/builtins/ir/noise2
@@ -1,18 +1,61 @@
((function noise2
- (signature vec2
- (parameters
- (declare (in) float x))
- ((return (constant vec2 (0 0)))))
- (signature vec2
- (parameters
- (declare (in) vec2 x))
- ((return (constant vec2 (0 0)))))
- (signature vec2
- (parameters
- (declare (in) vec3 x))
- ((return (constant vec2 (0 0)))))
- (signature vec2
- (parameters
- (declare (in) vec4 x))
- ((return (constant vec2 (0 0)))))
+ (signature vec2
+ (parameters (declare (in) vec4 p))
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () vec2 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))
+ (return (var_ref t))
+ ))
+
+ (signature vec2
+ (parameters (declare (in) vec3 p))
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () vec2 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))
+ (return (var_ref t))
+ ))
+
+ (signature vec2
+ (parameters
+ (declare (in ) vec2 p)
+ )
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () vec2 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))
+ (return (var_ref t))
+ ))
+
+ (signature vec2
+ (parameters
+ (declare (in ) float p)
+ )
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () vec2 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xx (var_ref b)))
+ (return (var_ref t))
+ ))
))
diff --git a/src/glsl/builtins/ir/noise3 b/src/glsl/builtins/ir/noise3
index 30d9681890..f191e145f9 100644
--- a/src/glsl/builtins/ir/noise3
+++ b/src/glsl/builtins/ir/noise3
@@ -1,18 +1,73 @@
((function noise3
- (signature vec3
- (parameters
- (declare (in) float x))
- ((return (constant vec3 (0 0 0)))))
- (signature vec3
- (parameters
- (declare (in) vec2 x))
- ((return (constant vec3 (0 0 0)))))
- (signature vec3
- (parameters
- (declare (in) vec3 x))
- ((return (constant vec3 (0 0 0)))))
- (signature vec3
- (parameters
- (declare (in) vec4 x))
- ((return (constant vec3 (0 0 0)))))
+ (signature vec3
+ (parameters (declare (in) vec4 p))
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () float c)
+ (declare () vec3 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))
+ (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))
+ (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))
+ (return (var_ref t))
+ ))
+
+ (signature vec3
+ (parameters (declare (in) vec3 p))
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () float c)
+ (declare () vec3 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))
+ (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))
+ (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))
+ (return (var_ref t))
+ ))
+
+ (signature vec3
+ (parameters (declare (in) vec2 p))
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () float c)
+ (declare () vec3 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))
+ (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))
+ (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))
+ (return (var_ref t))
+ ))
+
+ (signature vec3
+ (parameters (declare (in) float p))
+ (
+ (declare () float a)
+ (declare () float b)
+ (declare () float c)
+ (declare () vec3 t)
+
+ (assign (constant bool (1)) (x) (var_ref a) (expression float noise (var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))
+ (assign (constant bool (1)) (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref t) (swiz xxx (var_ref a)))
+ (assign (constant bool (1)) (y) (var_ref t) (swiz xxx (var_ref b)))
+ (assign (constant bool (1)) (z) (var_ref t) (swiz xxx (var_ref c)))
+ (return (var_ref t))
+ ))
))
diff --git a/src/glsl/builtins/ir/noise4 b/src/glsl/builtins/ir/noise4
index 913bef2aa1..fb300fd148 100644
--- a/src/glsl/builtins/ir/noise4
+++ b/src/glsl/builtins/ir/noise4
@@ -1,18 +1,97 @@
((function noise4
- (signature vec4
- (parameters
- (declare (in) float x))
- ((return (constant vec4 (0 0 0 0)))))
- (signature vec4
- (parameters
- (declare (in) vec2 x))
- ((return (constant vec4 (0 0 0 0)))))
- (signature vec4
- (parameters
- (declare (in) vec3 x))
- ((return (constant vec4 (0 0 0 0)))))
- (signature vec4
- (parameters
- (declare (in) vec4 x))
- ((return (constant vec4 (0 0 0 0)))))
+ (signature vec4
+ (parameters (declare (in) vec4 p))
+ (
+ (declare () float _x)
+ (declare () float _y)
+ (declare () float _z)
+ (declare () float _w)
+ (declare () vec4 _r)
+
+ (declare () vec4 _p)
+ (assign (constant bool (1)) (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) )
+
+ (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))
+ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))
+ (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))
+ (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))
+ (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))
+ (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))
+ (return (var_ref _r))
+ ))
+
+ (signature vec4
+ (parameters (declare (in) vec3 p))
+ (
+ (declare () float _x)
+ (declare () float _y)
+ (declare () float _z)
+ (declare () float _w)
+ (declare () vec4 _r)
+
+ (declare () vec3 _p)
+ (assign (constant bool (1)) (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) )
+
+ (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))
+ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))
+ (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))
+ (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))
+ (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))
+ (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))
+ (return (var_ref _r))
+ ))
+
+ (signature vec4
+ (parameters (declare (in) vec2 p))
+ (
+ (declare () float _x)
+ (declare () float _y)
+ (declare () float _z)
+ (declare () float _w)
+ (declare () vec4 _r)
+
+ (declare () vec2 _p)
+ (assign (constant bool (1)) (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) )
+
+ (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))
+ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))
+ (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))
+ (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))
+ (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))
+ (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))
+ (return (var_ref _r))
+ ))
+
+ (signature vec4
+ (parameters (declare (in) float p))
+ (
+ (declare () float _x)
+ (declare () float _y)
+ (declare () float _z)
+ (declare () float _w)
+ (declare () vec4 _r)
+
+ (declare () float _p)
+ (assign (constant bool (1)) (xy) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) )
+
+ (assign (constant bool (1)) (x) (var_ref _x) (expression float noise(var_ref p)))
+ (assign (constant bool (1)) (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0 313.0 29.0 277.0)))))
+ (assign (constant bool (1)) (x) (var_ref _z) (expression float noise(var_ref _p)))
+ (assign (constant bool (1)) (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0 313.0 29.0 277.0)))))
+
+ (assign (constant bool (1)) (x) (var_ref _r) (swiz xxxx (var_ref _x)))
+ (assign (constant bool (1)) (y) (var_ref _r) (swiz xxxx (var_ref _y)))
+ (assign (constant bool (1)) (z) (var_ref _r) (swiz xxxx (var_ref _z)))
+ (assign (constant bool (1)) (w) (var_ref _r) (swiz xxxx (var_ref _w)))
+ (return (var_ref _r))
+ ))
))
diff --git a/src/glsl/builtins/ir/normalize b/src/glsl/builtins/ir/normalize
index be88a9830d..0de0db0b64 100644
--- a/src/glsl/builtins/ir/normalize
+++ b/src/glsl/builtins/ir/normalize
@@ -2,7 +2,7 @@
(signature float
(parameters
(declare (in) float arg0))
- ((return (expression float * (var_ref arg0) (expression float rsq (expression float dot (var_ref arg0) (var_ref arg0)))))))
+ ((return (expression float sign (var_ref arg0)))))
(signature vec2
(parameters
diff --git a/src/glsl/builtins/ir/notEqual b/src/glsl/builtins/ir/notEqual
index eeeda79042..d07cdbf41f 100644
--- a/src/glsl/builtins/ir/notEqual
+++ b/src/glsl/builtins/ir/notEqual
@@ -3,119 +3,71 @@
(parameters
(declare (in) vec2 arg0)
(declare (in) vec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) vec3 arg0)
(declare (in) vec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) vec4 arg0)
(declare (in) vec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) bvec2 arg0)
(declare (in) bvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) bvec3 arg0)
(declare (in) bvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) bvec4 arg0)
(declare (in) bvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) ivec2 arg0)
(declare (in) ivec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) ivec3 arg0)
(declare (in) ivec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) ivec4 arg0)
(declare (in) ivec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec2
(parameters
(declare (in) uvec2 arg0)
(declare (in) uvec2 arg1))
- ((declare () bvec2 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec2 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec3
(parameters
(declare (in) uvec3 arg0)
(declare (in) uvec3 arg1))
- ((declare () bvec3 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec3 any_nequal (var_ref arg0) (var_ref arg1)))))
(signature bvec4
(parameters
(declare (in) uvec4 arg0)
(declare (in) uvec4 arg1))
- ((declare () bvec4 temp)
- (assign (constant bool (1)) (swiz x (var_ref temp)) (expression bool != (swiz x (var_ref arg0))(swiz x (var_ref arg1))))
- (assign (constant bool (1)) (swiz y (var_ref temp)) (expression bool != (swiz y (var_ref arg0))(swiz y (var_ref arg1))))
- (assign (constant bool (1)) (swiz z (var_ref temp)) (expression bool != (swiz z (var_ref arg0))(swiz z (var_ref arg1))))
- (assign (constant bool (1)) (swiz w (var_ref temp)) (expression bool != (swiz w (var_ref arg0))(swiz w (var_ref arg1))))
- (return (var_ref temp))))
+ ((return (expression bvec4 any_nequal (var_ref arg0) (var_ref arg1)))))
))
diff --git a/src/glsl/builtins/ir/outerProduct b/src/glsl/builtins/ir/outerProduct
index 69ae741e17..61d4626154 100644
--- a/src/glsl/builtins/ir/outerProduct
+++ b/src/glsl/builtins/ir/outerProduct
@@ -4,8 +4,8 @@
(declare (in) vec2 u)
(declare (in) vec2 v))
((declare () mat2 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))
(return (var_ref m))))
(signature mat2x3
@@ -13,8 +13,8 @@
(declare (in) vec3 u)
(declare (in) vec2 v))
((declare () mat2x3 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))
(return (var_ref m))))
(signature mat2x4
@@ -22,8 +22,8 @@
(declare (in) vec4 u)
(declare (in) vec2 v))
((declare () mat2x4 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))
(return (var_ref m))))
(signature mat3x2
@@ -31,9 +31,9 @@
(declare (in) vec2 u)
(declare (in) vec3 v))
((declare () mat3x2 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))
(return (var_ref m))
))
@@ -42,9 +42,9 @@
(declare (in) vec3 u)
(declare (in) vec3 v))
((declare () mat3 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))
(return (var_ref m))))
(signature mat3x4
@@ -52,9 +52,9 @@
(declare (in) vec4 u)
(declare (in) vec3 v))
((declare () mat3x4 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))
(return (var_ref m))))
(signature mat4x2
@@ -62,10 +62,10 @@
(declare (in) vec2 u)
(declare (in) vec4 v))
((declare () mat4x2 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))
+ (assign (constant bool (1)) (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))
(return (var_ref m))))
(signature mat4x3
@@ -73,10 +73,10 @@
(declare (in) vec3 u)
(declare (in) vec4 v))
((declare () mat4x3 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))
+ (assign (constant bool (1)) (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))
(return (var_ref m))))
(signature mat4
@@ -84,9 +84,9 @@
(declare (in) vec4 u)
(declare (in) vec4 v))
((declare () mat4 m)
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))
- (assign (constant bool (1)) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))
+ (assign (constant bool (1)) (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))
(return (var_ref m))))
))
diff --git a/src/glsl/builtins/ir/reflect b/src/glsl/builtins/ir/reflect
index 8238fdc93f..1fa394e3c9 100644
--- a/src/glsl/builtins/ir/reflect
+++ b/src/glsl/builtins/ir/reflect
@@ -8,7 +8,7 @@
(expression float *
(constant float (2.0))
(expression float *
- (expression float dot
+ (expression float *
(var_ref n)
(var_ref i))
(var_ref n)))))))
diff --git a/src/glsl/builtins/ir/refract b/src/glsl/builtins/ir/refract
index 522ab41173..f6319b0ed4 100644
--- a/src/glsl/builtins/ir/refract
+++ b/src/glsl/builtins/ir/refract
@@ -5,14 +5,14 @@
(declare (in) float n)
(declare (in) float eta))
((declare () float k)
- (assign (constant bool (1)) (var_ref k)
+ (assign (constant bool (1)) (x) (var_ref k)
(expression float - (constant float (1.0))
(expression float * (var_ref eta)
(expression float * (var_ref eta)
(expression float - (constant float (1.0))
(expression float *
- (expression float dot (var_ref n) (var_ref i))
- (expression float dot (var_ref n) (var_ref i))))))))
+ (expression float * (var_ref n) (var_ref i))
+ (expression float * (var_ref n) (var_ref i))))))))
(if (expression bool < (var_ref k) (constant float (0.0)))
((return (constant float (0.0))))
((return (expression float -
@@ -20,7 +20,7 @@
(expression float *
(expression float +
(expression float * (var_ref eta)
- (expression float dot (var_ref n) (var_ref i)))
+ (expression float * (var_ref n) (var_ref i)))
(expression float sqrt (var_ref k)))
(var_ref n))))))))
@@ -30,7 +30,7 @@
(declare (in) vec2 n)
(declare (in) float eta))
((declare () float k)
- (assign (constant bool (1)) (var_ref k)
+ (assign (constant bool (1)) (x) (var_ref k)
(expression float - (constant float (1.0))
(expression float * (var_ref eta)
(expression float * (var_ref eta)
@@ -55,7 +55,7 @@
(declare (in) vec3 n)
(declare (in) float eta))
((declare () float k)
- (assign (constant bool (1)) (var_ref k)
+ (assign (constant bool (1)) (x) (var_ref k)
(expression float - (constant float (1.0))
(expression float * (var_ref eta)
(expression float * (var_ref eta)
@@ -80,7 +80,7 @@
(declare (in) vec4 n)
(declare (in) float eta))
((declare () float k)
- (assign (constant bool (1)) (var_ref k)
+ (assign (constant bool (1)) (x) (var_ref k)
(expression float - (constant float (1.0))
(expression float * (var_ref eta)
(expression float * (var_ref eta)
diff --git a/src/glsl/builtins/ir/smoothstep b/src/glsl/builtins/ir/smoothstep
index 663eec6341..0164219a05 100644
--- a/src/glsl/builtins/ir/smoothstep
+++ b/src/glsl/builtins/ir/smoothstep
@@ -6,7 +6,7 @@
(declare (in) float x))
((declare () float t)
- (assign (constant bool (1)) (var_ref t)
+ (assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
@@ -22,21 +22,21 @@
((declare () vec2 t)
(declare () vec2 retval)
- (assign (constant bool (1)) (swiz x (var_ref t))
+ (assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
+ (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
- (assign (constant bool (1)) (swiz y (var_ref t))
+ (assign (constant bool (1)) (y) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
+ (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
(return (var_ref retval))
))
@@ -48,29 +48,29 @@
((declare () vec3 t)
(declare () vec3 retval)
- (assign (constant bool (1)) (swiz x (var_ref t))
+ (assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
+ (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
- (assign (constant bool (1)) (swiz y (var_ref t))
+ (assign (constant bool (1)) (y) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
+ (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
- (assign (constant bool (1)) (swiz z (var_ref t))
+ (assign (constant bool (1)) (z) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
+ (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
(return (var_ref retval))
))
@@ -83,37 +83,37 @@
((declare () vec4 t)
(declare () vec4 retval)
- (assign (constant bool (1)) (swiz x (var_ref t))
+ (assign (constant bool (1)) (x) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz x (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz x (var_ref retval)) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
+ (assign (constant bool (1)) (x) (var_ref retval) (expression float * (swiz x (var_ref t)) (expression float * (swiz x (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz x (var_ref t)))))))
- (assign (constant bool (1)) (swiz y (var_ref t))
+ (assign (constant bool (1)) (y) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz y (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz y (var_ref retval)) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
+ (assign (constant bool (1)) (y) (var_ref retval) (expression float * (swiz y (var_ref t)) (expression float * (swiz y (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz y (var_ref t)))))))
- (assign (constant bool (1)) (swiz z (var_ref t))
+ (assign (constant bool (1)) (z) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz z (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz z (var_ref retval)) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
+ (assign (constant bool (1)) (z) (var_ref retval) (expression float * (swiz z (var_ref t)) (expression float * (swiz z (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz z (var_ref t)))))))
- (assign (constant bool (1)) (swiz w (var_ref t))
+ (assign (constant bool (1)) (w) (var_ref t)
(expression float max
(expression float min
(expression float / (expression float - (swiz w (var_ref x)) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))
(constant float (1.0)))
(constant float (0.0))))
- (assign (constant bool (1)) (swiz w (var_ref retval)) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))
+ (assign (constant bool (1)) (w) (var_ref retval) (expression float * (swiz w (var_ref t)) (expression float * (swiz w (var_ref t)) (expression float - (constant float (3.000000)) (expression float * (constant float (2.000000)) (swiz w (var_ref t)))))))
(return (var_ref retval))
))
diff --git a/src/glsl/builtins/ir/step b/src/glsl/builtins/ir/step
index ce6f435422..7aec9d7a6c 100644
--- a/src/glsl/builtins/ir/step
+++ b/src/glsl/builtins/ir/step
@@ -10,8 +10,8 @@
(declare (in) float edge)
(declare (in) vec2 x))
((declare () vec2 t)
- (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))
- (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))
(return (var_ref t))))
(signature vec3
@@ -19,9 +19,9 @@
(declare (in) float edge)
(declare (in) vec3 x))
((declare () vec3 t)
- (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))
- (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))
- (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))
(return (var_ref t))))
(signature vec4
@@ -29,10 +29,10 @@
(declare (in) float edge)
(declare (in) vec4 x))
((declare () vec4 t)
- (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))
- (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))
- (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))
- (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))
+ (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))
(return (var_ref t))))
(signature vec2
@@ -40,8 +40,8 @@
(declare (in) vec2 edge)
(declare (in) vec2 x))
((declare () vec2 t)
- (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))
- (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))
+ (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))
+ (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))
(return (var_ref t))))
(signature vec3
@@ -49,9 +49,9 @@
(declare (in) vec3 edge)
(declare (in) vec3 x))
((declare () vec3 t)
- (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))
- (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))
- (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))
+ (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))
+ (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))
+ (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))
(return (var_ref t))))
(signature vec4
@@ -59,10 +59,10 @@
(declare (in) vec4 edge)
(declare (in) vec4 x))
((declare () vec4 t)
- (assign (constant bool (1)) (swiz x (var_ref t)) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))
- (assign (constant bool (1)) (swiz y (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))
- (assign (constant bool (1)) (swiz z (var_ref t)) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz z (var_ref edge)))))
- (assign (constant bool (1)) (swiz w (var_ref t)) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))
+ (assign (constant bool (1)) (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))
+ (assign (constant bool (1)) (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))
+ (assign (constant bool (1)) (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))
+ (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))
(return (var_ref t))))
))
diff --git a/src/glsl/builtins/ir/transpose b/src/glsl/builtins/ir/transpose
index 416a0ee467..4bed4489bf 100644
--- a/src/glsl/builtins/ir/transpose
+++ b/src/glsl/builtins/ir/transpose
@@ -3,135 +3,135 @@
(parameters
(declare (in) mat2 m))
((declare () mat2 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
(return (var_ref t))))
(signature mat3x2
(parameters
(declare (in) mat2x3 m))
((declare () mat3x2 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))
(return (var_ref t))))
(signature mat4x2
(parameters
(declare (in) mat2x4 m))
((declare () mat4x2 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))
(return (var_ref t))))
(signature mat2x3
(parameters
(declare (in) mat3x2 m))
((declare () mat2x3 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))
(return (var_ref t))))
(signature mat3
(parameters
(declare (in) mat3 m))
((declare () mat3 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))
(return (var_ref t))))
(signature mat4x3
(parameters
(declare (in) mat3x4 m))
((declare () mat4x3 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2)))))
(return (var_ref t))))
(signature mat2x4
(parameters
(declare (in) mat4x2 m))
((declare () mat2x4 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))
(return (var_ref t))))
(signature mat3x4
(parameters
(declare (in) mat4x3 m))
((declare () mat3x4 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3)))))
(return (var_ref t))))
(signature mat4
(parameters
(declare (in) mat4 m))
((declare () mat4 t)
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz x (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (0)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz y (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (1)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz z (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (2)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (0)))) (swiz x (array_ref (var_ref m) (constant int (3)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (1)))) (swiz y (array_ref (var_ref m) (constant int (3)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (2)))) (swiz z (array_ref (var_ref m) (constant int (3)))))
- (assign (constant bool (1)) (swiz w (array_ref (var_ref t) (constant int (3)))) (swiz w (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3)))))
+ (assign (constant bool (1)) (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3)))))
(return (var_ref t))))
)
diff --git a/src/glsl/builtins/profiles/100.frag b/src/glsl/builtins/profiles/100.frag
new file mode 100644
index 0000000000..df4c7f042c
--- /dev/null
+++ b/src/glsl/builtins/profiles/100.frag
@@ -0,0 +1,300 @@
+#version 100
+/*
+ * 8.1 - Angle and Trigonometry Functions
+ */
+float radians(float degrees);
+vec2 radians(vec2 degrees);
+vec3 radians(vec3 degrees);
+vec4 radians(vec4 degrees);
+
+float degrees(float radians);
+vec2 degrees(vec2 radians);
+vec3 degrees(vec3 radians);
+vec4 degrees(vec4 radians);
+
+float sin(float angle);
+vec2 sin(vec2 angle);
+vec3 sin(vec3 angle);
+vec4 sin(vec4 angle);
+
+float cos(float angle);
+vec2 cos(vec2 angle);
+vec3 cos(vec3 angle);
+vec4 cos(vec4 angle);
+
+float tan(float angle);
+vec2 tan(vec2 angle);
+vec3 tan(vec3 angle);
+vec4 tan(vec4 angle);
+
+float asin(float angle);
+vec2 asin(vec2 angle);
+vec3 asin(vec3 angle);
+vec4 asin(vec4 angle);
+
+float acos(float angle);
+vec2 acos(vec2 angle);
+vec3 acos(vec3 angle);
+vec4 acos(vec4 angle);
+
+float atan(float y, float x);
+vec2 atan(vec2 y, vec2 x);
+vec3 atan(vec3 y, vec3 x);
+vec4 atan(vec4 y, vec4 x);
+
+float atan(float y_over_x);
+vec2 atan(vec2 y_over_x);
+vec3 atan(vec3 y_over_x);
+vec4 atan(vec4 y_over_x);
+
+/*
+ * 8.2 - Exponential Functions
+ */
+float pow(float x, float y);
+vec2 pow(vec2 x, vec2 y);
+vec3 pow(vec3 x, vec3 y);
+vec4 pow(vec4 x, vec4 y);
+
+float exp(float x);
+vec2 exp(vec2 x);
+vec3 exp(vec3 x);
+vec4 exp(vec4 x);
+
+float log(float x);
+vec2 log(vec2 x);
+vec3 log(vec3 x);
+vec4 log(vec4 x);
+
+float exp2(float x);
+vec2 exp2(vec2 x);
+vec3 exp2(vec3 x);
+vec4 exp2(vec4 x);
+
+float log2(float x);
+vec2 log2(vec2 x);
+vec3 log2(vec3 x);
+vec4 log2(vec4 x);
+
+float sqrt(float x);
+vec2 sqrt(vec2 x);
+vec3 sqrt(vec3 x);
+vec4 sqrt(vec4 x);
+
+float inversesqrt(float x);
+vec2 inversesqrt(vec2 x);
+vec3 inversesqrt(vec3 x);
+vec4 inversesqrt(vec4 x);
+
+/*
+ * 8.3 - Common Functions
+ */
+float abs(float x);
+vec2 abs(vec2 x);
+vec3 abs(vec3 x);
+vec4 abs(vec4 x);
+
+float sign(float x);
+vec2 sign(vec2 x);
+vec3 sign(vec3 x);
+vec4 sign(vec4 x);
+
+float floor(float x);
+vec2 floor(vec2 x);
+vec3 floor(vec3 x);
+vec4 floor(vec4 x);
+
+float ceil(float x);
+vec2 ceil(vec2 x);
+vec3 ceil(vec3 x);
+vec4 ceil(vec4 x);
+
+float fract(float x);
+vec2 fract(vec2 x);
+vec3 fract(vec3 x);
+vec4 fract(vec4 x);
+
+float mod(float x, float y);
+vec2 mod(vec2 x, float y);
+vec3 mod(vec3 x, float y);
+vec4 mod(vec4 x, float y);
+
+vec2 mod(vec2 x, vec2 y);
+vec3 mod(vec3 x, vec3 y);
+vec4 mod(vec4 x, vec4 y);
+
+float min(float x, float y);
+vec2 min(vec2 x, vec2 y);
+vec3 min(vec3 x, vec3 y);
+vec4 min(vec4 x, vec4 y);
+
+vec2 min(vec2 x, float y);
+vec3 min(vec3 x, float y);
+vec4 min(vec4 x, float y);
+
+float max(float x, float y);
+vec2 max(vec2 x, vec2 y);
+vec3 max(vec3 x, vec3 y);
+vec4 max(vec4 x, vec4 y);
+
+vec2 max(vec2 x, float y);
+vec3 max(vec3 x, float y);
+vec4 max(vec4 x, float y);
+
+float clamp(float x, float minVal, float maxVal);
+vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
+vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
+vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
+
+vec2 clamp(vec2 x, float minVal, float maxVal);
+vec3 clamp(vec3 x, float minVal, float maxVal);
+vec4 clamp(vec4 x, float minVal, float maxVal);
+
+float mix(float x, float y, float a);
+vec2 mix(vec2 x, vec2 y, vec2 a);
+vec3 mix(vec3 x, vec3 y, vec3 a);
+vec4 mix(vec4 x, vec4 y, vec4 a);
+
+vec2 mix(vec2 x, vec2 y, float a);
+vec3 mix(vec3 x, vec3 y, float a);
+vec4 mix(vec4 x, vec4 y, float a);
+
+float step(float edge, float x);
+vec2 step(vec2 edge, vec2 x);
+vec3 step(vec3 edge, vec3 x);
+vec4 step(vec4 edge, vec4 x);
+
+vec2 step(float edge, vec2 x);
+vec3 step(float edge, vec3 x);
+vec4 step(float edge, vec4 x);
+
+float smoothstep(float edge0, float edge1, float x);
+vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
+vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
+vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
+
+vec2 smoothstep(float edge0, float edge1, vec2 x);
+vec3 smoothstep(float edge0, float edge1, vec3 x);
+vec4 smoothstep(float edge0, float edge1, vec4 x);
+
+/*
+ * 8.4 - Geometric Functions
+ */
+float length(float x);
+float length(vec2 x);
+float length(vec3 x);
+float length(vec4 x);
+
+float distance(float p0, float p1);
+float distance(vec2 p0, vec2 p1);
+float distance(vec3 p0, vec3 p1);
+float distance(vec4 p0, vec4 p1);
+
+float dot(float x, float y);
+float dot(vec2 x, vec2 y);
+float dot(vec3 x, vec3 y);
+float dot(vec4 x, vec4 y);
+
+vec3 cross(vec3 x, vec3 y);
+
+float normalize(float x);
+vec2 normalize(vec2 x);
+vec3 normalize(vec3 x);
+vec4 normalize(vec4 x);
+
+float faceforward(float N, float I, float Nref);
+vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
+vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
+vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
+
+float reflect(float I, float N);
+vec2 reflect(vec2 I, vec2 N);
+vec3 reflect(vec3 I, vec3 N);
+vec4 reflect(vec4 I, vec4 N);
+
+float refract(float I, float N, float eta);
+vec2 refract(vec2 I, vec2 N, float eta);
+vec3 refract(vec3 I, vec3 N, float eta);
+vec4 refract(vec4 I, vec4 N, float eta);
+
+/*
+ * 8.5 - Matrix Functions
+ */
+mat2 matrixCompMult(mat2 x, mat2 y);
+mat3 matrixCompMult(mat3 x, mat3 y);
+mat4 matrixCompMult(mat4 x, mat4 y);
+
+/*
+ * 8.6 - Vector Relational Functions
+ */
+bvec2 lessThan( vec2 x, vec2 y);
+bvec3 lessThan( vec3 x, vec3 y);
+bvec4 lessThan( vec4 x, vec4 y);
+bvec2 lessThan(ivec2 x, ivec2 y);
+bvec3 lessThan(ivec3 x, ivec3 y);
+bvec4 lessThan(ivec4 x, ivec4 y);
+
+bvec2 lessThanEqual( vec2 x, vec2 y);
+bvec3 lessThanEqual( vec3 x, vec3 y);
+bvec4 lessThanEqual( vec4 x, vec4 y);
+bvec2 lessThanEqual(ivec2 x, ivec2 y);
+bvec3 lessThanEqual(ivec3 x, ivec3 y);
+bvec4 lessThanEqual(ivec4 x, ivec4 y);
+
+bvec2 greaterThan( vec2 x, vec2 y);
+bvec3 greaterThan( vec3 x, vec3 y);
+bvec4 greaterThan( vec4 x, vec4 y);
+bvec2 greaterThan(ivec2 x, ivec2 y);
+bvec3 greaterThan(ivec3 x, ivec3 y);
+bvec4 greaterThan(ivec4 x, ivec4 y);
+
+bvec2 greaterThanEqual( vec2 x, vec2 y);
+bvec3 greaterThanEqual( vec3 x, vec3 y);
+bvec4 greaterThanEqual( vec4 x, vec4 y);
+bvec2 greaterThanEqual(ivec2 x, ivec2 y);
+bvec3 greaterThanEqual(ivec3 x, ivec3 y);
+bvec4 greaterThanEqual(ivec4 x, ivec4 y);
+
+bvec2 equal( vec2 x, vec2 y);
+bvec3 equal( vec3 x, vec3 y);
+bvec4 equal( vec4 x, vec4 y);
+bvec2 equal(ivec2 x, ivec2 y);
+bvec3 equal(ivec3 x, ivec3 y);
+bvec4 equal(ivec4 x, ivec4 y);
+bvec2 equal(bvec2 x, bvec2 y);
+bvec3 equal(bvec3 x, bvec3 y);
+bvec4 equal(bvec4 x, bvec4 y);
+
+bvec2 notEqual( vec2 x, vec2 y);
+bvec3 notEqual( vec3 x, vec3 y);
+bvec4 notEqual( vec4 x, vec4 y);
+bvec2 notEqual(ivec2 x, ivec2 y);
+bvec3 notEqual(ivec3 x, ivec3 y);
+bvec4 notEqual(ivec4 x, ivec4 y);
+bvec2 notEqual(bvec2 x, bvec2 y);
+bvec3 notEqual(bvec3 x, bvec3 y);
+bvec4 notEqual(bvec4 x, bvec4 y);
+
+bool any(bvec2 x);
+bool any(bvec3 x);
+bool any(bvec4 x);
+
+bool all(bvec2 x);
+bool all(bvec3 x);
+bool all(bvec4 x);
+
+bvec2 not(bvec2 x);
+bvec3 not(bvec3 x);
+bvec4 not(bvec4 x);
+
+/*
+ * 8.7 - Texture Lookup Functions
+ */
+vec4 texture2D (sampler2D sampler, vec2 coord);
+vec4 texture2DProj (sampler2D sampler, vec3 coord);
+vec4 texture2DProj (sampler2D sampler, vec4 coord);
+vec4 texture2D (sampler2D sampler, vec2 coord, float bias);
+vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias);
+vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias);
+
+vec4 textureCube (samplerCube sampler, vec3 coord);
+vec4 textureCube (samplerCube sampler, vec3 coord, float bias);
diff --git a/src/glsl/builtins/profiles/100.vert b/src/glsl/builtins/profiles/100.vert
new file mode 100644
index 0000000000..e5d96f1db7
--- /dev/null
+++ b/src/glsl/builtins/profiles/100.vert
@@ -0,0 +1,300 @@
+#version 100
+/*
+ * 8.1 - Angle and Trigonometry Functions
+ */
+float radians(float degrees);
+vec2 radians(vec2 degrees);
+vec3 radians(vec3 degrees);
+vec4 radians(vec4 degrees);
+
+float degrees(float radians);
+vec2 degrees(vec2 radians);
+vec3 degrees(vec3 radians);
+vec4 degrees(vec4 radians);
+
+float sin(float angle);
+vec2 sin(vec2 angle);
+vec3 sin(vec3 angle);
+vec4 sin(vec4 angle);
+
+float cos(float angle);
+vec2 cos(vec2 angle);
+vec3 cos(vec3 angle);
+vec4 cos(vec4 angle);
+
+float tan(float angle);
+vec2 tan(vec2 angle);
+vec3 tan(vec3 angle);
+vec4 tan(vec4 angle);
+
+float asin(float angle);
+vec2 asin(vec2 angle);
+vec3 asin(vec3 angle);
+vec4 asin(vec4 angle);
+
+float acos(float angle);
+vec2 acos(vec2 angle);
+vec3 acos(vec3 angle);
+vec4 acos(vec4 angle);
+
+float atan(float y, float x);
+vec2 atan(vec2 y, vec2 x);
+vec3 atan(vec3 y, vec3 x);
+vec4 atan(vec4 y, vec4 x);
+
+float atan(float y_over_x);
+vec2 atan(vec2 y_over_x);
+vec3 atan(vec3 y_over_x);
+vec4 atan(vec4 y_over_x);
+
+/*
+ * 8.2 - Exponential Functions
+ */
+float pow(float x, float y);
+vec2 pow(vec2 x, vec2 y);
+vec3 pow(vec3 x, vec3 y);
+vec4 pow(vec4 x, vec4 y);
+
+float exp(float x);
+vec2 exp(vec2 x);
+vec3 exp(vec3 x);
+vec4 exp(vec4 x);
+
+float log(float x);
+vec2 log(vec2 x);
+vec3 log(vec3 x);
+vec4 log(vec4 x);
+
+float exp2(float x);
+vec2 exp2(vec2 x);
+vec3 exp2(vec3 x);
+vec4 exp2(vec4 x);
+
+float log2(float x);
+vec2 log2(vec2 x);
+vec3 log2(vec3 x);
+vec4 log2(vec4 x);
+
+float sqrt(float x);
+vec2 sqrt(vec2 x);
+vec3 sqrt(vec3 x);
+vec4 sqrt(vec4 x);
+
+float inversesqrt(float x);
+vec2 inversesqrt(vec2 x);
+vec3 inversesqrt(vec3 x);
+vec4 inversesqrt(vec4 x);
+
+/*
+ * 8.3 - Common Functions
+ */
+float abs(float x);
+vec2 abs(vec2 x);
+vec3 abs(vec3 x);
+vec4 abs(vec4 x);
+
+float sign(float x);
+vec2 sign(vec2 x);
+vec3 sign(vec3 x);
+vec4 sign(vec4 x);
+
+float floor(float x);
+vec2 floor(vec2 x);
+vec3 floor(vec3 x);
+vec4 floor(vec4 x);
+
+float ceil(float x);
+vec2 ceil(vec2 x);
+vec3 ceil(vec3 x);
+vec4 ceil(vec4 x);
+
+float fract(float x);
+vec2 fract(vec2 x);
+vec3 fract(vec3 x);
+vec4 fract(vec4 x);
+
+float mod(float x, float y);
+vec2 mod(vec2 x, float y);
+vec3 mod(vec3 x, float y);
+vec4 mod(vec4 x, float y);
+
+vec2 mod(vec2 x, vec2 y);
+vec3 mod(vec3 x, vec3 y);
+vec4 mod(vec4 x, vec4 y);
+
+float min(float x, float y);
+vec2 min(vec2 x, vec2 y);
+vec3 min(vec3 x, vec3 y);
+vec4 min(vec4 x, vec4 y);
+
+vec2 min(vec2 x, float y);
+vec3 min(vec3 x, float y);
+vec4 min(vec4 x, float y);
+
+float max(float x, float y);
+vec2 max(vec2 x, vec2 y);
+vec3 max(vec3 x, vec3 y);
+vec4 max(vec4 x, vec4 y);
+
+vec2 max(vec2 x, float y);
+vec3 max(vec3 x, float y);
+vec4 max(vec4 x, float y);
+
+float clamp(float x, float minVal, float maxVal);
+vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
+vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
+vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
+
+vec2 clamp(vec2 x, float minVal, float maxVal);
+vec3 clamp(vec3 x, float minVal, float maxVal);
+vec4 clamp(vec4 x, float minVal, float maxVal);
+
+float mix(float x, float y, float a);
+vec2 mix(vec2 x, vec2 y, vec2 a);
+vec3 mix(vec3 x, vec3 y, vec3 a);
+vec4 mix(vec4 x, vec4 y, vec4 a);
+
+vec2 mix(vec2 x, vec2 y, float a);
+vec3 mix(vec3 x, vec3 y, float a);
+vec4 mix(vec4 x, vec4 y, float a);
+
+float step(float edge, float x);
+vec2 step(vec2 edge, vec2 x);
+vec3 step(vec3 edge, vec3 x);
+vec4 step(vec4 edge, vec4 x);
+
+vec2 step(float edge, vec2 x);
+vec3 step(float edge, vec3 x);
+vec4 step(float edge, vec4 x);
+
+float smoothstep(float edge0, float edge1, float x);
+vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
+vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
+vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
+
+vec2 smoothstep(float edge0, float edge1, vec2 x);
+vec3 smoothstep(float edge0, float edge1, vec3 x);
+vec4 smoothstep(float edge0, float edge1, vec4 x);
+
+/*
+ * 8.4 - Geometric Functions
+ */
+float length(float x);
+float length(vec2 x);
+float length(vec3 x);
+float length(vec4 x);
+
+float distance(float p0, float p1);
+float distance(vec2 p0, vec2 p1);
+float distance(vec3 p0, vec3 p1);
+float distance(vec4 p0, vec4 p1);
+
+float dot(float x, float y);
+float dot(vec2 x, vec2 y);
+float dot(vec3 x, vec3 y);
+float dot(vec4 x, vec4 y);
+
+vec3 cross(vec3 x, vec3 y);
+
+float normalize(float x);
+vec2 normalize(vec2 x);
+vec3 normalize(vec3 x);
+vec4 normalize(vec4 x);
+
+float faceforward(float N, float I, float Nref);
+vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
+vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
+vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
+
+float reflect(float I, float N);
+vec2 reflect(vec2 I, vec2 N);
+vec3 reflect(vec3 I, vec3 N);
+vec4 reflect(vec4 I, vec4 N);
+
+float refract(float I, float N, float eta);
+vec2 refract(vec2 I, vec2 N, float eta);
+vec3 refract(vec3 I, vec3 N, float eta);
+vec4 refract(vec4 I, vec4 N, float eta);
+
+/*
+ * 8.5 - Matrix Functions
+ */
+mat2 matrixCompMult(mat2 x, mat2 y);
+mat3 matrixCompMult(mat3 x, mat3 y);
+mat4 matrixCompMult(mat4 x, mat4 y);
+
+/*
+ * 8.6 - Vector Relational Functions
+ */
+bvec2 lessThan( vec2 x, vec2 y);
+bvec3 lessThan( vec3 x, vec3 y);
+bvec4 lessThan( vec4 x, vec4 y);
+bvec2 lessThan(ivec2 x, ivec2 y);
+bvec3 lessThan(ivec3 x, ivec3 y);
+bvec4 lessThan(ivec4 x, ivec4 y);
+
+bvec2 lessThanEqual( vec2 x, vec2 y);
+bvec3 lessThanEqual( vec3 x, vec3 y);
+bvec4 lessThanEqual( vec4 x, vec4 y);
+bvec2 lessThanEqual(ivec2 x, ivec2 y);
+bvec3 lessThanEqual(ivec3 x, ivec3 y);
+bvec4 lessThanEqual(ivec4 x, ivec4 y);
+
+bvec2 greaterThan( vec2 x, vec2 y);
+bvec3 greaterThan( vec3 x, vec3 y);
+bvec4 greaterThan( vec4 x, vec4 y);
+bvec2 greaterThan(ivec2 x, ivec2 y);
+bvec3 greaterThan(ivec3 x, ivec3 y);
+bvec4 greaterThan(ivec4 x, ivec4 y);
+
+bvec2 greaterThanEqual( vec2 x, vec2 y);
+bvec3 greaterThanEqual( vec3 x, vec3 y);
+bvec4 greaterThanEqual( vec4 x, vec4 y);
+bvec2 greaterThanEqual(ivec2 x, ivec2 y);
+bvec3 greaterThanEqual(ivec3 x, ivec3 y);
+bvec4 greaterThanEqual(ivec4 x, ivec4 y);
+
+bvec2 equal( vec2 x, vec2 y);
+bvec3 equal( vec3 x, vec3 y);
+bvec4 equal( vec4 x, vec4 y);
+bvec2 equal(ivec2 x, ivec2 y);
+bvec3 equal(ivec3 x, ivec3 y);
+bvec4 equal(ivec4 x, ivec4 y);
+bvec2 equal(bvec2 x, bvec2 y);
+bvec3 equal(bvec3 x, bvec3 y);
+bvec4 equal(bvec4 x, bvec4 y);
+
+bvec2 notEqual( vec2 x, vec2 y);
+bvec3 notEqual( vec3 x, vec3 y);
+bvec4 notEqual( vec4 x, vec4 y);
+bvec2 notEqual(ivec2 x, ivec2 y);
+bvec3 notEqual(ivec3 x, ivec3 y);
+bvec4 notEqual(ivec4 x, ivec4 y);
+bvec2 notEqual(bvec2 x, bvec2 y);
+bvec3 notEqual(bvec3 x, bvec3 y);
+bvec4 notEqual(bvec4 x, bvec4 y);
+
+bool any(bvec2 x);
+bool any(bvec3 x);
+bool any(bvec4 x);
+
+bool all(bvec2 x);
+bool all(bvec3 x);
+bool all(bvec4 x);
+
+bvec2 not(bvec2 x);
+bvec3 not(bvec3 x);
+bvec4 not(bvec4 x);
+
+/*
+ * 8.7 - Texture Lookup Functions
+ */
+vec4 texture2D (sampler2D sampler, vec2 coord);
+vec4 texture2DProj (sampler2D sampler, vec3 coord);
+vec4 texture2DProj (sampler2D sampler, vec4 coord);
+vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod);
+vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);
+vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);
+
+vec4 textureCube (samplerCube sampler, vec3 coord);
+vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod);
diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
index 5accc1b120..691a318c1c 100755
--- a/src/glsl/builtins/tools/generate_builtins.py
+++ b/src/glsl/builtins/tools/generate_builtins.py
@@ -128,9 +128,11 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
+ GLcontext fakeCtx;
+ fakeCtx.API = API_OPENGL;
gl_shader *sh = _mesa_new_shader(NULL, 0, target);
struct _mesa_glsl_parse_state *st =
- new(sh) _mesa_glsl_parse_state(NULL, target, sh);
+ new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
st->language_version = 130;
st->symbols->language_version = 130;
@@ -153,6 +155,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
if (st->error) {
printf("error reading builtin: %.35s ...\\n", functions[i]);
+ printf("Info log:\\n%s\\n", st->info_log);
talloc_free(sh);
return NULL;
}
@@ -180,6 +183,7 @@ _mesa_glsl_release_functions(void)
{
talloc_free(builtin_mem_ctx);
builtin_mem_ctx = NULL;
+ memset(builtin_profiles, 0, sizeof(builtin_profiles));
}
static void
diff --git a/src/glsl/glcpp/glcpp-parse.c b/src/glsl/glcpp/glcpp-parse.c
index 91eb0bf972..1773ca5c13 100644
--- a/src/glsl/glcpp/glcpp-parse.c
+++ b/src/glsl/glcpp/glcpp-parse.c
@@ -1,10 +1,9 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -101,6 +100,7 @@
#include "glcpp.h"
#include "main/core.h" /* for struct gl_extensions */
+#include "main/mtypes.h" /* for gl_api enum */
#define glcpp_print(stream, str) stream = talloc_strdup_append(stream, str)
#define glcpp_printf(stream, fmt, args, ...) \
@@ -357,7 +357,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -632,17 +632,17 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 187, 187, 189, 193, 196, 201, 202, 206, 209,
- 215, 218, 221, 224, 232, 251, 261, 266, 271, 290,
- 305, 308, 311, 320, 324, 333, 338, 339, 342, 345,
- 348, 351, 354, 357, 360, 363, 366, 369, 372, 375,
- 378, 381, 384, 387, 390, 393, 396, 399, 402, 405,
- 411, 416, 424, 425, 429, 435, 436, 439, 441, 448,
- 452, 456, 461, 467, 475, 481, 489, 493, 497, 501,
- 505, 512, 513, 514, 515, 516, 517, 518, 519, 520,
- 521, 522, 523, 524, 525, 526, 527, 528, 529, 530,
- 531, 532, 533, 534, 535, 536, 537, 538, 539, 540,
- 541, 542
+ 0, 188, 188, 190, 194, 197, 202, 203, 207, 210,
+ 216, 219, 222, 225, 233, 252, 262, 267, 272, 291,
+ 306, 309, 312, 325, 329, 338, 343, 344, 347, 350,
+ 353, 356, 359, 362, 365, 368, 371, 374, 377, 380,
+ 383, 386, 389, 392, 395, 398, 401, 404, 407, 410,
+ 416, 421, 429, 430, 434, 440, 441, 444, 446, 453,
+ 457, 461, 466, 472, 480, 486, 494, 498, 502, 506,
+ 510, 517, 518, 519, 520, 521, 522, 523, 524, 525,
+ 526, 527, 528, 529, 530, 531, 532, 533, 534, 535,
+ 536, 537, 538, 539, 540, 541, 542, 543, 544, 545,
+ 546, 547
};
#endif
@@ -945,9 +945,18 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -1004,7 +1013,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -1546,7 +1555,7 @@ YYLTYPE yylloc;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
- YYLTYPE yyerror_range[2];
+ YYLTYPE yyerror_range[3];
YYSIZE_T yystacksize;
@@ -1593,7 +1602,7 @@ YYLTYPE yylloc;
yyvsp = yyvs;
yylsp = yyls;
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
@@ -1601,8 +1610,8 @@ YYLTYPE yylloc;
/* User initialization code. */
-/* Line 1242 of yacc.c */
-#line 154 "glcpp/glcpp-parse.y"
+/* Line 1251 of yacc.c */
+#line 155 "glcpp/glcpp-parse.y"
{
yylloc.first_line = 1;
yylloc.first_column = 1;
@@ -1611,8 +1620,8 @@ YYLTYPE yylloc;
yylloc.source = 0;
}
-/* Line 1242 of yacc.c */
-#line 1616 "glcpp/glcpp-parse.c"
+/* Line 1251 of yacc.c */
+#line 1625 "glcpp/glcpp-parse.c"
yylsp[0] = yylloc;
goto yysetstate;
@@ -1799,8 +1808,8 @@ yyreduce:
{
case 4:
-/* Line 1455 of yacc.c */
-#line 193 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 194 "glcpp/glcpp-parse.y"
{
glcpp_print(parser->output, "\n");
;}
@@ -1808,8 +1817,8 @@ yyreduce:
case 5:
-/* Line 1455 of yacc.c */
-#line 196 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 197 "glcpp/glcpp-parse.y"
{
_glcpp_parser_print_expanded_token_list (parser, (yyvsp[(1) - (1)].token_list));
glcpp_print(parser->output, "\n");
@@ -1819,8 +1828,8 @@ yyreduce:
case 8:
-/* Line 1455 of yacc.c */
-#line 206 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 207 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), (yyvsp[(2) - (3)].ival));
;}
@@ -1828,8 +1837,8 @@ yyreduce:
case 9:
-/* Line 1455 of yacc.c */
-#line 209 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 210 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (3)]), "elif", (yyvsp[(2) - (3)].ival));
;}
@@ -1837,8 +1846,8 @@ yyreduce:
case 10:
-/* Line 1455 of yacc.c */
-#line 215 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 216 "glcpp/glcpp-parse.y"
{
_define_object_macro (parser, & (yylsp[(2) - (4)]), (yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].token_list));
;}
@@ -1846,8 +1855,8 @@ yyreduce:
case 11:
-/* Line 1455 of yacc.c */
-#line 218 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 219 "glcpp/glcpp-parse.y"
{
_define_function_macro (parser, & (yylsp[(2) - (6)]), (yyvsp[(2) - (6)].str), NULL, (yyvsp[(5) - (6)].token_list));
;}
@@ -1855,8 +1864,8 @@ yyreduce:
case 12:
-/* Line 1455 of yacc.c */
-#line 221 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 222 "glcpp/glcpp-parse.y"
{
_define_function_macro (parser, & (yylsp[(2) - (7)]), (yyvsp[(2) - (7)].str), (yyvsp[(4) - (7)].string_list), (yyvsp[(6) - (7)].token_list));
;}
@@ -1864,8 +1873,8 @@ yyreduce:
case 13:
-/* Line 1455 of yacc.c */
-#line 224 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 225 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (3)].str));
if (macro) {
@@ -1878,8 +1887,8 @@ yyreduce:
case 14:
-/* Line 1455 of yacc.c */
-#line 232 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 233 "glcpp/glcpp-parse.y"
{
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we
@@ -1903,8 +1912,8 @@ yyreduce:
case 15:
-/* Line 1455 of yacc.c */
-#line 251 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 252 "glcpp/glcpp-parse.y"
{
/* #if without an expression is only an error if we
* are not skipping */
@@ -1919,8 +1928,8 @@ yyreduce:
case 16:
-/* Line 1455 of yacc.c */
-#line 261 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 262 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str));
talloc_free ((yyvsp[(2) - (4)].str));
@@ -1930,8 +1939,8 @@ yyreduce:
case 17:
-/* Line 1455 of yacc.c */
-#line 266 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 267 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str));
talloc_free ((yyvsp[(2) - (4)].str));
@@ -1941,8 +1950,8 @@ yyreduce:
case 18:
-/* Line 1455 of yacc.c */
-#line 271 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 272 "glcpp/glcpp-parse.y"
{
/* Be careful to only evaluate the 'elif' expression
* if we are not skipping. When we are skipping, we
@@ -1966,8 +1975,8 @@ yyreduce:
case 19:
-/* Line 1455 of yacc.c */
-#line 290 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 291 "glcpp/glcpp-parse.y"
{
/* #elif without an expression is an error unless we
* are skipping. */
@@ -1987,8 +1996,8 @@ yyreduce:
case 20:
-/* Line 1455 of yacc.c */
-#line 305 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 306 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (2)]), "else", 1);
;}
@@ -1996,8 +2005,8 @@ yyreduce:
case 21:
-/* Line 1455 of yacc.c */
-#line 308 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 309 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_pop (parser, & (yylsp[(1) - (2)]));
;}
@@ -2005,8 +2014,8 @@ yyreduce:
case 22:
-/* Line 1455 of yacc.c */
-#line 311 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 312 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
if (macro) {
@@ -2014,14 +2023,18 @@ yyreduce:
talloc_free (macro);
}
add_builtin_define (parser, "__VERSION__", (yyvsp[(2) - (3)].ival));
+
+ if ((yyvsp[(2) - (3)].ival) == 100)
+ add_builtin_define (parser, "GL_ES", 1);
+
glcpp_printf(parser->output, "#version %" PRIiMAX, (yyvsp[(2) - (3)].ival));
;}
break;
case 24:
-/* Line 1455 of yacc.c */
-#line 324 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 329 "glcpp/glcpp-parse.y"
{
if (strlen ((yyvsp[(1) - (1)].str)) >= 3 && strncmp ((yyvsp[(1) - (1)].str), "0x", 2) == 0) {
(yyval.ival) = strtoll ((yyvsp[(1) - (1)].str) + 2, NULL, 16);
@@ -2035,8 +2048,8 @@ yyreduce:
case 25:
-/* Line 1455 of yacc.c */
-#line 333 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 338 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (1)].ival);
;}
@@ -2044,8 +2057,8 @@ yyreduce:
case 27:
-/* Line 1455 of yacc.c */
-#line 339 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 344 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) || (yyvsp[(3) - (3)].ival);
;}
@@ -2053,8 +2066,8 @@ yyreduce:
case 28:
-/* Line 1455 of yacc.c */
-#line 342 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 347 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) && (yyvsp[(3) - (3)].ival);
;}
@@ -2062,8 +2075,8 @@ yyreduce:
case 29:
-/* Line 1455 of yacc.c */
-#line 345 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 350 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival);
;}
@@ -2071,8 +2084,8 @@ yyreduce:
case 30:
-/* Line 1455 of yacc.c */
-#line 348 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 353 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) ^ (yyvsp[(3) - (3)].ival);
;}
@@ -2080,8 +2093,8 @@ yyreduce:
case 31:
-/* Line 1455 of yacc.c */
-#line 351 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 356 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) & (yyvsp[(3) - (3)].ival);
;}
@@ -2089,8 +2102,8 @@ yyreduce:
case 32:
-/* Line 1455 of yacc.c */
-#line 354 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 359 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) != (yyvsp[(3) - (3)].ival);
;}
@@ -2098,8 +2111,8 @@ yyreduce:
case 33:
-/* Line 1455 of yacc.c */
-#line 357 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 362 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) == (yyvsp[(3) - (3)].ival);
;}
@@ -2107,8 +2120,8 @@ yyreduce:
case 34:
-/* Line 1455 of yacc.c */
-#line 360 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 365 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) >= (yyvsp[(3) - (3)].ival);
;}
@@ -2116,8 +2129,8 @@ yyreduce:
case 35:
-/* Line 1455 of yacc.c */
-#line 363 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 368 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) <= (yyvsp[(3) - (3)].ival);
;}
@@ -2125,8 +2138,8 @@ yyreduce:
case 36:
-/* Line 1455 of yacc.c */
-#line 366 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 371 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) > (yyvsp[(3) - (3)].ival);
;}
@@ -2134,8 +2147,8 @@ yyreduce:
case 37:
-/* Line 1455 of yacc.c */
-#line 369 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 374 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) < (yyvsp[(3) - (3)].ival);
;}
@@ -2143,8 +2156,8 @@ yyreduce:
case 38:
-/* Line 1455 of yacc.c */
-#line 372 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 377 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) >> (yyvsp[(3) - (3)].ival);
;}
@@ -2152,8 +2165,8 @@ yyreduce:
case 39:
-/* Line 1455 of yacc.c */
-#line 375 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 380 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) << (yyvsp[(3) - (3)].ival);
;}
@@ -2161,8 +2174,8 @@ yyreduce:
case 40:
-/* Line 1455 of yacc.c */
-#line 378 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 383 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) - (yyvsp[(3) - (3)].ival);
;}
@@ -2170,8 +2183,8 @@ yyreduce:
case 41:
-/* Line 1455 of yacc.c */
-#line 381 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 386 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) + (yyvsp[(3) - (3)].ival);
;}
@@ -2179,8 +2192,8 @@ yyreduce:
case 42:
-/* Line 1455 of yacc.c */
-#line 384 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 389 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) % (yyvsp[(3) - (3)].ival);
;}
@@ -2188,8 +2201,8 @@ yyreduce:
case 43:
-/* Line 1455 of yacc.c */
-#line 387 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 392 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) / (yyvsp[(3) - (3)].ival);
;}
@@ -2197,8 +2210,8 @@ yyreduce:
case 44:
-/* Line 1455 of yacc.c */
-#line 390 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 395 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) * (yyvsp[(3) - (3)].ival);
;}
@@ -2206,8 +2219,8 @@ yyreduce:
case 45:
-/* Line 1455 of yacc.c */
-#line 393 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 398 "glcpp/glcpp-parse.y"
{
(yyval.ival) = ! (yyvsp[(2) - (2)].ival);
;}
@@ -2215,8 +2228,8 @@ yyreduce:
case 46:
-/* Line 1455 of yacc.c */
-#line 396 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 401 "glcpp/glcpp-parse.y"
{
(yyval.ival) = ~ (yyvsp[(2) - (2)].ival);
;}
@@ -2224,8 +2237,8 @@ yyreduce:
case 47:
-/* Line 1455 of yacc.c */
-#line 399 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 404 "glcpp/glcpp-parse.y"
{
(yyval.ival) = - (yyvsp[(2) - (2)].ival);
;}
@@ -2233,8 +2246,8 @@ yyreduce:
case 48:
-/* Line 1455 of yacc.c */
-#line 402 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 407 "glcpp/glcpp-parse.y"
{
(yyval.ival) = + (yyvsp[(2) - (2)].ival);
;}
@@ -2242,8 +2255,8 @@ yyreduce:
case 49:
-/* Line 1455 of yacc.c */
-#line 405 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 410 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(2) - (3)].ival);
;}
@@ -2251,8 +2264,8 @@ yyreduce:
case 50:
-/* Line 1455 of yacc.c */
-#line 411 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 416 "glcpp/glcpp-parse.y"
{
(yyval.string_list) = _string_list_create (parser);
_string_list_append_item ((yyval.string_list), (yyvsp[(1) - (1)].str));
@@ -2262,8 +2275,8 @@ yyreduce:
case 51:
-/* Line 1455 of yacc.c */
-#line 416 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 421 "glcpp/glcpp-parse.y"
{
(yyval.string_list) = (yyvsp[(1) - (3)].string_list);
_string_list_append_item ((yyval.string_list), (yyvsp[(3) - (3)].str));
@@ -2273,15 +2286,15 @@ yyreduce:
case 52:
-/* Line 1455 of yacc.c */
-#line 424 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 429 "glcpp/glcpp-parse.y"
{ (yyval.token_list) = NULL; ;}
break;
case 54:
-/* Line 1455 of yacc.c */
-#line 429 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 434 "glcpp/glcpp-parse.y"
{
yyerror (& (yylsp[(1) - (2)]), parser, "Invalid tokens after #");
;}
@@ -2289,15 +2302,15 @@ yyreduce:
case 55:
-/* Line 1455 of yacc.c */
-#line 435 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 440 "glcpp/glcpp-parse.y"
{ (yyval.token_list) = NULL; ;}
break;
case 58:
-/* Line 1455 of yacc.c */
-#line 441 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 446 "glcpp/glcpp-parse.y"
{
glcpp_warning(&(yylsp[(1) - (1)]), parser, "extra tokens at end of directive");
;}
@@ -2305,8 +2318,8 @@ yyreduce:
case 59:
-/* Line 1455 of yacc.c */
-#line 448 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 453 "glcpp/glcpp-parse.y"
{
int v = hash_table_find (parser->defines, (yyvsp[(2) - (2)].str)) ? 1 : 0;
(yyval.token) = _token_create_ival (parser, INTEGER, v);
@@ -2315,8 +2328,8 @@ yyreduce:
case 60:
-/* Line 1455 of yacc.c */
-#line 452 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 457 "glcpp/glcpp-parse.y"
{
int v = hash_table_find (parser->defines, (yyvsp[(3) - (4)].str)) ? 1 : 0;
(yyval.token) = _token_create_ival (parser, INTEGER, v);
@@ -2325,8 +2338,8 @@ yyreduce:
case 62:
-/* Line 1455 of yacc.c */
-#line 461 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 466 "glcpp/glcpp-parse.y"
{
parser->space_tokens = 1;
(yyval.token_list) = _token_list_create (parser);
@@ -2337,8 +2350,8 @@ yyreduce:
case 63:
-/* Line 1455 of yacc.c */
-#line 467 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 472 "glcpp/glcpp-parse.y"
{
(yyval.token_list) = (yyvsp[(1) - (2)].token_list);
_token_list_append ((yyval.token_list), (yyvsp[(2) - (2)].token));
@@ -2348,8 +2361,8 @@ yyreduce:
case 64:
-/* Line 1455 of yacc.c */
-#line 475 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 480 "glcpp/glcpp-parse.y"
{
parser->space_tokens = 1;
(yyval.token_list) = _token_list_create (parser);
@@ -2360,8 +2373,8 @@ yyreduce:
case 65:
-/* Line 1455 of yacc.c */
-#line 481 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 486 "glcpp/glcpp-parse.y"
{
(yyval.token_list) = (yyvsp[(1) - (2)].token_list);
_token_list_append ((yyval.token_list), (yyvsp[(2) - (2)].token));
@@ -2371,8 +2384,8 @@ yyreduce:
case 66:
-/* Line 1455 of yacc.c */
-#line 489 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 494 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[(1) - (1)].str));
(yyval.token)->location = yylloc;
@@ -2381,8 +2394,8 @@ yyreduce:
case 67:
-/* Line 1455 of yacc.c */
-#line 493 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 498 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[(1) - (1)].str));
(yyval.token)->location = yylloc;
@@ -2391,8 +2404,8 @@ yyreduce:
case 68:
-/* Line 1455 of yacc.c */
-#line 497 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 502 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_ival (parser, (yyvsp[(1) - (1)].ival), (yyvsp[(1) - (1)].ival));
(yyval.token)->location = yylloc;
@@ -2401,8 +2414,8 @@ yyreduce:
case 69:
-/* Line 1455 of yacc.c */
-#line 501 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 506 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_str (parser, OTHER, (yyvsp[(1) - (1)].str));
(yyval.token)->location = yylloc;
@@ -2411,8 +2424,8 @@ yyreduce:
case 70:
-/* Line 1455 of yacc.c */
-#line 505 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 510 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_ival (parser, SPACE, SPACE);
(yyval.token)->location = yylloc;
@@ -2421,225 +2434,225 @@ yyreduce:
case 71:
-/* Line 1455 of yacc.c */
-#line 512 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 517 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '['; ;}
break;
case 72:
-/* Line 1455 of yacc.c */
-#line 513 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 518 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ']'; ;}
break;
case 73:
-/* Line 1455 of yacc.c */
-#line 514 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 519 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '('; ;}
break;
case 74:
-/* Line 1455 of yacc.c */
-#line 515 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 520 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ')'; ;}
break;
case 75:
-/* Line 1455 of yacc.c */
-#line 516 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 521 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '{'; ;}
break;
case 76:
-/* Line 1455 of yacc.c */
-#line 517 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 522 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '}'; ;}
break;
case 77:
-/* Line 1455 of yacc.c */
-#line 518 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 523 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '.'; ;}
break;
case 78:
-/* Line 1455 of yacc.c */
-#line 519 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 524 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '&'; ;}
break;
case 79:
-/* Line 1455 of yacc.c */
-#line 520 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 525 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '*'; ;}
break;
case 80:
-/* Line 1455 of yacc.c */
-#line 521 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 526 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '+'; ;}
break;
case 81:
-/* Line 1455 of yacc.c */
-#line 522 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 527 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '-'; ;}
break;
case 82:
-/* Line 1455 of yacc.c */
-#line 523 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 528 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '~'; ;}
break;
case 83:
-/* Line 1455 of yacc.c */
-#line 524 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 529 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '!'; ;}
break;
case 84:
-/* Line 1455 of yacc.c */
-#line 525 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 530 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '/'; ;}
break;
case 85:
-/* Line 1455 of yacc.c */
-#line 526 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 531 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '%'; ;}
break;
case 86:
-/* Line 1455 of yacc.c */
-#line 527 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 532 "glcpp/glcpp-parse.y"
{ (yyval.ival) = LEFT_SHIFT; ;}
break;
case 87:
-/* Line 1455 of yacc.c */
-#line 528 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 533 "glcpp/glcpp-parse.y"
{ (yyval.ival) = RIGHT_SHIFT; ;}
break;
case 88:
-/* Line 1455 of yacc.c */
-#line 529 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 534 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '<'; ;}
break;
case 89:
-/* Line 1455 of yacc.c */
-#line 530 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 535 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '>'; ;}
break;
case 90:
-/* Line 1455 of yacc.c */
-#line 531 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 536 "glcpp/glcpp-parse.y"
{ (yyval.ival) = LESS_OR_EQUAL; ;}
break;
case 91:
-/* Line 1455 of yacc.c */
-#line 532 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 537 "glcpp/glcpp-parse.y"
{ (yyval.ival) = GREATER_OR_EQUAL; ;}
break;
case 92:
-/* Line 1455 of yacc.c */
-#line 533 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 538 "glcpp/glcpp-parse.y"
{ (yyval.ival) = EQUAL; ;}
break;
case 93:
-/* Line 1455 of yacc.c */
-#line 534 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 539 "glcpp/glcpp-parse.y"
{ (yyval.ival) = NOT_EQUAL; ;}
break;
case 94:
-/* Line 1455 of yacc.c */
-#line 535 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 540 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '^'; ;}
break;
case 95:
-/* Line 1455 of yacc.c */
-#line 536 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 541 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '|'; ;}
break;
case 96:
-/* Line 1455 of yacc.c */
-#line 537 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 542 "glcpp/glcpp-parse.y"
{ (yyval.ival) = AND; ;}
break;
case 97:
-/* Line 1455 of yacc.c */
-#line 538 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 543 "glcpp/glcpp-parse.y"
{ (yyval.ival) = OR; ;}
break;
case 98:
-/* Line 1455 of yacc.c */
-#line 539 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 544 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ';'; ;}
break;
case 99:
-/* Line 1455 of yacc.c */
-#line 540 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 545 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ','; ;}
break;
case 100:
-/* Line 1455 of yacc.c */
-#line 541 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 546 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '='; ;}
break;
case 101:
-/* Line 1455 of yacc.c */
-#line 542 "glcpp/glcpp-parse.y"
+/* Line 1464 of yacc.c */
+#line 547 "glcpp/glcpp-parse.y"
{ (yyval.ival) = PASTE; ;}
break;
-/* Line 1455 of yacc.c */
-#line 2643 "glcpp/glcpp-parse.c"
+/* Line 1464 of yacc.c */
+#line 2656 "glcpp/glcpp-parse.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2711,7 +2724,7 @@ yyerrlab:
#endif
}
- yyerror_range[0] = yylloc;
+ yyerror_range[1] = yylloc;
if (yyerrstatus == 3)
{
@@ -2748,7 +2761,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- yyerror_range[0] = yylsp[1-yylen];
+ yyerror_range[1] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
@@ -2782,7 +2795,7 @@ yyerrlab1:
if (yyssp == yyss)
YYABORT;
- yyerror_range[0] = *yylsp;
+ yyerror_range[1] = *yylsp;
yydestruct ("Error: popping",
yystos[yystate], yyvsp, yylsp, parser);
YYPOPSTACK (1);
@@ -2792,10 +2805,10 @@ yyerrlab1:
*++yyvsp = yylval;
- yyerror_range[1] = yylloc;
+ yyerror_range[2] = yylloc;
/* Using YYLLOC is tempting, but would change the location of
the lookahead. YYLOC is available though. */
- YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+ YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
*++yylsp = yyloc;
/* Shift the error token. */
@@ -2857,8 +2870,8 @@ yyreturn:
-/* Line 1675 of yacc.c */
-#line 545 "glcpp/glcpp-parse.y"
+/* Line 1684 of yacc.c */
+#line 550 "glcpp/glcpp-parse.y"
string_list_t *
@@ -3365,7 +3378,7 @@ static void add_builtin_define(glcpp_parser_t *parser,
}
glcpp_parser_t *
-glcpp_parser_create (const struct gl_extensions *extensions)
+glcpp_parser_create (const struct gl_extensions *extensions, int api)
{
glcpp_parser_t *parser;
int language_version;
@@ -3395,6 +3408,9 @@ glcpp_parser_create (const struct gl_extensions *extensions)
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
+ if (api == API_OPENGLES2)
+ add_builtin_define(parser, "GL_ES", 1);
+
if (extensions != NULL) {
if (extensions->EXT_texture_array) {
add_builtin_define(parser, "GL_EXT_texture_array", 1);
diff --git a/src/glsl/glcpp/glcpp-parse.h b/src/glsl/glcpp/glcpp-parse.h
index 50758930e9..40556854f3 100644
--- a/src/glsl/glcpp/glcpp-parse.h
+++ b/src/glsl/glcpp/glcpp-parse.h
@@ -1,10 +1,9 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 3c28edf688..43513ebb66 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -30,6 +30,7 @@
#include "glcpp.h"
#include "main/core.h" /* for struct gl_extensions */
+#include "main/mtypes.h" /* for gl_api enum */
#define glcpp_print(stream, str) stream = talloc_strdup_append(stream, str)
#define glcpp_printf(stream, fmt, args, ...) \
@@ -315,6 +316,10 @@ control_line:
talloc_free (macro);
}
add_builtin_define (parser, "__VERSION__", $2);
+
+ if ($2 == 100)
+ add_builtin_define (parser, "GL_ES", 1);
+
glcpp_printf(parser->output, "#version %" PRIiMAX, $2);
}
| HASH NEWLINE
@@ -1048,7 +1053,7 @@ static void add_builtin_define(glcpp_parser_t *parser,
}
glcpp_parser_t *
-glcpp_parser_create (const struct gl_extensions *extensions)
+glcpp_parser_create (const struct gl_extensions *extensions, int api)
{
glcpp_parser_t *parser;
int language_version;
@@ -1078,6 +1083,9 @@ glcpp_parser_create (const struct gl_extensions *extensions)
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
+ if (api == API_OPENGLES2)
+ add_builtin_define(parser, "GL_ES", 1);
+
if (extensions != NULL) {
if (extensions->EXT_texture_array) {
add_builtin_define(parser, "GL_EXT_texture_array", 1);
diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
index 56714936bb..8d1ced571b 100644
--- a/src/glsl/glcpp/glcpp.c
+++ b/src/glsl/glcpp/glcpp.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <errno.h>
#include "glcpp.h"
+#include "main/mtypes.h"
extern int yydebug;
@@ -111,7 +112,7 @@ main (int argc, char *argv[])
if (shader == NULL)
return 1;
- ret = preprocess(ctx, &shader, &info_log, NULL);
+ ret = preprocess(ctx, &shader, &info_log, NULL, API_OPENGL);
printf("%s", shader);
fprintf(stderr, "%s", info_log);
diff --git a/src/glsl/glcpp/glcpp.h b/src/glsl/glcpp/glcpp.h
index 0bebdb9ae8..7125d325df 100644
--- a/src/glsl/glcpp/glcpp.h
+++ b/src/glsl/glcpp/glcpp.h
@@ -180,7 +180,7 @@ struct glcpp_parser {
struct gl_extensions;
glcpp_parser_t *
-glcpp_parser_create (const struct gl_extensions *extensions);
+glcpp_parser_create (const struct gl_extensions *extensions, int api);
int
glcpp_parser_parse (glcpp_parser_t *parser);
@@ -190,7 +190,7 @@ glcpp_parser_destroy (glcpp_parser_t *parser);
int
preprocess(void *talloc_ctx, const char **shader, char **info_log,
- const struct gl_extensions *extensions);
+ const struct gl_extensions *extensions, int api);
/* Functions for writing to the info log */
diff --git a/src/glsl/glcpp/pp.c b/src/glsl/glcpp/pp.c
index a1d00c4193..e1a3a88a3e 100644
--- a/src/glsl/glcpp/pp.c
+++ b/src/glsl/glcpp/pp.c
@@ -143,10 +143,10 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
int
preprocess(void *talloc_ctx, const char **shader, char **info_log,
- const struct gl_extensions *extensions)
+ const struct gl_extensions *extensions, int api)
{
int errors;
- glcpp_parser_t *parser = glcpp_parser_create (extensions);
+ glcpp_parser_t *parser = glcpp_parser_create (extensions, api);
*shader = remove_line_continuations(parser, *shader);
glcpp_lex_set_source_string (parser, *shader);
diff --git a/src/glsl/glsl_lexer.cpp b/src/glsl/glsl_lexer.cpp
index 873df609d3..7661bbe982 100644
--- a/src/glsl/glsl_lexer.cpp
+++ b/src/glsl/glsl_lexer.cpp
@@ -54,6 +54,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! C99 */
-
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -159,15 +158,7 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -974,6 +965,16 @@ static yyconst flex_int16_t yy_chk[1145] =
} \
} while (0)
+/* Handle reserved words in GLSL ES (version 100) */
+#define TOKEN_OR_IDENTIFIER_ES(version, token) \
+ do { \
+ if (yyextra->es_shader) { \
+ return token; \
+ } else { \
+ TOKEN_OR_IDENTIFIER(version, token); \
+ } \
+ } while (0)
+
#define RESERVED_WORD(version, token) \
do { \
if (yyextra->language_version >= version) { \
@@ -985,7 +986,7 @@ static yyconst flex_int16_t yy_chk[1145] =
} \
} while (0)
-#line 989 "glsl_lexer.cpp"
+#line 990 "glsl_lexer.cpp"
#define INITIAL 0
#define PP 1
@@ -1112,12 +1113,7 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -1125,7 +1121,7 @@ static int input (yyscan_t yyscanner );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1136,7 +1132,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1224,10 +1220,10 @@ YY_DECL
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 76 "glsl_lexer.lpp"
+#line 86 "glsl_lexer.lpp"
-#line 1231 "glsl_lexer.cpp"
+#line 1227 "glsl_lexer.cpp"
yylval = yylval_param;
@@ -1313,7 +1309,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 78 "glsl_lexer.lpp"
+#line 88 "glsl_lexer.lpp"
;
YY_BREAK
/* Preprocessor tokens. */
@@ -1322,17 +1318,17 @@ case 2:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 81 "glsl_lexer.lpp"
+#line 91 "glsl_lexer.lpp"
;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 82 "glsl_lexer.lpp"
+#line 92 "glsl_lexer.lpp"
{ BEGIN PP; return VERSION; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 83 "glsl_lexer.lpp"
+#line 93 "glsl_lexer.lpp"
{ BEGIN PP; return EXTENSION; }
YY_BREAK
case 5:
@@ -1340,7 +1336,7 @@ case 5:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 84 "glsl_lexer.lpp"
+#line 94 "glsl_lexer.lpp"
{
/* Eat characters until the first digit is
* encountered
@@ -1362,7 +1358,7 @@ case 6:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 99 "glsl_lexer.lpp"
+#line 109 "glsl_lexer.lpp"
{
/* Eat characters until the first digit is
* encountered
@@ -1380,7 +1376,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 113 "glsl_lexer.lpp"
+#line 123 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_DEBUG_ON;
@@ -1388,7 +1384,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 117 "glsl_lexer.lpp"
+#line 127 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_DEBUG_OFF;
@@ -1396,7 +1392,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 121 "glsl_lexer.lpp"
+#line 131 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_ON;
@@ -1404,7 +1400,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 125 "glsl_lexer.lpp"
+#line 135 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_OFF;
@@ -1412,38 +1408,38 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 129 "glsl_lexer.lpp"
+#line 139 "glsl_lexer.lpp"
{ BEGIN PRAGMA; }
YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
-#line 131 "glsl_lexer.lpp"
+#line 141 "glsl_lexer.lpp"
{ BEGIN 0; yylineno++; yycolumn = 0; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 132 "glsl_lexer.lpp"
+#line 142 "glsl_lexer.lpp"
{ }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 134 "glsl_lexer.lpp"
+#line 144 "glsl_lexer.lpp"
{ }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 135 "glsl_lexer.lpp"
+#line 145 "glsl_lexer.lpp"
{ }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 136 "glsl_lexer.lpp"
+#line 146 "glsl_lexer.lpp"
return COLON;
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 137 "glsl_lexer.lpp"
+#line 147 "glsl_lexer.lpp"
{
yylval->identifier = strdup(yytext);
return IDENTIFIER;
@@ -1451,7 +1447,7 @@ YY_RULE_SETUP
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 141 "glsl_lexer.lpp"
+#line 151 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext, NULL, 10);
return INTCONSTANT;
@@ -1460,283 +1456,283 @@ YY_RULE_SETUP
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
-#line 145 "glsl_lexer.lpp"
+#line 155 "glsl_lexer.lpp"
{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
YY_BREAK
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
-#line 147 "glsl_lexer.lpp"
+#line 157 "glsl_lexer.lpp"
{ yylineno++; yycolumn = 0; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 149 "glsl_lexer.lpp"
+#line 159 "glsl_lexer.lpp"
return ATTRIBUTE;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 150 "glsl_lexer.lpp"
+#line 160 "glsl_lexer.lpp"
return CONST_TOK;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 151 "glsl_lexer.lpp"
+#line 161 "glsl_lexer.lpp"
return BOOL_TOK;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 152 "glsl_lexer.lpp"
+#line 162 "glsl_lexer.lpp"
return FLOAT_TOK;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 153 "glsl_lexer.lpp"
+#line 163 "glsl_lexer.lpp"
return INT_TOK;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 155 "glsl_lexer.lpp"
+#line 165 "glsl_lexer.lpp"
return BREAK;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 156 "glsl_lexer.lpp"
+#line 166 "glsl_lexer.lpp"
return CONTINUE;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 157 "glsl_lexer.lpp"
+#line 167 "glsl_lexer.lpp"
return DO;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 158 "glsl_lexer.lpp"
+#line 168 "glsl_lexer.lpp"
return WHILE;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 159 "glsl_lexer.lpp"
+#line 169 "glsl_lexer.lpp"
return ELSE;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 160 "glsl_lexer.lpp"
+#line 170 "glsl_lexer.lpp"
return FOR;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 161 "glsl_lexer.lpp"
+#line 171 "glsl_lexer.lpp"
return IF;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 162 "glsl_lexer.lpp"
+#line 172 "glsl_lexer.lpp"
return DISCARD;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 163 "glsl_lexer.lpp"
+#line 173 "glsl_lexer.lpp"
return RETURN;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 165 "glsl_lexer.lpp"
+#line 175 "glsl_lexer.lpp"
return BVEC2;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 166 "glsl_lexer.lpp"
+#line 176 "glsl_lexer.lpp"
return BVEC3;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 167 "glsl_lexer.lpp"
+#line 177 "glsl_lexer.lpp"
return BVEC4;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 168 "glsl_lexer.lpp"
+#line 178 "glsl_lexer.lpp"
return IVEC2;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 169 "glsl_lexer.lpp"
+#line 179 "glsl_lexer.lpp"
return IVEC3;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 170 "glsl_lexer.lpp"
+#line 180 "glsl_lexer.lpp"
return IVEC4;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 171 "glsl_lexer.lpp"
+#line 181 "glsl_lexer.lpp"
return VEC2;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 172 "glsl_lexer.lpp"
+#line 182 "glsl_lexer.lpp"
return VEC3;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 173 "glsl_lexer.lpp"
+#line 183 "glsl_lexer.lpp"
return VEC4;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 174 "glsl_lexer.lpp"
+#line 184 "glsl_lexer.lpp"
return MAT2X2;
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 175 "glsl_lexer.lpp"
+#line 185 "glsl_lexer.lpp"
return MAT3X3;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 176 "glsl_lexer.lpp"
+#line 186 "glsl_lexer.lpp"
return MAT4X4;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 177 "glsl_lexer.lpp"
+#line 187 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT2X2);
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 178 "glsl_lexer.lpp"
+#line 188 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT2X3);
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 179 "glsl_lexer.lpp"
+#line 189 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT2X4);
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 180 "glsl_lexer.lpp"
+#line 190 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT3X2);
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 181 "glsl_lexer.lpp"
+#line 191 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT3X3);
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 182 "glsl_lexer.lpp"
+#line 192 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT3X4);
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 183 "glsl_lexer.lpp"
+#line 193 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT4X2);
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 184 "glsl_lexer.lpp"
+#line 194 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT4X3);
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 185 "glsl_lexer.lpp"
+#line 195 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, MAT4X4);
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 187 "glsl_lexer.lpp"
+#line 197 "glsl_lexer.lpp"
return IN_TOK;
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 188 "glsl_lexer.lpp"
+#line 198 "glsl_lexer.lpp"
return OUT_TOK;
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 189 "glsl_lexer.lpp"
+#line 199 "glsl_lexer.lpp"
return INOUT_TOK;
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 190 "glsl_lexer.lpp"
+#line 200 "glsl_lexer.lpp"
return UNIFORM;
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 191 "glsl_lexer.lpp"
+#line 201 "glsl_lexer.lpp"
return VARYING;
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 192 "glsl_lexer.lpp"
+#line 202 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(120, CENTROID);
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 193 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(120, INVARIANT);
+#line 203 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(120, INVARIANT);
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 195 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(130, FLAT);
+#line 205 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(130, FLAT);
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 196 "glsl_lexer.lpp"
+#line 206 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, SMOOTH);
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 197 "glsl_lexer.lpp"
+#line 207 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE);
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 199 "glsl_lexer.lpp"
+#line 209 "glsl_lexer.lpp"
return SAMPLER1D;
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 200 "glsl_lexer.lpp"
+#line 210 "glsl_lexer.lpp"
return SAMPLER2D;
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 201 "glsl_lexer.lpp"
+#line 211 "glsl_lexer.lpp"
return SAMPLER3D;
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 202 "glsl_lexer.lpp"
+#line 212 "glsl_lexer.lpp"
return SAMPLERCUBE;
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 203 "glsl_lexer.lpp"
+#line 213 "glsl_lexer.lpp"
return SAMPLER1DSHADOW;
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 204 "glsl_lexer.lpp"
+#line 214 "glsl_lexer.lpp"
return SAMPLER2DSHADOW;
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 206 "glsl_lexer.lpp"
+#line 216 "glsl_lexer.lpp"
return STRUCT;
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 207 "glsl_lexer.lpp"
+#line 217 "glsl_lexer.lpp"
return VOID_TOK;
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 209 "glsl_lexer.lpp"
+#line 219 "glsl_lexer.lpp"
{
if ((yyextra->language_version >= 140)
|| (yyextra->ARB_fragment_coord_conventions_enable)){
@@ -1749,102 +1745,102 @@ YY_RULE_SETUP
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 219 "glsl_lexer.lpp"
+#line 229 "glsl_lexer.lpp"
return INC_OP;
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 220 "glsl_lexer.lpp"
+#line 230 "glsl_lexer.lpp"
return DEC_OP;
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 221 "glsl_lexer.lpp"
+#line 231 "glsl_lexer.lpp"
return LE_OP;
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 222 "glsl_lexer.lpp"
+#line 232 "glsl_lexer.lpp"
return GE_OP;
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 223 "glsl_lexer.lpp"
+#line 233 "glsl_lexer.lpp"
return EQ_OP;
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 224 "glsl_lexer.lpp"
+#line 234 "glsl_lexer.lpp"
return NE_OP;
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 225 "glsl_lexer.lpp"
+#line 235 "glsl_lexer.lpp"
return AND_OP;
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 226 "glsl_lexer.lpp"
+#line 236 "glsl_lexer.lpp"
return OR_OP;
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 227 "glsl_lexer.lpp"
+#line 237 "glsl_lexer.lpp"
return XOR_OP;
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 229 "glsl_lexer.lpp"
+#line 239 "glsl_lexer.lpp"
return MUL_ASSIGN;
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 230 "glsl_lexer.lpp"
+#line 240 "glsl_lexer.lpp"
return DIV_ASSIGN;
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 231 "glsl_lexer.lpp"
+#line 241 "glsl_lexer.lpp"
return ADD_ASSIGN;
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 232 "glsl_lexer.lpp"
+#line 242 "glsl_lexer.lpp"
return MOD_ASSIGN;
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 233 "glsl_lexer.lpp"
+#line 243 "glsl_lexer.lpp"
return LEFT_ASSIGN;
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 234 "glsl_lexer.lpp"
+#line 244 "glsl_lexer.lpp"
return RIGHT_ASSIGN;
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 235 "glsl_lexer.lpp"
+#line 245 "glsl_lexer.lpp"
return AND_ASSIGN;
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 236 "glsl_lexer.lpp"
+#line 246 "glsl_lexer.lpp"
return XOR_ASSIGN;
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 237 "glsl_lexer.lpp"
+#line 247 "glsl_lexer.lpp"
return OR_ASSIGN;
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 238 "glsl_lexer.lpp"
+#line 248 "glsl_lexer.lpp"
return SUB_ASSIGN;
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 240 "glsl_lexer.lpp"
+#line 250 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext, NULL, 10);
return INTCONSTANT;
@@ -1852,7 +1848,7 @@ YY_RULE_SETUP
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 244 "glsl_lexer.lpp"
+#line 254 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext + 2, NULL, 16);
return INTCONSTANT;
@@ -1860,7 +1856,7 @@ YY_RULE_SETUP
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 248 "glsl_lexer.lpp"
+#line 258 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext, NULL, 8);
return INTCONSTANT;
@@ -1868,7 +1864,7 @@ YY_RULE_SETUP
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 253 "glsl_lexer.lpp"
+#line 263 "glsl_lexer.lpp"
{
yylval->real = strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -1876,7 +1872,7 @@ YY_RULE_SETUP
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 257 "glsl_lexer.lpp"
+#line 267 "glsl_lexer.lpp"
{
yylval->real = strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -1884,7 +1880,7 @@ YY_RULE_SETUP
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 261 "glsl_lexer.lpp"
+#line 271 "glsl_lexer.lpp"
{
yylval->real = strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -1892,7 +1888,7 @@ YY_RULE_SETUP
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 265 "glsl_lexer.lpp"
+#line 275 "glsl_lexer.lpp"
{
yylval->real = strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -1900,7 +1896,7 @@ YY_RULE_SETUP
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 269 "glsl_lexer.lpp"
+#line 279 "glsl_lexer.lpp"
{
yylval->real = strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -1908,7 +1904,7 @@ YY_RULE_SETUP
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 274 "glsl_lexer.lpp"
+#line 284 "glsl_lexer.lpp"
{
yylval->n = 1;
return BOOLCONSTANT;
@@ -1916,7 +1912,7 @@ YY_RULE_SETUP
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 278 "glsl_lexer.lpp"
+#line 288 "glsl_lexer.lpp"
{
yylval->n = 0;
return BOOLCONSTANT;
@@ -1925,394 +1921,394 @@ YY_RULE_SETUP
/* Reserved words in GLSL 1.10. */
case 104:
YY_RULE_SETUP
-#line 285 "glsl_lexer.lpp"
+#line 295 "glsl_lexer.lpp"
RESERVED_WORD(999, ASM);
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 286 "glsl_lexer.lpp"
+#line 296 "glsl_lexer.lpp"
RESERVED_WORD(999, CLASS);
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 287 "glsl_lexer.lpp"
+#line 297 "glsl_lexer.lpp"
RESERVED_WORD(999, UNION);
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 288 "glsl_lexer.lpp"
+#line 298 "glsl_lexer.lpp"
RESERVED_WORD(999, ENUM);
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 289 "glsl_lexer.lpp"
+#line 299 "glsl_lexer.lpp"
RESERVED_WORD(999, TYPEDEF);
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 290 "glsl_lexer.lpp"
+#line 300 "glsl_lexer.lpp"
RESERVED_WORD(999, TEMPLATE);
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 291 "glsl_lexer.lpp"
+#line 301 "glsl_lexer.lpp"
RESERVED_WORD(999, THIS);
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 292 "glsl_lexer.lpp"
+#line 302 "glsl_lexer.lpp"
RESERVED_WORD(999, PACKED_TOK);
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 293 "glsl_lexer.lpp"
+#line 303 "glsl_lexer.lpp"
RESERVED_WORD(999, GOTO);
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 294 "glsl_lexer.lpp"
+#line 304 "glsl_lexer.lpp"
RESERVED_WORD(130, SWITCH);
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 295 "glsl_lexer.lpp"
+#line 305 "glsl_lexer.lpp"
RESERVED_WORD(130, DEFAULT);
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 296 "glsl_lexer.lpp"
+#line 306 "glsl_lexer.lpp"
RESERVED_WORD(999, INLINE_TOK);
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 297 "glsl_lexer.lpp"
+#line 307 "glsl_lexer.lpp"
RESERVED_WORD(999, NOINLINE);
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 298 "glsl_lexer.lpp"
+#line 308 "glsl_lexer.lpp"
RESERVED_WORD(999, VOLATILE);
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 299 "glsl_lexer.lpp"
+#line 309 "glsl_lexer.lpp"
RESERVED_WORD(999, PUBLIC_TOK);
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 300 "glsl_lexer.lpp"
+#line 310 "glsl_lexer.lpp"
RESERVED_WORD(999, STATIC);
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 301 "glsl_lexer.lpp"
+#line 311 "glsl_lexer.lpp"
RESERVED_WORD(999, EXTERN);
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 302 "glsl_lexer.lpp"
+#line 312 "glsl_lexer.lpp"
RESERVED_WORD(999, EXTERNAL);
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 303 "glsl_lexer.lpp"
+#line 313 "glsl_lexer.lpp"
RESERVED_WORD(999, INTERFACE);
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 304 "glsl_lexer.lpp"
+#line 314 "glsl_lexer.lpp"
RESERVED_WORD(999, LONG_TOK);
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 305 "glsl_lexer.lpp"
+#line 315 "glsl_lexer.lpp"
RESERVED_WORD(999, SHORT_TOK);
YY_BREAK
case 125:
YY_RULE_SETUP
-#line 306 "glsl_lexer.lpp"
+#line 316 "glsl_lexer.lpp"
RESERVED_WORD(999, DOUBLE_TOK);
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 307 "glsl_lexer.lpp"
+#line 317 "glsl_lexer.lpp"
RESERVED_WORD(999, HALF);
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 308 "glsl_lexer.lpp"
+#line 318 "glsl_lexer.lpp"
RESERVED_WORD(999, FIXED_TOK);
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 309 "glsl_lexer.lpp"
+#line 319 "glsl_lexer.lpp"
RESERVED_WORD(999, UNSIGNED);
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 310 "glsl_lexer.lpp"
+#line 320 "glsl_lexer.lpp"
RESERVED_WORD(999, INPUT_TOK);
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 311 "glsl_lexer.lpp"
+#line 321 "glsl_lexer.lpp"
RESERVED_WORD(999, OUTPUT);
YY_BREAK
case 131:
YY_RULE_SETUP
-#line 312 "glsl_lexer.lpp"
+#line 322 "glsl_lexer.lpp"
RESERVED_WORD(999, HVEC2);
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 313 "glsl_lexer.lpp"
+#line 323 "glsl_lexer.lpp"
RESERVED_WORD(999, HVEC3);
YY_BREAK
case 133:
YY_RULE_SETUP
-#line 314 "glsl_lexer.lpp"
+#line 324 "glsl_lexer.lpp"
RESERVED_WORD(999, HVEC4);
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 315 "glsl_lexer.lpp"
+#line 325 "glsl_lexer.lpp"
RESERVED_WORD(999, DVEC2);
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 316 "glsl_lexer.lpp"
+#line 326 "glsl_lexer.lpp"
RESERVED_WORD(999, DVEC3);
YY_BREAK
case 136:
YY_RULE_SETUP
-#line 317 "glsl_lexer.lpp"
+#line 327 "glsl_lexer.lpp"
RESERVED_WORD(999, DVEC4);
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 318 "glsl_lexer.lpp"
+#line 328 "glsl_lexer.lpp"
RESERVED_WORD(999, FVEC2);
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 319 "glsl_lexer.lpp"
+#line 329 "glsl_lexer.lpp"
RESERVED_WORD(999, FVEC3);
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 320 "glsl_lexer.lpp"
+#line 330 "glsl_lexer.lpp"
RESERVED_WORD(999, FVEC4);
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 321 "glsl_lexer.lpp"
+#line 331 "glsl_lexer.lpp"
return SAMPLER2DRECT;
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 322 "glsl_lexer.lpp"
+#line 332 "glsl_lexer.lpp"
RESERVED_WORD(999, SAMPLER3DRECT);
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 323 "glsl_lexer.lpp"
+#line 333 "glsl_lexer.lpp"
return SAMPLER2DRECTSHADOW;
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 324 "glsl_lexer.lpp"
+#line 334 "glsl_lexer.lpp"
RESERVED_WORD(999, SIZEOF);
YY_BREAK
case 144:
YY_RULE_SETUP
-#line 325 "glsl_lexer.lpp"
+#line 335 "glsl_lexer.lpp"
RESERVED_WORD(999, CAST);
YY_BREAK
case 145:
YY_RULE_SETUP
-#line 326 "glsl_lexer.lpp"
+#line 336 "glsl_lexer.lpp"
RESERVED_WORD(999, NAMESPACE);
YY_BREAK
case 146:
YY_RULE_SETUP
-#line 327 "glsl_lexer.lpp"
+#line 337 "glsl_lexer.lpp"
RESERVED_WORD(999, USING);
YY_BREAK
/* Additional reserved words in GLSL 1.20. */
case 147:
YY_RULE_SETUP
-#line 330 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(120, LOWP);
+#line 340 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(120, LOWP);
YY_BREAK
case 148:
YY_RULE_SETUP
-#line 331 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(120, MEDIUMP);
+#line 341 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP);
YY_BREAK
case 149:
YY_RULE_SETUP
-#line 332 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(120, HIGHP);
+#line 342 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(120, HIGHP);
YY_BREAK
case 150:
YY_RULE_SETUP
-#line 333 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(120, PRECISION);
+#line 343 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(120, PRECISION);
YY_BREAK
/* Additional reserved words in GLSL 1.30. */
case 151:
YY_RULE_SETUP
-#line 336 "glsl_lexer.lpp"
+#line 346 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, COMMON);
YY_BREAK
case 152:
YY_RULE_SETUP
-#line 337 "glsl_lexer.lpp"
+#line 347 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, PARTITION);
YY_BREAK
case 153:
YY_RULE_SETUP
-#line 338 "glsl_lexer.lpp"
+#line 348 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, ACTIVE);
YY_BREAK
case 154:
YY_RULE_SETUP
-#line 339 "glsl_lexer.lpp"
-TOKEN_OR_IDENTIFIER(130, SUPERP);
+#line 349 "glsl_lexer.lpp"
+TOKEN_OR_IDENTIFIER_ES(130, SUPERP);
YY_BREAK
case 155:
YY_RULE_SETUP
-#line 340 "glsl_lexer.lpp"
+#line 350 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
YY_BREAK
case 156:
YY_RULE_SETUP
-#line 341 "glsl_lexer.lpp"
+#line 351 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, FILTER);
YY_BREAK
case 157:
YY_RULE_SETUP
-#line 342 "glsl_lexer.lpp"
+#line 352 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE1D);
YY_BREAK
case 158:
YY_RULE_SETUP
-#line 343 "glsl_lexer.lpp"
+#line 353 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE2D);
YY_BREAK
case 159:
YY_RULE_SETUP
-#line 344 "glsl_lexer.lpp"
+#line 354 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE3D);
YY_BREAK
case 160:
YY_RULE_SETUP
-#line 345 "glsl_lexer.lpp"
+#line 355 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGECUBE);
YY_BREAK
case 161:
YY_RULE_SETUP
-#line 346 "glsl_lexer.lpp"
+#line 356 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGE1D);
YY_BREAK
case 162:
YY_RULE_SETUP
-#line 347 "glsl_lexer.lpp"
+#line 357 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGE2D);
YY_BREAK
case 163:
YY_RULE_SETUP
-#line 348 "glsl_lexer.lpp"
+#line 358 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGE3D);
YY_BREAK
case 164:
YY_RULE_SETUP
-#line 349 "glsl_lexer.lpp"
+#line 359 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGECUBE);
YY_BREAK
case 165:
YY_RULE_SETUP
-#line 350 "glsl_lexer.lpp"
+#line 360 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGE1D);
YY_BREAK
case 166:
YY_RULE_SETUP
-#line 351 "glsl_lexer.lpp"
+#line 361 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGE2D);
YY_BREAK
case 167:
YY_RULE_SETUP
-#line 352 "glsl_lexer.lpp"
+#line 362 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGE3D);
YY_BREAK
case 168:
YY_RULE_SETUP
-#line 353 "glsl_lexer.lpp"
+#line 363 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGECUBE);
YY_BREAK
case 169:
YY_RULE_SETUP
-#line 354 "glsl_lexer.lpp"
+#line 364 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE1DARRAY);
YY_BREAK
case 170:
YY_RULE_SETUP
-#line 355 "glsl_lexer.lpp"
+#line 365 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE2DARRAY);
YY_BREAK
case 171:
YY_RULE_SETUP
-#line 356 "glsl_lexer.lpp"
+#line 366 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGE1DARRAY);
YY_BREAK
case 172:
YY_RULE_SETUP
-#line 357 "glsl_lexer.lpp"
+#line 367 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGE2DARRAY);
YY_BREAK
case 173:
YY_RULE_SETUP
-#line 358 "glsl_lexer.lpp"
+#line 368 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGE1DARRAY);
YY_BREAK
case 174:
YY_RULE_SETUP
-#line 359 "glsl_lexer.lpp"
+#line 369 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGE2DARRAY);
YY_BREAK
case 175:
YY_RULE_SETUP
-#line 360 "glsl_lexer.lpp"
+#line 370 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE1DSHADOW);
YY_BREAK
case 176:
YY_RULE_SETUP
-#line 361 "glsl_lexer.lpp"
+#line 371 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGE2DSHADOW);
YY_BREAK
case 177:
YY_RULE_SETUP
-#line 362 "glsl_lexer.lpp"
+#line 372 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IMAGEBUFFER);
YY_BREAK
case 178:
YY_RULE_SETUP
-#line 363 "glsl_lexer.lpp"
+#line 373 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, IIMAGEBUFFER);
YY_BREAK
case 179:
YY_RULE_SETUP
-#line 364 "glsl_lexer.lpp"
+#line 374 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, UIMAGEBUFFER);
YY_BREAK
case 180:
YY_RULE_SETUP
-#line 365 "glsl_lexer.lpp"
+#line 375 "glsl_lexer.lpp"
TOKEN_OR_IDENTIFIER(130, ROW_MAJOR);
YY_BREAK
case 181:
YY_RULE_SETUP
-#line 367 "glsl_lexer.lpp"
+#line 377 "glsl_lexer.lpp"
{
struct _mesa_glsl_parse_state *state = yyextra;
void *ctx = state;
@@ -2322,15 +2318,15 @@ YY_RULE_SETUP
YY_BREAK
case 182:
YY_RULE_SETUP
-#line 374 "glsl_lexer.lpp"
+#line 384 "glsl_lexer.lpp"
{ return yytext[0]; }
YY_BREAK
case 183:
YY_RULE_SETUP
-#line 376 "glsl_lexer.lpp"
+#line 386 "glsl_lexer.lpp"
ECHO;
YY_BREAK
-#line 2334 "glsl_lexer.cpp"
+#line 2330 "glsl_lexer.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(PP):
case YY_STATE_EOF(PRAGMA):
@@ -3066,8 +3062,8 @@ YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscann
/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will
* scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
@@ -3473,7 +3469,7 @@ void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 376 "glsl_lexer.lpp"
+#line 386 "glsl_lexer.lpp"
diff --git a/src/glsl/glsl_lexer.lpp b/src/glsl/glsl_lexer.lpp
index 1de1fb4cf7..ed3cb251a1 100644
--- a/src/glsl/glsl_lexer.lpp
+++ b/src/glsl/glsl_lexer.lpp
@@ -46,6 +46,16 @@
} \
} while (0)
+/* Handle reserved words in GLSL ES (version 100) */
+#define TOKEN_OR_IDENTIFIER_ES(version, token) \
+ do { \
+ if (yyextra->es_shader) { \
+ return token; \
+ } else { \
+ TOKEN_OR_IDENTIFIER(version, token); \
+ } \
+ } while (0)
+
#define RESERVED_WORD(version, token) \
do { \
if (yyextra->language_version >= version) { \
@@ -190,9 +200,9 @@ inout return INOUT_TOK;
uniform return UNIFORM;
varying return VARYING;
centroid TOKEN_OR_IDENTIFIER(120, CENTROID);
-invariant TOKEN_OR_IDENTIFIER(120, INVARIANT);
+invariant TOKEN_OR_IDENTIFIER_ES(120, INVARIANT);
-flat TOKEN_OR_IDENTIFIER(130, FLAT);
+flat TOKEN_OR_IDENTIFIER_ES(130, FLAT);
smooth TOKEN_OR_IDENTIFIER(130, SMOOTH);
noperspective TOKEN_OR_IDENTIFIER(130, NOPERSPECTIVE);
@@ -327,16 +337,16 @@ namespace RESERVED_WORD(999, NAMESPACE);
using RESERVED_WORD(999, USING);
/* Additional reserved words in GLSL 1.20. */
-lowp TOKEN_OR_IDENTIFIER(120, LOWP);
-mediump TOKEN_OR_IDENTIFIER(120, MEDIUMP);
-highp TOKEN_OR_IDENTIFIER(120, HIGHP);
-precision TOKEN_OR_IDENTIFIER(120, PRECISION);
+lowp TOKEN_OR_IDENTIFIER_ES(120, LOWP);
+mediump TOKEN_OR_IDENTIFIER_ES(120, MEDIUMP);
+highp TOKEN_OR_IDENTIFIER_ES(120, HIGHP);
+precision TOKEN_OR_IDENTIFIER_ES(120, PRECISION);
/* Additional reserved words in GLSL 1.30. */
common TOKEN_OR_IDENTIFIER(130, COMMON);
partition TOKEN_OR_IDENTIFIER(130, PARTITION);
active TOKEN_OR_IDENTIFIER(130, ACTIVE);
-superp TOKEN_OR_IDENTIFIER(130, SUPERP);
+superp TOKEN_OR_IDENTIFIER_ES(130, SUPERP);
samplerBuffer TOKEN_OR_IDENTIFIER(130, SAMPLERBUFFER);
filter TOKEN_OR_IDENTIFIER(130, FILTER);
image1D TOKEN_OR_IDENTIFIER(130, IMAGE1D);
diff --git a/src/glsl/glsl_parser.cpp b/src/glsl/glsl_parser.cpp
index e36bb03c43..301c221892 100644
--- a/src/glsl/glsl_parser.cpp
+++ b/src/glsl/glsl_parser.cpp
@@ -1,10 +1,9 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -114,7 +113,7 @@
/* Line 189 of yacc.c */
-#line 118 "glsl_parser.cpp"
+#line 117 "glsl_parser.cpp"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -367,10 +366,15 @@ typedef union YYSTYPE
ast_expression *rest;
} for_rest_statement;
+ struct {
+ ast_node *then_statement;
+ ast_node *else_statement;
+ } selection_rest_statement;
+
/* Line 214 of yacc.c */
-#line 374 "glsl_parser.cpp"
+#line 378 "glsl_parser.cpp"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -395,7 +399,7 @@ typedef struct YYLTYPE
/* Line 264 of yacc.c */
-#line 399 "glsl_parser.cpp"
+#line 403 "glsl_parser.cpp"
#ifdef short
# undef short
@@ -445,7 +449,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -612,16 +616,16 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 5
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 4115
+#define YYLAST 4005
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 215
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 90
+#define YYNNTS 88
/* YYNRULES -- Number of rules. */
-#define YYNRULES 278
+#define YYNRULES 274
/* YYNRULES -- Number of states. */
-#define YYNSTATES 419
+#define YYNSTATES 409
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -709,10 +713,10 @@ static const yytype_uint16 yyprhs[] =
588, 590, 592, 594, 596, 598, 600, 602, 604, 606,
612, 617, 619, 622, 626, 628, 632, 634, 639, 641,
643, 645, 647, 649, 651, 653, 655, 657, 659, 661,
- 663, 665, 667, 670, 674, 676, 678, 681, 685, 687,
- 690, 692, 695, 703, 709, 715, 723, 725, 730, 736,
- 740, 743, 749, 757, 764, 766, 768, 770, 771, 774,
- 778, 781, 784, 787, 791, 794, 796, 798, 800
+ 664, 668, 670, 672, 675, 679, 681, 684, 686, 689,
+ 695, 699, 701, 703, 708, 714, 718, 721, 727, 735,
+ 742, 744, 746, 748, 749, 752, 756, 759, 762, 765,
+ 769, 772, 774, 776, 778
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -721,7 +725,7 @@ static const yytype_int16 yyrhs[] =
216, 0, -1, -1, 218, 220, 217, 222, -1, -1,
109, 78, 113, -1, 116, 113, -1, 117, 113, -1,
118, 113, -1, 119, 113, -1, -1, 220, 221, -1,
- 110, 76, 112, 76, 113, -1, 303, -1, 222, 303,
+ 110, 76, 112, 76, 113, -1, 301, -1, 222, 301,
-1, 76, -1, 223, -1, 78, -1, 79, -1, 77,
-1, 80, -1, 191, 250, 192, -1, 224, -1, 225,
193, 226, 194, -1, 227, -1, 225, 195, 76, -1,
@@ -782,29 +786,27 @@ static const yytype_int16 yyrhs[] =
214, -1, 73, 213, 278, 214, -1, 279, -1, 278,
279, -1, 272, 280, 212, -1, 281, -1, 280, 196,
281, -1, 76, -1, 76, 193, 251, 194, -1, 248,
- -1, 252, -1, 285, -1, 286, -1, 288, -1, 287,
- -1, 294, -1, 283, -1, 292, -1, 293, -1, 296,
- -1, 297, -1, 298, -1, 302, -1, 213, 214, -1,
- 213, 291, 214, -1, 290, -1, 287, -1, 213, 214,
- -1, 213, 291, 214, -1, 284, -1, 291, 284, -1,
- 212, -1, 250, 212, -1, 14, 191, 250, 192, 285,
- 12, 285, -1, 14, 191, 250, 192, 285, -1, 14,
- 191, 250, 192, 286, -1, 14, 191, 250, 192, 285,
- 12, 286, -1, 250, -1, 263, 76, 211, 282, -1,
- 17, 191, 250, 192, 288, -1, 18, 250, 210, -1,
- 19, 210, -1, 75, 191, 295, 192, 289, -1, 11,
- 284, 75, 191, 250, 192, 212, -1, 13, 191, 299,
- 301, 192, 289, -1, 292, -1, 283, -1, 295, -1,
- -1, 300, 212, -1, 300, 212, 250, -1, 10, 212,
- -1, 9, 212, -1, 16, 212, -1, 16, 250, 212,
- -1, 15, 212, -1, 304, -1, 252, -1, 219, -1,
- 253, 290, -1
+ -1, 252, -1, 286, -1, 285, -1, 283, -1, 290,
+ -1, 291, -1, 294, -1, 295, -1, 296, -1, 300,
+ -1, 213, 214, -1, 213, 289, 214, -1, 288, -1,
+ 285, -1, 213, 214, -1, 213, 289, 214, -1, 284,
+ -1, 289, 284, -1, 212, -1, 250, 212, -1, 14,
+ 191, 250, 192, 292, -1, 284, 12, 284, -1, 284,
+ -1, 250, -1, 263, 76, 211, 282, -1, 17, 191,
+ 250, 192, 286, -1, 18, 250, 210, -1, 19, 210,
+ -1, 75, 191, 293, 192, 287, -1, 11, 284, 75,
+ 191, 250, 192, 212, -1, 13, 191, 297, 299, 192,
+ 287, -1, 290, -1, 283, -1, 293, -1, -1, 298,
+ 212, -1, 298, 212, 250, -1, 10, 212, -1, 9,
+ 212, -1, 16, 212, -1, 16, 250, 212, -1, 15,
+ 212, -1, 302, -1, 252, -1, 219, -1, 253, 288,
+ -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 211, 211, 210, 219, 223, 242, 243, 244, 245,
+ 0, 214, 214, 213, 220, 222, 242, 243, 244, 245,
248, 250, 254, 263, 271, 282, 286, 293, 300, 307,
314, 321, 328, 329, 335, 339, 346, 352, 361, 365,
369, 370, 379, 380, 384, 385, 389, 395, 407, 411,
@@ -827,11 +829,11 @@ static const yytype_uint16 yyrline[] =
1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142,
1143, 1144, 1145, 1146, 1147, 1148, 1152, 1163, 1174, 1188,
1194, 1203, 1208, 1216, 1231, 1236, 1244, 1250, 1259, 1263,
- 1269, 1270, 1274, 1275, 1279, 1283, 1284, 1285, 1286, 1287,
- 1288, 1289, 1293, 1299, 1308, 1309, 1313, 1319, 1328, 1338,
- 1350, 1356, 1365, 1374, 1380, 1386, 1395, 1399, 1413, 1417,
- 1418, 1422, 1429, 1436, 1446, 1447, 1451, 1453, 1459, 1464,
- 1473, 1479, 1485, 1491, 1497, 1506, 1507, 1508, 1512
+ 1269, 1270, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1284,
+ 1290, 1299, 1300, 1304, 1310, 1319, 1329, 1341, 1347, 1356,
+ 1365, 1370, 1378, 1382, 1396, 1400, 1401, 1405, 1412, 1419,
+ 1429, 1430, 1434, 1436, 1442, 1447, 1456, 1462, 1468, 1474,
+ 1480, 1489, 1490, 1491, 1495
};
#endif
@@ -904,11 +906,11 @@ static const char *const yytname[] =
"basic_type_specifier_nonarray", "precision_qualifier",
"struct_specifier", "struct_declaration_list", "struct_declaration",
"struct_declarator_list", "struct_declarator", "initializer",
- "declaration_statement", "statement", "statement_matched",
- "statement_unmatched", "simple_statement", "compound_statement",
- "statement_no_new_scope", "compound_statement_no_new_scope",
- "statement_list", "expression_statement", "selection_statement_matched",
- "selection_statement_unmatched", "condition", "switch_statement",
+ "declaration_statement", "statement", "simple_statement",
+ "compound_statement", "statement_no_new_scope",
+ "compound_statement_no_new_scope", "statement_list",
+ "expression_statement", "selection_statement",
+ "selection_rest_statement", "condition", "switch_statement",
"case_label", "iteration_statement", "for_init_statement",
"conditionopt", "for_rest_statement", "jump_statement",
"external_declaration", "function_definition", 0
@@ -971,11 +973,11 @@ static const yytype_uint16 yyr1[] =
275, 275, 275, 275, 275, 275, 275, 275, 275, 275,
275, 275, 275, 275, 275, 275, 276, 276, 276, 277,
277, 278, 278, 279, 280, 280, 281, 281, 282, 283,
- 284, 284, 285, 285, 286, 287, 287, 287, 287, 287,
- 287, 287, 288, 288, 289, 289, 290, 290, 291, 291,
- 292, 292, 293, 294, 294, 294, 295, 295, 296, 297,
- 297, 298, 298, 298, 299, 299, 300, 300, 301, 301,
- 302, 302, 302, 302, 302, 303, 303, 303, 304
+ 284, 284, 285, 285, 285, 285, 285, 285, 285, 286,
+ 286, 287, 287, 288, 288, 289, 289, 290, 290, 291,
+ 292, 292, 293, 293, 294, 295, 295, 296, 296, 296,
+ 297, 297, 298, 298, 299, 299, 300, 300, 300, 300,
+ 300, 301, 301, 301, 302
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -1004,11 +1006,11 @@ static const yytype_uint8 yyr2[] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
4, 1, 2, 3, 1, 3, 1, 4, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 3, 1, 1, 2, 3, 1, 2,
- 1, 2, 7, 5, 5, 7, 1, 4, 5, 3,
- 2, 5, 7, 6, 1, 1, 1, 0, 2, 3,
- 2, 2, 2, 3, 2, 1, 1, 1, 2
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 3, 1, 1, 2, 3, 1, 2, 1, 2, 5,
+ 3, 1, 1, 4, 5, 3, 2, 5, 7, 6,
+ 1, 1, 1, 0, 2, 3, 2, 2, 2, 3,
+ 2, 1, 1, 1, 2
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -1024,262 +1026,249 @@ static const yytype_uint16 yydefact[] =
197, 199, 200, 201, 202, 203, 204, 205, 206, 207,
208, 209, 210, 211, 212, 213, 214, 215, 0, 165,
164, 135, 218, 217, 216, 0, 0, 0, 0, 0,
- 0, 193, 198, 277, 135, 276, 0, 0, 103, 113,
+ 0, 193, 198, 273, 135, 272, 0, 0, 103, 113,
0, 118, 125, 0, 136, 135, 0, 145, 133, 157,
- 159, 162, 0, 163, 13, 275, 0, 154, 155, 151,
+ 159, 162, 0, 163, 13, 271, 0, 154, 155, 151,
0, 0, 132, 135, 147, 0, 6, 7, 8, 9,
- 0, 14, 98, 135, 278, 101, 113, 144, 114, 115,
+ 0, 14, 98, 135, 274, 101, 113, 144, 114, 115,
116, 104, 0, 113, 0, 99, 126, 152, 150, 146,
134, 0, 158, 0, 0, 0, 0, 221, 0, 140,
0, 138, 0, 0, 135, 0, 0, 0, 0, 0,
0, 0, 0, 15, 19, 17, 18, 20, 41, 0,
- 0, 0, 46, 47, 48, 49, 250, 135, 246, 16,
+ 0, 0, 46, 47, 48, 49, 247, 135, 243, 16,
22, 42, 24, 29, 30, 0, 0, 35, 0, 50,
0, 54, 57, 60, 65, 68, 70, 72, 74, 76,
- 78, 80, 82, 95, 0, 229, 0, 133, 235, 248,
- 230, 231, 233, 232, 135, 236, 237, 234, 238, 239,
- 240, 241, 105, 110, 112, 117, 0, 119, 106, 0,
- 0, 160, 50, 97, 0, 39, 12, 0, 226, 0,
- 224, 220, 222, 100, 137, 0, 271, 270, 0, 135,
- 0, 274, 272, 0, 0, 0, 260, 135, 43, 44,
- 0, 242, 135, 26, 27, 0, 0, 33, 32, 0,
- 165, 36, 38, 85, 86, 88, 87, 90, 91, 92,
- 93, 94, 89, 84, 0, 45, 0, 0, 0, 0,
+ 78, 80, 82, 95, 0, 229, 0, 133, 232, 245,
+ 231, 230, 135, 233, 234, 235, 236, 237, 238, 105,
+ 110, 112, 117, 0, 119, 106, 0, 0, 160, 50,
+ 97, 0, 39, 12, 0, 226, 0, 224, 220, 222,
+ 100, 137, 0, 267, 266, 0, 135, 0, 270, 268,
+ 0, 0, 0, 256, 135, 43, 44, 0, 239, 135,
+ 26, 27, 0, 0, 33, 32, 0, 165, 36, 38,
+ 85, 86, 88, 87, 90, 91, 92, 93, 94, 89,
+ 84, 0, 45, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 251, 247, 249,
- 107, 109, 111, 0, 0, 127, 0, 228, 131, 161,
- 219, 0, 0, 223, 139, 0, 265, 264, 135, 0,
- 273, 0, 259, 256, 0, 0, 21, 243, 0, 28,
- 25, 31, 37, 83, 51, 52, 53, 55, 56, 58,
- 59, 63, 64, 61, 62, 66, 67, 69, 71, 73,
- 75, 77, 79, 0, 96, 0, 120, 0, 124, 0,
- 128, 0, 225, 0, 266, 0, 0, 135, 0, 0,
- 135, 23, 0, 0, 0, 121, 129, 0, 227, 0,
- 268, 135, 253, 254, 258, 0, 0, 245, 261, 244,
- 81, 108, 122, 0, 130, 0, 269, 263, 135, 257,
- 0, 123, 262, 252, 255, 0, 135, 0, 135
+ 0, 0, 0, 0, 248, 244, 246, 107, 109, 111,
+ 0, 0, 127, 0, 228, 131, 161, 219, 0, 0,
+ 223, 139, 0, 261, 260, 135, 0, 269, 0, 255,
+ 252, 0, 0, 21, 240, 0, 28, 25, 31, 37,
+ 83, 51, 52, 53, 55, 56, 58, 59, 63, 64,
+ 61, 62, 66, 67, 69, 71, 73, 75, 77, 79,
+ 0, 96, 0, 120, 0, 124, 0, 128, 0, 225,
+ 0, 262, 0, 0, 135, 0, 0, 135, 23, 0,
+ 0, 0, 121, 129, 0, 227, 0, 264, 135, 251,
+ 249, 254, 0, 242, 257, 241, 81, 108, 122, 0,
+ 130, 0, 265, 259, 135, 253, 123, 258, 250
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 2, 9, 3, 83, 6, 10, 84, 179, 180,
- 181, 338, 182, 183, 184, 185, 186, 187, 188, 189,
+ 181, 335, 182, 183, 184, 185, 186, 187, 188, 189,
190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
- 200, 201, 202, 203, 284, 204, 234, 205, 206, 87,
- 88, 89, 223, 131, 132, 224, 90, 91, 92, 93,
- 94, 150, 151, 95, 133, 96, 97, 235, 99, 100,
- 101, 102, 103, 146, 147, 239, 240, 318, 208, 209,
- 210, 211, 212, 213, 398, 399, 214, 215, 216, 217,
- 335, 218, 219, 220, 328, 375, 376, 221, 104, 105
+ 200, 201, 202, 203, 281, 204, 231, 205, 206, 87,
+ 88, 89, 220, 131, 132, 221, 90, 91, 92, 93,
+ 94, 150, 151, 95, 133, 96, 97, 232, 99, 100,
+ 101, 102, 103, 146, 147, 236, 237, 315, 208, 209,
+ 210, 211, 394, 395, 212, 213, 214, 390, 332, 215,
+ 216, 217, 325, 372, 373, 218, 104, 105
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -367
+#define YYPACT_NINF -329
static const yytype_int16 yypact[] =
{
- -88, -21, 24, -367, -53, -367, -3, -367, 9, 3699,
- -367, 0, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- 126, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, -367, -367, -367, -75, -367,
- -367, 29, -367, -367, -367, 92, 4, 12, 20, 26,
- -49, -367, -367, -367, 3580, -367, -197, -45, -46, 3,
- -134, -367, 82, 71, -367, 52, 3887, -367, -367, -367,
- -29, -367, 3959, -367, -367, -367, 97, -367, -367, -367,
- -19, 3887, -367, 52, -367, 3959, -367, -367, -367, -367,
- 130, -367, -367, 282, -367, -367, 47, -367, -367, -367,
- -367, -367, 3887, 187, 139, -367, -162, -367, -367, -367,
- -367, 2675, -367, 105, 3887, 154, 2064, -367, 23, -367,
- -62, -367, 27, 31, 1130, 50, 53, 33, 2296, 55,
- 3218, 37, 58, -67, -367, -367, -367, -367, -367, 3218,
- 3218, 3218, -367, -367, -367, -367, -367, 494, -367, -367,
- -367, -66, -367, -367, -367, 60, -56, 3399, 64, -54,
- 3218, 22, 6, 118, -84, 120, 51, 54, 56, 168,
- 167, -83, -367, -367, -103, -367, 48, 72, -367, -367,
- -367, -367, -367, -367, 706, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, -367, 186, 3887, -139, -367, 2856,
- 3218, -367, -367, -367, 73, -367, -367, 2180, 75, -102,
- -367, -367, -367, -367, -367, 130, -367, -367, 190, 1750,
- 3218, -367, -367, -90, 3218, -146, -367, 2494, -367, -367,
- -48, -367, 918, -367, -367, 3218, 3815, -367, -367, 3218,
- 74, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, 3218, -367, 3218, 3218, 3218, 3218,
- 3218, 3218, 3218, 3218, 3218, 3218, 3218, 3218, 3218, 3218,
- 3218, 3218, 3218, 3218, 3218, 3218, 3218, -367, -367, -367,
- 76, -367, -367, 3037, 3218, 59, 77, -367, -367, -367,
- -367, 3218, 154, -367, -367, 81, -367, -367, 1948, -40,
- -367, -27, -367, 78, 197, 83, -367, -367, 84, 78,
- 85, -367, -367, -367, -367, -367, -367, 22, 22, 6,
- 6, 118, 118, 118, 118, -84, -84, 120, 51, 54,
- 56, 168, 167, -97, -367, 3218, 66, 86, -367, 3218,
- 68, 87, -367, 3218, -367, 70, 91, 1130, 102, 106,
- 1341, -367, 3218, 90, 3218, 153, -367, 3218, -367, -26,
- 3218, 1341, 353, -367, -367, 3218, 103, -367, -367, -367,
- -367, -367, -367, 3218, -367, 157, 78, -367, 1130, -367,
- 3218, -367, -367, -367, -367, -25, 1552, 358, 1552
+ -58, -22, 72, -329, -28, -329, -15, -329, 22, 3589,
+ -329, -4, -329, -329, -329, -329, -329, -329, -329, -329,
+ -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
+ 44, -329, -329, -329, -329, -329, -329, -329, -329, -329,
+ -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
+ -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
+ -329, -329, -329, -329, -329, -329, -329, -329, -72, -329,
+ -329, 6, -329, -329, -329, 14, -8, 9, 11, 26,
+ -64, -329, -329, -329, 3470, -329, -159, -23, -12, -2,
+ -149, -329, 105, 57, -329, 140, 3777, -329, -329, -329,
+ 15, -329, 3849, -329, -329, -329, 131, -329, -329, -329,
+ -3, 3777, -329, 140, -329, 3849, -329, -329, -329, -329,
+ 133, -329, -329, 383, -329, -329, 32, -329, -329, -329,
+ -329, -329, 3777, 158, 135, -329, -150, -329, -329, -329,
+ -329, 2565, -329, 100, 3777, 141, 1954, -329, 4, -329,
+ -95, -329, 7, 8, 1231, 27, 31, 12, 2186, 37,
+ 3108, 13, 39, -59, -329, -329, -329, -329, -329, 3108,
+ 3108, 3108, -329, -329, -329, -329, -329, 595, -329, -329,
+ -329, -55, -329, -329, -329, 41, -92, 3289, 40, -75,
+ 3108, -7, -118, 51, -74, 109, 28, 29, 30, 145,
+ 147, -84, -329, -329, -148, -329, 34, 49, -329, -329,
+ -329, -329, 807, -329, -329, -329, -329, -329, -329, -329,
+ -329, -329, 166, 3777, -143, -329, 2746, 3108, -329, -329,
+ -329, 53, -329, -329, 2070, 55, -139, -329, -329, -329,
+ -329, -329, 133, -329, -329, 174, 1640, 3108, -329, -329,
+ -138, 3108, -134, -329, 2384, -329, -329, -81, -329, 1019,
+ -329, -329, 3108, 3705, -329, -329, 3108, 61, -329, -329,
+ -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
+ -329, 3108, -329, 3108, 3108, 3108, 3108, 3108, 3108, 3108,
+ 3108, 3108, 3108, 3108, 3108, 3108, 3108, 3108, 3108, 3108,
+ 3108, 3108, 3108, 3108, -329, -329, -329, 62, -329, -329,
+ 2927, 3108, 43, 63, -329, -329, -329, -329, 3108, 141,
+ -329, -329, 65, -329, -329, 1838, -80, -329, -79, -329,
+ 66, 182, 69, -329, -329, 70, 66, 74, -329, -329,
+ -329, -329, -329, -329, -7, -7, -118, -118, 51, 51,
+ 51, 51, -74, -74, 109, 28, 29, 30, 145, 147,
+ -127, -329, 3108, 52, 75, -329, 3108, 59, 77, -329,
+ 3108, -329, 54, 76, 1231, 60, 64, 1442, -329, 3108,
+ 78, 3108, 67, -329, 3108, -329, -50, 3108, 1442, 262,
+ -329, -329, 3108, -329, -329, -329, -329, -329, -329, 3108,
+ -329, 71, 66, -329, 1231, -329, -329, -329, -329
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -367, -367, -367, -367, -367, -367, -367, -367, -367, -367,
- -367, -367, -367, -367, 107, -367, -367, -367, -367, -111,
- -367, -63, -59, -82, -60, 79, 80, 88, 89, 69,
- 93, -367, -114, -153, -367, -154, -224, 11, 14, -367,
- -367, -367, 148, 249, 243, 151, -367, -367, -245, -367,
- -367, -367, 134, -367, -367, -43, -367, -9, -89, -367,
- -367, 306, -367, 239, -136, -367, 62, -241, 143, -143,
- -342, -355, -366, 15, 5, 308, 218, 149, -367, -367,
- 94, -367, -367, -367, -367, -367, -367, -367, 316, -367
+ -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
+ -329, -329, -329, -329, 16, -329, -329, -329, -329, -135,
+ -329, -87, -83, -104, -93, -20, -16, -21, -13, -11,
+ -17, -329, -133, -99, -329, -155, -189, 2, 5, -329,
+ -329, -329, 68, 161, 155, 73, -329, -329, -215, -329,
+ -329, -329, 48, -329, -329, -43, -329, -9, -31, -329,
+ -329, 217, -329, 150, -131, -329, -24, -140, 56, -153,
+ -328, -78, -90, 213, 124, 58, -329, -329, -19, -329,
+ -329, -329, -329, -329, -329, -329, 219, -329
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -268
+#define YYTABLE_NINF -264
static const yytype_int16 yytable[] =
{
- 98, 110, 293, 294, 253, 316, 255, 127, 304, -164,
- 242, 248, 334, 142, 397, 122, 123, 260, 263, 264,
- 85, 1, 393, 86, 5, 397, 148, 233, 114, 228,
- 232, 229, 12, 13, 271, 392, 128, 129, 130, 273,
- 274, 275, 276, 277, 278, 279, 280, 281, 282, 230,
- 306, 127, 139, 414, 313, 12, 13, 4, 258, 259,
- 7, 30, 134, 31, 332, 32, 413, 33, 34, 35,
- 114, 309, 314, 368, 417, 98, 413, 317, 135, 285,
- 128, 129, 130, 334, 30, 11, 31, 140, 32, 367,
- 33, 34, 35, 306, 322, 85, 329, 371, 86, 306,
- 331, 242, 145, 333, 137, 112, 306, 8, 138, 307,
- 323, 339, 106, 382, 207, 233, 342, 116, 232, 309,
- 295, 296, 330, 225, -40, 117, 305, 265, 386, 266,
- 244, 343, 113, 118, 245, 145, 268, 145, 111, 119,
- 269, 383, 120, 402, 336, 207, 404, 125, 306, 80,
- 126, 363, 377, 364, 409, 113, 306, 283, 136, 107,
- 108, 317, 411, 109, 141, 378, 405, 416, 207, 306,
- 306, 306, 80, 143, 333, 344, 345, 346, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 144, -102, 72, 73, 74, 233,
- 291, 292, 232, 289, 290, 207, 149, 233, 297, 298,
- 232, 351, 352, 353, 354, 227, 317, 225, 236, 389,
- 128, 129, 130, 286, 287, 288, 347, 348, 145, 400,
- 238, 317, 349, 350, 317, 243, 406, 355, 356, 246,
- 207, 249, 317, 247, 250, 251, 254, 256, 207, 257,
- 317, 233, 267, 207, 232, 272, 415, 299, 302, 303,
- 122, 300, 310, -39, 301, 325, -34, 319, 321, 365,
- 369, 370, 373, 379, 306, 380, -40, 384, 381, 387,
- 385, 388, 390, 391, 401, 12, 13, 14, 15, 16,
- 17, 152, 153, 154, 410, 155, 156, 157, 158, 159,
- 160, 161, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 177, 31, 395, 32, 207,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 69, 162, 163, 164,
- 165, 166, 167, 168, 403, 408, 169, 170, 207, 412,
- 418, 207, 361, 341, 311, 222, 226, 312, 357, 324,
- 358, 115, 207, 237, 372, 71, 72, 73, 74, 359,
- 75, 360, 326, 394, 124, 262, 407, 362, 327, 207,
- 121, 0, 80, 0, 0, 0, 0, 207, 0, 207,
+ 98, 245, 127, 250, 110, 252, 229, 301, 230, 12,
+ 13, 85, 290, 291, 86, 239, 257, -164, 270, 271,
+ 272, 273, 274, 275, 276, 277, 278, 279, 114, 260,
+ 261, 128, 129, 130, 255, 256, 127, 313, 30, 331,
+ 31, 225, 32, 226, 33, 34, 35, 134, 303, 393,
+ 310, 1, 139, 122, 123, 282, 4, 319, 303, 306,
+ 393, 227, 303, 135, 304, 128, 129, 130, 311, 303,
+ 114, 142, 5, 320, 327, 98, 329, 107, 108, 286,
+ 287, 109, 112, 379, 148, 7, 85, 140, 268, 86,
+ 137, 229, 326, 230, 138, 8, 328, 241, 11, 330,
+ 265, 242, 145, 239, 266, 116, 306, 336, 106, 113,
+ 331, 333, 374, 375, 207, 303, 303, 303, 72, 73,
+ 74, 364, 117, 222, 118, 302, 80, 120, 314, 368,
+ 292, 293, -40, 288, 289, 145, 280, 145, 262, 119,
+ 263, 111, 401, 12, 13, 207, 303, 360, 341, 342,
+ 343, 229, 229, 229, 229, 229, 229, 229, 229, 229,
+ 229, 229, 229, 229, 229, 229, 229, 339, 207, 125,
+ 330, 365, 30, 380, 31, 229, 32, 230, 33, 34,
+ 35, 136, 340, 229, 126, 230, 348, 349, 350, 351,
+ -102, 128, 129, 130, 283, 284, 285, 294, 295, 344,
+ 345, 352, 353, 207, 361, 346, 347, 143, 141, 149,
+ 144, 224, 314, 233, 222, 386, 240, 235, 246, 243,
+ 244, 389, 247, 253, 248, 145, 383, 229, 251, 230,
+ 254, 269, 402, 264, 296, 299, 297, 207, 298, 300,
+ -39, 398, 307, 113, 400, 207, 122, 316, 318, 322,
+ 207, 408, 405, -34, 366, 362, 370, 367, 376, 406,
+ 80, 377, 303, 381, 378, -40, 387, 314, 388, 382,
+ 384, 385, 397, 177, 404, 392, 354, 356, 399, 338,
+ 396, 355, 314, 407, 359, 314, 357, 219, 223, 358,
+ 321, 308, 115, 314, 234, 369, 309, 391, 403, 124,
+ 314, 259, 323, 121, 324, 0, 371, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 207, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 374, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 81, 0, 82, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 171, 0, 0, 0, 0, 0, 172,
- 173, 174, 175, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 176, 177, 178, 12, 13, 14,
- 15, 16, 17, 152, 153, 154, 0, 155, 156, 157,
- 158, 159, 160, 161, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 0, 31, 0,
- 32, 0, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68, 69, 162,
- 163, 164, 165, 166, 167, 168, 0, 0, 169, 170,
+ 0, 0, 0, 0, 0, 207, 0, 0, 207, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 207,
+ 0, 0, 0, 0, 0, 0, 12, 13, 14, 15,
+ 16, 17, 152, 153, 154, 207, 155, 156, 157, 158,
+ 159, 160, 161, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 0, 31, 0, 32,
+ 0, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 65, 66, 67, 68, 69, 162, 163,
+ 164, 165, 166, 167, 168, 0, 0, 169, 170, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 71, 72, 73,
- 74, 0, 75, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 80, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 71, 72, 73, 74,
+ 0, 75, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 80, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 81, 0,
- 82, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 81, 0, 82,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 171, 0, 0, 0, 0,
- 0, 172, 173, 174, 175, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 176, 177, 261, 12,
- 13, 14, 15, 16, 17, 152, 153, 154, 0, 155,
- 156, 157, 158, 159, 160, 161, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 0,
- 31, 0, 32, 0, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
- 69, 162, 163, 164, 165, 166, 167, 168, 0, 0,
- 169, 170, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 71,
- 72, 73, 74, 0, 75, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 171, 0, 0, 0, 0, 0,
+ 172, 173, 174, 175, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 176, 177, 178, 12, 13,
+ 14, 15, 16, 17, 152, 153, 154, 0, 155, 156,
+ 157, 158, 159, 160, 161, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 0, 31,
+ 0, 32, 0, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ 162, 163, 164, 165, 166, 167, 168, 0, 0, 169,
+ 170, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 71, 72,
+ 73, 74, 0, 75, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 80, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 81, 0, 82, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,
+ 0, 82, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 171, 0, 0,
- 0, 0, 0, 172, 173, 174, 175, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 176, 177,
- 308, 12, 13, 14, 15, 16, 17, 152, 153, 154,
- 0, 155, 156, 157, 158, 159, 160, 161, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 0, 31, 0, 32, 0, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
- 67, 68, 69, 162, 163, 164, 165, 166, 167, 168,
- 0, 0, 169, 170, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 171, 0, 0, 0,
+ 0, 0, 172, 173, 174, 175, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 176, 177, 258,
+ 12, 13, 14, 15, 16, 17, 152, 153, 154, 0,
+ 155, 156, 157, 158, 159, 160, 161, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 0, 31, 0, 32, 0, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 162, 163, 164, 165, 166, 167, 168, 0,
+ 0, 169, 170, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 71, 72, 73, 74, 0, 75, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 80, 0,
+ 71, 72, 73, 74, 0, 75, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 80, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 81, 0, 82, 0, 0, 0, 0, 0,
+ 0, 81, 0, 82, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 171,
- 0, 0, 0, 0, 0, 172, 173, 174, 175, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 171, 0,
+ 0, 0, 0, 0, 172, 173, 174, 175, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 176,
+ 177, 305, 12, 13, 14, 15, 16, 17, 152, 153,
+ 154, 0, 155, 156, 157, 158, 159, 160, 161, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 0, 31, 0, 32, 0, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 162, 163, 164, 165, 166, 167,
+ 168, 0, 0, 169, 170, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 176, 177, 337, 12, 13, 14, 15, 16, 17, 152,
- 153, 154, 0, 155, 156, 157, 158, 159, 160, 161,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- 28, 29, 30, 0, 31, 0, 32, 0, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 162, 163, 164, 165, 166,
- 167, 168, 0, 0, 169, 170, 0, 0, 0, 0,
+ 0, 0, 71, 72, 73, 74, 0, 75, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 71, 72, 73, 74, 0, 75, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 81, 0, 82, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 81, 0, 82, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 171, 0, 0, 0, 0, 0, 172, 173, 174, 175,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 171, 0, 0, 0, 0, 0, 172, 173, 174,
- 175, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 176, 177, 12, 13, 14, 15, 16, 17,
- 152, 153, 154, 0, 155, 396, 157, 158, 159, 160,
+ 0, 176, 177, 334, 12, 13, 14, 15, 16, 17,
+ 152, 153, 154, 0, 155, 156, 157, 158, 159, 160,
161, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 0, 31, 0, 32, 0, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
@@ -1299,8 +1288,8 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 171, 0, 0, 0, 0, 0, 172, 173,
174, 175, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 176, 123, 12, 13, 14, 15, 16,
- 17, 152, 153, 154, 0, 155, 396, 157, 158, 159,
+ 0, 0, 0, 176, 177, 12, 13, 14, 15, 16,
+ 17, 152, 153, 154, 0, 155, 156, 157, 158, 159,
160, 161, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 0, 31, 0, 32, 0,
33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
@@ -1320,7 +1309,7 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 171, 0, 0, 0, 0, 0, 172,
173, 174, 175, 12, 13, 14, 15, 16, 17, 0,
- 0, 0, 0, 0, 176, 177, 0, 0, 0, 0,
+ 0, 0, 0, 0, 176, 123, 0, 0, 0, 0,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 0, 31, 0, 32, 0, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
@@ -1360,7 +1349,7 @@ static const yytype_int16 yytable[] =
61, 62, 63, 64, 65, 66, 67, 68, 69, 171,
70, 0, 0, 0, 0, 172, 173, 174, 175, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- -267, 0, 0, 0, 0, 0, 0, 0, 72, 73,
+ -263, 0, 0, 0, 0, 0, 0, 0, 72, 73,
74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 14, 15, 16, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1371,7 +1360,7 @@ static const yytype_int16 yytable[] =
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 0, 70, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 241, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 238, 0,
0, 0, 0, 0, 72, 73, 74, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
@@ -1383,7 +1372,7 @@ static const yytype_int16 yytable[] =
59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 0, 163, 164, 165, 166, 167, 168, 0, 0,
169, 170, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 320, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 317, 0, 0, 0, 0, 0,
72, 73, 74, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1394,7 +1383,7 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 171, 0, 0,
0, 0, 0, 172, 173, 174, 175, 12, 13, 14,
- 15, 16, 17, 0, 0, 0, 0, 0, 252, 0,
+ 15, 16, 17, 0, 0, 0, 0, 0, 249, 0,
0, 0, 0, 0, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 0, 31, 0,
32, 0, 33, 34, 35, 36, 37, 38, 39, 40,
@@ -1430,7 +1419,7 @@ static const yytype_int16 yytable[] =
0, 82, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 14, 15, 16, 17, 0, 171, 0, 0, 231,
+ 0, 14, 15, 16, 17, 0, 171, 0, 0, 228,
0, 0, 172, 173, 174, 175, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 0, 0,
0, 0, 0, 0, 0, 0, 0, 36, 37, 38,
@@ -1449,7 +1438,7 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 14, 15, 16, 17, 0, 171, 0, 0,
- 315, 0, 0, 172, 173, 174, 175, 18, 19, 20,
+ 312, 0, 0, 172, 173, 174, 175, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 0,
0, 0, 0, 0, 0, 0, 0, 0, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@@ -1467,7 +1456,7 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 14, 15, 16, 17, 0, 171, 0,
- 0, 366, 0, 0, 172, 173, 174, 175, 18, 19,
+ 0, 363, 0, 0, 172, 173, 174, 175, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
0, 0, 0, 0, 0, 0, 0, 0, 0, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
@@ -1491,7 +1480,7 @@ static const yytype_int16 yytable[] =
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 270, 0, 163, 164, 165, 166, 167,
+ 66, 67, 68, 267, 0, 163, 164, 165, 166, 167,
168, 0, 0, 169, 170, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 72, 73, 74, 0, 0, 0, 0,
@@ -1533,7 +1522,7 @@ static const yytype_int16 yytable[] =
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 0, 340, 14, 15, 16, 17, 168, 0, 0, 0,
+ 0, 337, 14, 15, 16, 17, 168, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 72,
73, 74, 0, 0, 0, 0, 0, 0, 36, 37,
@@ -1560,141 +1549,130 @@ static const yytype_int16 yytable[] =
static const yytype_int16 yycheck[] =
{
- 9, 76, 86, 87, 158, 229, 160, 4, 91, 76,
- 146, 154, 257, 102, 380, 212, 213, 171, 84, 85,
- 9, 109, 377, 9, 0, 391, 115, 141, 71, 191,
- 141, 193, 3, 4, 187, 377, 33, 34, 35, 93,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 211,
- 196, 4, 95, 408, 193, 3, 4, 78, 169, 170,
- 113, 32, 196, 34, 210, 36, 408, 38, 39, 40,
- 113, 214, 211, 314, 416, 84, 418, 230, 212, 190,
- 33, 34, 35, 328, 32, 76, 34, 96, 36, 313,
- 38, 39, 40, 196, 196, 84, 250, 321, 84, 196,
- 254, 237, 111, 257, 33, 76, 196, 110, 37, 212,
- 212, 265, 112, 210, 123, 229, 269, 113, 229, 262,
- 204, 205, 212, 132, 191, 113, 209, 193, 369, 195,
- 192, 284, 103, 113, 196, 144, 192, 146, 213, 113,
- 196, 365, 191, 384, 192, 154, 387, 192, 196, 120,
- 196, 305, 192, 306, 395, 103, 196, 211, 76, 33,
- 34, 314, 403, 37, 193, 192, 192, 192, 177, 196,
- 196, 196, 120, 76, 328, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
- 301, 302, 303, 304, 213, 192, 104, 105, 106, 313,
- 82, 83, 313, 197, 198, 214, 76, 321, 88, 89,
- 321, 293, 294, 295, 296, 76, 369, 226, 113, 373,
- 33, 34, 35, 201, 202, 203, 289, 290, 237, 382,
- 76, 384, 291, 292, 387, 212, 390, 297, 298, 212,
- 249, 191, 395, 212, 191, 212, 191, 210, 257, 191,
- 403, 365, 192, 262, 365, 191, 410, 206, 90, 92,
- 212, 207, 76, 191, 208, 75, 192, 194, 193, 193,
- 211, 194, 191, 76, 196, 192, 191, 211, 194, 211,
- 194, 194, 212, 192, 194, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 191, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- 28, 29, 30, 31, 32, 213, 34, 211, 36, 328,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 81, 211, 12, 84, 85, 377, 212,
- 12, 380, 303, 266, 226, 126, 133, 226, 299, 245,
- 300, 75, 391, 144, 322, 103, 104, 105, 106, 301,
- 108, 302, 249, 378, 86, 177, 391, 304, 249, 408,
- 84, -1, 120, -1, -1, -1, -1, 416, -1, 418,
+ 9, 154, 4, 158, 76, 160, 141, 91, 141, 3,
+ 4, 9, 86, 87, 9, 146, 171, 76, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 71, 84,
+ 85, 33, 34, 35, 169, 170, 4, 226, 32, 254,
+ 34, 191, 36, 193, 38, 39, 40, 196, 196, 377,
+ 193, 109, 95, 212, 213, 190, 78, 196, 196, 212,
+ 388, 211, 196, 212, 212, 33, 34, 35, 211, 196,
+ 113, 102, 0, 212, 212, 84, 210, 33, 34, 197,
+ 198, 37, 76, 210, 115, 113, 84, 96, 187, 84,
+ 33, 226, 247, 226, 37, 110, 251, 192, 76, 254,
+ 192, 196, 111, 234, 196, 113, 259, 262, 112, 103,
+ 325, 192, 192, 192, 123, 196, 196, 196, 104, 105,
+ 106, 310, 113, 132, 113, 209, 120, 191, 227, 318,
+ 204, 205, 191, 82, 83, 144, 211, 146, 193, 113,
+ 195, 213, 192, 3, 4, 154, 196, 302, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 266, 177, 192,
+ 325, 311, 32, 362, 34, 310, 36, 310, 38, 39,
+ 40, 76, 281, 318, 196, 318, 290, 291, 292, 293,
+ 192, 33, 34, 35, 201, 202, 203, 88, 89, 286,
+ 287, 294, 295, 212, 303, 288, 289, 76, 193, 76,
+ 213, 76, 311, 113, 223, 370, 212, 76, 191, 212,
+ 212, 374, 191, 210, 212, 234, 366, 362, 191, 362,
+ 191, 191, 387, 192, 206, 90, 207, 246, 208, 92,
+ 191, 381, 76, 103, 384, 254, 212, 194, 193, 75,
+ 259, 404, 392, 192, 211, 193, 191, 194, 76, 399,
+ 120, 192, 196, 211, 194, 191, 212, 366, 192, 194,
+ 211, 194, 194, 213, 12, 211, 296, 298, 211, 263,
+ 379, 297, 381, 212, 301, 384, 299, 126, 133, 300,
+ 242, 223, 75, 392, 144, 319, 223, 375, 388, 86,
+ 399, 177, 246, 84, 246, -1, 325, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 325, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 328, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 154, -1, 156, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 191, -1, -1, -1, -1, -1, 197,
- 198, 199, 200, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 212, 213, 214, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, -1, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, -1, 34, -1,
- 36, -1, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, -1, -1, 84, 85,
+ -1, -1, -1, -1, -1, 374, -1, -1, 377, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 388,
+ -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 404, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, -1, 34, -1, 36,
+ -1, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, -1, -1, 84, 85, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 103, 104, 105,
- 106, -1, 108, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 120, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 103, 104, 105, 106,
+ -1, 108, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 120, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 154, -1,
- 156, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 154, -1, 156,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 191, -1, -1, -1, -1,
- -1, 197, 198, 199, 200, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 212, 213, 214, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, -1, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
- 34, -1, 36, -1, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, -1, -1,
- 84, 85, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 103,
- 104, 105, 106, -1, 108, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 120, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 191, -1, -1, -1, -1, -1,
+ 197, 198, 199, 200, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 212, 213, 214, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, -1, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, -1, 34,
+ -1, 36, -1, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, -1, -1, 84,
+ 85, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 103, 104,
+ 105, 106, -1, 108, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 120, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 154, -1, 156, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 154,
+ -1, 156, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 191, -1, -1,
- -1, -1, -1, 197, 198, 199, 200, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 212, 213,
- 214, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- -1, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, -1, 34, -1, 36, -1, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
- -1, -1, 84, 85, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 191, -1, -1, -1,
+ -1, -1, 197, 198, 199, 200, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 212, 213, 214,
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, -1,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ -1, 34, -1, 36, -1, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, -1,
+ -1, 84, 85, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 103, 104, 105, 106, -1, 108, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 120, -1,
+ 103, 104, 105, 106, -1, 108, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 120, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 154, -1, 156, -1, -1, -1, -1, -1,
+ -1, 154, -1, 156, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 191,
- -1, -1, -1, -1, -1, 197, 198, 199, 200, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 191, -1,
+ -1, -1, -1, -1, 197, 198, 199, 200, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 212,
+ 213, 214, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, -1, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, -1, 34, -1, 36, -1, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, -1, -1, 84, 85, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 212, 213, 214, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, -1, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, -1, 34, -1, 36, -1, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, -1, -1, 84, 85, -1, -1, -1, -1,
+ -1, -1, 103, 104, 105, 106, -1, 108, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 120,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 103, 104, 105, 106, -1, 108, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 120, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 154, -1, 156, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 154, -1, 156, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 191, -1, -1, -1, -1, -1, 197, 198, 199, 200,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 191, -1, -1, -1, -1, -1, 197, 198, 199,
- 200, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 212, 213, 3, 4, 5, 6, 7, 8,
+ -1, 212, 213, 214, 3, 4, 5, 6, 7, 8,
9, 10, 11, -1, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, -1, 34, -1, 36, -1, 38,
@@ -1988,9 +1966,9 @@ static const yytype_uint16 yystos[] =
76, 103, 104, 105, 106, 108, 116, 117, 118, 119,
120, 154, 156, 219, 222, 252, 253, 254, 255, 256,
261, 262, 263, 264, 265, 268, 270, 271, 272, 273,
- 274, 275, 276, 277, 303, 304, 112, 33, 34, 37,
+ 274, 275, 276, 277, 301, 302, 112, 33, 34, 37,
76, 213, 76, 103, 270, 276, 113, 113, 113, 113,
- 191, 303, 212, 213, 290, 192, 196, 4, 33, 34,
+ 191, 301, 212, 213, 288, 192, 196, 4, 33, 34,
35, 258, 259, 269, 196, 212, 76, 33, 37, 270,
272, 193, 273, 76, 213, 272, 278, 279, 273, 76,
266, 267, 9, 10, 11, 13, 14, 15, 16, 17,
@@ -1999,27 +1977,26 @@ static const yytype_uint16 yystos[] =
224, 225, 227, 228, 229, 230, 231, 232, 233, 234,
235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
245, 246, 247, 248, 250, 252, 253, 272, 283, 284,
- 285, 286, 287, 288, 291, 292, 293, 294, 296, 297,
- 298, 302, 258, 257, 260, 272, 259, 76, 191, 193,
- 211, 194, 234, 247, 251, 272, 113, 278, 76, 280,
- 281, 214, 279, 212, 192, 196, 212, 212, 284, 191,
- 191, 212, 212, 250, 191, 250, 210, 191, 234, 234,
- 250, 214, 291, 84, 85, 193, 195, 192, 192, 196,
- 74, 248, 191, 93, 94, 95, 96, 97, 98, 99,
- 100, 101, 102, 211, 249, 234, 201, 202, 203, 197,
- 198, 82, 83, 86, 87, 204, 205, 88, 89, 206,
- 207, 208, 90, 92, 91, 209, 196, 212, 214, 284,
- 76, 257, 260, 193, 211, 194, 251, 248, 282, 194,
- 214, 193, 196, 212, 267, 75, 283, 292, 299, 250,
- 212, 250, 210, 250, 263, 295, 192, 214, 226, 250,
- 76, 229, 248, 248, 234, 234, 234, 236, 236, 237,
- 237, 238, 238, 238, 238, 239, 239, 240, 241, 242,
- 243, 244, 245, 250, 248, 193, 194, 251, 282, 211,
- 194, 251, 281, 191, 295, 300, 301, 192, 192, 76,
- 192, 194, 210, 251, 211, 194, 282, 211, 194, 250,
- 212, 192, 285, 286, 288, 211, 14, 287, 289, 290,
- 248, 194, 282, 211, 282, 192, 250, 289, 12, 282,
- 191, 282, 212, 285, 286, 250, 192, 285, 12
+ 285, 286, 289, 290, 291, 294, 295, 296, 300, 258,
+ 257, 260, 272, 259, 76, 191, 193, 211, 194, 234,
+ 247, 251, 272, 113, 278, 76, 280, 281, 214, 279,
+ 212, 192, 196, 212, 212, 284, 191, 191, 212, 212,
+ 250, 191, 250, 210, 191, 234, 234, 250, 214, 289,
+ 84, 85, 193, 195, 192, 192, 196, 74, 248, 191,
+ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
+ 211, 249, 234, 201, 202, 203, 197, 198, 82, 83,
+ 86, 87, 204, 205, 88, 89, 206, 207, 208, 90,
+ 92, 91, 209, 196, 212, 214, 284, 76, 257, 260,
+ 193, 211, 194, 251, 248, 282, 194, 214, 193, 196,
+ 212, 267, 75, 283, 290, 297, 250, 212, 250, 210,
+ 250, 263, 293, 192, 214, 226, 250, 76, 229, 248,
+ 248, 234, 234, 234, 236, 236, 237, 237, 238, 238,
+ 238, 238, 239, 239, 240, 241, 242, 243, 244, 245,
+ 250, 248, 193, 194, 251, 282, 211, 194, 251, 281,
+ 191, 293, 298, 299, 192, 192, 76, 192, 194, 210,
+ 251, 211, 194, 282, 211, 194, 250, 212, 192, 284,
+ 292, 286, 211, 285, 287, 288, 248, 194, 282, 211,
+ 282, 192, 250, 287, 12, 282, 282, 212, 284
};
#define yyerrok (yyerrstatus = 0)
@@ -2034,9 +2011,18 @@ static const yytype_uint16 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -2093,7 +2079,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -2635,7 +2621,7 @@ YYLTYPE yylloc;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
- YYLTYPE yyerror_range[2];
+ YYLTYPE yyerror_range[3];
YYSIZE_T yystacksize;
@@ -2682,7 +2668,7 @@ YYLTYPE yylloc;
yyvsp = yyvs;
yylsp = yyls;
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
@@ -2690,7 +2676,7 @@ YYLTYPE yylloc;
/* User initialization code. */
-/* Line 1242 of yacc.c */
+/* Line 1251 of yacc.c */
#line 41 "glsl_parser.ypp"
{
yylloc.first_line = 1;
@@ -2700,8 +2686,8 @@ YYLTYPE yylloc;
yylloc.source = 0;
}
-/* Line 1242 of yacc.c */
-#line 2705 "glsl_parser.cpp"
+/* Line 1251 of yacc.c */
+#line 2691 "glsl_parser.cpp"
yylsp[0] = yylloc;
goto yysetstate;
@@ -2888,35 +2874,26 @@ yyreduce:
{
case 2:
-/* Line 1455 of yacc.c */
-#line 211 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 214 "glsl_parser.ypp"
{
_mesa_glsl_initialize_types(state);
;}
break;
- case 4:
-
-/* Line 1455 of yacc.c */
-#line 219 "glsl_parser.ypp"
- {
- state->language_version = 110;
- state->symbols->language_version = 110;
- ;}
- break;
-
case 5:
-/* Line 1455 of yacc.c */
-#line 224 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 223 "glsl_parser.ypp"
{
switch ((yyvsp[(2) - (3)].n)) {
+ case 100:
+ state->es_shader = true;
case 110:
case 120:
case 130:
/* FINISHME: Check against implementation support versions. */
state->language_version = (yyvsp[(2) - (3)].n);
- state->symbols->language_version = (yyvsp[(2) - (3)].n);
break;
default:
_mesa_glsl_error(& (yylsp[(2) - (3)]), state, "Shading language version"
@@ -2928,7 +2905,7 @@ yyreduce:
case 12:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 255 "glsl_parser.ypp"
{
if (!_mesa_glsl_process_extension((yyvsp[(2) - (5)].identifier), & (yylsp[(2) - (5)]), (yyvsp[(4) - (5)].identifier), & (yylsp[(4) - (5)]), state)) {
@@ -2939,7 +2916,7 @@ yyreduce:
case 13:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 264 "glsl_parser.ypp"
{
/* FINISHME: The NULL test is only required because 'precision'
@@ -2952,7 +2929,7 @@ yyreduce:
case 14:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 272 "glsl_parser.ypp"
{
/* FINISHME: The NULL test is only required because 'precision'
@@ -2965,7 +2942,7 @@ yyreduce:
case 16:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 287 "glsl_parser.ypp"
{
void *ctx = state;
@@ -2977,7 +2954,7 @@ yyreduce:
case 17:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 294 "glsl_parser.ypp"
{
void *ctx = state;
@@ -2989,7 +2966,7 @@ yyreduce:
case 18:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 301 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3001,7 +2978,7 @@ yyreduce:
case 19:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 308 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3013,7 +2990,7 @@ yyreduce:
case 20:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 315 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3025,7 +3002,7 @@ yyreduce:
case 21:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 322 "glsl_parser.ypp"
{
(yyval.expression) = (yyvsp[(2) - (3)].expression);
@@ -3034,7 +3011,7 @@ yyreduce:
case 23:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 330 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3045,7 +3022,7 @@ yyreduce:
case 24:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 336 "glsl_parser.ypp"
{
(yyval.expression) = (yyvsp[(1) - (1)].expression);
@@ -3054,7 +3031,7 @@ yyreduce:
case 25:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 340 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3066,7 +3043,7 @@ yyreduce:
case 26:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 347 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3077,7 +3054,7 @@ yyreduce:
case 27:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 353 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3088,7 +3065,7 @@ yyreduce:
case 31:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 371 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3099,7 +3076,7 @@ yyreduce:
case 36:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 390 "glsl_parser.ypp"
{
(yyval.expression) = (yyvsp[(1) - (2)].expression);
@@ -3110,7 +3087,7 @@ yyreduce:
case 37:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 396 "glsl_parser.ypp"
{
(yyval.expression) = (yyvsp[(1) - (3)].expression);
@@ -3121,7 +3098,7 @@ yyreduce:
case 39:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 412 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3132,7 +3109,7 @@ yyreduce:
case 40:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 418 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3144,7 +3121,7 @@ yyreduce:
case 41:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 425 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3156,7 +3133,7 @@ yyreduce:
case 43:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 437 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3167,7 +3144,7 @@ yyreduce:
case 44:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 443 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3178,7 +3155,7 @@ yyreduce:
case 45:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 449 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3189,35 +3166,35 @@ yyreduce:
case 46:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 458 "glsl_parser.ypp"
{ (yyval.n) = ast_plus; ;}
break;
case 47:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 459 "glsl_parser.ypp"
{ (yyval.n) = ast_neg; ;}
break;
case 48:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 460 "glsl_parser.ypp"
{ (yyval.n) = ast_logic_not; ;}
break;
case 49:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 461 "glsl_parser.ypp"
{ (yyval.n) = ast_bit_not; ;}
break;
case 51:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 467 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3228,7 +3205,7 @@ yyreduce:
case 52:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 473 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3239,7 +3216,7 @@ yyreduce:
case 53:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 479 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3250,7 +3227,7 @@ yyreduce:
case 55:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 489 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3261,7 +3238,7 @@ yyreduce:
case 56:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 495 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3272,7 +3249,7 @@ yyreduce:
case 58:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 505 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3283,7 +3260,7 @@ yyreduce:
case 59:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 511 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3294,7 +3271,7 @@ yyreduce:
case 61:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 521 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3305,7 +3282,7 @@ yyreduce:
case 62:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 527 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3316,7 +3293,7 @@ yyreduce:
case 63:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 533 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3327,7 +3304,7 @@ yyreduce:
case 64:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 539 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3338,7 +3315,7 @@ yyreduce:
case 66:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 549 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3349,7 +3326,7 @@ yyreduce:
case 67:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 555 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3360,7 +3337,7 @@ yyreduce:
case 69:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 565 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3371,7 +3348,7 @@ yyreduce:
case 71:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 575 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3382,7 +3359,7 @@ yyreduce:
case 73:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 585 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3393,7 +3370,7 @@ yyreduce:
case 75:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 595 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3404,7 +3381,7 @@ yyreduce:
case 77:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 605 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3415,7 +3392,7 @@ yyreduce:
case 79:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 615 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3426,7 +3403,7 @@ yyreduce:
case 81:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 625 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3437,7 +3414,7 @@ yyreduce:
case 83:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 635 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3448,84 +3425,84 @@ yyreduce:
case 84:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 643 "glsl_parser.ypp"
{ (yyval.n) = ast_assign; ;}
break;
case 85:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 644 "glsl_parser.ypp"
{ (yyval.n) = ast_mul_assign; ;}
break;
case 86:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 645 "glsl_parser.ypp"
{ (yyval.n) = ast_div_assign; ;}
break;
case 87:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 646 "glsl_parser.ypp"
{ (yyval.n) = ast_mod_assign; ;}
break;
case 88:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 647 "glsl_parser.ypp"
{ (yyval.n) = ast_add_assign; ;}
break;
case 89:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 648 "glsl_parser.ypp"
{ (yyval.n) = ast_sub_assign; ;}
break;
case 90:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 649 "glsl_parser.ypp"
{ (yyval.n) = ast_ls_assign; ;}
break;
case 91:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 650 "glsl_parser.ypp"
{ (yyval.n) = ast_rs_assign; ;}
break;
case 92:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 651 "glsl_parser.ypp"
{ (yyval.n) = ast_and_assign; ;}
break;
case 93:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 652 "glsl_parser.ypp"
{ (yyval.n) = ast_xor_assign; ;}
break;
case 94:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 653 "glsl_parser.ypp"
{ (yyval.n) = ast_or_assign; ;}
break;
case 95:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 658 "glsl_parser.ypp"
{
(yyval.expression) = (yyvsp[(1) - (1)].expression);
@@ -3534,7 +3511,7 @@ yyreduce:
case 96:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 662 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3552,7 +3529,7 @@ yyreduce:
case 98:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 682 "glsl_parser.ypp"
{
(yyval.node) = (yyvsp[(1) - (2)].function);
@@ -3561,7 +3538,7 @@ yyreduce:
case 99:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 686 "glsl_parser.ypp"
{
(yyval.node) = (yyvsp[(1) - (2)].declarator_list);
@@ -3570,7 +3547,7 @@ yyreduce:
case 100:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 690 "glsl_parser.ypp"
{
if (((yyvsp[(3) - (4)].type_specifier)->type_specifier != ast_float)
@@ -3586,7 +3563,7 @@ yyreduce:
case 104:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 713 "glsl_parser.ypp"
{
(yyval.function) = (yyvsp[(1) - (2)].function);
@@ -3596,7 +3573,7 @@ yyreduce:
case 105:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 718 "glsl_parser.ypp"
{
(yyval.function) = (yyvsp[(1) - (3)].function);
@@ -3606,7 +3583,7 @@ yyreduce:
case 106:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 726 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3619,7 +3596,7 @@ yyreduce:
case 107:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 737 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3634,7 +3611,7 @@ yyreduce:
case 108:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 747 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3651,7 +3628,7 @@ yyreduce:
case 109:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 762 "glsl_parser.ypp"
{
(yyvsp[(1) - (3)].type_qualifier).i |= (yyvsp[(2) - (3)].type_qualifier).i;
@@ -3663,7 +3640,7 @@ yyreduce:
case 110:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 769 "glsl_parser.ypp"
{
(yyval.parameter_declarator) = (yyvsp[(2) - (2)].parameter_declarator);
@@ -3673,7 +3650,7 @@ yyreduce:
case 111:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 774 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3689,7 +3666,7 @@ yyreduce:
case 112:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 785 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3703,35 +3680,35 @@ yyreduce:
case 113:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 796 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; ;}
break;
case 114:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 797 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.in = 1; ;}
break;
case 115:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 798 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.out = 1; ;}
break;
case 116:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 799 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.in = 1; (yyval.type_qualifier).q.out = 1; ;}
break;
case 119:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 809 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3745,7 +3722,7 @@ yyreduce:
case 120:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 818 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3759,7 +3736,7 @@ yyreduce:
case 121:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 827 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3773,7 +3750,7 @@ yyreduce:
case 122:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 836 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3787,7 +3764,7 @@ yyreduce:
case 123:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 845 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3801,7 +3778,7 @@ yyreduce:
case 124:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 854 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3815,7 +3792,7 @@ yyreduce:
case 125:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 867 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3831,7 +3808,7 @@ yyreduce:
case 126:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 878 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3845,7 +3822,7 @@ yyreduce:
case 127:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 887 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3859,7 +3836,7 @@ yyreduce:
case 128:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 896 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3873,7 +3850,7 @@ yyreduce:
case 129:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 905 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3887,7 +3864,7 @@ yyreduce:
case 130:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 914 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3901,7 +3878,7 @@ yyreduce:
case 131:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 923 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3915,7 +3892,7 @@ yyreduce:
case 132:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 932 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3931,7 +3908,7 @@ yyreduce:
case 133:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 946 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3943,7 +3920,7 @@ yyreduce:
case 134:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 953 "glsl_parser.ypp"
{
void *ctx = state;
@@ -3956,14 +3933,14 @@ yyreduce:
case 135:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 963 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; ;}
break;
case 137:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 969 "glsl_parser.ypp"
{
(yyval.type_qualifier) = (yyvsp[(3) - (4)].type_qualifier);
@@ -3972,7 +3949,7 @@ yyreduce:
case 139:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 977 "glsl_parser.ypp"
{
(yyval.type_qualifier).i = (yyvsp[(1) - (3)].type_qualifier).i | (yyvsp[(3) - (3)].type_qualifier).i;
@@ -3981,7 +3958,7 @@ yyreduce:
case 140:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 984 "glsl_parser.ypp"
{
(yyval.type_qualifier).i = 0;
@@ -4017,35 +3994,35 @@ yyreduce:
case 141:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1017 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.smooth = 1; ;}
break;
case 142:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1018 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.flat = 1; ;}
break;
case 143:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1019 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.noperspective = 1; ;}
break;
case 144:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1023 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.constant = 1; ;}
break;
case 146:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1029 "glsl_parser.ypp"
{
(yyval.type_qualifier).i = (yyvsp[(1) - (2)].type_qualifier).i | (yyvsp[(2) - (2)].type_qualifier).i;
@@ -4054,7 +4031,7 @@ yyreduce:
case 147:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1033 "glsl_parser.ypp"
{
(yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier);
@@ -4064,70 +4041,70 @@ yyreduce:
case 148:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1040 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.constant = 1; ;}
break;
case 149:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1041 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.attribute = 1; ;}
break;
case 150:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1042 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = (yyvsp[(1) - (2)].type_qualifier).i; (yyval.type_qualifier).q.varying = 1; ;}
break;
case 151:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1043 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.centroid = 1; (yyval.type_qualifier).q.varying = 1; ;}
break;
case 152:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1044 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.in = 1; ;}
break;
case 153:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1045 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.out = 1; ;}
break;
case 154:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1046 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.centroid = 1; (yyval.type_qualifier).q.in = 1; ;}
break;
case 155:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1047 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.centroid = 1; (yyval.type_qualifier).q.out = 1; ;}
break;
case 156:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1048 "glsl_parser.ypp"
{ (yyval.type_qualifier).i = 0; (yyval.type_qualifier).q.uniform = 1; ;}
break;
case 158:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1054 "glsl_parser.ypp"
{
(yyval.type_specifier) = (yyvsp[(2) - (2)].type_specifier);
@@ -4137,7 +4114,7 @@ yyreduce:
case 160:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1063 "glsl_parser.ypp"
{
(yyval.type_specifier) = (yyvsp[(1) - (3)].type_specifier);
@@ -4148,7 +4125,7 @@ yyreduce:
case 161:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1069 "glsl_parser.ypp"
{
(yyval.type_specifier) = (yyvsp[(1) - (4)].type_specifier);
@@ -4159,7 +4136,7 @@ yyreduce:
case 162:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1078 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4170,7 +4147,7 @@ yyreduce:
case 163:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1084 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4181,7 +4158,7 @@ yyreduce:
case 164:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1090 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4192,415 +4169,415 @@ yyreduce:
case 165:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1098 "glsl_parser.ypp"
{ (yyval.n) = ast_void; ;}
break;
case 166:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1099 "glsl_parser.ypp"
{ (yyval.n) = ast_float; ;}
break;
case 167:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1100 "glsl_parser.ypp"
{ (yyval.n) = ast_int; ;}
break;
case 168:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1101 "glsl_parser.ypp"
{ (yyval.n) = ast_uint; ;}
break;
case 169:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1102 "glsl_parser.ypp"
{ (yyval.n) = ast_bool; ;}
break;
case 170:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1103 "glsl_parser.ypp"
{ (yyval.n) = ast_vec2; ;}
break;
case 171:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1104 "glsl_parser.ypp"
{ (yyval.n) = ast_vec3; ;}
break;
case 172:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1105 "glsl_parser.ypp"
{ (yyval.n) = ast_vec4; ;}
break;
case 173:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1106 "glsl_parser.ypp"
{ (yyval.n) = ast_bvec2; ;}
break;
case 174:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1107 "glsl_parser.ypp"
{ (yyval.n) = ast_bvec3; ;}
break;
case 175:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1108 "glsl_parser.ypp"
{ (yyval.n) = ast_bvec4; ;}
break;
case 176:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1109 "glsl_parser.ypp"
{ (yyval.n) = ast_ivec2; ;}
break;
case 177:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1110 "glsl_parser.ypp"
{ (yyval.n) = ast_ivec3; ;}
break;
case 178:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1111 "glsl_parser.ypp"
{ (yyval.n) = ast_ivec4; ;}
break;
case 179:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1112 "glsl_parser.ypp"
{ (yyval.n) = ast_uvec2; ;}
break;
case 180:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1113 "glsl_parser.ypp"
{ (yyval.n) = ast_uvec3; ;}
break;
case 181:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1114 "glsl_parser.ypp"
{ (yyval.n) = ast_uvec4; ;}
break;
case 182:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1115 "glsl_parser.ypp"
{ (yyval.n) = ast_mat2; ;}
break;
case 183:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1116 "glsl_parser.ypp"
{ (yyval.n) = ast_mat2x3; ;}
break;
case 184:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1117 "glsl_parser.ypp"
{ (yyval.n) = ast_mat2x4; ;}
break;
case 185:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1118 "glsl_parser.ypp"
{ (yyval.n) = ast_mat3x2; ;}
break;
case 186:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1119 "glsl_parser.ypp"
{ (yyval.n) = ast_mat3; ;}
break;
case 187:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1120 "glsl_parser.ypp"
{ (yyval.n) = ast_mat3x4; ;}
break;
case 188:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1121 "glsl_parser.ypp"
{ (yyval.n) = ast_mat4x2; ;}
break;
case 189:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1122 "glsl_parser.ypp"
{ (yyval.n) = ast_mat4x3; ;}
break;
case 190:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1123 "glsl_parser.ypp"
{ (yyval.n) = ast_mat4; ;}
break;
case 191:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1124 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler1d; ;}
break;
case 192:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1125 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler2d; ;}
break;
case 193:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1126 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler2drect; ;}
break;
case 194:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1127 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler3d; ;}
break;
case 195:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1128 "glsl_parser.ypp"
{ (yyval.n) = ast_samplercube; ;}
break;
case 196:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1129 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler1dshadow; ;}
break;
case 197:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1130 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler2dshadow; ;}
break;
case 198:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1131 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler2drectshadow; ;}
break;
case 199:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1132 "glsl_parser.ypp"
{ (yyval.n) = ast_samplercubeshadow; ;}
break;
case 200:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1133 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler1darray; ;}
break;
case 201:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1134 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler2darray; ;}
break;
case 202:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1135 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler1darrayshadow; ;}
break;
case 203:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1136 "glsl_parser.ypp"
{ (yyval.n) = ast_sampler2darrayshadow; ;}
break;
case 204:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1137 "glsl_parser.ypp"
{ (yyval.n) = ast_isampler1d; ;}
break;
case 205:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1138 "glsl_parser.ypp"
{ (yyval.n) = ast_isampler2d; ;}
break;
case 206:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1139 "glsl_parser.ypp"
{ (yyval.n) = ast_isampler3d; ;}
break;
case 207:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1140 "glsl_parser.ypp"
{ (yyval.n) = ast_isamplercube; ;}
break;
case 208:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1141 "glsl_parser.ypp"
{ (yyval.n) = ast_isampler1darray; ;}
break;
case 209:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1142 "glsl_parser.ypp"
{ (yyval.n) = ast_isampler2darray; ;}
break;
case 210:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1143 "glsl_parser.ypp"
{ (yyval.n) = ast_usampler1d; ;}
break;
case 211:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1144 "glsl_parser.ypp"
{ (yyval.n) = ast_usampler2d; ;}
break;
case 212:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1145 "glsl_parser.ypp"
{ (yyval.n) = ast_usampler3d; ;}
break;
case 213:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1146 "glsl_parser.ypp"
{ (yyval.n) = ast_usamplercube; ;}
break;
case 214:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1147 "glsl_parser.ypp"
{ (yyval.n) = ast_usampler1darray; ;}
break;
case 215:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1148 "glsl_parser.ypp"
{ (yyval.n) = ast_usampler2darray; ;}
break;
case 216:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1152 "glsl_parser.ypp"
{
- if (state->language_version < 130)
- _mesa_glsl_error(& (yylsp[(1) - (1)]), state,
- "precision qualifier forbidden "
- "in GLSL %d.%d (1.30 or later "
- "required)\n",
- state->language_version / 100,
- state->language_version % 100);
+ if (!state->es_shader && state->language_version < 130)
+ _mesa_glsl_error(& (yylsp[(1) - (1)]), state,
+ "precision qualifier forbidden "
+ "in GLSL %d.%d (1.30 or later "
+ "required)\n",
+ state->language_version / 100,
+ state->language_version % 100);
- (yyval.n) = ast_precision_high;
- ;}
+ (yyval.n) = ast_precision_high;
+ ;}
break;
case 217:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1163 "glsl_parser.ypp"
{
- if (state->language_version < 130)
- _mesa_glsl_error(& (yylsp[(1) - (1)]), state,
- "precision qualifier forbidden "
- "in GLSL %d.%d (1.30 or later "
- "required)\n",
- state->language_version / 100,
- state->language_version % 100);
+ if (!state->es_shader && state->language_version < 130)
+ _mesa_glsl_error(& (yylsp[(1) - (1)]), state,
+ "precision qualifier forbidden "
+ "in GLSL %d.%d (1.30 or later "
+ "required)\n",
+ state->language_version / 100,
+ state->language_version % 100);
- (yyval.n) = ast_precision_medium;
- ;}
+ (yyval.n) = ast_precision_medium;
+ ;}
break;
case 218:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1174 "glsl_parser.ypp"
{
- if (state->language_version < 130)
- _mesa_glsl_error(& (yylsp[(1) - (1)]), state,
- "precision qualifier forbidden "
- "in GLSL %d.%d (1.30 or later "
- "required)\n",
- state->language_version / 100,
- state->language_version % 100);
+ if (!state->es_shader && state->language_version < 130)
+ _mesa_glsl_error(& (yylsp[(1) - (1)]), state,
+ "precision qualifier forbidden "
+ "in GLSL %d.%d (1.30 or later "
+ "required)\n",
+ state->language_version / 100,
+ state->language_version % 100);
- (yyval.n) = ast_precision_low;
- ;}
+ (yyval.n) = ast_precision_low;
+ ;}
break;
case 219:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1189 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4611,7 +4588,7 @@ yyreduce:
case 220:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1195 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4622,7 +4599,7 @@ yyreduce:
case 221:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1204 "glsl_parser.ypp"
{
(yyval.node) = (ast_node *) (yyvsp[(1) - (1)].declarator_list);
@@ -4632,7 +4609,7 @@ yyreduce:
case 222:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1209 "glsl_parser.ypp"
{
(yyval.node) = (ast_node *) (yyvsp[(1) - (2)].node);
@@ -4642,7 +4619,7 @@ yyreduce:
case 223:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1217 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4659,7 +4636,7 @@ yyreduce:
case 224:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1232 "glsl_parser.ypp"
{
(yyval.declaration) = (yyvsp[(1) - (1)].declaration);
@@ -4669,7 +4646,7 @@ yyreduce:
case 225:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1237 "glsl_parser.ypp"
{
(yyval.declaration) = (yyvsp[(1) - (3)].declaration);
@@ -4679,7 +4656,7 @@ yyreduce:
case 226:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1245 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4690,7 +4667,7 @@ yyreduce:
case 227:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1251 "glsl_parser.ypp"
{
void *ctx = state;
@@ -4699,31 +4676,31 @@ yyreduce:
;}
break;
- case 232:
+ case 230:
-/* Line 1455 of yacc.c */
-#line 1274 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1269 "glsl_parser.ypp"
{ (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;}
break;
- case 238:
+ case 235:
-/* Line 1455 of yacc.c */
-#line 1286 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1277 "glsl_parser.ypp"
{ (yyval.node) = NULL; ;}
break;
- case 239:
+ case 236:
-/* Line 1455 of yacc.c */
-#line 1287 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1278 "glsl_parser.ypp"
{ (yyval.node) = NULL; ;}
break;
- case 242:
+ case 239:
-/* Line 1455 of yacc.c */
-#line 1294 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1285 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL);
@@ -4731,10 +4708,10 @@ yyreduce:
;}
break;
- case 243:
+ case 240:
-/* Line 1455 of yacc.c */
-#line 1300 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1291 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[(2) - (3)].node));
@@ -4742,17 +4719,17 @@ yyreduce:
;}
break;
- case 244:
+ case 241:
-/* Line 1455 of yacc.c */
-#line 1308 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1299 "glsl_parser.ypp"
{ (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;}
break;
- case 246:
+ case 243:
-/* Line 1455 of yacc.c */
-#line 1314 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1305 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL);
@@ -4760,10 +4737,10 @@ yyreduce:
;}
break;
- case 247:
+ case 244:
-/* Line 1455 of yacc.c */
-#line 1320 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1311 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[(2) - (3)].node));
@@ -4771,10 +4748,10 @@ yyreduce:
;}
break;
- case 248:
+ case 245:
-/* Line 1455 of yacc.c */
-#line 1329 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1320 "glsl_parser.ypp"
{
if ((yyvsp[(1) - (1)].node) == NULL) {
_mesa_glsl_error(& (yylsp[(1) - (1)]), state, "<nil> statement\n");
@@ -4786,10 +4763,10 @@ yyreduce:
;}
break;
- case 249:
+ case 246:
-/* Line 1455 of yacc.c */
-#line 1339 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1330 "glsl_parser.ypp"
{
if ((yyvsp[(2) - (2)].node) == NULL) {
_mesa_glsl_error(& (yylsp[(2) - (2)]), state, "<nil> statement\n");
@@ -4800,10 +4777,10 @@ yyreduce:
;}
break;
- case 250:
+ case 247:
-/* Line 1455 of yacc.c */
-#line 1351 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1342 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_expression_statement(NULL);
@@ -4811,10 +4788,10 @@ yyreduce:
;}
break;
- case 251:
+ case 248:
-/* Line 1455 of yacc.c */
-#line 1357 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1348 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_expression_statement((yyvsp[(1) - (2)].expression));
@@ -4822,63 +4799,50 @@ yyreduce:
;}
break;
- case 252:
-
-/* Line 1455 of yacc.c */
-#line 1366 "glsl_parser.ypp"
- {
- void *ctx = state;
- (yyval.node) = new(ctx) ast_selection_statement((yyvsp[(3) - (7)].expression), (yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node));
- (yyval.node)->set_location(yylloc);
- ;}
- break;
-
- case 253:
+ case 249:
-/* Line 1455 of yacc.c */
-#line 1375 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1357 "glsl_parser.ypp"
{
- void *ctx = state;
- (yyval.node) = new(ctx) ast_selection_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].node), NULL);
+ (yyval.node) = new(state) ast_selection_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].selection_rest_statement).then_statement,
+ (yyvsp[(5) - (5)].selection_rest_statement).else_statement);
(yyval.node)->set_location(yylloc);
;}
break;
- case 254:
+ case 250:
-/* Line 1455 of yacc.c */
-#line 1381 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1366 "glsl_parser.ypp"
{
- void *ctx = state;
- (yyval.node) = new(ctx) ast_selection_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].node), NULL);
- (yyval.node)->set_location(yylloc);
+ (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (3)].node);
+ (yyval.selection_rest_statement).else_statement = (yyvsp[(3) - (3)].node);
;}
break;
- case 255:
+ case 251:
-/* Line 1455 of yacc.c */
-#line 1387 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1371 "glsl_parser.ypp"
{
- void *ctx = state;
- (yyval.node) = new(ctx) ast_selection_statement((yyvsp[(3) - (7)].expression), (yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node));
- (yyval.node)->set_location(yylloc);
+ (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (1)].node);
+ (yyval.selection_rest_statement).else_statement = NULL;
;}
break;
- case 256:
+ case 252:
-/* Line 1455 of yacc.c */
-#line 1396 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1379 "glsl_parser.ypp"
{
(yyval.node) = (ast_node *) (yyvsp[(1) - (1)].expression);
;}
break;
- case 257:
+ case 253:
-/* Line 1455 of yacc.c */
-#line 1400 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1383 "glsl_parser.ypp"
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (4)].identifier), false, NULL, (yyvsp[(4) - (4)].expression));
@@ -4891,10 +4855,10 @@ yyreduce:
;}
break;
- case 261:
+ case 257:
-/* Line 1455 of yacc.c */
-#line 1423 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1406 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while,
@@ -4903,10 +4867,10 @@ yyreduce:
;}
break;
- case 262:
+ case 258:
-/* Line 1455 of yacc.c */
-#line 1430 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1413 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while,
@@ -4915,10 +4879,10 @@ yyreduce:
;}
break;
- case 263:
+ case 259:
-/* Line 1455 of yacc.c */
-#line 1437 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1420 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for,
@@ -4927,39 +4891,39 @@ yyreduce:
;}
break;
- case 267:
+ case 263:
-/* Line 1455 of yacc.c */
-#line 1453 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1436 "glsl_parser.ypp"
{
(yyval.node) = NULL;
;}
break;
- case 268:
+ case 264:
-/* Line 1455 of yacc.c */
-#line 1460 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1443 "glsl_parser.ypp"
{
(yyval.for_rest_statement).cond = (yyvsp[(1) - (2)].node);
(yyval.for_rest_statement).rest = NULL;
;}
break;
- case 269:
+ case 265:
-/* Line 1455 of yacc.c */
-#line 1465 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1448 "glsl_parser.ypp"
{
(yyval.for_rest_statement).cond = (yyvsp[(1) - (3)].node);
(yyval.for_rest_statement).rest = (yyvsp[(3) - (3)].expression);
;}
break;
- case 270:
+ case 266:
-/* Line 1455 of yacc.c */
-#line 1474 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1457 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL);
@@ -4967,10 +4931,10 @@ yyreduce:
;}
break;
- case 271:
+ case 267:
-/* Line 1455 of yacc.c */
-#line 1480 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1463 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL);
@@ -4978,10 +4942,10 @@ yyreduce:
;}
break;
- case 272:
+ case 268:
-/* Line 1455 of yacc.c */
-#line 1486 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1469 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL);
@@ -4989,10 +4953,10 @@ yyreduce:
;}
break;
- case 273:
+ case 269:
-/* Line 1455 of yacc.c */
-#line 1492 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1475 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[(2) - (3)].expression));
@@ -5000,10 +4964,10 @@ yyreduce:
;}
break;
- case 274:
+ case 270:
-/* Line 1455 of yacc.c */
-#line 1498 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1481 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL);
@@ -5011,31 +4975,31 @@ yyreduce:
;}
break;
- case 275:
+ case 271:
-/* Line 1455 of yacc.c */
-#line 1506 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1489 "glsl_parser.ypp"
{ (yyval.node) = (yyvsp[(1) - (1)].function_definition); ;}
break;
- case 276:
+ case 272:
-/* Line 1455 of yacc.c */
-#line 1507 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1490 "glsl_parser.ypp"
{ (yyval.node) = (yyvsp[(1) - (1)].node); ;}
break;
- case 277:
+ case 273:
-/* Line 1455 of yacc.c */
-#line 1508 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1491 "glsl_parser.ypp"
{ (yyval.node) = NULL; ;}
break;
- case 278:
+ case 274:
-/* Line 1455 of yacc.c */
-#line 1513 "glsl_parser.ypp"
+/* Line 1464 of yacc.c */
+#line 1496 "glsl_parser.ypp"
{
void *ctx = state;
(yyval.function_definition) = new(ctx) ast_function_definition();
@@ -5047,8 +5011,8 @@ yyreduce:
-/* Line 1455 of yacc.c */
-#line 5052 "glsl_parser.cpp"
+/* Line 1464 of yacc.c */
+#line 5016 "glsl_parser.cpp"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -5120,7 +5084,7 @@ yyerrlab:
#endif
}
- yyerror_range[0] = yylloc;
+ yyerror_range[1] = yylloc;
if (yyerrstatus == 3)
{
@@ -5157,7 +5121,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- yyerror_range[0] = yylsp[1-yylen];
+ yyerror_range[1] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
@@ -5191,7 +5155,7 @@ yyerrlab1:
if (yyssp == yyss)
YYABORT;
- yyerror_range[0] = *yylsp;
+ yyerror_range[1] = *yylsp;
yydestruct ("Error: popping",
yystos[yystate], yyvsp, yylsp, state);
YYPOPSTACK (1);
@@ -5201,10 +5165,10 @@ yyerrlab1:
*++yyvsp = yylval;
- yyerror_range[1] = yylloc;
+ yyerror_range[2] = yylloc;
/* Using YYLLOC is tempting, but would change the location of
the lookahead. YYLOC is available though. */
- YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+ YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
*++yylsp = yyloc;
/* Shift the error token. */
diff --git a/src/glsl/glsl_parser.h b/src/glsl/glsl_parser.h
index 3ed90853ad..4a780375bf 100644
--- a/src/glsl/glsl_parser.h
+++ b/src/glsl/glsl_parser.h
@@ -1,10 +1,9 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -236,7 +235,7 @@
typedef union YYSTYPE
{
-/* Line 1676 of yacc.c */
+/* Line 1685 of yacc.c */
#line 52 "glsl_parser.ypp"
int n;
@@ -265,10 +264,15 @@ typedef union YYSTYPE
ast_expression *rest;
} for_rest_statement;
+ struct {
+ ast_node *then_statement;
+ ast_node *else_statement;
+ } selection_rest_statement;
+
-/* Line 1676 of yacc.c */
-#line 272 "glsl_parser.h"
+/* Line 1685 of yacc.c */
+#line 276 "glsl_parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/src/glsl/glsl_parser.ypp b/src/glsl/glsl_parser.ypp
index 6d99c52503..0df1e480ce 100644
--- a/src/glsl/glsl_parser.ypp
+++ b/src/glsl/glsl_parser.ypp
@@ -75,6 +75,11 @@
ast_node *cond;
ast_expression *rest;
} for_rest_statement;
+
+ struct {
+ ast_node *then_statement;
+ ast_node *else_statement;
+ } selection_rest_statement;
}
%token ATTRIBUTE CONST_TOK BOOL_TOK FLOAT_TOK INT_TOK UINT_TOK
@@ -130,8 +135,6 @@
%type <node> statement
%type <node> statement_list
%type <node> simple_statement
-%type <node> statement_matched
-%type <node> statement_unmatched
%type <n> precision_qualifier
%type <type_qualifier> type_qualifier
%type <type_qualifier> storage_qualifier
@@ -197,8 +200,8 @@
%type <declarator_list> struct_declaration
%type <declaration> struct_declarator
%type <declaration> struct_declarator_list
-%type <node> selection_statement_matched
-%type <node> selection_statement_unmatched
+%type <node> selection_statement
+%type <selection_rest_statement> selection_rest_statement
%type <node> iteration_statement
%type <node> condition
%type <node> conditionopt
@@ -215,20 +218,17 @@ translation_unit:
;
version_statement:
- /* blank - no #version specified */
- {
- state->language_version = 110;
- state->symbols->language_version = 110;
- }
+ /* blank - no #version specified: defaults are already set */
| VERSION INTCONSTANT EOL
{
switch ($2) {
+ case 100:
+ state->es_shader = true;
case 110:
case 120:
case 130:
/* FINISHME: Check against implementation support versions. */
state->language_version = $2;
- state->symbols->language_version = $2;
break;
default:
_mesa_glsl_error(& @2, state, "Shading language version"
@@ -1149,39 +1149,39 @@ basic_type_specifier_nonarray:
;
precision_qualifier:
- HIGHP {
- if (state->language_version < 130)
- _mesa_glsl_error(& @1, state,
- "precision qualifier forbidden "
- "in GLSL %d.%d (1.30 or later "
- "required)\n",
- state->language_version / 100,
- state->language_version % 100);
-
- $$ = ast_precision_high;
- }
- | MEDIUMP {
- if (state->language_version < 130)
- _mesa_glsl_error(& @1, state,
- "precision qualifier forbidden "
- "in GLSL %d.%d (1.30 or later "
- "required)\n",
- state->language_version / 100,
- state->language_version % 100);
-
- $$ = ast_precision_medium;
- }
- | LOWP {
- if (state->language_version < 130)
- _mesa_glsl_error(& @1, state,
- "precision qualifier forbidden "
- "in GLSL %d.%d (1.30 or later "
- "required)\n",
- state->language_version / 100,
- state->language_version % 100);
-
- $$ = ast_precision_low;
- }
+ HIGHP {
+ if (!state->es_shader && state->language_version < 130)
+ _mesa_glsl_error(& @1, state,
+ "precision qualifier forbidden "
+ "in GLSL %d.%d (1.30 or later "
+ "required)\n",
+ state->language_version / 100,
+ state->language_version % 100);
+
+ $$ = ast_precision_high;
+ }
+ | MEDIUMP {
+ if (!state->es_shader && state->language_version < 130)
+ _mesa_glsl_error(& @1, state,
+ "precision qualifier forbidden "
+ "in GLSL %d.%d (1.30 or later "
+ "required)\n",
+ state->language_version / 100,
+ state->language_version % 100);
+
+ $$ = ast_precision_medium;
+ }
+ | LOWP {
+ if (!state->es_shader && state->language_version < 130)
+ _mesa_glsl_error(& @1, state,
+ "precision qualifier forbidden "
+ "in GLSL %d.%d (1.30 or later "
+ "required)\n",
+ state->language_version / 100,
+ state->language_version % 100);
+
+ $$ = ast_precision_low;
+ }
;
struct_specifier:
@@ -1266,23 +1266,14 @@ declaration_statement:
// Grammar Note: labeled statements for SWITCH only; 'goto' is not
// supported.
statement:
- statement_matched
- | statement_unmatched
- ;
-
-statement_matched:
compound_statement { $$ = (ast_node *) $1; }
| simple_statement
;
-statement_unmatched:
- selection_statement_unmatched
- ;
-
simple_statement:
declaration_statement
| expression_statement
- | selection_statement_matched
+ | selection_statement
| switch_statement { $$ = NULL; }
| case_label { $$ = NULL; }
| iteration_statement
@@ -1361,33 +1352,25 @@ expression_statement:
}
;
-selection_statement_matched:
- IF '(' expression ')' statement_matched ELSE statement_matched
+selection_statement:
+ IF '(' expression ')' selection_rest_statement
{
- void *ctx = state;
- $$ = new(ctx) ast_selection_statement($3, $5, $7);
+ $$ = new(state) ast_selection_statement($3, $5.then_statement,
+ $5.else_statement);
$$->set_location(yylloc);
}
;
-selection_statement_unmatched:
- IF '(' expression ')' statement_matched
+selection_rest_statement:
+ statement ELSE statement
{
- void *ctx = state;
- $$ = new(ctx) ast_selection_statement($3, $5, NULL);
- $$->set_location(yylloc);
- }
- | IF '(' expression ')' statement_unmatched
- {
- void *ctx = state;
- $$ = new(ctx) ast_selection_statement($3, $5, NULL);
- $$->set_location(yylloc);
+ $$.then_statement = $1;
+ $$.else_statement = $3;
}
- | IF '(' expression ')' statement_matched ELSE statement_unmatched
+ | statement
{
- void *ctx = state;
- $$ = new(ctx) ast_selection_statement($3, $5, $7);
- $$->set_location(yylloc);
+ $$.then_statement = $1;
+ $$.else_statement = NULL;
}
;
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index bc56e4fcaf..4ac062b42c 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -34,6 +34,7 @@ extern "C" {
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
#include "ir_optimization.h"
+#include "loop_analysis.h"
_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct __GLcontextRec *ctx,
GLenum target, void *mem_ctx)
@@ -50,58 +51,34 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct __GLcontextRec *ctx,
this->info_log = talloc_strdup(mem_ctx, "");
this->error = false;
this->loop_or_switch_nesting = NULL;
- this->ARB_texture_rectangle_enable = true;
-
- if (ctx != NULL) {
- this->extensions = &ctx->Extensions;
-
- this->Const.MaxLights = ctx->Const.MaxLights;
- this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
- this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
- this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
- this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
- this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
- this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4;
- this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits;
- this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
- this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
- this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
-
- this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
- } else {
- /* If there is no GL context (standalone compiler), fill in constants
- * with the minimum required values.
- */
- static struct gl_extensions null_extensions;
-
- memset(&null_extensions, 0, sizeof(null_extensions));
- null_extensions.ARB_draw_buffers = GL_TRUE;
- null_extensions.ARB_fragment_coord_conventions = GL_TRUE;
- null_extensions.EXT_texture_array = GL_TRUE;
- null_extensions.NV_texture_rectangle = GL_TRUE;
- this->extensions = &null_extensions;
+ /* Set default language version and extensions */
+ this->language_version = 110;
+ this->es_shader = false;
+ this->ARB_texture_rectangle_enable = true;
- /* 1.10 minimums. */
- this->Const.MaxLights = 8;
- this->Const.MaxClipPlanes = 8;
- this->Const.MaxTextureUnits = 2;
+ /* OpenGL ES 2.0 has different defaults from desktop GL. */
+ if (ctx->API == API_OPENGLES2) {
+ this->language_version = 100;
+ this->es_shader = true;
+ this->ARB_texture_rectangle_enable = false;
+ }
- /* More than the 1.10 minimum to appease parser tests taken from
- * apps that (hopefully) already checked the number of coords.
- */
- this->Const.MaxTextureCoords = 4;
+ this->extensions = &ctx->Extensions;
- this->Const.MaxVertexAttribs = 16;
- this->Const.MaxVertexUniformComponents = 512;
- this->Const.MaxVaryingFloats = 32;
- this->Const.MaxVertexTextureImageUnits = 0;
- this->Const.MaxCombinedTextureImageUnits = 2;
- this->Const.MaxTextureImageUnits = 2;
- this->Const.MaxFragmentUniformComponents = 64;
+ this->Const.MaxLights = ctx->Const.MaxLights;
+ this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes;
+ this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits;
+ this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits;
+ this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
+ this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
+ this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4;
+ this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits;
+ this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
+ this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
+ this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
- this->Const.MaxDrawBuffers = 2;
- }
+ this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers;
}
const char *
@@ -708,7 +685,7 @@ ast_struct_specifier::ast_struct_specifier(char *identifier,
}
bool
-do_common_optimization(exec_list *ir, bool linked)
+do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations)
{
GLboolean progress = GL_FALSE;
@@ -734,11 +711,18 @@ do_common_optimization(exec_list *ir, bool linked)
progress = do_constant_variable_unlinked(ir) || progress;
progress = do_constant_folding(ir) || progress;
progress = do_algebraic(ir) || progress;
- progress = do_if_return(ir) || progress;
+ progress = do_lower_jumps(ir) || progress;
progress = do_vec_index_to_swizzle(ir) || progress;
progress = do_swizzle_swizzle(ir) || progress;
progress = do_noop_swizzle(ir) || progress;
+ progress = optimize_redundant_jumps(ir) || progress;
+
+ loop_state *ls = analyze_loop_variables(ir);
+ progress = set_loop_controls(ir, ls) || progress;
+ progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
+ delete ls;
+
return progress;
}
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 3ccdab4ef2..ddc2138b76 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -68,6 +68,7 @@ struct _mesa_glsl_parse_state {
exec_list translation_unit;
glsl_symbol_table *symbols;
+ bool es_shader;
unsigned language_version;
enum _mesa_glsl_parser_targets target;
@@ -222,7 +223,7 @@ extern "C" {
#endif
extern int preprocess(void *ctx, const char **shader, char **info_log,
- const struct gl_extensions *extensions);
+ const struct gl_extensions *extensions, int api);
extern void _mesa_destroy_shader_compiler();
extern void _mesa_destroy_shader_compiler_caches();
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 92ad3efafc..82eb470605 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -111,9 +111,8 @@ add_types_to_symbol_table(glsl_symbol_table *symtab,
}
}
-
void
-glsl_type::generate_110_types(glsl_symbol_table *symtab)
+glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
{
add_types_to_symbol_table(symtab, builtin_core_types,
Elements(builtin_core_types),
@@ -121,10 +120,20 @@ glsl_type::generate_110_types(glsl_symbol_table *symtab)
add_types_to_symbol_table(symtab, builtin_structure_types,
Elements(builtin_structure_types),
false);
+ add_types_to_symbol_table(symtab, &void_type, 1, false);
+}
+
+void
+glsl_type::generate_110_types(glsl_symbol_table *symtab)
+{
+ generate_100ES_types(symtab);
+
+ add_types_to_symbol_table(symtab, builtin_110_types,
+ Elements(builtin_110_types),
+ false);
add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
Elements(builtin_110_deprecated_structure_types),
false);
- add_types_to_symbol_table(symtab, & void_type, 1, false);
}
@@ -173,6 +182,10 @@ void
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
{
switch (state->language_version) {
+ case 100:
+ assert(state->es_shader);
+ glsl_type::generate_100ES_types(state->symbols);
+ break;
case 110:
glsl_type::generate_110_types(state->symbols);
break;
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index b4e83c9833..4f7d2f74af 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -430,6 +430,7 @@ private:
static const glsl_type builtin_core_types[];
static const glsl_type builtin_structure_types[];
static const glsl_type builtin_110_deprecated_structure_types[];
+ static const glsl_type builtin_110_types[];
static const glsl_type builtin_120_types[];
static const glsl_type builtin_130_types[];
static const glsl_type builtin_ARB_texture_rectangle_types[];
@@ -446,13 +447,12 @@ private:
* the world in a public header file.
*/
/*@{*/
+ static void generate_100ES_types(glsl_symbol_table *);
static void generate_110_types(glsl_symbol_table *);
static void generate_120_types(glsl_symbol_table *);
static void generate_130_types(glsl_symbol_table *);
- static void generate_ARB_texture_rectangle_types(glsl_symbol_table *,
- bool);
- static void generate_EXT_texture_array_types(glsl_symbol_table *,
- bool);
+ static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool);
+ static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);
/*@}*/
/**
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 68ad512bf5..86dc490154 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -196,6 +196,8 @@ ir_expression::get_num_operands(ir_expression_operation op)
1, /* ir_unop_dFdx */
1, /* ir_unop_dFdy */
+ 1, /* ir_unop_noise */
+
2, /* ir_binop_add */
2, /* ir_binop_sub */
2, /* ir_binop_mul */
@@ -208,6 +210,8 @@ ir_expression::get_num_operands(ir_expression_operation op)
2, /* ir_binop_gequal */
2, /* ir_binop_equal */
2, /* ir_binop_nequal */
+ 2, /* ir_binop_all_equal */
+ 2, /* ir_binop_any_nequal */
2, /* ir_binop_lshift */
2, /* ir_binop_rshift */
@@ -261,6 +265,7 @@ static const char *const operator_strs[] = {
"cos",
"dFdx",
"dFdy",
+ "noise",
"+",
"-",
"*",
@@ -272,6 +277,8 @@ static const char *const operator_strs[] = {
">=",
"==",
"!=",
+ "all_equal",
+ "any_nequal",
"<<",
">>",
"&",
@@ -287,11 +294,16 @@ static const char *const operator_strs[] = {
"pow",
};
+const char *ir_expression::operator_string(ir_expression_operation op)
+{
+ assert((unsigned int) op < Elements(operator_strs));
+ assert(Elements(operator_strs) == (ir_binop_pow + 1));
+ return operator_strs[op];
+}
+
const char *ir_expression::operator_string()
{
- assert((unsigned int) operation <=
- sizeof(operator_strs) / sizeof(operator_strs[0]));
- return operator_strs[operation];
+ return operator_string(this->operation);
}
ir_expression_operation
@@ -701,6 +713,18 @@ ir_constant::has_value(const ir_constant *c) const
return true;
}
+
+ir_loop::ir_loop()
+{
+ this->ir_type = ir_type_loop;
+ this->cmp = ir_unop_neg;
+ this->from = NULL;
+ this->to = NULL;
+ this->increment = NULL;
+ this->counter = NULL;
+}
+
+
ir_dereference_variable::ir_dereference_variable(ir_variable *var)
{
this->ir_type = ir_type_dereference_variable;
@@ -1057,6 +1081,7 @@ ir_function_signature::ir_function_signature(const glsl_type *return_type)
: return_type(return_type), is_defined(false), _function(NULL)
{
this->ir_type = ir_type_function_signature;
+ this->is_builtin = false;
}
@@ -1108,7 +1133,18 @@ ir_function::ir_function(const char *name)
{
this->ir_type = ir_type_function;
this->name = talloc_strdup(this, name);
- this->is_builtin = false;
+}
+
+
+bool
+ir_function::has_builtin_signature()
+{
+ foreach_list(n, &this->signatures) {
+ ir_function_signature *const sig = (ir_function_signature *) n;
+ if (sig->is_builtin)
+ return true;
+ }
+ return false;
}
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 0f887a9327..70c6faaf15 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -342,6 +342,9 @@ public:
/** Whether or not this function has a body (which may be empty). */
unsigned is_defined:1;
+ /** Whether or not this function signature is a built-in. */
+ unsigned is_builtin:1;
+
/** Body of instructions in the function. */
struct exec_list body;
@@ -407,8 +410,8 @@ public:
*/
const char *name;
- /** Whether or not this function is a built-in. */
- unsigned is_builtin:1;
+ /** Whether or not this function has a signature that is a built-in. */
+ bool has_builtin_signature();
/**
* List of ir_function_signature for each overloaded function with this name.
@@ -461,10 +464,7 @@ public:
*/
class ir_loop : public ir_instruction {
public:
- ir_loop() : from(NULL), to(NULL), increment(NULL), counter(NULL)
- {
- ir_type = ir_type_loop;
- }
+ ir_loop();
virtual ir_loop *clone(void *mem_ctx, struct hash_table *ht) const;
@@ -493,12 +493,30 @@ public:
/**
* \name Loop counter and controls
+ *
+ * Represents a loop like a FORTRAN \c do-loop.
+ *
+ * \note
+ * If \c from and \c to are the same value, the loop will execute once.
*/
/*@{*/
- ir_rvalue *from;
- ir_rvalue *to;
+ ir_rvalue *from; /** Value of the loop counter on the first
+ * iteration of the loop.
+ */
+ ir_rvalue *to; /** Value of the loop counter on the last
+ * iteration of the loop.
+ */
ir_rvalue *increment;
ir_variable *counter;
+
+ /**
+ * Comparison operation in the loop terminator.
+ *
+ * If any of the loop control fields are non-\c NULL, this field must be
+ * one of \c ir_binop_less, \c ir_binop_greater, \c ir_binop_lequal,
+ * \c ir_binop_gequal, \c ir_binop_equal, or \c ir_binop_nequal.
+ */
+ int cmp;
/*@}*/
};
@@ -632,6 +650,8 @@ enum ir_expression_operation {
ir_unop_dFdy,
/*@}*/
+ ir_unop_noise,
+
ir_binop_add,
ir_binop_sub,
ir_binop_mul,
@@ -655,16 +675,18 @@ enum ir_expression_operation {
ir_binop_greater,
ir_binop_lequal,
ir_binop_gequal,
+ ir_binop_equal,
+ ir_binop_nequal,
/**
* Returns single boolean for whether all components of operands[0]
* equal the components of operands[1].
*/
- ir_binop_equal,
+ ir_binop_all_equal,
/**
* Returns single boolean for whether any component of operands[0]
* is not equal to the corresponding component of operands[1].
*/
- ir_binop_nequal,
+ ir_binop_any_nequal,
/*@}*/
/**
@@ -716,6 +738,12 @@ public:
const char *operator_string();
/**
+ * Return a string representing this expression's operator.
+ */
+ static const char *operator_string(ir_expression_operation);
+
+
+ /**
* Do a reverse-lookup to translate the given string into an operator.
*/
static ir_expression_operation get_operator(const char *);
diff --git a/src/glsl/ir_algebraic.cpp b/src/glsl/ir_algebraic.cpp
index ff81563f19..2ed66db476 100644
--- a/src/glsl/ir_algebraic.cpp
+++ b/src/glsl/ir_algebraic.cpp
@@ -270,6 +270,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
case ir_binop_gequal: new_op = ir_binop_less; break;
case ir_binop_equal: new_op = ir_binop_nequal; break;
case ir_binop_nequal: new_op = ir_binop_equal; break;
+ case ir_binop_all_equal: new_op = ir_binop_any_nequal; break;
+ case ir_binop_any_nequal: new_op = ir_binop_all_equal; break;
default:
/* The default case handler is here to silence a warning from GCC.
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index 1d690a4da7..aa84cf0572 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -134,6 +134,7 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const
new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht));
}
+ new_loop->cmp = this->cmp;
return new_loop;
}
@@ -249,8 +250,6 @@ ir_function::clone(void *mem_ctx, struct hash_table *ht) const
{
ir_function *copy = new(mem_ctx) ir_function(this->name);
- copy->is_builtin = this->is_builtin;
-
foreach_list_const(node, &this->signatures) {
const ir_function_signature *const sig =
(const ir_function_signature *const) node;
@@ -273,6 +272,7 @@ ir_function_signature::clone(void *mem_ctx, struct hash_table *ht) const
new(mem_ctx) ir_function_signature(this->return_type);
copy->is_defined = this->is_defined;
+ copy->is_builtin = this->is_builtin;
/* Clone the parameter list.
*/
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 458dca7977..ec0e26de18 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -89,9 +89,9 @@ ir_expression::constant_expression_value()
if (op[0]->type->is_array()) {
assert(op[1] != NULL && op[1]->type->is_array());
switch (this->operation) {
- case ir_binop_equal:
+ case ir_binop_all_equal:
return new(ctx) ir_constant(op[0]->has_value(op[1]));
- case ir_binop_nequal:
+ case ir_binop_any_nequal:
return new(ctx) ir_constant(!op[0]->has_value(op[1]));
default:
break;
@@ -622,11 +622,41 @@ ir_expression::constant_expression_value()
assert(0);
}
break;
-
case ir_binop_equal:
- data.b[0] = op[0]->has_value(op[1]);
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[0] = op[0]->value.u[0] == op[1]->value.u[0];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[0] = op[0]->value.i[0] == op[1]->value.i[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[0] = op[0]->value.f[0] == op[1]->value.f[0];
+ break;
+ default:
+ assert(0);
+ }
break;
case ir_binop_nequal:
+ switch (op[0]->type->base_type) {
+ case GLSL_TYPE_UINT:
+ data.b[0] = op[0]->value.u[0] != op[1]->value.u[0];
+ break;
+ case GLSL_TYPE_INT:
+ data.b[0] = op[0]->value.i[0] != op[1]->value.i[0];
+ break;
+ case GLSL_TYPE_FLOAT:
+ data.b[0] = op[0]->value.f[0] != op[1]->value.f[0];
+ break;
+ default:
+ assert(0);
+ }
+ break;
+
+ case ir_binop_all_equal:
+ data.b[0] = op[0]->has_value(op[1]);
+ break;
+ case ir_binop_any_nequal:
data.b[0] = !op[0]->has_value(op[1]);
break;
@@ -785,7 +815,7 @@ ir_call::constant_expression_value()
* "Function calls to user-defined functions (non-built-in functions)
* cannot be used to form constant expressions."
*/
- if (!this->callee->function()->is_builtin)
+ if (!this->callee->is_builtin)
return NULL;
unsigned num_parameters = 0;
diff --git a/src/glsl/ir_constant_propagation.cpp b/src/glsl/ir_constant_propagation.cpp
index 76c1ce7013..f7a0599f42 100644
--- a/src/glsl/ir_constant_propagation.cpp
+++ b/src/glsl/ir_constant_propagation.cpp
@@ -90,7 +90,7 @@ public:
virtual ir_visitor_status visit_enter(class ir_loop *);
virtual ir_visitor_status visit_enter(class ir_function_signature *);
virtual ir_visitor_status visit_enter(class ir_function *);
- virtual ir_visitor_status visit_enter(class ir_assignment *);
+ virtual ir_visitor_status visit_leave(class ir_assignment *);
virtual ir_visitor_status visit_enter(class ir_call *);
virtual ir_visitor_status visit_enter(class ir_if *);
@@ -119,7 +119,7 @@ public:
void
ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue)
{
- if (!*rvalue)
+ if (this->in_assignee || !*rvalue)
return;
const glsl_type *type = (*rvalue)->type;
@@ -216,22 +216,16 @@ ir_constant_propagation_visitor::visit_enter(ir_function_signature *ir)
}
ir_visitor_status
-ir_constant_propagation_visitor::visit_enter(ir_assignment *ir)
+ir_constant_propagation_visitor::visit_leave(ir_assignment *ir)
{
- /* Inline accepting children, skipping the LHS. */
- ir->rhs->accept(this);
- handle_rvalue(&ir->rhs);
-
- if (ir->condition) {
- ir->condition->accept(this);
- handle_rvalue(&ir->condition);
- }
+ if (this->in_assignee)
+ return visit_continue;
kill(ir->lhs->variable_referenced(), ir->write_mask);
add_constant(ir);
- return visit_continue_with_parent;
+ return visit_continue;
}
ir_visitor_status
diff --git a/src/glsl/ir_copy_propagation.cpp b/src/glsl/ir_copy_propagation.cpp
index 6c211f0e70..0fe8fa6c41 100644
--- a/src/glsl/ir_copy_propagation.cpp
+++ b/src/glsl/ir_copy_propagation.cpp
@@ -84,7 +84,7 @@ public:
virtual ir_visitor_status visit_enter(class ir_loop *);
virtual ir_visitor_status visit_enter(class ir_function_signature *);
virtual ir_visitor_status visit_enter(class ir_function *);
- virtual ir_visitor_status visit_enter(class ir_assignment *);
+ virtual ir_visitor_status visit_leave(class ir_assignment *);
virtual ir_visitor_status visit_enter(class ir_call *);
virtual ir_visitor_status visit_enter(class ir_if *);
@@ -132,30 +132,13 @@ ir_copy_propagation_visitor::visit_enter(ir_function_signature *ir)
}
ir_visitor_status
-ir_copy_propagation_visitor::visit_enter(ir_assignment *ir)
+ir_copy_propagation_visitor::visit_leave(ir_assignment *ir)
{
- ir_visitor_status s;
-
- /* ir_assignment::accept(ir_hv *v), skipping the LHS so that we can
- * avoid copy propagating into the LHS.
- *
- * Note that this means we won't copy propagate into the derefs of
- * an array index. Oh well.
- */
-
- s = ir->rhs->accept(this);
- assert(s == visit_continue);
-
- if (ir->condition) {
- s = ir->condition->accept(this);
- assert(s == visit_continue);
- }
-
kill(ir->lhs->variable_referenced());
add_copy(ir);
- return visit_continue_with_parent;
+ return visit_continue;
}
ir_visitor_status
@@ -175,6 +158,9 @@ ir_copy_propagation_visitor::visit_enter(ir_function *ir)
ir_visitor_status
ir_copy_propagation_visitor::visit(ir_dereference_variable *ir)
{
+ if (this->in_assignee)
+ return visit_continue;
+
ir_variable *var = ir->var;
foreach_iter(exec_list_iterator, iter, *this->acp) {
diff --git a/src/glsl/ir_hierarchical_visitor.cpp b/src/glsl/ir_hierarchical_visitor.cpp
index 809b08ee62..b5eacd6d2d 100644
--- a/src/glsl/ir_hierarchical_visitor.cpp
+++ b/src/glsl/ir_hierarchical_visitor.cpp
@@ -29,6 +29,7 @@ ir_hierarchical_visitor::ir_hierarchical_visitor()
this->base_ir = NULL;
this->callback = NULL;
this->data = NULL;
+ this->in_assignee = false;
}
ir_visitor_status
diff --git a/src/glsl/ir_hierarchical_visitor.h b/src/glsl/ir_hierarchical_visitor.h
index afa780dc91..dc177f5eb0 100644
--- a/src/glsl/ir_hierarchical_visitor.h
+++ b/src/glsl/ir_hierarchical_visitor.h
@@ -165,6 +165,13 @@ public:
* Extra data parameter passed to the per-node callback function
*/
void *data;
+
+ /**
+ * Currently in the LHS of an assignment?
+ *
+ * This is set and cleared by the \c ir_assignment::accept method.
+ */
+ bool in_assignee;
};
void visit_tree(ir_instruction *ir,
diff --git a/src/glsl/ir_hv_accept.cpp b/src/glsl/ir_hv_accept.cpp
index 6dae4ed2f3..be8b36a7cf 100644
--- a/src/glsl/ir_hv_accept.cpp
+++ b/src/glsl/ir_hv_accept.cpp
@@ -242,7 +242,14 @@ ir_dereference_array::accept(ir_hierarchical_visitor *v)
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
+ /* The array index is not the target of the assignment, so clear the
+ * 'in_assignee' flag. Restore it after returning from the array index.
+ */
+ const bool was_in_assignee = v->in_assignee;
+ v->in_assignee = false;
s = this->array_index->accept(v);
+ v->in_assignee = was_in_assignee;
+
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
@@ -270,7 +277,9 @@ ir_assignment::accept(ir_hierarchical_visitor *v)
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
+ v->in_assignee = true;
s = this->lhs->accept(v);
+ v->in_assignee = false;
if (s != visit_continue)
return (s == visit_continue_with_parent) ? visit_continue : s;
diff --git a/src/glsl/ir_if_return.cpp b/src/glsl/ir_if_return.cpp
deleted file mode 100644
index 5ab8759958..0000000000
--- a/src/glsl/ir_if_return.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright © 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/**
- * \file ir_if_return.cpp
- *
- * This pass tries to normalize functions to always return from one
- * place by moving around blocks of code in if statements.
- *
- * This helps on hardware with no branching support, and may even be a
- * useful transform on hardware supporting control flow by turning
- * masked returns into normal returns.
- */
-
-#include <string.h>
-#include "glsl_types.h"
-#include "ir.h"
-
-class ir_if_return_visitor : public ir_hierarchical_visitor {
-public:
- ir_if_return_visitor()
- {
- this->progress = false;
- }
-
- ir_visitor_status visit_enter(ir_function_signature *);
- ir_visitor_status visit_leave(ir_if *);
-
- ir_visitor_status move_outer_block_inside(ir_instruction *ir,
- exec_list *inner_block);
- void move_returns_after_block(ir_instruction *ir,
- ir_return *then_return,
- ir_return *else_return);
- bool progress;
-};
-
-bool
-do_if_return(exec_list *instructions)
-{
- ir_if_return_visitor v;
-
- do {
- v.progress = false;
- visit_list_elements(&v, instructions);
- } while (v.progress);
-
- return v.progress;
-}
-
-/**
- * Removes any instructions after a (unconditional) return, since they will
- * never be executed.
- */
-static void
-truncate_after_instruction(ir_instruction *ir)
-{
- if (!ir)
- return;
-
- while (!ir->get_next()->is_tail_sentinel())
- ((ir_instruction *)ir->get_next())->remove();
-}
-
-/**
- * Returns an ir_instruction of the first ir_return in the exec_list, or NULL.
- */
-static ir_return *
-find_return_in_block(exec_list *instructions)
-{
- foreach_iter(exec_list_iterator, iter, *instructions) {
- ir_instruction *ir = (ir_instruction *)iter.get();
- if (ir->ir_type == ir_type_return)
- return (ir_return *)ir;
- }
-
- return NULL;
-}
-
-void
-ir_if_return_visitor::move_returns_after_block(ir_instruction *ir,
- ir_return *then_return,
- ir_return *else_return)
-{
-
- if (!then_return->value) {
- then_return->remove();
- else_return->remove();
- ir->insert_after(new(ir) ir_return(NULL));
- } else {
- ir_assignment *assign;
- ir_variable *new_var = new(ir) ir_variable(then_return->value->type,
- "if_return_tmp",
- ir_var_temporary);
- ir->insert_before(new_var);
-
- assign = new(ir) ir_assignment(new(ir) ir_dereference_variable(new_var),
- then_return->value, NULL);
- then_return->replace_with(assign);
-
- assign = new(ir) ir_assignment(new(ir) ir_dereference_variable(new_var),
- else_return->value, NULL);
- else_return->replace_with(assign);
-
- ir_dereference_variable *deref = new(ir) ir_dereference_variable(new_var);
- ir->insert_after(new(ir) ir_return(deref));
- }
- this->progress = true;
-}
-
-ir_visitor_status
-ir_if_return_visitor::move_outer_block_inside(ir_instruction *ir,
- exec_list *inner_block)
-{
- if (!ir->get_next()->is_tail_sentinel()) {
- while (!ir->get_next()->is_tail_sentinel()) {
- ir_instruction *move_ir = (ir_instruction *)ir->get_next();
-
- move_ir->remove();
- inner_block->push_tail(move_ir);
- }
-
- /* If we move the instructions following ir inside the block, it
- * will confuse the exec_list iteration in the parent that visited
- * us. So stop the visit at this point.
- */
- return visit_stop;
- } else {
- return visit_continue;
- }
-}
-
-/* Normalize a function to always have a return statement at the end.
- *
- * This avoids the ir_if handler needing to know whether it is at the
- * top level of the function to know if there's an implicit return at
- * the end of the outer block.
- */
-ir_visitor_status
-ir_if_return_visitor::visit_enter(ir_function_signature *ir)
-{
- ir_return *ret;
-
- if (!ir->is_defined)
- return visit_continue_with_parent;
- if (strcmp(ir->function_name(), "main") == 0)
- return visit_continue_with_parent;
-
- ret = find_return_in_block(&ir->body);
-
- if (ret) {
- truncate_after_instruction(ret);
- } else {
- if (ir->return_type->is_void()) {
- ir->body.push_tail(new(ir) ir_return(NULL));
- } else {
- /* Probably, if we've got a function with a return value
- * hitting this point, it's something like:
- *
- * float reduce_below_half(float val)
- * {
- * while () {
- * if (val >= 0.5)
- * val /= 2.0;
- * else
- * return val;
- * }
- * }
- *
- * So we gain a junk return statement of an undefined value
- * at the end that never gets executed. However, a backend
- * using this pass is probably desperate to get rid of
- * function calls, so go ahead and do it for their sake in
- * case it fixes apps.
- */
- ir_variable *undef = new(ir) ir_variable(ir->return_type,
- "if_return_undef",
- ir_var_temporary);
- ir->body.push_tail(undef);
-
- ir_dereference_variable *deref = new(ir) ir_dereference_variable(undef);
- ir->body.push_tail(new(ir) ir_return(deref));
- }
- }
-
- return visit_continue;
-}
-
-ir_visitor_status
-ir_if_return_visitor::visit_leave(ir_if *ir)
-{
- ir_return *then_return;
- ir_return *else_return;
-
- then_return = find_return_in_block(&ir->then_instructions);
- else_return = find_return_in_block(&ir->else_instructions);
- if (!then_return && !else_return)
- return visit_continue;
-
- /* Trim off any trailing instructions after the return statements
- * on both sides.
- */
- truncate_after_instruction(then_return);
- truncate_after_instruction(else_return);
-
- /* If both sides return, then we can move the returns to a single
- * one outside the if statement.
- */
- if (then_return && else_return) {
- move_returns_after_block(ir, then_return, else_return);
- return visit_continue;
- }
-
- /* If only one side returns, then the block of code after the "if"
- * is only executed by the other side, so those instructions don't
- * need to be anywhere but that other side.
- *
- * This will usually pull a return statement up into the other
- * side, so we'll trigger the above case on the next pass.
- */
- if (then_return) {
- return move_outer_block_inside(ir, &ir->else_instructions);
- } else {
- assert(else_return);
- return move_outer_block_inside(ir, &ir->then_instructions);
- }
-}
diff --git a/src/glsl/ir_if_simplification.cpp b/src/glsl/ir_if_simplification.cpp
index 6882ef72b9..021615ebd1 100644
--- a/src/glsl/ir_if_simplification.cpp
+++ b/src/glsl/ir_if_simplification.cpp
@@ -22,7 +22,7 @@
*/
/**
- * \file ir_function_inlining.cpp
+ * \file ir_if_simplification.cpp
*
* Moves constant branches of if statements out to the surrounding
* instruction stream.
diff --git a/src/glsl/ir_import_prototypes.cpp b/src/glsl/ir_import_prototypes.cpp
index a39b384071..066137e60a 100644
--- a/src/glsl/ir_import_prototypes.cpp
+++ b/src/glsl/ir_import_prototypes.cpp
@@ -59,7 +59,6 @@ public:
this->function = this->symbols->get_function(ir->name);
if (!this->function) {
this->function = new(this->mem_ctx) ir_function(ir->name);
- this->function->is_builtin = ir->is_builtin;
list->push_tail(this->function);
@@ -87,6 +86,7 @@ public:
new(mem_ctx) ir_function_signature(ir->return_type);
copy->is_defined = false;
+ copy->is_builtin = ir->is_builtin;
/* Clone the parameter list, but NOT the body.
*/
diff --git a/src/glsl/ir_lower_jumps.cpp b/src/glsl/ir_lower_jumps.cpp
new file mode 100644
index 0000000000..b69cc1ec31
--- /dev/null
+++ b/src/glsl/ir_lower_jumps.cpp
@@ -0,0 +1,544 @@
+/*
+ * Copyright © 2010 Luca Barbieri
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file ir_lower_jumps.cpp
+ */
+
+#include "glsl_types.h"
+#include <string.h>
+#include "ir.h"
+
+enum jump_strength
+{
+ strength_none,
+ strength_always_clears_execute_flag,
+ strength_continue,
+ strength_break,
+ strength_return,
+ strength_discard
+};
+
+struct block_record
+{
+ /* minimum jump strength (of lowered IR, not pre-lowering IR)
+ *
+ * If the block ends with a jump, must be the strength of the jump.
+ * Otherwise, the jump would be dead and have been deleted before)
+ *
+ * If the block doesn't end with a jump, it can be different than strength_none if all paths before it lead to some jump
+ * (e.g. an if with a return in one branch, and a break in the other, while not lowering them)
+ * Note that identical jumps are usually unified though.
+ */
+ jump_strength min_strength;
+
+ /* can anything clear the execute flag? */
+ bool may_clear_execute_flag;
+
+ block_record()
+ {
+ this->min_strength = strength_none;
+ this->may_clear_execute_flag = false;
+ }
+};
+
+struct loop_record
+{
+ ir_function_signature* signature;
+ ir_loop* loop;
+
+ /* used to avoid lowering the break used to represent lowered breaks */
+ unsigned nesting_depth;
+ bool in_if_at_the_end_of_the_loop;
+
+ bool may_set_return_flag;
+
+ ir_variable* break_flag;
+ ir_variable* execute_flag; /* cleared to emulate continue */
+
+ loop_record(ir_function_signature* p_signature = 0, ir_loop* p_loop = 0)
+ {
+ this->signature = p_signature;
+ this->loop = p_loop;
+ this->nesting_depth = 0;
+ this->in_if_at_the_end_of_the_loop = false;
+ this->may_set_return_flag = false;
+ this->break_flag = 0;
+ this->execute_flag = 0;
+ }
+
+ ir_variable* get_execute_flag()
+ {
+ /* also supported for the "function loop" */
+ if(!this->execute_flag) {
+ exec_list& list = this->loop ? this->loop->body_instructions : signature->body;
+ this->execute_flag = new(this->signature) ir_variable(glsl_type::bool_type, "execute_flag", ir_var_temporary);
+ list.push_head(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(execute_flag), new(this->signature) ir_constant(true), 0));
+ list.push_head(this->execute_flag);
+ }
+ return this->execute_flag;
+ }
+
+ ir_variable* get_break_flag()
+ {
+ assert(this->loop);
+ if(!this->break_flag) {
+ this->break_flag = new(this->signature) ir_variable(glsl_type::bool_type, "break_flag", ir_var_temporary);
+ this->loop->insert_before(this->break_flag);
+ this->loop->insert_before(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(break_flag), new(this->signature) ir_constant(false), 0));
+ }
+ return this->break_flag;
+ }
+};
+
+struct function_record
+{
+ ir_function_signature* signature;
+ ir_variable* return_flag; /* used to break out of all loops and then jump to the return instruction */
+ ir_variable* return_value;
+ bool is_main;
+ unsigned nesting_depth;
+
+ function_record(ir_function_signature* p_signature = 0)
+ {
+ this->signature = p_signature;
+ this->return_flag = 0;
+ this->return_value = 0;
+ this->nesting_depth = 0;
+ this->is_main = this->signature && (strcmp(this->signature->function_name(), "main") == 0);
+ }
+
+ ir_variable* get_return_flag()
+ {
+ if(!this->return_flag) {
+ this->return_flag = new(this->signature) ir_variable(glsl_type::bool_type, "return_flag", ir_var_temporary);
+ this->signature->body.push_head(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(return_flag), new(this->signature) ir_constant(false), 0));
+ this->signature->body.push_head(this->return_flag);
+ }
+ return this->return_flag;
+ }
+
+ ir_variable* get_return_value()
+ {
+ if(!this->return_value) {
+ assert(!this->signature->return_type->is_void());
+ return_value = new(this->signature) ir_variable(this->signature->return_type, "return_value", ir_var_temporary);
+ this->signature->body.push_head(this->return_value);
+ }
+ return this->return_value;
+ }
+};
+
+struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
+ bool progress;
+
+ struct function_record function;
+ struct loop_record loop;
+ struct block_record block;
+
+ bool pull_out_jumps;
+ bool lower_continue;
+ bool lower_break;
+ bool lower_sub_return;
+ bool lower_main_return;
+
+ ir_lower_jumps_visitor()
+ {
+ this->progress = false;
+ }
+
+ void truncate_after_instruction(exec_node *ir)
+ {
+ if (!ir)
+ return;
+
+ while (!ir->get_next()->is_tail_sentinel()) {
+ ((ir_instruction *)ir->get_next())->remove();
+ this->progress = true;
+ }
+ }
+
+ void move_outer_block_inside(ir_instruction *ir, exec_list *inner_block)
+ {
+ while (!ir->get_next()->is_tail_sentinel()) {
+ ir_instruction *move_ir = (ir_instruction *)ir->get_next();
+
+ move_ir->remove();
+ inner_block->push_tail(move_ir);
+ }
+ }
+
+ virtual void visit(class ir_loop_jump * ir)
+ {
+ truncate_after_instruction(ir);
+ this->block.min_strength = ir->is_break() ? strength_break : strength_continue;
+ }
+
+ virtual void visit(class ir_return * ir)
+ {
+ truncate_after_instruction(ir);
+ this->block.min_strength = strength_return;
+ }
+
+ virtual void visit(class ir_discard * ir)
+ {
+ truncate_after_instruction(ir);
+ this->block.min_strength = strength_discard;
+ }
+
+ enum jump_strength get_jump_strength(ir_instruction* ir)
+ {
+ if(!ir)
+ return strength_none;
+ else if(ir->ir_type == ir_type_loop_jump) {
+ if(((ir_loop_jump*)ir)->is_break())
+ return strength_break;
+ else
+ return strength_continue;
+ } else if(ir->ir_type == ir_type_return)
+ return strength_return;
+ else if(ir->ir_type == ir_type_discard)
+ return strength_discard;
+ else
+ return strength_none;
+ }
+
+ bool should_lower_jump(ir_jump* ir)
+ {
+ unsigned strength = get_jump_strength(ir);
+ bool lower;
+ switch(strength)
+ {
+ case strength_none:
+ lower = false; /* don't change this, code relies on it */
+ break;
+ case strength_continue:
+ lower = lower_continue;
+ break;
+ case strength_break:
+ assert(this->loop.loop);
+ /* never lower "canonical break" */
+ if(ir->get_next()->is_tail_sentinel() && (this->loop.nesting_depth == 0
+ || (this->loop.nesting_depth == 1 && this->loop.in_if_at_the_end_of_the_loop)))
+ lower = false;
+ else
+ lower = lower_break;
+ break;
+ case strength_return:
+ /* never lower return at the end of a this->function */
+ if(this->function.nesting_depth == 0 && ir->get_next()->is_tail_sentinel())
+ lower = false;
+ else if (this->function.is_main)
+ lower = lower_main_return;
+ else
+ lower = lower_sub_return;
+ break;
+ case strength_discard:
+ lower = false; /* probably nothing needs this lowered */
+ break;
+ }
+ return lower;
+ }
+
+ block_record visit_block(exec_list* list)
+ {
+ block_record saved_block = this->block;
+ this->block = block_record();
+ visit_exec_list(list, this);
+ block_record ret = this->block;
+ this->block = saved_block;
+ return ret;
+ }
+
+ virtual void visit(ir_if *ir)
+ {
+ if(this->loop.nesting_depth == 0 && ir->get_next()->is_tail_sentinel())
+ this->loop.in_if_at_the_end_of_the_loop = true;
+
+ ++this->function.nesting_depth;
+ ++this->loop.nesting_depth;
+
+ block_record block_records[2];
+ ir_jump* jumps[2];
+
+ block_records[0] = visit_block(&ir->then_instructions);
+ block_records[1] = visit_block(&ir->else_instructions);
+
+retry: /* we get here if we put code after the if inside a branch */
+ for(unsigned i = 0; i < 2; ++i) {
+ exec_list& list = i ? ir->else_instructions : ir->then_instructions;
+ jumps[i] = 0;
+ if(!list.is_empty() && get_jump_strength((ir_instruction*)list.get_tail()))
+ jumps[i] = (ir_jump*)list.get_tail();
+ }
+
+ for(;;) {
+ jump_strength jump_strengths[2];
+
+ for(unsigned i = 0; i < 2; ++i) {
+ if(jumps[i]) {
+ jump_strengths[i] = block_records[i].min_strength;
+ assert(jump_strengths[i] == get_jump_strength(jumps[i]));
+ } else
+ jump_strengths[i] = strength_none;
+ }
+
+ /* move both jumps out if possible */
+ if(pull_out_jumps && jump_strengths[0] == jump_strengths[1]) {
+ bool unify = true;
+ if(jump_strengths[0] == strength_continue)
+ ir->insert_after(new(ir) ir_loop_jump(ir_loop_jump::jump_continue));
+ else if(jump_strengths[0] == strength_break)
+ ir->insert_after(new(ir) ir_loop_jump(ir_loop_jump::jump_break));
+ /* FINISHME: unify returns with identical expressions */
+ else if(jump_strengths[0] == strength_return && this->function.signature->return_type->is_void())
+ ir->insert_after(new(ir) ir_return(NULL));
+ /* FINISHME: unify discards */
+ else
+ unify = false;
+
+ if(unify) {
+ jumps[0]->remove();
+ jumps[1]->remove();
+ this->progress = true;
+
+ jumps[0] = 0;
+ jumps[1] = 0;
+ block_records[0].min_strength = strength_none;
+ block_records[1].min_strength = strength_none;
+ break;
+ }
+ }
+
+ /* lower a jump: if both need to lowered, start with the strongest one, so that
+ * we might later unify the lowered version with the other one
+ */
+ bool should_lower[2];
+ for(unsigned i = 0; i < 2; ++i)
+ should_lower[i] = should_lower_jump(jumps[i]);
+
+ int lower;
+ if(should_lower[1] && should_lower[0])
+ lower = jump_strengths[1] > jump_strengths[0];
+ else if(should_lower[0])
+ lower = 0;
+ else if(should_lower[1])
+ lower = 1;
+ else
+ break;
+
+ if(jump_strengths[lower] == strength_return) {
+ ir_variable* return_flag = this->function.get_return_flag();
+ if(!this->function.signature->return_type->is_void()) {
+ ir_variable* return_value = this->function.get_return_value();
+ jumps[lower]->insert_before(new(ir) ir_assignment(new (ir) ir_dereference_variable(return_value), ((ir_return*)jumps[lower])->value, NULL));
+ }
+ jumps[lower]->insert_before(new(ir) ir_assignment(new (ir) ir_dereference_variable(return_flag), new (ir) ir_constant(true), NULL));
+ this->loop.may_set_return_flag = true;
+ if(this->loop.loop) {
+ ir_loop_jump* lowered = 0;
+ lowered = new(ir) ir_loop_jump(ir_loop_jump::jump_break);
+ block_records[lower].min_strength = strength_break;
+ jumps[lower]->replace_with(lowered);
+ jumps[lower] = lowered;
+ } else
+ goto lower_continue;
+ this->progress = true;
+ } else if(jump_strengths[lower] == strength_break) {
+ /* We can't lower to an actual continue because that would execute the increment.
+ *
+ * In the lowered code, we instead put the break check between the this->loop body and the increment,
+ * which is impossible with a real continue as defined by the GLSL IR currently.
+ *
+ * Smarter options (such as undoing the increment) are possible but it's not worth implementing them,
+ * because if break is lowered, continue is almost surely lowered too.
+ */
+ jumps[lower]->insert_before(new(ir) ir_assignment(new (ir) ir_dereference_variable(this->loop.get_break_flag()), new (ir) ir_constant(true), 0));
+ goto lower_continue;
+ } else if(jump_strengths[lower] == strength_continue) {
+lower_continue:
+ ir_variable* execute_flag = this->loop.get_execute_flag();
+ jumps[lower]->replace_with(new(ir) ir_assignment(new (ir) ir_dereference_variable(execute_flag), new (ir) ir_constant(false), 0));
+ jumps[lower] = 0;
+ block_records[lower].min_strength = strength_always_clears_execute_flag;
+ block_records[lower].may_clear_execute_flag = true;
+ this->progress = true;
+ break;
+ }
+ }
+
+ /* move out a jump out if possible */
+ if(pull_out_jumps) {
+ int move_out = -1;
+ if(jumps[0] && block_records[1].min_strength >= strength_continue)
+ move_out = 0;
+ else if(jumps[1] && block_records[0].min_strength >= strength_continue)
+ move_out = 1;
+
+ if(move_out >= 0)
+ {
+ jumps[move_out]->remove();
+ ir->insert_after(jumps[move_out]);
+ jumps[move_out] = 0;
+ block_records[move_out].min_strength = strength_none;
+ this->progress = true;
+ }
+ }
+
+ if(block_records[0].min_strength < block_records[1].min_strength)
+ this->block.min_strength = block_records[0].min_strength;
+ else
+ this->block.min_strength = block_records[1].min_strength;
+ this->block.may_clear_execute_flag = this->block.may_clear_execute_flag || block_records[0].may_clear_execute_flag || block_records[1].may_clear_execute_flag;
+
+ if(this->block.min_strength)
+ truncate_after_instruction(ir);
+ else if(this->block.may_clear_execute_flag)
+ {
+ int move_into = -1;
+ if(block_records[0].min_strength && !block_records[1].may_clear_execute_flag)
+ move_into = 1;
+ else if(block_records[1].min_strength && !block_records[0].may_clear_execute_flag)
+ move_into = 0;
+
+ if(move_into >= 0) {
+ assert(!block_records[move_into].min_strength && !block_records[move_into].may_clear_execute_flag); /* otherwise, we just truncated */
+
+ exec_list* list = move_into ? &ir->else_instructions : &ir->then_instructions;
+ exec_node* next = ir->get_next();
+ if(!next->is_tail_sentinel()) {
+ move_outer_block_inside(ir, list);
+
+ exec_list list;
+ list.head = next;
+ block_records[move_into] = visit_block(&list);
+
+ this->progress = true;
+ goto retry;
+ }
+ } else {
+ ir_instruction* ir_after;
+ for(ir_after = (ir_instruction*)ir->get_next(); !ir_after->is_tail_sentinel();)
+ {
+ ir_if* ir_if = ir_after->as_if();
+ if(ir_if && ir_if->else_instructions.is_empty()) {
+ ir_dereference_variable* ir_if_cond_deref = ir_if->condition->as_dereference_variable();
+ if(ir_if_cond_deref && ir_if_cond_deref->var == this->loop.execute_flag) {
+ ir_instruction* ir_next = (ir_instruction*)ir_after->get_next();
+ ir_after->insert_before(&ir_if->then_instructions);
+ ir_after->remove();
+ ir_after = ir_next;
+ continue;
+ }
+ }
+ ir_after = (ir_instruction*)ir_after->get_next();
+
+ /* only set this if we find any unprotected instruction */
+ this->progress = true;
+ }
+
+ if(!ir->get_next()->is_tail_sentinel()) {
+ assert(this->loop.execute_flag);
+ ir_if* if_execute = new(ir) ir_if(new(ir) ir_dereference_variable(this->loop.execute_flag));
+ move_outer_block_inside(ir, &if_execute->then_instructions);
+ ir->insert_after(if_execute);
+ }
+ }
+ }
+ --this->loop.nesting_depth;
+ --this->function.nesting_depth;
+ }
+
+ virtual void visit(ir_loop *ir)
+ {
+ ++this->function.nesting_depth;
+ loop_record saved_loop = this->loop;
+ this->loop = loop_record(this->function.signature, ir);
+
+ block_record body = visit_block(&ir->body_instructions);
+
+ if(body.min_strength >= strength_break) {
+ /* FINISHME: turn the this->loop into an if, or replace it with its body */
+ }
+
+ if(this->loop.break_flag) {
+ ir_if* break_if = new(ir) ir_if(new(ir) ir_dereference_variable(this->loop.break_flag));
+ break_if->then_instructions.push_tail(new(ir) ir_loop_jump(ir_loop_jump::jump_break));
+ ir->body_instructions.push_tail(break_if);
+ }
+
+ if(this->loop.may_set_return_flag) {
+ assert(this->function.return_flag);
+ ir_if* return_if = new(ir) ir_if(new(ir) ir_dereference_variable(this->function.return_flag));
+ return_if->then_instructions.push_tail(new(ir) ir_loop_jump(saved_loop.loop ? ir_loop_jump::jump_break : ir_loop_jump::jump_continue));
+ ir->insert_after(return_if);
+ }
+
+ this->loop = saved_loop;
+ --this->function.nesting_depth;
+ }
+
+ virtual void visit(ir_function_signature *ir)
+ {
+ /* these are not strictly necessary */
+ assert(!this->function.signature);
+ assert(!this->loop.loop);
+
+ function_record saved_function = this->function;
+ loop_record saved_loop = this->loop;
+ this->function = function_record(ir);
+ this->loop = loop_record(ir);
+
+ assert(!this->loop.loop);
+ visit_block(&ir->body);
+
+ if(this->function.return_value)
+ ir->body.push_tail(new(ir) ir_return(new (ir) ir_dereference_variable(this->function.return_value)));
+
+ this->loop = saved_loop;
+ this->function = saved_function;
+ }
+
+ virtual void visit(class ir_function * ir)
+ {
+ visit_block(&ir->signatures);
+ }
+};
+
+bool
+do_lower_jumps(exec_list *instructions, bool pull_out_jumps, bool lower_sub_return, bool lower_main_return, bool lower_continue, bool lower_break)
+{
+ ir_lower_jumps_visitor v;
+ v.pull_out_jumps = pull_out_jumps;
+ v.lower_continue = lower_continue;
+ v.lower_break = lower_break;
+ v.lower_sub_return = lower_sub_return;
+ v.lower_main_return = lower_main_return;
+
+ do {
+ v.progress = false;
+ visit_exec_list(instructions, &v);
+ } while (v.progress);
+
+ return v.progress;
+}
diff --git a/src/glsl/ir_mat_op_to_vec.cpp b/src/glsl/ir_mat_op_to_vec.cpp
index da6de9492b..c32ca88b0f 100644
--- a/src/glsl/ir_mat_op_to_vec.cpp
+++ b/src/glsl/ir_mat_op_to_vec.cpp
@@ -307,7 +307,7 @@ ir_mat_op_to_vec_visitor::do_equal_mat_mat(ir_variable *result_var,
ir_dereference *const op1 = get_column(b_var, i);
ir_expression *const cmp =
- new(this->mem_ctx) ir_expression(ir_binop_nequal,
+ new(this->mem_ctx) ir_expression(ir_binop_any_nequal,
glsl_type::bool_type, op0, op1);
ir_rvalue *const swiz =
@@ -473,10 +473,10 @@ ir_mat_op_to_vec_visitor::visit_leave(ir_assignment *orig_assign)
}
break;
- case ir_binop_equal:
- case ir_binop_nequal:
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
do_equal_mat_mat(result_var, op_var[1], op_var[0],
- (orig_expr->operation == ir_binop_equal));
+ (orig_expr->operation == ir_binop_all_equal));
break;
default:
diff --git a/src/glsl/ir_mod_to_fract.cpp b/src/glsl/ir_mod_to_fract.cpp
index 71c9472b12..c82a1f64fd 100644
--- a/src/glsl/ir_mod_to_fract.cpp
+++ b/src/glsl/ir_mod_to_fract.cpp
@@ -22,7 +22,7 @@
*/
/**
- * \file ir_mod_to_floor.cpp
+ * \file ir_mod_to_fract.cpp
*
* Breaks an ir_unop_mod expression down to (op1 * fract(op0 / op1))
*
diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h
index 33f4bc78f7..b365ed2b23 100644
--- a/src/glsl/ir_optimization.h
+++ b/src/glsl/ir_optimization.h
@@ -28,7 +28,7 @@
* Prototypes for optimization passes to be called by the compiler and drivers.
*/
-bool do_common_optimization(exec_list *ir, bool linked);
+bool do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iterations);
bool do_algebraic(exec_list *instructions);
bool do_constant_folding(exec_list *instructions);
@@ -43,7 +43,7 @@ bool do_dead_functions(exec_list *instructions);
bool do_div_to_mul_rcp(exec_list *instructions);
bool do_explog_to_explog2(exec_list *instructions);
bool do_function_inlining(exec_list *instructions);
-bool do_if_return(exec_list *instructions);
+bool do_lower_jumps(exec_list *instructions, bool pull_out_jumps = true, bool lower_sub_return = true, bool lower_main_return = false, bool lower_continue = false, bool lower_break = false);
bool do_if_simplification(exec_list *instructions);
bool do_if_to_cond_assign(exec_list *instructions);
bool do_mat_op_to_vec(exec_list *instructions);
@@ -55,3 +55,5 @@ bool do_swizzle_swizzle(exec_list *instructions);
bool do_tree_grafting(exec_list *instructions);
bool do_vec_index_to_cond_assign(exec_list *instructions);
bool do_vec_index_to_swizzle(exec_list *instructions);
+bool lower_noise(exec_list *instructions);
+bool optimize_redundant_jumps(exec_list *instructions);
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp
index f47ad87550..eff950ebd7 100644
--- a/src/glsl/ir_print_visitor.cpp
+++ b/src/glsl/ir_print_visitor.cpp
@@ -153,15 +153,14 @@ void ir_print_visitor::visit(ir_function_signature *ir)
void ir_print_visitor::visit(ir_function *ir)
{
- /* Don't print built-in functions as part of the IR. */
- if (ir->is_builtin)
- return;
-
printf("(function %s\n", ir->name);
indentation++;
foreach_iter(exec_list_iterator, iter, *ir) {
ir_function_signature *const sig = (ir_function_signature *) iter.get();
+ if (sig->is_builtin)
+ continue;
+
indent();
sig->accept(this);
printf("\n");
@@ -405,19 +404,23 @@ ir_print_visitor::visit(ir_if *ir)
printf(")\n");
indent();
- printf("(\n");
- indentation++;
+ if (!ir->else_instructions.is_empty()) {
+ printf("(\n");
+ indentation++;
- foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
- ir_instruction *const inst = (ir_instruction *) iter.get();
+ foreach_iter(exec_list_iterator, iter, ir->else_instructions) {
+ ir_instruction *const inst = (ir_instruction *) iter.get();
+ indent();
+ inst->accept(this);
+ printf("\n");
+ }
+ indentation--;
indent();
- inst->accept(this);
- printf("\n");
+ printf("))\n");
+ } else {
+ printf("())\n");
}
- indentation--;
- indent();
- printf("))\n");
}
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index e57e03c307..a9cbf8ea94 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -32,6 +32,8 @@ extern "C" {
#include "glsl_types.h"
#include "s_expression.h"
+const static bool debug = false;
+
static void ir_read_error(_mesa_glsl_parse_state *, s_expression *,
const char *fmt, ...);
static const glsl_type *read_type(_mesa_glsl_parse_state *, s_expression *);
@@ -84,6 +86,9 @@ _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions,
read_instructions(state, instructions, expr, NULL);
talloc_free(expr);
+
+ if (debug)
+ validate_ir_tree(instructions);
}
static void
@@ -94,6 +99,10 @@ ir_read_error(_mesa_glsl_parse_state *state, s_expression *expr,
state->error = true;
+ if (state->current_function != NULL)
+ state->info_log = talloc_asprintf_append(state->info_log,
+ "In function %s:\n",
+ state->current_function->function_name());
state->info_log = talloc_strdup_append(state->info_log, "error: ");
va_start(ap, fmt);
@@ -209,7 +218,6 @@ read_function(_mesa_glsl_parse_state *st, s_list *list, bool skip_body)
ir_function *f = st->symbols->get_function(name->value());
if (f == NULL) {
f = new(ctx) ir_function(name->value());
- f->is_builtin = true;
added = st->symbols->add_function(f->name, f);
assert(added);
}
@@ -282,6 +290,7 @@ read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list,
if (sig == NULL && skip_body) {
/* If scanning for prototypes, generate a new signature. */
sig = new(ctx) ir_function_signature(return_type);
+ sig->is_builtin = true;
f->add_signature(sig);
} else if (sig != NULL) {
const char *badvar = sig->qualifiers_match(&hir_parameters);
@@ -310,7 +319,9 @@ read_function_sig(_mesa_glsl_parse_state *st, ir_function *f, s_list *list,
ir_read_error(st, list, "function %s redefined", f->name);
return;
}
+ st->current_function = sig;
read_instructions(st, &sig->body, body_list, NULL);
+ st->current_function = NULL;
sig->is_defined = true;
}
@@ -331,8 +342,17 @@ read_instructions(_mesa_glsl_parse_state *st, exec_list *instructions,
foreach_iter(exec_list_iterator, it, list->subexpressions) {
s_expression *sub = (s_expression*) it.get();
ir_instruction *ir = read_instruction(st, sub, loop_ctx);
- if (ir != NULL)
- instructions->push_tail(ir);
+ if (ir != NULL) {
+ /* Global variable declarations should be moved to the top, before
+ * any functions that might use them. Functions are added to the
+ * instruction stream when scanning for prototypes, so without this
+ * hack, they always appear before variable declarations.
+ */
+ if (st->current_function == NULL && ir->as_variable() != NULL)
+ instructions->push_head(ir);
+ else
+ instructions->push_tail(ir);
+ }
}
}
@@ -575,23 +595,56 @@ static ir_assignment *
read_assignment(_mesa_glsl_parse_state *st, s_list *list)
{
void *ctx = st;
- if (list->length() != 4) {
- ir_read_error(st, list, "expected (assign <condition> <lhs> <rhs>)");
+ if (list->length() != 5) {
+ ir_read_error(st, list, "expected (assign <condition> (<write mask>) "
+ "<lhs> <rhs>)");
return NULL;
}
s_expression *cond_expr = (s_expression*) list->subexpressions.head->next;
- s_expression *lhs_expr = (s_expression*) cond_expr->next;
+ s_list *mask_list = SX_AS_LIST(cond_expr->next);
+ s_expression *lhs_expr = (s_expression*) cond_expr->next->next;
s_expression *rhs_expr = (s_expression*) lhs_expr->next;
- // FINISHME: Deal with "true" condition
ir_rvalue *condition = read_rvalue(st, cond_expr);
if (condition == NULL) {
ir_read_error(st, NULL, "when reading condition of assignment");
return NULL;
}
- ir_rvalue *lhs = read_rvalue(st, lhs_expr);
+ if (mask_list == NULL || mask_list->length() > 1) {
+ ir_read_error(st, mask_list, "expected () or (<write mask>)");
+ return NULL;
+ }
+
+ unsigned mask = 0;
+ if (mask_list->length() == 1) {
+ s_symbol *mask_symbol = SX_AS_SYMBOL(mask_list->subexpressions.head);
+ if (mask_symbol == NULL) {
+ ir_read_error(st, list, "expected a write mask; found non-symbol");
+ return NULL;
+ }
+
+ const char *mask_str = mask_symbol->value();
+ unsigned mask_length = strlen(mask_str);
+ if (mask_length > 4) {
+ ir_read_error(st, list, "invalid write mask: %s", mask_str);
+ return NULL;
+ }
+
+ const unsigned idx_map[] = { 3, 0, 1, 2 }; /* w=bit 3, x=0, y=1, z=2 */
+
+ for (unsigned i = 0; i < mask_length; i++) {
+ if (mask_str[i] < 'w' || mask_str[i] > 'z') {
+ ir_read_error(st, list, "write mask contains invalid character: %c",
+ mask_str[i]);
+ return NULL;
+ }
+ mask |= 1 << idx_map[mask_str[i] - 'w'];
+ }
+ }
+
+ ir_dereference *lhs = read_dereference(st, lhs_expr);
if (lhs == NULL) {
ir_read_error(st, NULL, "when reading left-hand side of assignment");
return NULL;
@@ -603,7 +656,12 @@ read_assignment(_mesa_glsl_parse_state *st, s_list *list)
return NULL;
}
- return new(ctx) ir_assignment(lhs, rhs, condition);
+ if (mask == 0 && (lhs->type->is_vector() || lhs->type->is_scalar())) {
+ ir_read_error(st, list, "non-zero write mask required.");
+ return NULL;
+ }
+
+ return new(ctx) ir_assignment(lhs, rhs, condition, mask);
}
static ir_call *
diff --git a/src/glsl/ir_rvalue_visitor.cpp b/src/glsl/ir_rvalue_visitor.cpp
index 613b07c302..773bfcfa3e 100644
--- a/src/glsl/ir_rvalue_visitor.cpp
+++ b/src/glsl/ir_rvalue_visitor.cpp
@@ -83,7 +83,14 @@ ir_rvalue_visitor::visit_leave(ir_swizzle *ir)
ir_visitor_status
ir_rvalue_visitor::visit_leave(ir_dereference_array *ir)
{
+ /* The array index is not the target of the assignment, so clear the
+ * 'in_assignee' flag. Restore it after returning from the array index.
+ */
+ const bool was_in_assignee = this->in_assignee;
+ this->in_assignee = false;
handle_rvalue(&ir->array_index);
+ this->in_assignee = was_in_assignee;
+
handle_rvalue(&ir->array);
return visit_continue;
}
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 9ea11dd400..58ab8aa58f 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -61,6 +61,7 @@ public:
virtual ir_visitor_status visit(ir_dereference_variable *ir);
virtual ir_visitor_status visit(ir_if *ir);
+ virtual ir_visitor_status visit_leave(ir_loop *ir);
virtual ir_visitor_status visit_enter(ir_function *ir);
virtual ir_visitor_status visit_leave(ir_function *ir);
virtual ir_visitor_status visit_enter(ir_function_signature *ir);
@@ -114,6 +115,40 @@ ir_validate::visit(ir_if *ir)
ir_visitor_status
+ir_validate::visit_leave(ir_loop *ir)
+{
+ if (ir->counter != NULL) {
+ if ((ir->from == NULL) || (ir->from == NULL) || (ir->increment == NULL)) {
+ printf("ir_loop has invalid loop controls:\n"
+ " counter: %p\n"
+ " from: %p\n"
+ " to: %p\n"
+ " increment: %p\n",
+ ir->counter, ir->from, ir->to, ir->increment);
+ abort();
+ }
+
+ if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) {
+ printf("ir_loop has invalid comparitor %d\n", ir->cmp);
+ abort();
+ }
+ } else {
+ if ((ir->from != NULL) || (ir->from != NULL) || (ir->increment != NULL)) {
+ printf("ir_loop has invalid loop controls:\n"
+ " counter: %p\n"
+ " from: %p\n"
+ " to: %p\n"
+ " increment: %p\n",
+ ir->counter, ir->from, ir->to, ir->increment);
+ abort();
+ }
+ }
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
ir_validate::visit_enter(ir_function *ir)
{
/* Function definitions cannot be nested.
@@ -240,6 +275,10 @@ ir_validate::visit_leave(ir_expression *ir)
assert(ir->operands[0]->type == ir->type);
break;
+ case ir_unop_noise:
+ /* XXX what can we assert here? */
+ break;
+
case ir_binop_add:
case ir_binop_sub:
case ir_binop_mul:
@@ -258,24 +297,30 @@ ir_validate::visit_leave(ir_expression *ir)
assert(ir->operands[0]->type == ir->type);
}
break;
+
case ir_binop_less:
case ir_binop_greater:
case ir_binop_lequal:
case ir_binop_gequal:
- /* GLSL < > <= >= operators take scalar floats/ints, but in the
- * IR we may want to do them for vectors instead to support the
- * lessEqual() and friends builtins.
+ case ir_binop_equal:
+ case ir_binop_nequal:
+ /* The semantics of the IR operators differ from the GLSL <, >, <=, >=,
+ * ==, and != operators. The IR operators perform a component-wise
+ * comparison on scalar or vector types and return a boolean scalar or
+ * vector type of the same size.
*/
- assert(ir->type == glsl_type::bool_type);
+ assert(ir->type->base_type == GLSL_TYPE_BOOL);
assert(ir->operands[0]->type == ir->operands[1]->type);
+ assert(ir->operands[0]->type->is_vector()
+ || ir->operands[0]->type->is_scalar());
+ assert(ir->operands[0]->type->vector_elements
+ == ir->type->vector_elements);
break;
- case ir_binop_equal:
- case ir_binop_nequal:
- /* GLSL == and != operate on vectors and return a bool, and the
- * IR matches that. We may want to switch up the IR to work on
- * vectors and return a bvec and make the operators break down
- * to ANDing/ORing the results of the vector comparison.
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
+ /* GLSL == and != operate on scalars, vectors, matrices and arrays, and
+ * return a scalar boolean. The IR matches that.
*/
assert(ir->type == glsl_type::bool_type);
assert(ir->operands[0]->type == ir->operands[1]->type);
@@ -303,6 +348,7 @@ ir_validate::visit_leave(ir_expression *ir)
case ir_binop_dot:
assert(ir->type == glsl_type::float_type);
assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->operands[0]->type->is_vector());
assert(ir->operands[0]->type == ir->operands[1]->type);
break;
diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp
index e638c9602f..3fed4d9e6e 100644
--- a/src/glsl/ir_variable.cpp
+++ b/src/glsl/ir_variable.cpp
@@ -97,6 +97,32 @@ add_builtin_constant(exec_list *instructions,
var->constant_value = new(var) ir_constant(value);
}
+/* Several constants in GLSL ES have different names than normal desktop GLSL.
+ * Therefore, this function should only be called on the ES path.
+ */
+static void
+generate_100ES_uniforms(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ add_builtin_constant(instructions, state, "gl_MaxVertexAttribs",
+ state->Const.MaxVertexAttribs);
+ add_builtin_constant(instructions, state, "gl_MaxVertexUniformVectors",
+ state->Const.MaxVertexUniformComponents);
+ add_builtin_constant(instructions, state, "gl_MaxVaryingVectors",
+ state->Const.MaxVaryingFloats / 4);
+ add_builtin_constant(instructions, state, "gl_MaxVertexTextureImageUnits",
+ state->Const.MaxVertexTextureImageUnits);
+ add_builtin_constant(instructions, state, "gl_MaxCombinedTextureImageUnits",
+ state->Const.MaxCombinedTextureImageUnits);
+ add_builtin_constant(instructions, state, "gl_MaxTextureImageUnits",
+ state->Const.MaxTextureImageUnits);
+ add_builtin_constant(instructions, state, "gl_MaxFragmentUniformVectors",
+ state->Const.MaxFragmentUniformComponents);
+
+ add_uniform(instructions, state, "gl_DepthRange",
+ state->symbols->get_type("gl_DepthRangeParameters"));
+}
+
static void
generate_110_uniforms(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
@@ -189,6 +215,23 @@ generate_110_uniforms(exec_list *instructions,
state->symbols->get_type("gl_FogParameters"));
}
+/* This function should only be called for ES, not desktop GL. */
+static void
+generate_100ES_vs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) {
+ add_builtin_variable(& builtin_core_vs_variables[i],
+ instructions, state->symbols);
+ }
+
+ generate_100ES_uniforms(instructions, state);
+
+ generate_ARB_draw_buffers_variables(instructions, state, false,
+ vertex_shader);
+}
+
+
static void
generate_110_vs_variables(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
@@ -264,6 +307,9 @@ initialize_vs_variables(exec_list *instructions,
{
switch (state->language_version) {
+ case 100:
+ generate_100ES_vs_variables(instructions, state);
+ break;
case 110:
generate_110_vs_variables(instructions, state);
break;
@@ -276,6 +322,27 @@ initialize_vs_variables(exec_list *instructions,
}
}
+/* This function should only be called for ES, not desktop GL. */
+static void
+generate_100ES_fs_variables(exec_list *instructions,
+ struct _mesa_glsl_parse_state *state)
+{
+ for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) {
+ add_builtin_variable(& builtin_core_fs_variables[i],
+ instructions, state->symbols);
+ }
+
+ for (unsigned i = 0; i < Elements(builtin_100ES_fs_variables); i++) {
+ add_builtin_variable(& builtin_100ES_fs_variables[i],
+ instructions, state->symbols);
+ }
+
+ generate_100ES_uniforms(instructions, state);
+
+ generate_ARB_draw_buffers_variables(instructions, state, false,
+ fragment_shader);
+}
+
static void
generate_110_fs_variables(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
@@ -285,6 +352,11 @@ generate_110_fs_variables(exec_list *instructions,
instructions, state->symbols);
}
+ for (unsigned i = 0; i < Elements(builtin_110_fs_variables); i++) {
+ add_builtin_variable(& builtin_110_fs_variables[i],
+ instructions, state->symbols);
+ }
+
for (unsigned i = 0
; i < Elements(builtin_110_deprecated_fs_variables)
; i++) {
@@ -382,6 +454,9 @@ initialize_fs_variables(exec_list *instructions,
{
switch (state->language_version) {
+ case 100:
+ generate_100ES_fs_variables(instructions, state);
+ break;
case 110:
generate_110_fs_variables(instructions, state);
break;
diff --git a/src/glsl/ir_visitor.h b/src/glsl/ir_visitor.h
index b87d737318..7dd35fe1dc 100644
--- a/src/glsl/ir_visitor.h
+++ b/src/glsl/ir_visitor.h
@@ -64,4 +64,21 @@ public:
/*@}*/
};
+/* NOTE: function calls may never return due to discards inside them
+ * This is usually not an issue, but if it is, keep it in mind
+ */
+class ir_control_flow_visitor : public ir_visitor {
+public:
+ virtual void visit(class ir_variable *) {}
+ virtual void visit(class ir_expression *) {}
+ virtual void visit(class ir_texture *) {}
+ virtual void visit(class ir_swizzle *) {}
+ virtual void visit(class ir_dereference_variable *) {}
+ virtual void visit(class ir_dereference_array *) {}
+ virtual void visit(class ir_dereference_record *) {}
+ virtual void visit(class ir_assignment *) {}
+ virtual void visit(class ir_constant *) {}
+ virtual void visit(class ir_call *) {}
+};
+
#endif /* IR_VISITOR_H */
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index e0823c3af4..c2c662152e 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -740,14 +740,14 @@ link_intrastage_shaders(GLcontext *ctx,
ir_function_signature *sig =
(ir_function_signature *) iter.get();
- if (!sig->is_defined || f->is_builtin)
+ if (!sig->is_defined || sig->is_builtin)
continue;
ir_function_signature *other_sig =
other->exact_matching_signature(& sig->parameters);
if ((other_sig != NULL) && other_sig->is_defined
- && !other_sig->function()->is_builtin) {
+ && !other_sig->is_builtin) {
linker_error_printf(prog,
"function `%s' is multiply defined",
f->name);
@@ -1402,9 +1402,10 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
* match shading language versions. With GLSL 1.30 and later, the versions
* of all shaders must match.
*/
- assert(min_version >= 110);
+ assert(min_version >= 100);
assert(max_version <= 130);
- if ((max_version >= 130) && (min_version != max_version)) {
+ if ((max_version >= 130 || min_version == 100)
+ && min_version != max_version) {
linker_error_printf(prog, "all shaders must use same shading "
"language version\n");
goto done;
@@ -1470,13 +1471,13 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog)
* some of that unused.
*/
for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) {
- while (do_common_optimization(prog->_LinkedShaders[i]->ir, true))
+ while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, 32))
;
}
assign_uniform_locations(prog);
- if (prog->_LinkedShaders[0]->Type == GL_VERTEX_SHADER) {
+ if (prog->_NumLinkedShaders && prog->_LinkedShaders[0]->Type == GL_VERTEX_SHADER) {
/* FINISHME: The value of the max_attribute_index parameter is
* FINISHME: implementation dependent based on the value of
* FINISHME: GL_MAX_VERTEX_ATTRIBS. GL_MAX_VERTEX_ATTRIBS must be
diff --git a/src/glsl/list.h b/src/glsl/list.h
index a70b79d571..3197b03cf2 100644
--- a/src/glsl/list.h
+++ b/src/glsl/list.h
@@ -165,6 +165,12 @@ struct exec_node {
this->prev->next = before;
this->prev = before;
}
+
+ /**
+ * Insert another list in the list before the current node
+ */
+ void insert_before(struct exec_list *before);
+
/**
* Replace the current node with the given node.
*/
@@ -378,6 +384,23 @@ struct exec_list {
}
/**
+ * Remove the first node from a list and return it
+ *
+ * \return
+ * The first node in the list or \c NULL if the list is empty.
+ *
+ * \sa exec_list::get_head
+ */
+ exec_node *pop_head()
+ {
+ exec_node *const n = this->get_head();
+ if (n != NULL)
+ n->remove();
+
+ return n;
+ }
+
+ /**
* Move all of the nodes from this list to the target list
*/
void move_nodes_to(exec_list *target)
@@ -432,6 +455,23 @@ struct exec_list {
#endif
};
+
+#ifdef __cplusplus
+inline void exec_node::insert_before(exec_list *before)
+{
+ if (before->is_empty())
+ return;
+
+ before->tail_pred->next = this;
+ before->head->prev = this->prev;
+
+ this->prev->next = before->head;
+ this->prev = before->tail_pred;
+
+ before->make_empty();
+}
+#endif
+
/**
* This version is safe even if the current node is removed.
*/
diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp
new file mode 100644
index 0000000000..91e34da0ee
--- /dev/null
+++ b/src/glsl/loop_analysis.cpp
@@ -0,0 +1,496 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glsl_types.h"
+#include "loop_analysis.h"
+#include "ir_hierarchical_visitor.h"
+
+static bool is_loop_terminator(ir_if *ir);
+
+static bool all_expression_operands_are_loop_constant(ir_rvalue *,
+ hash_table *);
+
+static ir_rvalue *get_basic_induction_increment(ir_assignment *, hash_table *);
+
+
+loop_state::loop_state()
+{
+ this->ht = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
+ this->mem_ctx = talloc_init("loop state");
+}
+
+
+loop_state::~loop_state()
+{
+ hash_table_dtor(this->ht);
+}
+
+
+loop_variable_state *
+loop_state::insert(ir_loop *ir)
+{
+ loop_variable_state *ls = new(this->mem_ctx) loop_variable_state;
+ hash_table_insert(this->ht, ls, ir);
+
+ return ls;
+}
+
+
+loop_variable_state *
+loop_state::get(const ir_loop *ir)
+{
+ return (loop_variable_state *) hash_table_find(this->ht, ir);
+}
+
+
+loop_variable *
+loop_variable_state::get(const ir_variable *ir)
+{
+ return (loop_variable *) hash_table_find(this->var_hash, ir);
+}
+
+
+loop_variable *
+loop_variable_state::insert(ir_variable *var)
+{
+ void *mem_ctx = talloc_parent(this);
+ loop_variable *lv = talloc_zero(mem_ctx, loop_variable);
+
+ lv->var = var;
+
+ hash_table_insert(this->var_hash, lv, lv->var);
+ this->variables.push_tail(lv);
+
+ return lv;
+}
+
+
+loop_terminator *
+loop_variable_state::insert(ir_if *if_stmt)
+{
+ void *mem_ctx = talloc_parent(this);
+ loop_terminator *t = talloc_zero(mem_ctx, loop_terminator);
+
+ t->ir = if_stmt;
+ this->terminators.push_tail(t);
+
+ return t;
+}
+
+
+class loop_analysis : public ir_hierarchical_visitor {
+public:
+ loop_analysis();
+
+ virtual ir_visitor_status visit(ir_loop_jump *);
+ virtual ir_visitor_status visit(ir_dereference_variable *);
+
+ virtual ir_visitor_status visit_enter(ir_loop *);
+ virtual ir_visitor_status visit_leave(ir_loop *);
+ virtual ir_visitor_status visit_enter(ir_assignment *);
+ virtual ir_visitor_status visit_leave(ir_assignment *);
+ virtual ir_visitor_status visit_enter(ir_if *);
+ virtual ir_visitor_status visit_leave(ir_if *);
+
+ loop_state *loops;
+
+ int if_statement_depth;
+
+ ir_assignment *current_assignment;
+
+ exec_list state;
+};
+
+
+loop_analysis::loop_analysis()
+{
+ this->loops = new loop_state;
+
+ this->if_statement_depth = 0;
+ this->current_assignment = NULL;
+}
+
+
+ir_visitor_status
+loop_analysis::visit(ir_loop_jump *ir)
+{
+ (void) ir;
+
+ assert(!this->state.is_empty());
+
+ loop_variable_state *const ls =
+ (loop_variable_state *) this->state.get_head();
+
+ ls->num_loop_jumps++;
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
+loop_analysis::visit(ir_dereference_variable *ir)
+{
+ /* If we're not somewhere inside a loop, there's nothing to do.
+ */
+ if (this->state.is_empty())
+ return visit_continue;
+
+ loop_variable_state *const ls =
+ (loop_variable_state *) this->state.get_head();
+
+ ir_variable *var = ir->variable_referenced();
+ loop_variable *lv = ls->get(var);
+
+ if (lv == NULL) {
+ lv = ls->insert(var);
+ lv->read_before_write = !this->in_assignee;
+ }
+
+ if (this->in_assignee) {
+ assert(this->current_assignment != NULL);
+
+ lv->conditional_assignment = (this->if_statement_depth > 0)
+ || (this->current_assignment->condition != NULL);
+
+ if (lv->first_assignment == NULL) {
+ assert(lv->num_assignments == 0);
+
+ lv->first_assignment = this->current_assignment;
+ }
+
+ lv->num_assignments++;
+ } else if (lv->first_assignment == this->current_assignment) {
+ /* This catches the case where the variable is used in the RHS of an
+ * assignment where it is also in the LHS.
+ */
+ lv->read_before_write = true;
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+loop_analysis::visit_enter(ir_loop *ir)
+{
+ loop_variable_state *ls = this->loops->insert(ir);
+ this->state.push_head(ls);
+
+ return visit_continue;
+}
+
+ir_visitor_status
+loop_analysis::visit_leave(ir_loop *ir)
+{
+ loop_variable_state *const ls =
+ (loop_variable_state *) this->state.pop_head();
+
+
+ foreach_list(node, &ir->body_instructions) {
+ /* Skip over declarations at the start of a loop.
+ */
+ if (((ir_instruction *) node)->as_variable())
+ continue;
+
+ ir_if *if_stmt = ((ir_instruction *) node)->as_if();
+
+ if ((if_stmt != NULL) && is_loop_terminator(if_stmt))
+ ls->insert(if_stmt);
+ else
+ break;
+ }
+
+
+ foreach_list_safe(node, &ls->variables) {
+ loop_variable *lv = (loop_variable *) node;
+
+ /* Move variables that are already marked as being loop constant to
+ * a separate list. These trivially don't need to be tested.
+ */
+ if (lv->is_loop_constant()) {
+ lv->remove();
+ ls->constants.push_tail(lv);
+ }
+ }
+
+ /* Each variable assigned in the loop that isn't already marked as being loop
+ * constant might still be loop constant. The requirements at this point
+ * are:
+ *
+ * - Variable is written before it is read.
+ *
+ * - Only one assignment to the variable.
+ *
+ * - All operands on the RHS of the assignment are also loop constants.
+ *
+ * The last requirement is the reason for the progress loop. A variable
+ * marked as a loop constant on one pass may allow other variables to be
+ * marked as loop constant on following passes.
+ */
+ bool progress;
+ do {
+ progress = false;
+
+ foreach_list_safe(node, &ls->variables) {
+ loop_variable *lv = (loop_variable *) node;
+
+ if (lv->conditional_assignment || (lv->num_assignments > 1))
+ continue;
+
+ /* Process the RHS of the assignment. If all of the variables
+ * accessed there are loop constants, then add this
+ */
+ ir_rvalue *const rhs = lv->first_assignment->rhs;
+ if (all_expression_operands_are_loop_constant(rhs, ls->var_hash)) {
+ lv->rhs_clean = true;
+
+ if (lv->is_loop_constant()) {
+ progress = true;
+
+ lv->remove();
+ ls->constants.push_tail(lv);
+ }
+ }
+ }
+ } while (progress);
+
+ /* The remaining variables that are not loop invariant might be loop
+ * induction variables.
+ */
+ foreach_list_safe(node, &ls->variables) {
+ loop_variable *lv = (loop_variable *) node;
+
+ /* If there is more than one assignment to a variable, it cannot be a
+ * loop induction variable. This isn't strictly true, but this is a
+ * very simple induction variable detector, and it can't handle more
+ * complex cases.
+ */
+ if (lv->num_assignments > 1)
+ continue;
+
+ /* All of the variables with zero assignments in the loop are loop
+ * invariant, and they should have already been filtered out.
+ */
+ assert(lv->num_assignments == 1);
+ assert(lv->first_assignment != NULL);
+
+ /* The assignmnet to the variable in the loop must be unconditional.
+ */
+ if (lv->conditional_assignment)
+ continue;
+
+ /* Basic loop induction variables have a single assignment in the loop
+ * that has the form 'VAR = VAR + i' or 'VAR = VAR - i' where i is a
+ * loop invariant.
+ */
+ ir_rvalue *const inc =
+ get_basic_induction_increment(lv->first_assignment, ls->var_hash);
+ if (inc != NULL) {
+ lv->iv_scale = NULL;
+ lv->biv = lv->var;
+ lv->increment = inc;
+
+ lv->remove();
+ ls->induction_variables.push_tail(lv);
+ }
+ }
+
+ return visit_continue;
+}
+
+ir_visitor_status
+loop_analysis::visit_enter(ir_if *ir)
+{
+ (void) ir;
+
+ if (!this->state.is_empty())
+ this->if_statement_depth++;
+
+ return visit_continue;
+}
+
+ir_visitor_status
+loop_analysis::visit_leave(ir_if *ir)
+{
+ (void) ir;
+
+ if (!this->state.is_empty())
+ this->if_statement_depth--;
+
+ return visit_continue;
+}
+
+ir_visitor_status
+loop_analysis::visit_enter(ir_assignment *ir)
+{
+ /* If we're not somewhere inside a loop, there's nothing to do.
+ */
+ if (this->state.is_empty())
+ return visit_continue_with_parent;
+
+ this->current_assignment = ir;
+
+ return visit_continue;
+}
+
+ir_visitor_status
+loop_analysis::visit_leave(ir_assignment *ir)
+{
+ /* Since the visit_enter exits with visit_continue_with_parent for this
+ * case, the loop state stack should never be empty here.
+ */
+ assert(!this->state.is_empty());
+
+ assert(this->current_assignment == ir);
+ this->current_assignment = NULL;
+
+ return visit_continue;
+}
+
+
+class examine_rhs : public ir_hierarchical_visitor {
+public:
+ examine_rhs(hash_table *loop_variables)
+ {
+ this->only_uses_loop_constants = true;
+ this->loop_variables = loop_variables;
+ }
+
+ virtual ir_visitor_status visit(ir_dereference_variable *ir)
+ {
+ loop_variable *lv =
+ (loop_variable *) hash_table_find(this->loop_variables, ir->var);
+
+ assert(lv != NULL);
+
+ if (lv->is_loop_constant()) {
+ return visit_continue;
+ } else {
+ this->only_uses_loop_constants = false;
+ return visit_stop;
+ }
+ }
+
+ hash_table *loop_variables;
+ bool only_uses_loop_constants;
+};
+
+
+bool
+all_expression_operands_are_loop_constant(ir_rvalue *ir, hash_table *variables)
+{
+ examine_rhs v(variables);
+
+ ir->accept(&v);
+
+ return v.only_uses_loop_constants;
+}
+
+
+ir_rvalue *
+get_basic_induction_increment(ir_assignment *ir, hash_table *var_hash)
+{
+ /* The RHS must be a binary expression.
+ */
+ ir_expression *const rhs = ir->rhs->as_expression();
+ if ((rhs == NULL)
+ || ((rhs->operation != ir_binop_add)
+ && (rhs->operation != ir_binop_sub)))
+ return NULL;
+
+ /* One of the of operands of the expression must be the variable assigned.
+ * If the operation is subtraction, the variable in question must be the
+ * "left" operand.
+ */
+ ir_variable *const var = ir->lhs->variable_referenced();
+
+ ir_variable *const op0 = rhs->operands[0]->variable_referenced();
+ ir_variable *const op1 = rhs->operands[1]->variable_referenced();
+
+ if (((op0 != var) && (op1 != var))
+ || ((op1 == var) && (rhs->operation == ir_binop_sub)))
+ return NULL;
+
+ ir_rvalue *inc = (op0 == var) ? rhs->operands[1] : rhs->operands[0];
+
+ if (inc->as_constant() == NULL) {
+ ir_variable *const inc_var = inc->variable_referenced();
+ if (inc_var != NULL) {
+ loop_variable *lv =
+ (loop_variable *) hash_table_find(var_hash, inc_var);
+
+ if (!lv->is_loop_constant())
+ inc = NULL;
+ } else
+ inc = NULL;
+ }
+
+ if ((inc != NULL) && (rhs->operation == ir_binop_sub)) {
+ void *mem_ctx = talloc_parent(ir);
+
+ inc = new(mem_ctx) ir_expression(ir_unop_neg,
+ inc->type,
+ inc->clone(mem_ctx, NULL),
+ NULL);
+ }
+
+ return inc;
+}
+
+
+/**
+ * Detect whether an if-statement is a loop terminating condition
+ *
+ * Detects if-statements of the form
+ *
+ * (if (expression bool ...) (break))
+ */
+bool
+is_loop_terminator(ir_if *ir)
+{
+ if (!ir->else_instructions.is_empty())
+ return false;
+
+ ir_instruction *const inst =
+ (ir_instruction *) ir->then_instructions.get_head();
+ assert(inst != NULL);
+
+ if (inst->ir_type != ir_type_loop_jump)
+ return false;
+
+ ir_loop_jump *const jump = (ir_loop_jump *) inst;
+ if (jump->mode != ir_loop_jump::jump_break)
+ return false;
+
+ return true;
+}
+
+
+loop_state *
+analyze_loop_variables(exec_list *instructions)
+{
+ loop_analysis v;
+
+ v.run(instructions);
+ return v.loops;
+}
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h
new file mode 100644
index 0000000000..7b0511fbbe
--- /dev/null
+++ b/src/glsl/loop_analysis.h
@@ -0,0 +1,230 @@
+/* -*- c++ -*- */
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#pragma once
+#ifndef LOOP_ANALYSIS_H
+#define LOOP_ANALYSIS_H
+
+#include "ir.h"
+#include "program/hash_table.h"
+
+/**
+ * Analyze and classify all variables used in all loops in the instruction list
+ */
+extern class loop_state *
+analyze_loop_variables(exec_list *instructions);
+
+
+/**
+ * Fill in loop control fields
+ *
+ * Based on analysis of loop variables, this function tries to remove sequences
+ * in the loop of the form
+ *
+ * (if (expression bool ...) (break))
+ *
+ * and fill in the \c ir_loop::from, \c ir_loop::to, and \c ir_loop::counter
+ * fields of the \c ir_loop.
+ *
+ * In this process, some conditional break-statements may be eliminated
+ * altogether. For example, if it is provable that one loop exit condition will
+ * always be satisfied before another, the unnecessary exit condition will be
+ * removed.
+ */
+extern bool
+set_loop_controls(exec_list *instructions, loop_state *ls);
+
+
+extern bool
+unroll_loops(exec_list *instructions, loop_state *ls, unsigned max_iterations);
+
+
+/**
+ * Tracking for all variables used in a loop
+ */
+class loop_variable_state : public exec_node {
+public:
+ class loop_variable *get(const ir_variable *);
+ class loop_variable *insert(ir_variable *);
+ class loop_terminator *insert(ir_if *);
+
+
+ /**
+ * Loop whose variable state is being tracked by this structure
+ */
+ ir_loop *loop;
+
+ /**
+ * Variables that have not yet been classified
+ */
+ exec_list variables;
+
+ /**
+ * Variables whose values are constant within the body of the loop
+ *
+ * This list contains \c loop_variable objects.
+ */
+ exec_list constants;
+
+ /**
+ * Induction variables for this loop
+ *
+ * This list contains \c loop_variable objects.
+ */
+ exec_list induction_variables;
+
+ /**
+ * Simple if-statements that lead to the termination of the loop
+ *
+ * This list contains \c loop_terminator objects.
+ *
+ * \sa is_loop_terminator
+ */
+ exec_list terminators;
+
+ /**
+ * Hash table containing all variables accessed in this loop
+ */
+ hash_table *var_hash;
+
+ /**
+ * Maximum number of loop iterations.
+ *
+ * If this value is negative, then the loop may be infinite. This actually
+ * means that analysis was unable to determine an upper bound on the number
+ * of loop iterations.
+ */
+ int max_iterations;
+
+ /**
+ * Number of ir_loop_jump instructions that operate on this loop
+ */
+ unsigned num_loop_jumps;
+
+ loop_variable_state()
+ {
+ this->max_iterations = -1;
+ this->num_loop_jumps = 0;
+ this->var_hash = hash_table_ctor(0, hash_table_pointer_hash,
+ hash_table_pointer_compare);
+ }
+
+ ~loop_variable_state()
+ {
+ hash_table_dtor(this->var_hash);
+ }
+};
+
+
+class loop_variable : public exec_node {
+public:
+ /** The variable in question. */
+ ir_variable *var;
+
+ /** Is the variable read in the loop before it is written? */
+ bool read_before_write;
+
+ /** Are all variables in the RHS of the assignment loop constants? */
+ bool rhs_clean;
+
+ /** Is there an assignment to the variable that is conditional? */
+ bool conditional_assignment;
+
+ /** Reference to the first assignment to the variable in the loop body. */
+ ir_assignment *first_assignment;
+
+ /** Number of assignments to the variable in the loop body. */
+ unsigned num_assignments;
+
+ /**
+ * Increment values for loop induction variables
+ *
+ * Loop induction variables have a single increment of the form
+ * \c b * \c biv + \c c, where \c b and \c c are loop constants and \c i
+ * is a basic loop induction variable.
+ *
+ * If \c iv_scale is \c NULL, 1 is used. If \c biv is the same as \c var,
+ * then \c var is a basic loop induction variable.
+ */
+ /*@{*/
+ ir_rvalue *iv_scale;
+ ir_variable *biv;
+ ir_rvalue *increment;
+ /*@}*/
+
+
+ inline bool is_loop_constant() const
+ {
+ const bool is_const = (this->num_assignments == 0)
+ || ((this->num_assignments == 1)
+ && !this->conditional_assignment
+ && !this->read_before_write
+ && this->rhs_clean);
+
+ /* If the RHS of *the* assignment is clean, then there must be exactly
+ * one assignment of the variable.
+ */
+ assert((this->rhs_clean && (this->num_assignments == 1))
+ || !this->rhs_clean);
+
+ /* Variables that are marked read-only *MUST* be loop constant.
+ */
+ assert(!this->var->read_only || (this->var->read_only && is_const));
+
+ return is_const;
+ }
+};
+
+
+class loop_terminator : public exec_node {
+public:
+ ir_if *ir;
+};
+
+
+class loop_state {
+public:
+ ~loop_state();
+
+ /**
+ * Get the loop variable state data for a particular loop
+ */
+ loop_variable_state *get(const ir_loop *);
+
+ loop_variable_state *insert(ir_loop *ir);
+
+private:
+ loop_state();
+
+ /**
+ * Hash table containing all loops that have been analyzed.
+ */
+ hash_table *ht;
+
+ void *mem_ctx;
+
+ friend class loop_analysis;
+};
+
+#endif /* LOOP_ANALYSIS_H */
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp
new file mode 100644
index 0000000000..2ef3d30525
--- /dev/null
+++ b/src/glsl/loop_controls.cpp
@@ -0,0 +1,301 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <climits>
+#include "main/compiler.h"
+#include "glsl_types.h"
+#include "loop_analysis.h"
+#include "ir_hierarchical_visitor.h"
+
+/**
+ * Find an initializer of a variable outside a loop
+ *
+ * Works backwards from the loop to find the pre-loop value of the variable.
+ * This is used, for example, to find the initial value of loop induction
+ * variables.
+ *
+ * \param loop Loop where \c var is an induction variable
+ * \param var Variable whose initializer is to be found
+ *
+ * \return
+ * The \c ir_rvalue assigned to the variable outside the loop. May return
+ * \c NULL if no initializer can be found.
+ */
+ir_rvalue *
+find_initial_value(ir_loop *loop, ir_variable *var)
+{
+ for (exec_node *node = loop->prev;
+ !node->is_head_sentinel();
+ node = node->prev) {
+ ir_instruction *ir = (ir_instruction *) node;
+
+ switch (ir->ir_type) {
+ case ir_type_call:
+ case ir_type_loop:
+ case ir_type_loop_jump:
+ case ir_type_return:
+ case ir_type_if:
+ return NULL;
+
+ case ir_type_function:
+ case ir_type_function_signature:
+ assert(!"Should not get here.");
+ return NULL;
+
+ case ir_type_assignment: {
+ ir_assignment *assign = ir->as_assignment();
+ ir_variable *assignee = assign->lhs->whole_variable_referenced();
+
+ if (assignee == var)
+ return (assign->condition != NULL) ? NULL : assign->rhs;
+
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ return NULL;
+}
+
+
+int
+calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment,
+ enum ir_expression_operation op)
+{
+ void *mem_ctx = talloc_init("%s", __func__);
+
+ ir_expression *const sub =
+ new(mem_ctx) ir_expression(ir_binop_sub, from->type, to, from);
+
+ ir_expression *const div =
+ new(mem_ctx) ir_expression(ir_binop_div, sub->type, sub, increment);
+
+ ir_constant *iter = div->constant_expression_value();
+
+ if (iter == NULL)
+ return -1;
+
+ if (!iter->type->is_integer()) {
+ ir_rvalue *cast =
+ new(mem_ctx) ir_expression(ir_unop_f2i, glsl_type::int_type, iter,
+ NULL);
+
+ iter = cast->constant_expression_value();
+ }
+
+ int iter_value = iter->get_int_component(0);
+
+ /* Make sure that the calculated number of iterations satisfies the exit
+ * condition. This is needed to catch off-by-one errors and some types of
+ * ill-formed loops. For example, we need to detect that the following
+ * loop does not have a maximum iteration count.
+ *
+ * for (float x = 0.0; x != 0.9; x += 0.2)
+ * ;
+ */
+ const int bias[] = { -1, 0, 1 };
+ bool valid_loop = false;
+
+ for (unsigned i = 0; i < Elements(bias); i++) {
+ iter = (increment->type->is_integer())
+ ? new(mem_ctx) ir_constant(iter_value + bias[i])
+ : new(mem_ctx) ir_constant(float(iter_value + bias[i]));
+
+ ir_expression *const mul =
+ new(mem_ctx) ir_expression(ir_binop_mul, increment->type, iter,
+ increment);
+
+ ir_expression *const add =
+ new(mem_ctx) ir_expression(ir_binop_add, mul->type, mul, from);
+
+ ir_expression *const cmp =
+ new(mem_ctx) ir_expression(op, glsl_type::bool_type, add, to);
+
+ ir_constant *const cmp_result = cmp->constant_expression_value();
+
+ assert(cmp_result != NULL);
+ if (cmp_result->get_bool_component(0)) {
+ iter_value += bias[i];
+ valid_loop = true;
+ break;
+ }
+ }
+
+ talloc_free(mem_ctx);
+ return (valid_loop) ? iter_value : -1;
+}
+
+
+class loop_control_visitor : public ir_hierarchical_visitor {
+public:
+ loop_control_visitor(loop_state *state)
+ {
+ this->state = state;
+ this->progress = false;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_loop *ir);
+
+ loop_state *state;
+
+ bool progress;
+};
+
+
+ir_visitor_status
+loop_control_visitor::visit_leave(ir_loop *ir)
+{
+ loop_variable_state *const ls = this->state->get(ir);
+
+ /* If we've entered a loop that hasn't been analyzed, something really,
+ * really bad has happened.
+ */
+ if (ls == NULL) {
+ assert(ls != NULL);
+ return visit_continue;
+ }
+
+ /* Search the loop terminating conditions for one of the form 'i < c' where
+ * i is a loop induction variable, c is a constant, and < is any relative
+ * operator.
+ */
+ int max_iterations = ls->max_iterations;
+
+ if(ir->from && ir->to && ir->increment)
+ max_iterations = calculate_iterations(ir->from, ir->to, ir->increment, (ir_expression_operation)ir->cmp);
+
+ if(max_iterations < 0)
+ max_iterations = INT_MAX;
+
+ foreach_list(node, &ls->terminators) {
+ loop_terminator *t = (loop_terminator *) node;
+ ir_if *if_stmt = t->ir;
+
+ /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care
+ * about the former here.
+ */
+ ir_expression *cond = if_stmt->condition->as_expression();
+ if (cond == NULL)
+ continue;
+
+ switch (cond->operation) {
+ case ir_binop_less:
+ case ir_binop_greater:
+ case ir_binop_lequal:
+ case ir_binop_gequal: {
+ /* The expressions that we care about will either be of the form
+ * 'counter < limit' or 'limit < counter'. Figure out which is
+ * which.
+ */
+ ir_rvalue *counter = cond->operands[0]->as_dereference_variable();
+ ir_constant *limit = cond->operands[1]->as_constant();
+ enum ir_expression_operation cmp = cond->operation;
+
+ if (limit == NULL) {
+ counter = cond->operands[1]->as_dereference_variable();
+ limit = cond->operands[0]->as_constant();
+
+ switch (cmp) {
+ case ir_binop_less: cmp = ir_binop_gequal; break;
+ case ir_binop_greater: cmp = ir_binop_lequal; break;
+ case ir_binop_lequal: cmp = ir_binop_greater; break;
+ case ir_binop_gequal: cmp = ir_binop_less; break;
+ default: assert(!"Should not get here.");
+ }
+ }
+
+ if ((counter == NULL) || (limit == NULL))
+ break;
+
+ ir_variable *var = counter->variable_referenced();
+
+ ir_rvalue *init = find_initial_value(ir, var);
+
+ foreach_list(iv_node, &ls->induction_variables) {
+ loop_variable *lv = (loop_variable *) iv_node;
+
+ if (lv->var == var) {
+ const int iterations = calculate_iterations(init, limit,
+ lv->increment,
+ cmp);
+ if (iterations >= 0) {
+ /* If the new iteration count is lower than the previously
+ * believed iteration count, update the loop control values.
+ */
+ if (iterations < max_iterations) {
+ ir->from = init->clone(ir, NULL);
+ ir->to = limit->clone(ir, NULL);
+ ir->increment = lv->increment->clone(ir, NULL);
+ ir->counter = lv->var;
+ ir->cmp = cmp;
+
+ max_iterations = iterations;
+ }
+
+ /* Remove the conditional break statement. The loop
+ * controls are now set such that the exit condition will be
+ * satisfied.
+ */
+ if_stmt->remove();
+
+ assert(ls->num_loop_jumps > 0);
+ ls->num_loop_jumps--;
+
+ this->progress = true;
+ }
+
+ break;
+ }
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ /* If we have proven the one of the loop exit conditions is satisifed before
+ * running the loop once, remove the loop.
+ */
+ if (max_iterations == 0)
+ ir->remove();
+ else
+ ls->max_iterations = max_iterations;
+
+ return visit_continue;
+}
+
+
+bool
+set_loop_controls(exec_list *instructions, loop_state *ls)
+{
+ loop_control_visitor v(ls);
+
+ v.run(instructions);
+
+ return v.progress;
+}
diff --git a/src/glsl/loop_unroll.cpp b/src/glsl/loop_unroll.cpp
new file mode 100644
index 0000000000..90797bde37
--- /dev/null
+++ b/src/glsl/loop_unroll.cpp
@@ -0,0 +1,187 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include "glsl_types.h"
+#include "loop_analysis.h"
+#include "ir_hierarchical_visitor.h"
+
+class loop_unroll_visitor : public ir_hierarchical_visitor {
+public:
+ loop_unroll_visitor(loop_state *state, unsigned max_iterations)
+ {
+ this->state = state;
+ this->progress = false;
+ this->max_iterations = max_iterations;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_loop *ir);
+
+ loop_state *state;
+
+ bool progress;
+ unsigned max_iterations;
+};
+
+
+ir_visitor_status
+loop_unroll_visitor::visit_leave(ir_loop *ir)
+{
+ loop_variable_state *const ls = this->state->get(ir);
+ int iterations;
+
+ /* If we've entered a loop that hasn't been analyzed, something really,
+ * really bad has happened.
+ */
+ if (ls == NULL) {
+ assert(ls != NULL);
+ return visit_continue;
+ }
+
+ iterations = ls->max_iterations;
+
+ /* Don't try to unroll loops where the number of iterations is not known
+ * at compile-time.
+ */
+ if (iterations < 0)
+ return visit_continue;
+
+ /* Don't try to unroll loops that have zillions of iterations either.
+ */
+ if (iterations > max_iterations)
+ return visit_continue;
+
+ if (ls->num_loop_jumps > 1)
+ return visit_continue;
+ else if (ls->num_loop_jumps) {
+ /* recognize loops in the form produced by ir_lower_jumps */
+ ir_instruction *last_ir =
+ ((ir_instruction*)ir->body_instructions.get_tail());
+
+ assert(last_ir != NULL);
+
+ ir_if *last_if = last_ir->as_if();
+ if (last_if) {
+ bool continue_from_then_branch;
+
+ /* Determine which if-statement branch, if any, ends with a break.
+ * The branch that did *not* have the break will get a temporary
+ * continue inserted in each iteration of the loop unroll.
+ *
+ * Note that since ls->num_loop_jumps is <= 1, it is impossible for
+ * both branches to end with a break.
+ */
+ ir_instruction *last =
+ (ir_instruction *) last_if->then_instructions.get_tail();
+
+ if (last && last->ir_type == ir_type_loop_jump
+ && ((ir_loop_jump*) last)->is_break()) {
+ continue_from_then_branch = false;
+ } else {
+ last = (ir_instruction *) last_if->then_instructions.get_tail();
+
+ if (last && last->ir_type == ir_type_loop_jump
+ && ((ir_loop_jump*) last)->is_break())
+ continue_from_then_branch = true;
+ else
+ /* Bail out if neither if-statement branch ends with a break.
+ */
+ return visit_continue;
+ }
+
+ /* Remove the break from the if-statement.
+ */
+ last->remove();
+
+ void *const mem_ctx = talloc_parent(ir);
+ ir_instruction *ir_to_replace = ir;
+
+ for (int i = 0; i < iterations; i++) {
+ exec_list copy_list;
+
+ copy_list.make_empty();
+ clone_ir_list(mem_ctx, &copy_list, &ir->body_instructions);
+
+ last_if = ((ir_instruction*)copy_list.get_tail())->as_if();
+ assert(last_if);
+
+ ir_to_replace->insert_before(&copy_list);
+ ir_to_replace->remove();
+
+ /* placeholder that will be removed in the next iteration */
+ ir_to_replace =
+ new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue);
+
+ exec_list *const list = (continue_from_then_branch)
+ ? &last_if->then_instructions : &last_if->else_instructions;
+
+ list->push_tail(ir_to_replace);
+ }
+
+ ir_to_replace->remove();
+
+ this->progress = true;
+ return visit_continue;
+ } else if (last_ir->ir_type == ir_type_loop_jump
+ && ((ir_loop_jump *)last_ir)->is_break()) {
+ /* If the only loop-jump is a break at the end of the loop, the loop
+ * will execute exactly once. Remove the break, set the iteration
+ * count, and fall through to the normal unroller.
+ */
+ last_ir->remove();
+ iterations = 1;
+
+ this->progress = true;
+ } else
+ return visit_continue;
+ }
+
+ void *const mem_ctx = talloc_parent(ir);
+
+ for (int i = 0; i < iterations; i++) {
+ exec_list copy_list;
+
+ copy_list.make_empty();
+ clone_ir_list(mem_ctx, &copy_list, &ir->body_instructions);
+
+ ir->insert_before(&copy_list);
+ }
+
+ /* The loop has been replaced by the unrolled copies. Remove the original
+ * loop from the IR sequence.
+ */
+ ir->remove();
+
+ this->progress = true;
+ return visit_continue;
+}
+
+
+bool
+unroll_loops(exec_list *instructions, loop_state *ls, unsigned max_iterations)
+{
+ loop_unroll_visitor v(ls, max_iterations);
+
+ v.run(instructions);
+
+ return v.progress;
+}
diff --git a/src/glsl/lower_noise.cpp b/src/glsl/lower_noise.cpp
new file mode 100644
index 0000000000..cb32d28348
--- /dev/null
+++ b/src/glsl/lower_noise.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file lower_noise.cpp
+ * IR lower pass to remove noise opcodes.
+ *
+ * \author Ian Romanick <ian.d.romanick@intel.com>
+ */
+
+#include "ir.h"
+#include "ir_rvalue_visitor.h"
+
+class lower_noise_visitor : public ir_rvalue_visitor {
+public:
+ lower_noise_visitor() : progress(false)
+ {
+ /* empty */
+ }
+
+ void handle_rvalue(ir_rvalue **rvalue)
+ {
+ if (!*rvalue)
+ return;
+
+ ir_expression *expr = (*rvalue)->as_expression();
+ if (!expr)
+ return;
+
+ /* In the future, ir_unop_noise may be replaced by a call to a function
+ * that implements noise. No hardware has a noise instruction.
+ */
+ if (expr->operation == ir_unop_noise) {
+ *rvalue = ir_constant::zero(talloc_parent(expr), expr->type);
+ this->progress = true;
+ }
+ }
+
+ bool progress;
+};
+
+
+bool
+lower_noise(exec_list *instructions)
+{
+ lower_noise_visitor v;
+
+ visit_list_elements(&v, instructions);
+
+ return v.progress;
+}
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index cb9f8a5277..94c14a58a7 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -35,6 +35,7 @@
#include "ir_optimization.h"
#include "ir_print_visitor.h"
#include "program.h"
+#include "loop_analysis.h"
extern "C" struct gl_shader *
_mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type);
@@ -58,6 +59,41 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
return shader;
}
+static void
+initialize_context(GLcontext *ctx, gl_api api)
+{
+ memset(ctx, 0, sizeof(*ctx));
+
+ ctx->API = api;
+
+ ctx->Extensions.ARB_draw_buffers = GL_TRUE;
+ ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
+ ctx->Extensions.EXT_texture_array = GL_TRUE;
+ ctx->Extensions.NV_texture_rectangle = GL_TRUE;
+
+ /* 1.10 minimums. */
+ ctx->Const.MaxLights = 8;
+ ctx->Const.MaxClipPlanes = 8;
+ ctx->Const.MaxTextureUnits = 2;
+
+ /* More than the 1.10 minimum to appease parser tests taken from
+ * apps that (hopefully) already checked the number of coords.
+ */
+ ctx->Const.MaxTextureCoordUnits = 4;
+
+ ctx->Const.VertexProgram.MaxAttribs = 16;
+ ctx->Const.VertexProgram.MaxUniformComponents = 512;
+ ctx->Const.MaxVarying = 8;
+ ctx->Const.MaxVertexTextureImageUnits = 0;
+ ctx->Const.MaxCombinedTextureImageUnits = 2;
+ ctx->Const.MaxTextureImageUnits = 2;
+ ctx->Const.FragmentProgram.MaxUniformComponents = 64;
+
+ ctx->Const.MaxDrawBuffers = 2;
+
+ ctx->Driver.NewShader = _mesa_new_shader;
+}
+
/* Returned string will have 'ctx' as its talloc owner. */
static char *
load_text_file(void *ctx, const char *file_name)
@@ -108,12 +144,14 @@ usage_fail(const char *name)
}
+int glsl_es = 0;
int dump_ast = 0;
int dump_hir = 0;
int dump_lir = 0;
int do_link = 0;
const struct option compiler_opts[] = {
+ { "glsl-es", 0, &glsl_es, 1 },
{ "dump-ast", 0, &dump_ast, 1 },
{ "dump-hir", 0, &dump_hir, 1 },
{ "dump-lir", 0, &dump_lir, 1 },
@@ -122,14 +160,14 @@ const struct option compiler_opts[] = {
};
void
-compile_shader(struct gl_shader *shader)
+compile_shader(GLcontext *ctx, struct gl_shader *shader)
{
struct _mesa_glsl_parse_state *state =
- new(shader) _mesa_glsl_parse_state(NULL, shader->Type, shader);
+ new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
const char *source = shader->Source;
state->error = preprocess(state, &source, &state->info_log,
- state->extensions);
+ state->extensions, ctx->API);
if (!state->error) {
_mesa_glsl_lexer_ctor(state, source);
@@ -174,6 +212,11 @@ compile_shader(struct gl_shader *shader)
progress = do_vec_index_to_swizzle(shader->ir) || progress;
progress = do_vec_index_to_cond_assign(shader->ir) || progress;
progress = do_swizzle_swizzle(shader->ir) || progress;
+
+ loop_state *ls = analyze_loop_variables(shader->ir);
+ progress = set_loop_controls(shader->ir, ls) || progress;
+ progress = unroll_loops(shader->ir, ls, 32) || progress;
+ delete ls;
} while (progress);
validate_ir_tree(shader->ir);
@@ -212,8 +255,6 @@ main(int argc, char **argv)
GLcontext local_ctx;
GLcontext *ctx = &local_ctx;
- ctx->Driver.NewShader = _mesa_new_shader;
-
int c;
int idx = 0;
while ((c = getopt_long(argc, argv, "", compiler_opts, &idx)) != -1)
@@ -223,6 +264,8 @@ main(int argc, char **argv)
if (argc <= optind)
usage_fail(argv[0]);
+ initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL);
+
struct gl_shader_program *whole_program;
whole_program = talloc_zero (NULL, struct gl_shader_program);
@@ -259,7 +302,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- compile_shader(shader);
+ compile_shader(ctx, shader);
if (!shader->CompileStatus) {
printf("Info log for %s:\n%s\n", argv[optind], shader->InfoLog);
diff --git a/src/glsl/opt_redundant_jumps.cpp b/src/glsl/opt_redundant_jumps.cpp
new file mode 100644
index 0000000000..edf4bb6c22
--- /dev/null
+++ b/src/glsl/opt_redundant_jumps.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file opt_redundant_jumps.cpp
+ * Remove certain types of redundant jumps
+ */
+
+#include "ir.h"
+
+class redundant_jumps_visitor : public ir_hierarchical_visitor {
+public:
+ redundant_jumps_visitor()
+ {
+ this->progress = false;
+ }
+
+ virtual ir_visitor_status visit_leave(ir_if *);
+ virtual ir_visitor_status visit_leave(ir_loop *);
+
+ bool progress;
+};
+
+
+ir_visitor_status
+redundant_jumps_visitor::visit_leave(ir_if *ir)
+{
+ /* If the last instruction in both branches is a 'break' or a 'continue',
+ * pull it out of the branches and insert it after the if-statment. Note
+ * that both must be the same type (either 'break' or 'continue').
+ */
+ ir_instruction *const last_then =
+ (ir_instruction *) ir->then_instructions.get_tail();
+ ir_instruction *const last_else =
+ (ir_instruction *) ir->else_instructions.get_tail();
+
+ if ((last_then == NULL) || (last_else == NULL))
+ return visit_continue;
+
+ if ((last_then->ir_type != ir_type_loop_jump)
+ || (last_else->ir_type != ir_type_loop_jump))
+ return visit_continue;
+
+ ir_loop_jump *const then_jump = (ir_loop_jump *) last_then;
+ ir_loop_jump *const else_jump = (ir_loop_jump *) last_else;
+
+ if (then_jump->mode != else_jump->mode)
+ return visit_continue;
+
+ then_jump->remove();
+ else_jump->remove();
+ this->progress = true;
+
+ ir->insert_after(then_jump);
+
+ /* If both branchs of the if-statement are now empty, remove the
+ * if-statement.
+ */
+ if (ir->then_instructions.is_empty() && ir->else_instructions.is_empty())
+ ir->remove();
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
+redundant_jumps_visitor::visit_leave(ir_loop *ir)
+{
+ /* If the last instruction of a loop body is a 'continue', remove it.
+ */
+ ir_instruction *const last =
+ (ir_instruction *) ir->body_instructions.get_tail();
+
+ if (last && (last->ir_type == ir_type_loop_jump)
+ && (((ir_loop_jump *) last)->mode == ir_loop_jump::jump_continue)) {
+ last->remove();
+ this->progress = true;
+ }
+
+ return visit_continue;
+}
+
+
+bool
+optimize_redundant_jumps(exec_list *instructions)
+{
+ redundant_jumps_visitor v;
+
+ v.run(instructions);
+ return v.progress;
+}